---
title: "CTV (CheckTemplateVerify) — definition | Nuri Glossary"
description: "A proposed opcode that lets an output commit to the exact shape of the transaction allowed to spend it."
lang: "en"
type: "glossary-term"
canonical: "https://nuri.com/glossary/check-template-verify"
---

# CTV (CheckTemplateVerify)

A proposed opcode that lets an output commit to the exact shape of the transaction allowed to spend it.

## Basically

CheckTemplateVerify (BIP 119) is a proposed Bitcoin rule. It lets you lock coins so they can only be spent through one exact future transaction.

## Key Takeaways

- CTV (OP_CHECKTEMPLATEVERIFY) is a proposed Bitcoin Script opcode defined in BIP 119. It enables basic covenants by locking coins so they can only be spent in a predefined transaction template.
- The opcode verifies a hash of the spending transaction’s key fields: version, locktime, outputs, input count and sequence values. The spend is valid if the hash matches and fails if it does not.
- CTV enables practical applications such as security vaults, congestion control batching and payment pools. It remains non-recursive by design, making it the most conservative covenant proposal under consideration.

## What Is CheckTemplateVerify?

CheckTemplateVerify (CTV) is a proposed Bitcoin opcode specified in BIP 119 and authored by Jeremy Rubin. It adds a minimal covenant: a spending condition that restricts not only who can spend coins, but also how they can spend them. You can lock a UTXO so the only valid spending transaction must match a predetermined template for its outputs, amounts and structure.
Jeremy Rubin originally proposed the opcode in 2019 as OP_CHECKOUTPUTSHASHVERIFY (COSHV), then renamed it OP_SECURETHEBAG. He refined it into its current form and formally specified it as BIP 119 in January 2020. A soft fork would deploy it by repurposing the existing OP_NOP4 opcode (0xb3), so older nodes would still accept CTV transactions as valid.
CTV has a deliberately narrow scope. Unlike more expressive proposals such as OP_CAT, it cannot create arbitrary smart contracts or recursive covenants; it can only verify that a spending transaction matches one fully specified template. Its minimalism provides its main strengths, safety and simplicity, while its limited flexibility is its main criticism.

## How It Works

A Bitcoin Script containing OP_CHECKTEMPLATEVERIFY pops a 32-byte hash from the stack when it executes. The opcode compares that hash with one computed from the spending transaction’s fields. Execution continues if the hashes match, but the transaction is invalid if they differ.

## The Template Hash

The template hash commits to selected transaction fields. These fields are concatenated in a specific order and then hashed with SHA-256.

## What Is Excluded

Certain fields are intentionally excluded from the template hash. Each exclusion serves a specific design purpose.

## Script Construction

A CTV-locked output uses a simple script. The script pushes the expected template hash onto the stack and then calls the opcode.
The spending transaction must exactly match the committed template. No partial matching or flexibility is allowed: the outputs, their amounts and the transaction structure must all correspond to the pre-committed hash.

## Reference Implementation

The hash computation follows a specific algorithm. BIP 119 provides pseudocode for the DefaultCheckTemplateVerifyHash function.
The specification requires implementations to cache the intermediate hashes: the scriptSigs hash, sequences hash and outputs hash. Caching prevents quadratic hashing attacks, where a maliciously constructed transaction could force repeated computation across multiple inputs.

## Vaults

CTV enables security vaults where funds can only be spent to a predetermined intermediate address with a time delay. If your keys are compromised, an attacker cannot steal the funds immediately because the spending transaction must follow the vault template. You get a window to detect the unauthorised spend and sweep the funds to a recovery address.
The vault pattern works in two stages. First, the attacker triggers the CTV-locked withdrawal, sending funds to a time-delayed intermediate script. Second, during the delay enforced via CSV, you detect the unauthorised transaction and use a pre-signed recovery path to redirect funds to a secure cold storage address.

## Congestion Control

During periods of high mempool congestion, a payment processor handling hundreds of payouts can use CTV to commit all recipients to a single on-chain transaction. The CTV output encodes a tree of future transactions that expands into individual payments when block space becomes cheaper.
The approach reduces an O(n) on-chain footprint to O(1) during peak fee periods. Recipients can trust that the CTV commitment guarantees their payout, even before the expansion transactions confirm. Each recipient can independently force their branch of the tree on-chain whenever they choose, without cooperation from the payment processor.

