Giter Site home page Giter Site logo

risc0 / risc0-ethereum Goto Github PK

View Code? Open in Web Editor NEW
41.0 18.0 6.0 1.95 MB

Integration of the RISC Zero verifiable compute platform with Ethereum and EVM chains.

Home Page: https://risczero.com

License: Apache License 2.0

Rust 72.16% Solidity 27.16% Python 0.68%
cryptography ethereum foundry rust solidity web3 zero-knowledge

risc0-ethereum's Introduction

Important

main is the development branch. Application developers should use the latest release instead.

RISC Zero Ethereum

RISC Zero is a zero-knowledge verifiable general computing platform, with Ethereum integration. This repository contains Solidity verifier contracts, Relay, Steel EVM view call library, and supporting code.

If you are looking to get started using RISC Zero in the application on Ethereum, the best place to look is the Foundry template.

You can also find the documentation for RISC Zero, including guides for writing zkVM programs, using the Bonsai prover, and more at dev.risczero.com.

Contracts

RISC Zero's Ethereum contracts, including the on-chain verifier for all RISC Zero Groth16 proofs, can be found in the contracts directory.

Steel

A powerful library for querying and generating verifiable proofs over Ethereum or other EVM-based blockchain state. It leverages alloy, giving developers a familiar and high quality interface for querying Ethereum via view calls. Steel makes it easy to securely move execution off chain saving gas and unlocking new use cases on Ethereum.

You can install Steel with cargo add risc0-steel, check out the examples in the examples directory.

Relay

The Relay is a service that can be run to accept proving requests from on-chain events or via REST Request, and post receipts to the developer's application contract as a callback. It represents one way of accepting requests, and posting proofs to Ethereum. It is also possible to write your application without using the Relay.

You can find and overview of how the Relay works, in our documentation. Source code for the Relay is in the relay directory.

risc0-ethereum's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

risc0-ethereum's Issues

Support compositions in the forge ffi prove function

Forge FFI is used in the tests to call out to external programs, and in our testing code is used to generate receipts that can then be used to test receipt-authorized logic. This functionality is also referred to as cheat codes. The prove cheat code used in tests supports only a subset of the prover API, and one particularly useful feature that we would like to support is providing assumption receipts for composition.

Update alloy and revm dependencies

I ran into an issue when trying to release 0.10 due to inconsistent versions of alloy and revm. It does not appear when the Cargo.lock file is in use, but will effect downstream users. I mitigated the issue on the release-0.10 branch in #85. Fixing it on main should be done by updating the dependencies.

Use Anvil for view call library examples

Foundry team fixed the bugs in Anvil that were previously preventing usage of Anvil for local development with the view call library. We can now use it, and should update instructions and scripts.

Fix documentation on the `CONTROL_ID` constants in the `RiscZeroGroth16Verifier.sol`

Comment highlighted below is inaccurate:

/// @notice Control ID hash for the identity_p254 predicate decomposed by `splitDigest`.
/// @dev This value controls what set of recursion programs, and therefore what version of the
/// zkVM circuit, will be accepted by this contract. Each instance of this verifier contract
/// will accept a single release of the RISC Zero circuits.
///
/// New releases of RISC Zero's zkVM require updating these values. These values can be
/// obtained by running `cargo run --bin bonsai-ethereum-contracts -F control-id`

Document the risc0-ethereum release process

  • Document that the development branch is main.
  • Document the release/* branch strategy.
  • Document the expectations of tags.
  • Document cargo publish including which ones are published.
  • Deploy a new verifier contract when changes to the contract are needed.
    • Document the address in the dev.risczero.com docs
    • Verify the source code on e.g. Etherescan
  • Add verifier to RISC Zero managed mux

Mark old crate names for renamed crates as deprecated

We have three crates that have been renamed, but their old names are still published on crates.io without any notes.

  • bonsai-ethereum-relay
  • bonsai-ethereum-contracts
  • risc0-ethereum-view-call

We should mark these as deprecated in some way.

Fix Soldiity compiler warnings due to payable fallback function

Warning (3628): This contract has a payable fallback function, but no receive ether function. Consider adding a receive ether function.
  --> lib/risc0-ethereum/contracts/src/relay/BonsaiRelayQueueWrapper.sol:26:1:
   |
26 | contract BonsaiRelayQueueWrapper is IBonsaiRelay, Proxy, Test {
   | ^ (Relevant source part starts here and spans across multiple lines).
Note: The payable fallback function is defined here.
  --> lib/openzeppelin-contracts/contracts/proxy/Proxy.sol:66:5:
   |
66 |     fallback() external payable virtual {
   |     ^ (Relevant source part starts here and spans across multiple lines).

Fix `risc0-ethereum-relay` ignored e2e tests

In risc-ethereum-relay there are some e2e tests that are currently marked as ignored. Unfortunately, the tests are broken right now, and need some work to get running in CI again.

Variable length ReceiptClaim encoding for use in Solidity

One of the friction points with the Eth Verifirer API is that the user has to drag around the post_state_digest. It is a field only needed to construct the receipt claim digest, and not a detail users need to concern themselves with, yet it pollutes the API.

By using a variable length encoding, it would be possible to have a ReceiptClaim type that optionally includes various components, including the post state digest. Action here is to implement this variable length encoding, and then use it to simplify the verifier API.

Move `bonsai-rest-api-mock` from risc0

The bonsai-rest-api-mock crate is only used by the relay. It should be tune down as an internal utility so that we can lower the burden on the risc0 release process

Run `forge doc` in CI

We want to run forge doc in CI to make sure docs are working, and ensure they are up to date when these docs are published. Unfortunately, there is an issue preventing forge doc from working.

$ forge doc --root contracts
Error:
prefix not found

Related: foundry-rs/foundry#4533

Use POSIX I/O for view call proofs

Currently, the view call proof library uses stdin and env::read to get it's required inputs, namely the Merkle inclusion proofs for the storage slots accessed in view call execution. This introduces from devex complications in that the developer needs to redefine the inputs to include this data.

By using POSIX I/O, this communication can be done out of band to user execution, and the details can be made internal to the view call library itself.

Depends on risc0/risc0-foundry-template#91

[Feature] Load groth16 proofs from disk

From @mothran feedback: "I would also love an example of having a unit test with the proof is baked on disk + script to regenerate all the proof test data. Because generally I don't need to rerun the proof for each forge test through bonsai/locally, if we had a cheat code to get the data like seal + journal + post_state from a .json on disk that would be awesome"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.