delvingbitcoin

Verification of RISC-V execution using OP_CCV

Original Postby halseth

A new proof of concept tool has been introduced which allows for the tracing of RISCV-32 binaries' execution and generates Bitcoin script for on-chain verification.

This innovative tool, available at Bitcoin Elftrace, utilizes the OP_CHECKCONTRACTVERIFY (OP_CCV) covenant opcode as outlined in the MATT proposal found here. The tool's mechanism commits to a single 32-bit hash—specifically, a merkle root—in the output of a transaction. When this transaction is spent, the spender modifies this root based on certain rules and commits the updated root in a new output. Essentially, all that is needed is a covenant opcode capable of enforcing the inclusion of a dynamic data element in the output, alongside a static taptree; capabilities that are provided by OP_CCV. Although OP_CCV serves this function effectively, it is suggested that other covenant proposals might also be suitable for similar purposes. The tool's creator welcomes feedback on this development, and a concise overview can be found via a Twitter post: https://twitter.com/johanth/status/1737778712987287990.