OP_CHECKTEMPLATEVERIFY locks a UTXO to a single, well defined transaction template. When you spend it, the transaction has to match that template exactly, aside from things like fees or witness data that are ignored. A typical use case is a vault that can only move funds to a specific cold wallet, or an exchange batching payouts in a fixed tree. The downside is it is rigid and you can not change fees or outputs without creating a new commitment.
OP_TEMPLATEHASH takes a more general approach. It commits a UTXO to the hash of an offchain template you define. That template can allow variable fees, multiple output options, or other custom rules. This makes it more flexible like a vault that adapts fees or a rollup exit but it also requires everyone to agree on the template format and coordinate tooling, so it is more complex to implement safely.










