Verification of RISC-V execution using OP_CCV

Dec 21 - May 19, 2025

  • The significant advancement in programming projects, specifically those involving emulation of a 32-bit system, is hindered by the limitation of Bitcoin Script, which only supports 31-bit arithmetic.

This restriction necessitates the complete reimplementation of bit-by-bit arithmetic within the script, resulting in considerably larger scripts. A modest increase in numerical capacity, as discussed, could simplify the code structure and improve performance without directly shifting to a 64-bit system, as suggested by the Great Script Restoration project. The initiative for restoring disabled opcodes to a 64-bit context, advocated by Rusty Russell, aims at enhancing system design and functionality through the comprehensive restoration of previously disabled opcodes. This effort is detailed further on Rusty Russell's blog.

A novel proof of concept tool, introduced for tracing the execution of RISCV-32 binaries and generating Bitcoin script for on-chain verification, highlights the practical application of such advancements. Available at Bitcoin Elftrace, this tool leverages the OP_CHECKCONTRACTVERIFY (OP_CCV) covenant opcode, as outlined in the MATT proposal found here. By committing to a single 32-bit hash—specifically, a merkle root—in a transaction's output and allowing for its modification upon spending, the tool underscores the efficacy of OP_CCV in enforcing dynamic data inclusion within outputs, alongside a static taptree. While OP_CCV efficiently fulfills this role, there is openness to exploring other covenant proposals that might serve similar functions. Further insights into this development are shared through a Twitter post available here, inviting feedback on this innovative approach.

Link to Raw Post
Bitcoin Logo

TLDR

Join Our Newsletter

We’ll email you summaries of the latest discussions from high signal bitcoin sources, like bitcoin-dev, lightning-dev, and Delving Bitcoin.

Explore all Products

ChatBTC imageBitcoin searchBitcoin TranscriptsSaving SatoshiDecoding BitcoinWarnet
Built with 🧡 by the Bitcoin Dev Project
View our public visitor count

We'd love to hear your feedback on this project.

Give Feedback