Also covering OP_CHECKOUTPUTSHASHVERIFY
OP_CHECKTEMPLATEVERIFY (CTV) is a proposed new opcode that takes a commitment hash as a parameter and requires any transaction executing the opcode include a set of outputs that match the commitment. This makes it possible to create an address that specifies how any funds received to that address may be spent—a design known in Bitcoin as a covenant.
Originally introduced under the name OP_CHECKOUTPUTSHASHVERIFY (COSHV), the proposal initially focused on the ability to create congestion control transactions where a spender pays a single address using CTV which, when confirmed to a suitable depth, then assures several receivers that they can each be paid. This two-step process can probably be used anywhere payment batching is an option but it can likely reduce fees even further than payment batching.
Later versions of the proposal placed greater emphasis on other contracts and covenants that could be created using the new opcode, such as the ability to create channel factories, vaults, and coinjoin transactions in new ways that might simplify construction or reduce fees. Other authors have mentioned that the new opcode could possibly be used to allow users to trustlessly pool their funds together into a single UTXO in a way that would increase privacy.
Primary code and documentation
Optech newsletter and website mentions
- Sapio: a new language for building contracts with OP_CHECKTEMPLATEVERIFY
- Vault prototype with sample implementation using OP_CHECKTEMPLATEVERIFY
- OP_CHECKTEMPLATEVERIFY workshop summary
- BIPs #875 assigns BIP119 to the OP_CHECKTEMPLATEVERIFY proposal
- 2019 year-in-review: OP_CHECKTEMPLATEVERIFY
- OP_CHECKTEMPLATEVERIFY (CTV) replaces COSHV proposal; concerns restated
- Potential script changes, including new COSHV opcode
- COSHV proposal replaced
- Proposed new opcode for transaction output commitments
- Detailed summary: proposed transaction output commitments