Skip to content

CTV API Reference

ctv::hash()

ctv::hash(tx: Transaction, input_index: Int = 0) -> Hash

Calculate the CTV template hash

ctv::verify()

ctv::verify(tx: Transaction, input_index: Int = 0) -> Script

Returns a Script that verifies the CTV hash, then clears it from the stack

Shorthand for `ctv::hash(tx, input_index) OP_CTV OP_DROP`

Aliased as: ctv()

ctv::check()

ctv::check(tx: Transaction, input_index: Int = 0) -> Script

Returns a Script that checks the CTV hash, leaving it on the stack

Shorthand for `ctv::hash(tx, input_index) OP_CTV`

OP_CTV Script

OP_CTV = script(0xb3) // OP_NOP4

Aliased as: OP_CHECKTEMPLATEVERIFY