OP_CHECKTEMPLATEVERIFY locks UTXOs into a single, well-defined transaction template. When using it, transactions must match that template exactly, excluding things like fees and witness data that are ignored. Typical use cases are vaults where funds can only be moved to specific cold wallets, or exchanging batch payments in a fixed tree. The downside is that it is rigid and cannot change rates or output without making new commitments.
OP_TEMPLATEHASH takes a more general approach. Commit a UTXO to the hash of the off-chain template you defined. This template can allow variable rates, multiple output options, or other custom rules. This allows for more flexibility, like vaulting to adjust fees and rollup terminations, but it is more complex to implement securely, as everyone has to agree on a template format and adjust the tools.
Discover more from Earlybirds Invest
Subscribe to get the latest posts sent to your email.