RISC Zero on Ethereum
Warning: The zkVM and Bonsai are still in development. Do not use in production.
Prove computation with the RISC Zero zkVM and verify the results in your Ethereum contract.
The zkVM and Bonsai together can act as a coprocessor to the smart contract application. This unlocks powerful new applications on Ethereum that offload computationally intensive (i.e. gas expensive) and difficult to implement (e.g. ed25519 signature verification, or HTML parsing) functions to the zkVM.
Getting Started
The RISC Zero Foundry Template provides a template and instructions for developing your application. You can get started right away by cloning the template and following the instructions there.
Overview
Below is a diagram and overview of a typical application with RISC Zero on Ethereum, utilizing Bonsai proving.
- Run your application logic in the zkVM. The off-chain component of your app (e.g. server or dApp client) sends a proof request to the Bonsai proving service.
- Bonsai generates the program result, written to the journal, and a SNARK proof of its correctness.
- The app submits this proof and journal on-chain to your app contract for validation.
- Your app contract calls the RISC Zero verifier contract to validate the proof. If the verification is successful, the journal is deemed trustworthy and can be safely used.
Verifier Contract
RISC Zero supports an on-chain verifier for Groth16 SNARK proofs generated by the Bonsai proving service. You can use this contract in your applications to verify zkVM receipts.
The verifier contract has the IRiscZeroVerifier
interface.
This interface defines the relevant data structures for the receipt and provides a verify
method.
The IRiscZeroVerifier
interface is implemented by the RiscZeroGroth16Verifier
contract.
The RiscZeroGroth16Verifier
contract is a stateless and immutable verifier the RISC Zero Groth16 SNARK proofs.
The
RiscZeroGroth16Verifier
contract is deployed to Sepolia at0x83C2e9CD64B2A16D3908E94C7654f3864212E2F8
. You can choose to use this contract, or deploy your own.