## Payment Pools

Multiple users can pool funds into a single UTXO with CTV-enforced individual withdrawal rights. Each participant has a guaranteed unilateral exit path embedded in the covenant template. The design improves on-chain efficiency, with one UTXO instead of many, and privacy, because a shared UTXO obscures individual holdings, while maintaining self-custody guarantees.

## Channel Factories

Channel factories allow multiple Lightning channels to be created from a single on-chain transaction. Without CTV, all factory participants must pre-sign unilateral exit transactions, which requires interactive multi-round communication. CTV removes that requirement by embedding the exit conditions directly in the covenant, reducing setup from two communication rounds to one.

## Non-Interactive Payment Channels

CTV enables payment channels where the counterparty does not need to be online during setup. The spending conditions sit in the template rather than requiring interactive signatures. The approach is particularly useful for services that want to pre-fund channels for users who have not yet come online.

## CTV Compared to Other Covenant Proposals

Several covenant proposals compete for inclusion in Bitcoin. Each represents a different trade-off between expressiveness and risk. For a deeper analysis of the covenant debate, see the OP_CAT covenant debate research article and the covenants explained deep dive.
CTV is the most conservative option and cannot create recursive covenants because it does not commit to input prevouts. A scriptPubKey containing a CTV hash that references itself would require solving a hash cycle of approximately 2^128 operations, which is computationally infeasible. OP_VAULT (BIP 345) depends on CTV internally and adds vault-specific recovery logic on top, while OP_CAT enables far broader programmability but also introduces risks around recursive covenants and potential MEV extraction on Bitcoin.

## Current Status

As of 2026, CTV remains a draft BIP and has not been activated on Bitcoin mainnet. The proposal has been under discussion since 2019 and has undergone extensive review. It has not achieved the broad consensus that previous soft forks like Taproot reached before activation.
In April 2022, Jeremy Rubin proposed activating CTV via Speedy Trial and released an activation client. Developers and community members significantly opposed the attempt because they felt sufficient consensus had not been reached. Rubin called off the activation attempt within weeks, acknowledging the lack of agreement.
In February 2026, a new CTV activation client was published with concrete BIP 9 deployment parameters. These were a 90% miner signalling threshold of 1,815 of 2,016 blocks, a signalling start of 30 March 2026 and a timeout of 30 March 2027. Whether CTV will achieve the required miner signalling remains uncertain, and the broader Bitcoin community has not reached consensus on activation methodology for covenant proposals.

## Why It Matters

CTV represents one of the most significant potential upgrades to Bitcoin Script since Taproot. Even basic covenants would unlock new categories of Bitcoin applications that are currently impossible: trustless vaults for institutional custody, efficient batching for exchanges handling high transaction volumes, and payment pools that improve both scalability and privacy.
For Layer 2 protocols like Spark and the Lightning Network, covenants could significantly improve channel construction and reduce the number of on-chain transactions required for setup. They could also enable new protocol designs that do not require all participants to be online simultaneously.

## Activation Uncertainty

CTV has not achieved community consensus despite years of review. The 2022 activation controversy showed how difficult it is to reach agreement on Bitcoin protocol changes. Developers remain divided on whether CTV alone provides sufficient value or whether a more expressive covenant opcode should be adopted instead.

## Scope Limitations

CTV’s minimalism is a double-edged sword: its narrow design prevents misuse but also limits its utility. Critics argue that adopting CTV will immediately create demand for additional covenant opcodes and pressure for further soft forks. Proponents counter that CTV’s conservative scope is precisely what makes it safe enough to deploy first.

## Fungibility Concerns

Covenants broadly raise questions about Bitcoin’s fungibility. If coins can be permanently restricted in how they are spent, some coins could be perceived as less valuable than unrestricted ones. CTV mitigates this concern because its covenants are finite: they expand through a predetermined tree and terminate, never creating permanent restrictions.

## P2SH Incompatibility

CTV is incompatible with P2SH (Pay-to-Script-Hash) transactions. The template hash must commit to the scriptSig, which for P2SH would contain the redeemScript. Since the redeemScript itself contains the template hash, this creates an unsolvable hash cycle, so CTV is designed to work with SegWit and Taproot outputs.
The glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.
Part of the [Nuri glossary](https://nuri.com/glossary), which defines 1876 Bitcoin, Lightning, wallet, stablecoin and payment terms.
