Urgent.News

What's breaking now, across thousands of outlets.

Finance & Markets

Bitcoin Covenants Part 5: MATT and OP_CHECKCONTRACTVERIFY — How Bitcoin could carry state across transactions

OP_CCV embeds contract state directly into Taproot output keys and enforces valid state transitions onchain. This makes it possible to achieve stateful contracts and compact fraud proofs.

Bitcoin Covenants Part 5: MATT and OP_CHECKCONTRACTVERIFY — How Bitcoin could carry state across transactions

MATT, a smart contract framework for Bitcoin, enables stateful contracts and scalable fraud proofs by embedding contract state directly into Taproot output keys. This innovation, outlined in Part 5 of a series on Bitcoin covenants, allows transactions to carry information forward across multiple transactions while updating it as the contract evolves.

Unlike standard Bitcoin scripts that do not retain memory of previous executions, MATT achieves this capability through its proposed implementation via OP_CCV. OP_CCV (Merkleize All The Things) is an opcode that embeds committed data into the public key, allowing it to be re-embedded into the next output upon spend. This mechanism enables dynamic state derivation for each spend, rather than selecting from predetermined states.

The process involves tweaking the internal key with a hash of the contract's current state, followed by applying Taproot's standard taptree tweak. The result is an output key that commits to both the tapscript and the contract's current state. OP_CCV then enforces state transitions on-chain by verifying the state data provided on the witness stack, performing computations, and requiring the updated state to be correctly re-committed in the next output.

The stack format for OP_CCV includes data, index, public key, and taptree, with three modes for checking outputs: default, deduct, and ignore. The transaction fees are paid through separate fee-paying inputs, preventing accidental fund burning and addressing limitations of presigned-transaction-style covenants. When combined with OP_CAT, MATT becomes even more expressive, allowing the full MATT framework to be realized.

This setup facilitates fraud-proof systems with slashing conditions, where a long computation is committed off-chain, and only specific disputed steps need to be revealed and verified on-chain. Additionally, OP_CCV + OP_CAT has implications for vaults, enabling fully featured vaults.

Written by urgent.news from Cointelegraph's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at cointelegraph.com →

More in Finance & Markets

More from Wednesday 11 November →