A minimal implementation of generating zero-knowledge proofs of EVM block execution using Reth. Supports both Ethereum and OP Stack.
Caution
This repository is still an active work-in-progress and is not audited or meant for production usage.
The basis for this work is the existing 'RSP' project by Succinct Labs.
To use ReVa, you must first have the Valida tools installed, which includes the Valida VM and Rust compiler. Then follow the instructions below.
In the directory bin/host, run:
cargo +valida build --release
this will build the binary bin/host/target/release/reva
for your host architecture.
Running the host application will generate an input file to be used by the target/client application. Simply suppply a block number, a chain ID (1 for ethereum, 10 for OP), and an RPC URL:
./bin/host/target/release/reva --block-number 20000005 --chain-id 1 --rpc-url <RPC>
The host application executes the block while fetching additional data necessary for offline execution. All the data required to run the execution and verification logic inside the Valida VM is serialized into a file bin/host/input/<chain_id>/<block_no>.bin
.
You can also run the host directly by running the following command:
cargo run --bin reva --release -- --block-number 20000005 --chain-id 1 --rpc-url <RPC>
The client input generated by executing against RPC can be used by the respective target/client applications. To build these applications for the Valida VM, use the following commands:
cd bin/client-eth
cargo +valida build --target=valida-unknown-baremetal-gnu --release
cd bin/client-op
cargo +valida build --target=valida-unknown-baremetal-gnu --release
To run each client application on the given input, simply use valida run
like so:
valida run --fast target/valida-unknown-baremetal-gnu/release/reva-client-{op,eth} log < bin/host/input/<chain_id>/<block_no>.bin
To prove, use:
valida prove target/valida-unknown-baremetal-gnu/release/reva-client-{op,eth} log < bin/host/input/<chain_id>/<block_no>.bin