Bitcoin Covenants Part 2: OP_CHECKTEMPLATEVERIFY
OP_CHECKTEMPLATEVERIFY (OP_CTV), proposed in BIP 119, is a covenant opcode that enforces a precommitted transaction template. It compares a hash derived from key transaction fields—version, locktime, input/output counts, and the full outputs set—to a commitment on the stack. If they match, execution succeeds; otherwise it fails. CTV can be combined with conditionals to allow multiple approved spending paths, each with its own committed template. A key use case is vaults: funds first move through an intermediate unvaulting output, then either continue to a hot wallet after a 100-block relative timelock or return immediately to cold storage if compromise is suspected. Each branch is precommitted with its own CTV hash. Compared with pre-signed transactions, CTV avoids ephemeral keys and can make certain outputs reusable because it does not commit to txids. It supports more trust-minimized vaults and congestion-control designs, though it still imposes rigid precommitment constraints.
