Brifing

Bitcoin Covenants: MATT and OP_CHECKCONTRACTVERIFY Explained

Exploring how Bitcoin can maintain state across transactions using advanced covenant proposals.

Cointelegraph.com News2 min

1The MATT Framework Concept

MATT, or Merkleize All The Things, introduces a smart contract framework for Bitcoin designed to enable stateful contracts. Unlike standard Bitcoin scripts that evaluate transactions independently without memory, MATT allows information to carry forward across multiple transactions. This evolution permits dynamic state updates rather than relying on predetermined sets of states.

2Leveraging Taproot Key Tweaking

MATT utilizes Taproot's cryptographic structure to commit data through public keys. By tweaking the internal key with a hash of the contract's current state, the output key commits to both spending conditions and contract data. This mechanism allows the blockchain to verify state transitions without embedding complex logic directly into scripts.

3OP_CHECKCONTRACTVERIFY Functionality

OP_CCV provides the primitive necessary to make state-carrying UTXOs feasible. It allows a script to inspect witness stack data, perform computations, and enforce that the updated state is correctly re-committed in the next output. This opcode effectively bridges the gap between static scripts and the requirement for dynamic, stateful contract execution.

4Transaction Value and Fee Management

OP_CCV supports three modes: default, deduct, and ignore, which manage how BTC value is allocated across outputs. Because these modes preserve value, transaction fees must be paid through separate inputs. This design prevents accidental fund burning, addressing a major limitation found in earlier covenant proposals like OP_CTV or SIGHASH_ANYPREVOUT.

5Synergy with OP_CAT

Combining OP_CCV with OP_CAT enables byte concatenation, allowing for the verification of Merkle proofs directly on-chain. This arrangement uses two trees: a taptree for spending scripts and a state tree for contract data. This combination significantly increases the expressiveness of the MATT framework, facilitating complex computations and data verification.

6Enabling On-Chain Fraud Proofs

This construction supports fraud-proof systems similar to optimistic rollups on other blockchains. By committing long computations off-chain, only disputed steps need verification on-chain. This approach avoids the reliance on Lamport one-time signatures or pre-signed transaction graphs, offering a more efficient method for enforcing state consistency during complex computational processes.

7Evolution of Vault Designs

While OP_CCV can implement vaults independently, its combination with OP_CAT allows for fully featured vault functionality. James O’Beirne, author of the OP_VAULT proposal, noted that OP_CCV represents a more general and robust design. This suggests that OP_CCV could effectively supersede earlier, more specialized proposals for securing Bitcoin assets within the ecosystem.

8Future Path for Covenants

The ongoing development of MATT and OP_CCV marks a shift toward broader programmability in Bitcoin. Future discussions will move beyond general covenant frameworks to review application-specific opcodes like OP_VAULT, OP_UNVAULT, and OP_EVICT. These tools aim to solve specific security and utility challenges rather than providing the broad, flexible programmability of MATT.

Original article: Cointelegraph.com News — Bitcoin Covenants: MATT and OP_CHECKCONTRACTVERIFY Explained