├── .github └── workflows │ ├── linear.yml │ └── main.yml ├── .gitignore ├── .gitmodules ├── .solhint.json ├── .vscode └── settings.json ├── Cargo.lock ├── Cargo.toml ├── README.md ├── apps ├── Cargo.toml ├── README.md └── src │ └── bin │ └── publisher.rs ├── contracts ├── EvenNumber.sol ├── IEvenNumber.sol └── README.md ├── deployment-guide.md ├── foundry.toml ├── images └── risc0-foundry-template.png ├── methods ├── Cargo.toml ├── README.md ├── build.rs ├── guest │ ├── Cargo.lock │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── bin │ │ └── is_even.rs └── src │ └── lib.rs ├── remappings.txt ├── rust-toolchain.toml ├── script ├── Deploy.s.sol └── config.toml └── tests └── EvenNumber.t.sol /.github/workflows/linear.yml: -------------------------------------------------------------------------------- 1 | name: Find or Create Linear Issue for PR 2 | 3 | on: 4 | workflow_dispatch: 5 | pull_request: 6 | branches: 7 | - main 8 | types: ["opened", "edited", "reopened", "synchronize"] 9 | 10 | permissions: 11 | pull-requests: write 12 | repository-projects: read 13 | 14 | 15 | concurrency: 16 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} 17 | cancel-in-progress: false 18 | 19 | jobs: 20 | create-linear-issue-pr: 21 | runs-on: ubuntu-latest 22 | steps: 23 | - name: Find or create a Linear Issue 24 | uses: risc0/action-find-or-create-linear-issue@risc0 25 | with: 26 | github-token: ${{ secrets.GITHUB_TOKEN }} 27 | linear-api-key: ${{ secrets.LINEAR_API_KEY }} 28 | linear-team-key: "WEB3" 29 | linear-created-issue-state-id: "2505ebd6-1fbe-4b25-b2a8-792dfaa50ad9" # in progress 30 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: main 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | 8 | # Allows you to run this workflow manually from the Actions tab 9 | workflow_dispatch: 10 | 11 | concurrency: 12 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} 13 | cancel-in-progress: true 14 | 15 | env: 16 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 17 | RUST_BACKTRACE: "1" 18 | RISC0_VERSION: 2.0.0 19 | RISC0_TOOLCHAIN_VERSION: 1.85.0 20 | 21 | jobs: 22 | test: 23 | runs-on: ubuntu-latest 24 | steps: 25 | # This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842 26 | - name: checkout dummy commit (submodule bug workaround) 27 | run: "git checkout -f $(git -c user.name=x -c user.email=x@x commit-tree $(git hash-object -t tree /dev/null) < /dev/null) || :" 28 | 29 | - name: clone repository 30 | uses: actions/checkout@v4 31 | with: 32 | submodules: recursive 33 | 34 | - name: Install rust 35 | uses: risc0/risc0/.github/actions/rustup@release-2.0 36 | with: 37 | toolchain: '1.85' 38 | 39 | - name: Install Foundry 40 | uses: foundry-rs/foundry-toolchain@v1 41 | 42 | - name: Install rzup 43 | run: | 44 | curl -L https://risczero.com/install | bash 45 | echo "$HOME/.risc0/bin" >> $GITHUB_PATH 46 | shell: bash 47 | 48 | - name: Install toolchains 49 | run: | 50 | rzup install --verbose cargo-risczero ${{ env.RISC0_VERSION }} 51 | rzup install --verbose r0vm ${{ env.RISC0_VERSION }} 52 | rzup install --verbose --force rust ${{ env.RISC0_TOOLCHAIN_VERSION }} 53 | rzup install --verbose cpp 54 | shell: bash 55 | 56 | - name: build rust guest 57 | run: cargo build 58 | 59 | - name: build solidity contracts 60 | run: forge build 61 | 62 | - name: run tests 63 | run: cargo test 64 | 65 | - name: run foundry tests in dev mode 66 | env: 67 | RISC0_DEV_MODE: true 68 | run: forge test -vvv 69 | 70 | integration-test: 71 | name: integration test 72 | runs-on: ubuntu-latest 73 | env: 74 | RUST_BACKTRACE: full 75 | steps: 76 | # This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842 77 | - name: checkout dummy commit (submodule bug workaround) 78 | run: "git checkout -f $(git -c user.name=x -c user.email=x@x commit-tree $(git hash-object -t tree /dev/null) < /dev/null) || :" 79 | 80 | - name: clone repository 81 | uses: actions/checkout@v4 82 | with: 83 | submodules: recursive 84 | 85 | - name: Install rust 86 | uses: risc0/risc0/.github/actions/rustup@release-2.0 87 | with: 88 | toolchain: '1.85' 89 | 90 | - name: Install Foundry 91 | uses: foundry-rs/foundry-toolchain@v1 92 | 93 | - name: Install rzup 94 | run: | 95 | curl -L https://risczero.com/install | bash 96 | echo "$HOME/.risc0/bin" >> $GITHUB_PATH 97 | shell: bash 98 | 99 | - name: Install toolchains 100 | run: | 101 | rzup install --verbose cargo-risczero ${{ env.RISC0_VERSION }} 102 | rzup install --verbose r0vm ${{ env.RISC0_VERSION }} 103 | rzup install --verbose --force rust ${{ env.RISC0_TOOLCHAIN_VERSION }} 104 | rzup install --verbose cpp 105 | shell: bash 106 | 107 | - name: build rust guest 108 | run: cargo build 109 | 110 | - name: build solidity contracts 111 | run: forge build 112 | 113 | - name: run foundry tests with local prover 114 | env: 115 | RISC0_DEV_MODE: false 116 | run: forge test -vvv 117 | 118 | lint: 119 | runs-on: ubuntu-latest 120 | steps: 121 | - name: checkout code 122 | uses: actions/checkout@v4 123 | with: 124 | submodules: recursive 125 | 126 | - name: Install rust 127 | uses: risc0/risc0/.github/actions/rustup@release-2.0 128 | with: 129 | toolchain: '1.85' 130 | 131 | - name: install cargo-sort 132 | uses: baptiste0928/cargo-install@904927dbe77864e0f2281519fe9d5bd097a220b3 133 | with: 134 | crate: cargo-sort 135 | version: "=1.0.9" 136 | locked: true 137 | 138 | - name: Install Foundry 139 | uses: foundry-rs/foundry-toolchain@v1 140 | 141 | - name: lint rust code 142 | run: cargo fmt --all --check 143 | 144 | - name: lint guest rust code 145 | working-directory: methods/guest 146 | run: cargo fmt --all --check 147 | 148 | - name: lint cargo files 149 | run: cargo sort --workspace --check 150 | 151 | - name: lint guest cargo files 152 | working-directory: methods/guest 153 | run: cargo sort --workspace --check 154 | 155 | - name: check solidity code formatting 156 | run: forge fmt --check 157 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiler files 2 | cache/ 3 | out/ 4 | 5 | # Ignores development broadcast logs 6 | broadcast/ 7 | 8 | # Autogenerated contracts 9 | contracts/ImageID.sol 10 | tests/Elf.sol 11 | 12 | # Dotenv file 13 | .env 14 | 15 | # Cargo 16 | target/ 17 | 18 | # Misc 19 | .DS_Store 20 | .idea 21 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/risc0-ethereum"] 2 | path = lib/risc0-ethereum 3 | url = https://github.com/risc0/risc0-ethereum 4 | -------------------------------------------------------------------------------- /.solhint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "solhint:default" 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "rust-analyzer.linkedProjects": [ 3 | "./apps/Cargo.toml", 4 | "./methods/Cargo.toml", 5 | "./methods/guest/Cargo.toml", 6 | ], 7 | "rust-analyzer.check.extraEnv": { 8 | "RISC0_SKIP_BUILD": "1", 9 | } 10 | } -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | resolver = "2" 3 | members = ["apps", "methods"] 4 | exclude = ["lib"] 5 | 6 | [workspace.package] 7 | version = "0.1.0" 8 | edition = "2021" 9 | 10 | [workspace.dependencies] 11 | alloy = { version = "0.15", features = ["full"] } 12 | alloy-primitives = { version = "1.0", default-features = false, features = ["rlp", "serde", "std"] } 13 | alloy-sol-types = { version = "1.0" } 14 | anyhow = { version = "1.0.75" } 15 | bincode = { version = "1.3" } 16 | bytemuck = { version = "1" } 17 | hex = { version = "0.4" } 18 | log = { version = "0.4" } 19 | methods = { path = "./methods" } 20 | risc0-build = { version = "2.0.1", features = ["docker"] } 21 | # using git references here to ensure this matches the submodules in ./lib 22 | risc0-build-ethereum = { git = "https://github.com/risc0/risc0-ethereum", tag = "v2.1.0" } 23 | risc0-ethereum-contracts = { git = "https://github.com/risc0/risc0-ethereum", tag = "v2.1.0" } 24 | risc0-zkvm = { version = "2.0.2" } 25 | risc0-zkp = { version = "2.0.1", default-features = false } 26 | serde = { version = "1.0", features = ["derive", "std"] } 27 | url = { version = "2.5" } 28 | 29 | [profile.release] 30 | debug = 1 31 | lto = true 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RISC Zero Foundry Template 2 | 3 | > Prove computation with the [RISC Zero zkVM][docs-zkvm] and verify the results in your Ethereum contract. 4 | 5 | This repository implements an example application on Ethereum utilizing RISC Zero as a [coprocessor][blog-coprocessor] to the smart contract application. 6 | It provides a starting point for building powerful new applications on Ethereum that offload work that is computationally intensive (i.e. gas expensive), or difficult to implement in Solidity (e.g. ed25519 signature verification, or HTML parsing). 7 | 8 | 9 | Integrate with [Steel][steel-repo] to execute view calls and simulate transactions on Ethereum. Check out the [ERC-20 counter][erc20-counter] demo to see an example. 10 | 11 | ## Overview 12 | 13 | Here is a simplified overview of how devs can integrate RISC Zero, including with [Bonsai][docs-bonsai] proving, into their Ethereum smart contracts: 14 | 15 | ![RISC Zero Foundry Template Diagram](images/risc0-foundry-template.png) 16 | 17 | 1. Run your application logic in the [RISC Zero zkVM][docs-zkvm]. The provided [publisher](./apps) app sends an off-chain proof request to the [Bonsai] proving service. 18 | 2. [Bonsai][docs-bonsai] generates the program result, written to the [journal][term-journal], and a SNARK proof of its correctness. 19 | 3. The [publisher](./apps) app submits this proof and journal on-chain to your app contract for validation. 20 | 4. Your app contract calls the [RISC Zero Verifier][docs-verifier] to validate the proof. If the verification is successful, the journal is deemed trustworthy and can be safely used. 21 | 22 | ## Dependencies 23 | 24 | First, [install Rust][install-rust] and [Foundry][install-foundry], and then restart your terminal. 25 | 26 | ```sh 27 | # Install Rust 28 | curl https://sh.rustup.rs -sSf | sh 29 | # Install Foundry 30 | curl -L https://foundry.paradigm.xyz | bash 31 | ``` 32 | 33 | Next, you will use `rzup` to install `cargo-risczero`. 34 | 35 | To install `rzup`, run the following command and follow the instructions: 36 | 37 | ```sh 38 | curl -L https://risczero.com/install | bash 39 | ``` 40 | 41 | Next we can install the RISC Zero toolchain by running `rzup`: 42 | 43 | ```sh 44 | rzup install 45 | ``` 46 | 47 | You can verify the installation was successful by running: 48 | 49 | ```sh 50 | cargo risczero --version 51 | ``` 52 | 53 | Now you have all the tools you need to develop and deploy an application with [RISC Zero][homepage-risczero]. 54 | 55 | ## Quick Start 56 | 57 | First, install the RISC Zero toolchain using the [instructions above](#dependencies). 58 | 59 | Now, you can initialize a new RISC Zero project at a location of your choosing: 60 | 61 | ```sh 62 | forge init -t risc0/risc0-foundry-template ./my-project 63 | ``` 64 | 65 | Congratulations! You've just started your first RISC Zero project. 66 | 67 | Your new project consists of: 68 | 69 | - a [zkVM program](./methods) (written in Rust), which specifies a computation that will be proven; 70 | - a [app contract](./contracts) (written in Solidity), which uses the proven results; 71 | - a [publisher](./apps) which makes proving requests to [Bonsai][docs-bonsai] and posts the proof to Ethereum. 72 | We provide an example implementation, but your dApp interface or application servers could act as the publisher. 73 | 74 | ### Build the Code 75 | 76 | - Update git submodules. 77 | 78 | ```sh 79 | git submodule update --init 80 | ``` 81 | 82 | - Builds for zkVM program, the publisher app, and any other Rust code. 83 | 84 | ```sh 85 | cargo build 86 | ``` 87 | 88 | - Build your Solidity smart contracts. 89 | 90 | > NOTE: `cargo build` needs to run first to generate the `ImageID.sol` contract. 91 | 92 | ```sh 93 | forge build 94 | ``` 95 | 96 | ### Run the Tests 97 | 98 | - Tests your zkVM program. 99 | 100 | ```sh 101 | cargo test 102 | ``` 103 | 104 | - Test your Solidity contracts, integrated with your zkVM program. 105 | 106 | ```sh 107 | RISC0_DEV_MODE=true forge test -vvv 108 | ``` 109 | 110 | - Run the same tests, with the full zkVM prover rather than dev-mode, by setting `RISC0_DEV_MODE=false`. 111 | 112 | ```sh 113 | RISC0_DEV_MODE=false forge test -vvv 114 | ``` 115 | 116 | Producing the [Groth16 SNARK proofs][groth16] for this test requires running on an x86 machine with [Docker][install-docker] installed, or using [Bonsai](#configuring-bonsai). 117 | Apple silicon is currently unsupported for local proving, you can find out more info in the relevant issues [here](https://github.com/risc0/risc0/issues/1520) and [here](https://github.com/risc0/risc0/issues/1749). 118 | 119 | ## Develop Your Application 120 | 121 | To build your application using the RISC Zero Foundry Template, you’ll need to make changes in three main areas: 122 | 123 | - ***Guest Code***: Write the code you want proven in the [methods/guest](./methods/guest/) folder. This code runs off-chain within the RISC Zero zkVM and performs the actual computations. For example, the provided template includes a computation to check if a given number is even and generate a proof of this computation. 124 | - ***Smart Contracts***: Write the on-chain part of your project in the [contracts](./contracts/) folder. The smart contract verifies zkVM proofs and updates the blockchain state based on the results of off-chain computations. For instance, in the [EvenNumber](./contracts/EvenNumber.sol) example, the smart contract verifies a proof that a number is even and stores that number on-chain if the proof is valid. 125 | - ***Publisher Application***: Adjust the publisher example in the [apps](./apps) folder. The publisher application bridges off-chain computation with on-chain verification by submitting proof requests, receiving proofs, and publishing them to the smart contract on Ethereum. 126 | 127 | ### Configuring Bonsai 128 | 129 | ***Note:*** *To request an API key [complete the form here](https://bonsai.xyz/apply).* 130 | 131 | With the Bonsai proving service, you can produce a [Groth16 SNARK proof][Groth16] that is verifiable on-chain. 132 | You can get started by setting the following environment variables with your API key and associated URL. 133 | 134 | ```bash 135 | export BONSAI_API_KEY="YOUR_API_KEY" # see form linked above 136 | export BONSAI_API_URL="BONSAI_URL" # provided with your api key 137 | ``` 138 | 139 | Now if you run `forge test` with `RISC0_DEV_MODE=false`, the test will run as before, but will additionally use the fully verifying `RiscZeroGroth16Verifier` contract instead of `MockRiscZeroVerifier` and will request a SNARK receipt from Bonsai. 140 | 141 | ```bash 142 | RISC0_DEV_MODE=false forge test -vvv 143 | ``` 144 | 145 | ### Deterministic Builds 146 | 147 | By setting the environment variable `RISC0_USE_DOCKER` a containerized build process via Docker will ensure that all builds of your guest code, regardless of the machine or local environment, will produce the same [image ID][image-id]. 148 | The [image ID][image-id], and its importance to security, is explained in more detail in our [developer FAQ][faq]. 149 | 150 | ```bash 151 | RISC0_USE_DOCKER=1 cargo build 152 | ``` 153 | 154 | > ***Note:*** *This requires having Docker installed and in your PATH. To install Docker see [Get Docker][install-docker].* 155 | 156 | ## Deploy Your Application 157 | 158 | When you're ready, follow the [deployment guide](./deployment-guide.md) to get your application running on [Sepolia][sepolia] or Ethereum Mainnet. 159 | 160 | ## Project Structure 161 | 162 | Below are the primary files in the project directory 163 | 164 | ```text 165 | . 166 | ├── Cargo.toml // Configuration for Cargo and Rust 167 | ├── foundry.toml // Configuration for Foundry 168 | ├── apps 169 | │ ├── Cargo.toml 170 | │ └── src 171 | │ └── lib.rs // Utility functions 172 | │ └── bin 173 | │ └── publisher.rs // Example app to publish program results into your app contract 174 | ├── contracts 175 | │ ├── EvenNumber.sol // Basic example contract for you to modify 176 | │ └── ImageID.sol // Generated contract with the image ID for your zkVM program 177 | ├── methods 178 | │ ├── Cargo.toml 179 | │ ├── guest 180 | │ │ ├── Cargo.toml 181 | │ │ └── src 182 | │ │ └── bin // You can add additional guest programs to this folder 183 | │ │ └── is_even.rs // Example guest program for checking if a number is even 184 | │ └── src 185 | │ └── lib.rs // Compiled image IDs and tests for your guest programs 186 | └── tests 187 | ├── EvenNumber.t.sol // Tests for the basic example contract 188 | └── Elf.sol // Generated contract with paths the guest program ELF files. 189 | ``` 190 | 191 | [docs-bonsai]: https://dev.risczero.com/api/generating-proofs/remote-proving 192 | [install-foundry]: https://getfoundry.sh/ 193 | [install-docker]: https://docs.docker.com/get-docker/ 194 | [groth16]: https://www.risczero.com/news/on-chain-verification 195 | [docs-verifier]: https://dev.risczero.com/api/blockchain-integration/contracts/verifier 196 | [docs-zkvm]: https://dev.risczero.com/zkvm 197 | [homepage-risczero]: https://www.risczero.com/ 198 | [Sepolia]: https://www.alchemy.com/overviews/sepolia-testnet 199 | [blog-coprocessor]: https://www.risczero.com/news/a-guide-to-zk-coprocessors-for-scalability 200 | [faq]: https://dev.risczero.com/faq#zkvm-application-design 201 | [image-id]: https://dev.risczero.com/terminology#image-id 202 | [install-rust]: https://doc.rust-lang.org/cargo/getting-started/installation.html 203 | [term-journal]: https://dev.risczero.com/terminology#journal 204 | [steel-repo]: https://github.com/risc0/risc0-ethereum/tree/main/crates/steel 205 | [erc20-counter]: https://github.com/risc0/risc0-ethereum/tree/main/examples/erc20-counter 206 | -------------------------------------------------------------------------------- /apps/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "apps" 3 | version = { workspace = true } 4 | edition = { workspace = true } 5 | 6 | [dependencies] 7 | alloy = { workspace = true } 8 | alloy-primitives = { workspace = true } 9 | alloy-sol-types = { workspace = true } 10 | anyhow = { workspace = true } 11 | clap = { version = "4.0", features = ["derive", "env"] } 12 | env_logger = { version = "0.10" } 13 | log = { workspace = true } 14 | methods = { workspace = true } 15 | risc0-ethereum-contracts = { workspace = true } 16 | risc0-zkvm = { workspace = true, default-features = true } 17 | tokio = { version = "1.35", features = ["full"] } 18 | url = { workspace = true } 19 | -------------------------------------------------------------------------------- /apps/README.md: -------------------------------------------------------------------------------- 1 | # Apps 2 | 3 | In typical applications, an off-chain app is needed to do two main actions: 4 | 5 | * Produce a proof e.g. by sending a proof request to [Bonsai]. 6 | * Send a transaction to Ethereum to execute your on-chain logic. 7 | 8 | This template provides the `publisher` CLI as an example application to execute these steps. 9 | In a production application, a back-end server or your dApp client may take on this role. 10 | 11 | ## Publisher 12 | 13 | The [`publisher` CLI][publisher], is an example application that sends an off-chain proof request to the [Bonsai] proving service, and publishes the received proofs to your deployed app contract. 14 | 15 | ### Usage 16 | 17 | Run the `publisher` with: 18 | 19 | ```sh 20 | cargo run --bin publisher 21 | ``` 22 | 23 | ```text 24 | $ cargo run --bin publisher -- --help 25 | 26 | Usage: publisher --chain-id --eth-wallet-private-key --rpc-url --contract --input 27 | 28 | Options: 29 | --chain-id 30 | Ethereum chain ID 31 | --eth-wallet-private-key 32 | Ethereum Node endpoint [env: ETH_WALLET_PRIVATE_KEY=] 33 | --rpc-url 34 | Ethereum Node endpoint 35 | --contract 36 | Application's contract address on Ethereum 37 | -i, --input 38 | The input to provide to the guest binary 39 | -h, --help 40 | Print help 41 | -V, --version 42 | Print version 43 | ``` 44 | 45 | [publisher]: ./src/bin/publisher.rs 46 | [Bonsai]: https://dev.bonsai.xyz/ 47 | -------------------------------------------------------------------------------- /apps/src/bin/publisher.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2024 RISC Zero, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // This application demonstrates how to send an off-chain proof request 16 | // to the Bonsai proving service and publish the received proofs directly 17 | // to your deployed app contract. 18 | 19 | use alloy::{ 20 | network::EthereumWallet, providers::ProviderBuilder, signers::local::PrivateKeySigner, 21 | sol_types::SolValue, 22 | }; 23 | use alloy_primitives::{Address, U256}; 24 | use anyhow::{Context, Result}; 25 | use clap::Parser; 26 | use methods::IS_EVEN_ELF; 27 | use risc0_ethereum_contracts::encode_seal; 28 | use risc0_zkvm::{default_prover, ExecutorEnv, ProverOpts, VerifierContext}; 29 | use url::Url; 30 | 31 | // `IEvenNumber` interface automatically generated via the alloy `sol!` macro. 32 | alloy::sol!( 33 | #[sol(rpc, all_derives)] 34 | "../contracts/IEvenNumber.sol" 35 | ); 36 | 37 | /// Arguments of the publisher CLI. 38 | #[derive(Parser, Debug)] 39 | #[clap(author, version, about, long_about = None)] 40 | struct Args { 41 | /// Ethereum chain ID 42 | #[clap(long)] 43 | chain_id: u64, 44 | 45 | /// Ethereum Node endpoint. 46 | #[clap(long, env)] 47 | eth_wallet_private_key: PrivateKeySigner, 48 | 49 | /// Ethereum Node endpoint. 50 | #[clap(long)] 51 | rpc_url: Url, 52 | 53 | /// Application's contract address on Ethereum 54 | #[clap(long)] 55 | contract: Address, 56 | 57 | /// The input to provide to the guest binary 58 | #[clap(short, long)] 59 | input: U256, 60 | } 61 | 62 | fn main() -> Result<()> { 63 | env_logger::init(); 64 | // Parse CLI Arguments: The application starts by parsing command-line arguments provided by the user. 65 | let args = Args::parse(); 66 | 67 | // Create an alloy provider for that private key and URL. 68 | let wallet = EthereumWallet::from(args.eth_wallet_private_key); 69 | let provider = ProviderBuilder::new() 70 | .wallet(wallet) 71 | .connect_http(args.rpc_url); 72 | 73 | // ABI encode input: Before sending the proof request to the Bonsai proving service, 74 | // the input number is ABI-encoded to match the format expected by the guest code running in the zkVM. 75 | let input = args.input.abi_encode(); 76 | 77 | let env = ExecutorEnv::builder().write_slice(&input).build()?; 78 | 79 | let receipt = default_prover() 80 | .prove_with_ctx( 81 | env, 82 | &VerifierContext::default(), 83 | IS_EVEN_ELF, 84 | &ProverOpts::groth16(), 85 | )? 86 | .receipt; 87 | 88 | // Encode the seal with the selector. 89 | let seal = encode_seal(&receipt)?; 90 | 91 | // Extract the journal from the receipt. 92 | let journal = receipt.journal.bytes.clone(); 93 | 94 | // Decode Journal: Upon receiving the proof, the application decodes the journal to extract 95 | // the verified number. This ensures that the number being submitted to the blockchain matches 96 | // the number that was verified off-chain. 97 | let x = U256::abi_decode(&journal).context("decoding journal data")?; 98 | 99 | // Construct function call: Using the IEvenNumber interface, the application constructs 100 | // the ABI-encoded function call for the set function of the EvenNumber contract. 101 | // This call includes the verified number, the post-state digest, and the seal (proof). 102 | let contract = IEvenNumber::new(args.contract, provider); 103 | let call_builder = contract.set(x, seal.into()); 104 | 105 | // Initialize the async runtime environment to handle the transaction sending. 106 | let runtime = tokio::runtime::Runtime::new()?; 107 | 108 | // Send transaction: Finally, send the transaction to the Ethereum blockchain, 109 | // effectively calling the set function of the EvenNumber contract with the verified number and proof. 110 | let pending_tx = runtime.block_on(call_builder.send())?; 111 | runtime.block_on(pending_tx.get_receipt())?; 112 | 113 | Ok(()) 114 | } 115 | -------------------------------------------------------------------------------- /contracts/EvenNumber.sol: -------------------------------------------------------------------------------- 1 | // Copyright 2024 RISC Zero, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // SPDX-License-Identifier: Apache-2.0 16 | 17 | pragma solidity ^0.8.20; 18 | 19 | import {IRiscZeroVerifier} from "risc0/IRiscZeroVerifier.sol"; 20 | import {ImageID} from "./ImageID.sol"; // auto-generated contract after running `cargo build`. 21 | 22 | /// @title A starter application using RISC Zero. 23 | /// @notice This basic application holds a number, guaranteed to be even. 24 | /// @dev This contract demonstrates one pattern for offloading the computation of an expensive 25 | /// or difficult to implement function to a RISC Zero guest running on the zkVM. 26 | contract EvenNumber { 27 | /// @notice RISC Zero verifier contract address. 28 | IRiscZeroVerifier public immutable verifier; 29 | /// @notice Image ID of the only zkVM binary to accept verification from. 30 | /// The image ID is similar to the address of a smart contract. 31 | /// It uniquely represents the logic of that guest program, 32 | /// ensuring that only proofs generated from a pre-defined guest program 33 | /// (in this case, checking if a number is even) are considered valid. 34 | bytes32 public constant imageId = ImageID.IS_EVEN_ID; 35 | 36 | /// @notice A number that is guaranteed, by the RISC Zero zkVM, to be even. 37 | /// It can be set by calling the `set` function. 38 | uint256 public number; 39 | 40 | /// @notice Initialize the contract, binding it to a specified RISC Zero verifier. 41 | constructor(IRiscZeroVerifier _verifier) { 42 | verifier = _verifier; 43 | number = 0; 44 | } 45 | 46 | /// @notice Set the even number stored on the contract. Requires a RISC Zero proof that the number is even. 47 | function set(uint256 x, bytes calldata seal) public { 48 | // Construct the expected journal data. Verify will fail if journal does not match. 49 | bytes memory journal = abi.encode(x); 50 | verifier.verify(seal, imageId, sha256(journal)); 51 | number = x; 52 | } 53 | 54 | /// @notice Returns the number stored. 55 | function get() public view returns (uint256) { 56 | return number; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /contracts/IEvenNumber.sol: -------------------------------------------------------------------------------- 1 | // Copyright 2024 RISC Zero, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // SPDX-License-Identifier: Apache-2.0 16 | 17 | pragma solidity ^0.8.20; 18 | 19 | /// @title A starter application using RISC Zero. 20 | /// @notice This basic application holds a number, guaranteed to be even. 21 | /// @dev This contract demonstrates one pattern for offloading the computation of an expensive 22 | /// or difficult to implement function to a RISC Zero guest running on the zkVM. 23 | interface IEvenNumber { 24 | /// @notice Set the even number stored on the contract. Requires a RISC Zero proof that the number is even. 25 | function set(uint256 x, bytes calldata seal) external; 26 | 27 | /// @notice Returns the number stored. 28 | function get() external view returns (uint256); 29 | } 30 | -------------------------------------------------------------------------------- /contracts/README.md: -------------------------------------------------------------------------------- 1 | # Solidity Contracts 2 | 3 | This directory contains the Solidity contracts for an application with [RISC Zero] on Ethereum. 4 | The example contract included within the template is [`EvenNumber.sol`](./EvenNumber.sol). 5 | It holds a number, guaranteed to be even. 6 | 7 | The Solidity libraries for RISC Zero can be found at [github.com/risc0/risc0-ethereum]. 8 | 9 | Contracts are built and tested with [forge], which is part of the [Foundry] toolkit. 10 | Tests are defined in the `tests` directory in the root of this template. 11 | 12 | ## Generated Contracts 13 | 14 | As part of the build process, this template generates the `ImageID.sol` and `Elf.sol` contracts. 15 | Running `cargo build` will generate these contracts with up to date references to your guest code. 16 | 17 | - `ImageID.sol`: contains the [Image IDs][image-id] for the guests implemented in the [methods] directory. 18 | - `Elf.sol`: contains the path of the guest binaries implemented in the [methods] directory. 19 | This contract is saved in the `tests` directory in the root of this template. 20 | 21 | [Foundry]: https://getfoundry.sh/ 22 | [RISC Zero]: https://risczero.com 23 | [forge]: https://github.com/foundry-rs/foundry#forge 24 | [github.com/risc0/risc0-ethereum]: https://github.com/risc0/risc0-ethereum/tree/main/contracts 25 | [image-id]: https://dev.risczero.com/terminology#image-id 26 | [methods]: ../methods/README.md 27 | -------------------------------------------------------------------------------- /deployment-guide.md: -------------------------------------------------------------------------------- 1 | # RISC Zero Ethereum Deployment Guide 2 | 3 | Welcome to the [RISC Zero] Ethereum Deployment guide! 4 | 5 | Once you've written your [contracts] and your [methods], and [tested] your program, you're ready to deploy your contract. 6 | 7 | You can either: 8 | 9 | - [Deploy your project to a local network][section-local] 10 | - [Deploy to a testnet][section-testnet] 11 | - [Deploy to Ethereum Mainnet][section-mainnet] 12 | 13 | ## Deploy your project on a local network 14 | 15 | You can deploy your contracts and run an end-to-end test or demo as follows: 16 | 17 | 1. Start a local testnet with `anvil` by running: 18 | 19 | ```bash 20 | anvil 21 | ``` 22 | 23 | Once anvil is started, keep it running in the terminal, and switch to a new terminal. 24 | 25 | 2. Set your environment variables: 26 | > ***Note:*** *This requires having access to a Bonsai API Key. To request an API key [complete the form here](https://bonsai.xyz/apply).* 27 | > Alternatively you can generate your proofs locally, assuming you have a machine with an x86 architecture and [Docker] installed. In this case do not export Bonsai related env variables. 28 | 29 | ```bash 30 | # Anvil sets up a number of default wallets, and this private key is one of them. 31 | export ETH_WALLET_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 32 | export BONSAI_API_KEY="YOUR_API_KEY" # see form linked in the previous section 33 | export BONSAI_API_URL="BONSAI_API_URL" # provided with your api key 34 | ``` 35 | 36 | 3. Build your project: 37 | 38 | ```bash 39 | cargo build 40 | ``` 41 | 42 | 4. Deploy your contract by running: 43 | 44 | ```bash 45 | forge script --rpc-url http://localhost:8545 --broadcast script/Deploy.s.sol 46 | ``` 47 | 48 | This command should output something similar to: 49 | 50 | ```bash 51 | ... 52 | == Logs == 53 | You are deploying on ChainID 31337 54 | Deployed RiscZeroGroth16Verifier to 0x5FbDB2315678afecb367f032d93F642f64180aa3 55 | Deployed EvenNumber to 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 56 | ... 57 | ``` 58 | 59 | Save the `EvenNumber` contract address to an env variable: 60 | 61 | ```bash 62 | export EVEN_NUMBER_ADDRESS=#COPY EVEN NUMBER ADDRESS FROM DEPLOY LOGS 63 | ``` 64 | 65 | > You can also use the following command to set the contract address if you have [`jq`][jq] installed: 66 | > 67 | > ```bash 68 | > export EVEN_NUMBER_ADDRESS=$(jq -re '.transactions[] | select(.contractName == "EvenNumber") | .contractAddress' ./broadcast/Deploy.s.sol/31337/run-latest.json) 69 | > ``` 70 | 71 | ### Interact with your local deployment 72 | 73 | 1. Query the state: 74 | 75 | ```bash 76 | cast call --rpc-url http://localhost:8545 ${EVEN_NUMBER_ADDRESS:?} 'get()(uint256)' 77 | ``` 78 | 79 | 2. Publish a new state 80 | 81 | ```bash 82 | cargo run --bin publisher -- \ 83 | --chain-id=31337 \ 84 | --rpc-url=http://localhost:8545 \ 85 | --contract=${EVEN_NUMBER_ADDRESS:?} \ 86 | --input=12345678 87 | ``` 88 | 89 | 3. Query the state again to see the change: 90 | 91 | ```bash 92 | cast call --rpc-url http://localhost:8545 ${EVEN_NUMBER_ADDRESS:?} 'get()(uint256)' 93 | ``` 94 | 95 | ## Deploy your project on Sepolia testnet 96 | 97 | You can deploy your contracts on the `Sepolia` testnet and run an end-to-end test or demo as follows: 98 | 99 | 1. Get access to Bonsai and an Ethereum node running on Sepolia testnet (in this example, we will be using [Alchemy](https://www.alchemy.com/) as our Ethereum node provider) and export the following environment variables: 100 | > ***Note:*** *This requires having access to a Bonsai API Key. To request an API key [complete the form here](https://bonsai.xyz/apply).* 101 | > Alternatively you can generate your proofs locally, assuming you have a machine with an x86 architecture and [Docker] installed. In this case do not export Bonsai related env variables. 102 | 103 | ```bash 104 | export BONSAI_API_KEY="YOUR_API_KEY" # see form linked in the previous section 105 | export BONSAI_API_URL="BONSAI_API_URL" # provided with your api key 106 | export ALCHEMY_API_KEY="YOUR_ALCHEMY_API_KEY" # the API_KEY provided with an alchemy account 107 | export ETH_WALLET_PRIVATE_KEY="YOUR_WALLET_PRIVATE_KEY" # the private hex-encoded key of your Sepolia testnet wallet 108 | ``` 109 | 110 | 2. Build your project: 111 | 112 | ```bash 113 | cargo build 114 | ``` 115 | 116 | 3. Deploy your contract by running: 117 | 118 | ```bash 119 | forge script script/Deploy.s.sol --rpc-url https://eth-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY:?} --broadcast 120 | ``` 121 | 122 | This command uses the `sepolia` profile defined in the [config][config] file, and should output something similar to: 123 | 124 | ```bash 125 | ... 126 | == Logs == 127 | You are deploying on ChainID 11155111 128 | Deploying using config profile: sepolia 129 | Using IRiscZeroVerifier contract deployed at 0x925d8331ddc0a1F0d96E68CF073DFE1d92b69187 130 | Deployed EvenNumber to 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 131 | ... 132 | ``` 133 | 134 | Save the `EvenNumber` contract address to an env variable: 135 | 136 | ```bash 137 | export EVEN_NUMBER_ADDRESS=#COPY EVEN NUMBER ADDRESS FROM DEPLOY LOGS 138 | ``` 139 | 140 | > You can also use the following command to set the contract address if you have [`jq`][jq] installed: 141 | > 142 | > ```bash 143 | > export EVEN_NUMBER_ADDRESS=$(jq -re '.transactions[] | select(.contractName == "EvenNumber") | .contractAddress' ./broadcast/Deploy.s.sol/11155111/run-latest.json) 144 | > ``` 145 | 146 | ### Interact with your Sepolia testnet deployment 147 | 148 | 1. Query the state: 149 | 150 | ```bash 151 | cast call --rpc-url https://eth-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY:?} ${EVEN_NUMBER_ADDRESS:?} 'get()(uint256)' 152 | ``` 153 | 154 | 2. Publish a new state 155 | 156 | ```bash 157 | cargo run --bin publisher -- \ 158 | --chain-id=11155111 \ 159 | --rpc-url=https://eth-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY:?} \ 160 | --contract=${EVEN_NUMBER_ADDRESS:?} \ 161 | --input=12345678 162 | ``` 163 | 164 | 3. Query the state again to see the change: 165 | 166 | ```bash 167 | cast call --rpc-url https://eth-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY:?} ${EVEN_NUMBER_ADDRESS:?} 'get()(uint256)' 168 | ``` 169 | 170 | ## Deploy your project on Ethereum mainnet 171 | 172 | You can deploy your contract on Ethereum Mainnet as follows: 173 | 174 | 1. Get access to Bonsai and an Ethereum node running on Mainnet (in this example, we will be using [Alchemy](https://www.alchemy.com/) as our Ethereum node provider) and export the following environment variables: 175 | > ***Note:*** *This requires having access to a Bonsai API Key. To request an API key [complete the form here](https://bonsai.xyz/apply).* 176 | > Alternatively you can generate your proofs locally, assuming you have a machine with an x86 architecture and [Docker] installed. In this case do not export Bonsai related env variables. 177 | 178 | ```bash 179 | export BONSAI_API_KEY="YOUR_API_KEY" # see form linked in the previous section 180 | export BONSAI_API_URL="BONSAI_API_URL" # provided with your api key 181 | export ALCHEMY_API_KEY="YOUR_ALCHEMY_API_KEY" # the API_KEY provided with an alchemy account 182 | export ETH_WALLET_ADDRESS="YOUR_WALLET_ADDRESS" # the account address you want to use for deployment 183 | ``` 184 | 185 | 2. Build your project: 186 | 187 | ```bash 188 | cargo build 189 | ``` 190 | 191 | 3. Deploy your contract by running: 192 | 193 | You'll need to pass options to forge script to connect to your deployer wallet. See the [Foundry documentation][forge-script-wallet-docs]. 194 | The example command below configures Forge to use a Ledger hardware wallet. 195 | 196 | ```bash 197 | forge script script/Deploy.s.sol --rpc-url https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY:?} --broadcast --ledger 198 | ``` 199 | 200 | This command uses the `mainnet` profile defined in the [config][config] file, and should output something similar to: 201 | 202 | ```bash 203 | ... 204 | == Logs == 205 | You are deploying on ChainID 1 206 | Deploying using config profile: mainnet 207 | Using IRiscZeroVerifier contract deployed at 0x8EaB2D97Dfce405A1692a21b3ff3A172d593D319 208 | Deployed EvenNumber to 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 209 | ... 210 | ``` 211 | 212 | Save the `EvenNumber` contract address to an env variable: 213 | 214 | ```bash 215 | export EVEN_NUMBER_ADDRESS=#COPY EVEN NUMBER ADDRESS FROM DEPLOY LOGS 216 | ``` 217 | 218 | > You can also use the following command to set the contract address if you have [`jq`][jq] installed: 219 | > 220 | > ```bash 221 | > export EVEN_NUMBER_ADDRESS=$(jq -re '.transactions[] | select(.contractName == "EvenNumber") | .contractAddress' ./broadcast/Deploy.s.sol/1/run-latest.json) 222 | > ``` 223 | 224 | ### Interact with your Ethereum Mainnet deployment 225 | 226 | 1. Query the state: 227 | 228 | ```bash 229 | cast call --rpc-url https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY:?} ${EVEN_NUMBER_ADDRESS:?} 'get()(uint256)' 230 | ``` 231 | 232 | 2. Publish a new state 233 | 234 | > NOTE: Currently only a local wallet, provided by the `ETH_WALLET_PRIVATE_KEY` env var is implemented in the example publisher app. 235 | > Please see https://github.com/risc0/risc0-foundry-template/issues/121 for more details. 236 | 237 | ```bash 238 | cargo run --bin publisher -- \ 239 | --chain-id=1 \ 240 | --rpc-url=https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY:?} \ 241 | --contract=${EVEN_NUMBER_ADDRESS:?} \ 242 | --input=12345678 243 | ``` 244 | 245 | 3. Query the state again to see the change: 246 | 247 | ```bash 248 | cast call --rpc-url https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY:?} ${EVEN_NUMBER_ADDRESS:?} 'get()(uint256)' 249 | ``` 250 | 251 | [section-mainnet]: #deploy-your-project-on-ethereum-mainnet 252 | [section-local]: #deploy-your-project-on-a-local-network 253 | [section-testnet]: #deploy-your-project-on-sepolia-testnet 254 | [RISC Zero]: https://www.risczero.com/ 255 | [Docker]: https://docs.docker.com/engine/install/ 256 | [contracts]: ./contracts/ 257 | [jq]: https://jqlang.github.io/jq/ 258 | [methods]: ./methods/ 259 | [tested]: ./README.md#run-the-tests 260 | [config]: ./script/config.toml 261 | [forge-script-wallet-docs]: https://book.getfoundry.sh/reference/forge/forge-script#wallet-options---raw 262 | -------------------------------------------------------------------------------- /foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = "contracts" 3 | out = "out" 4 | libs = ["lib"] 5 | test = "tests" 6 | ffi = true 7 | fs_permissions = [{ access = "read-write", path = "./"}] 8 | 9 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config 10 | -------------------------------------------------------------------------------- /images/risc0-foundry-template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/risc0/risc0-foundry-template/d4546e4257abaeaca34ac5bea94e38a7aeecff32/images/risc0-foundry-template.png -------------------------------------------------------------------------------- /methods/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "methods" 3 | version = { workspace = true } 4 | edition = { workspace = true } 5 | 6 | [package.metadata.risc0] 7 | methods = ["guest"] 8 | 9 | [build-dependencies] 10 | hex = { workspace = true } 11 | risc0-build = { workspace = true } 12 | risc0-build-ethereum = { workspace = true } 13 | risc0-zkp = { workspace = true } 14 | 15 | [dev-dependencies] 16 | alloy-primitives = { workspace = true } 17 | alloy-sol-types = { workspace = true } 18 | risc0-zkvm = { workspace = true, features = ["client"] } 19 | -------------------------------------------------------------------------------- /methods/README.md: -------------------------------------------------------------------------------- 1 | # zkVM Methods 2 | 3 | This directory contains the [zkVM] portion of your [RISC Zero] application. 4 | This is where you will define one or more [guest programs] to act as a coprocessor to your [on-chain logic]. 5 | 6 | > In typical use cases, the only code in this directory that you will need to edit is inside [guest/src/bin]. 7 | 8 | ## Writing Guest Code 9 | 10 | To learn to write code for the zkVM, we recommend the [Hello World tutorial][zkvm-hello-world]. 11 | 12 | Examples of what you can do in the guest can be found in the [RISC Zero examples]. 13 | 14 | ## From Guest Code to Binary File 15 | 16 | Code in the `methods/guest` directory will be compiled into one or more binaries. 17 | 18 | Build configuration for the methods is included in `methods/build.rs`. 19 | 20 | Each will have a corresponding image ID, which is a hash identifying the program. 21 | 22 | [zkVM]: https://dev.risczero.com/zkvm 23 | [RISC Zero]: https://www.risczero.com/ 24 | [guest programs]: https://dev.risczero.com/terminology#guest-program 25 | [on-chain logic]: ../contracts/ 26 | [guest/src/bin]: ./guest/src/bin/ 27 | [zkvm-hello-world]: https://dev.risczero.com/api/zkvm/tutorials/hello-world 28 | [RISC Zero examples]: https://github.com/risc0/risc0/tree/release-1.1/examples 29 | -------------------------------------------------------------------------------- /methods/build.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2023 RISC Zero, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | use std::{collections::HashMap, env, path::PathBuf, process::Command}; 16 | 17 | use risc0_build::{embed_methods_with_options, DockerOptionsBuilder, GuestOptionsBuilder}; 18 | use risc0_build_ethereum::generate_solidity_files; 19 | 20 | // Paths where the generated Solidity files will be written. 21 | const SOLIDITY_IMAGE_ID_PATH: &str = "../contracts/ImageID.sol"; 22 | const SOLIDITY_ELF_PATH: &str = "../tests/Elf.sol"; 23 | 24 | fn main() { 25 | git_submodule_init(); 26 | check_submodule_state(); 27 | 28 | // Builds can be made deterministic, and thereby reproducible, by using Docker to build the 29 | // guest. Check the RISC0_USE_DOCKER variable and use Docker to build the guest if set. 30 | println!("cargo:rerun-if-env-changed=RISC0_USE_DOCKER"); 31 | println!("cargo:rerun-if-changed=build.rs"); 32 | let manifest_dir = PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap()); 33 | let mut builder = GuestOptionsBuilder::default(); 34 | if env::var("RISC0_USE_DOCKER").is_ok() { 35 | let docker_options = DockerOptionsBuilder::default() 36 | .root_dir(manifest_dir.join("../")) 37 | .build() 38 | .unwrap(); 39 | builder.use_docker(docker_options); 40 | } 41 | let guest_options = builder.build().unwrap(); 42 | 43 | // Generate Rust source files for the methods crate. 44 | let guests = embed_methods_with_options(HashMap::from([("guests", guest_options)])); 45 | 46 | // Generate Solidity source files for use with Forge. 47 | let solidity_opts = risc0_build_ethereum::Options::default() 48 | .with_image_id_sol_path(SOLIDITY_IMAGE_ID_PATH) 49 | .with_elf_sol_path(SOLIDITY_ELF_PATH); 50 | 51 | generate_solidity_files(guests.as_slice(), &solidity_opts).unwrap(); 52 | } 53 | 54 | /// Initializes git submodules by adding their configurations to .git/config. 55 | /// This is a one-time setup step that only needs to run on first clone of the repository. 56 | /// Does not fetch or update submodule contents. 57 | /// 58 | /// # Warnings 59 | /// Prints a warning to stderr if the initialization fails, but does not interrupt the build process. 60 | fn git_submodule_init() { 61 | println!("cargo:rerun-if-changed=.gitmodules"); 62 | let output = Command::new("git") 63 | .args(["submodule", "init"]) 64 | .output() 65 | .expect("failed to run git submodule init in methods/build.rs"); 66 | 67 | if !output.status.success() { 68 | eprintln!( 69 | "WARNING: git submodule init failed (methods/build.rs): {}", 70 | String::from_utf8_lossy(&output.stderr) 71 | ); 72 | } 73 | } 74 | 75 | /// Checks and reports the status of all git submodules in the project. 76 | /// Runs on every build to inform developers about the state of their submodules. 77 | /// 78 | /// # Status Indicators 79 | /// - `-`: submodule is not initialized 80 | /// - `+`: submodule has local changes 81 | /// - ` `: submodule is clean (no warning displayed) 82 | /// 83 | /// # Warnings 84 | /// Prints warnings for any non-clean states, but does not modify submodules 85 | /// or interrupt the build process. 86 | fn check_submodule_state() { 87 | println!("cargo:rerun-if-changed=.gitmodules"); 88 | let status = Command::new("git") 89 | .args(["submodule", "status"]) 90 | .output() 91 | .expect("failed to run git submodule status"); 92 | 93 | if !status.status.success() { 94 | println!( 95 | "cargo:warning=failed to check git submodule status: {}", 96 | String::from_utf8_lossy(&status.stderr) 97 | ); 98 | return; 99 | } 100 | 101 | let output = String::from_utf8_lossy(&status.stdout); 102 | let mut has_uninitialized = false; 103 | let mut has_local_changes = false; 104 | 105 | for line in output.lines() { 106 | let path = line 107 | .split_whitespace() 108 | .nth(1) 109 | .unwrap_or("unknown path") 110 | .replace("../", ""); 111 | 112 | if let Some(first_char) = line.chars().next() { 113 | match first_char { 114 | '-' => { 115 | println!("cargo:warning=git submodule not initialized: {}", path); 116 | has_uninitialized = true; 117 | } 118 | '+' => { 119 | println!("cargo:warning=git submodule has local changes, this may cause unexpected behaviour: {}", path); 120 | has_local_changes = true; 121 | } 122 | _ => (), 123 | } 124 | } 125 | } 126 | 127 | if has_uninitialized { 128 | println!( 129 | "cargo:warning=to initialize missing submodules, run: git submodule update --init" 130 | ); 131 | } 132 | 133 | if has_local_changes { 134 | println!("cargo:warning=to reset submodules to their expected versions, run: git submodule update --recursive"); 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /methods/guest/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 4 4 | 5 | [[package]] 6 | name = "ahash" 7 | version = "0.8.11" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" 10 | dependencies = [ 11 | "cfg-if", 12 | "once_cell", 13 | "version_check", 14 | "zerocopy", 15 | ] 16 | 17 | [[package]] 18 | name = "allocator-api2" 19 | version = "0.2.21" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" 22 | 23 | [[package]] 24 | name = "alloy-json-abi" 25 | version = "1.1.0" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | checksum = "0068ae277f5ee3153a95eaea8ff10e188ed8ccde9b7f9926305415a2c0ab2442" 28 | dependencies = [ 29 | "alloy-primitives", 30 | "alloy-sol-type-parser", 31 | "serde", 32 | "serde_json", 33 | ] 34 | 35 | [[package]] 36 | name = "alloy-primitives" 37 | version = "1.1.0" 38 | source = "registry+https://github.com/rust-lang/crates.io-index" 39 | checksum = "6a12fe11d0b8118e551c29e1a67ccb6d01cc07ef08086df30f07487146de6fa1" 40 | dependencies = [ 41 | "alloy-rlp", 42 | "bytes", 43 | "cfg-if", 44 | "const-hex", 45 | "derive_more", 46 | "foldhash", 47 | "hashbrown", 48 | "indexmap", 49 | "itoa", 50 | "k256", 51 | "keccak-asm", 52 | "paste", 53 | "proptest", 54 | "rand 0.9.1", 55 | "ruint", 56 | "rustc-hash", 57 | "serde", 58 | "sha3", 59 | "tiny-keccak", 60 | ] 61 | 62 | [[package]] 63 | name = "alloy-rlp" 64 | version = "0.3.11" 65 | source = "registry+https://github.com/rust-lang/crates.io-index" 66 | checksum = "3d6c1d995bff8d011f7cd6c81820d51825e6e06d6db73914c1630ecf544d83d6" 67 | dependencies = [ 68 | "arrayvec", 69 | "bytes", 70 | ] 71 | 72 | [[package]] 73 | name = "alloy-sol-macro" 74 | version = "1.1.0" 75 | source = "registry+https://github.com/rust-lang/crates.io-index" 76 | checksum = "5d3ef8e0d622453d969ba3cded54cf6800efdc85cb929fe22c5bdf8335666757" 77 | dependencies = [ 78 | "alloy-sol-macro-expander", 79 | "alloy-sol-macro-input", 80 | "proc-macro-error2", 81 | "proc-macro2", 82 | "quote", 83 | "syn 2.0.99", 84 | ] 85 | 86 | [[package]] 87 | name = "alloy-sol-macro-expander" 88 | version = "1.1.0" 89 | source = "registry+https://github.com/rust-lang/crates.io-index" 90 | checksum = "f0e84bd0693c69a8fbe3ec0008465e029c6293494df7cb07580bf4a33eff52e1" 91 | dependencies = [ 92 | "alloy-sol-macro-input", 93 | "const-hex", 94 | "heck", 95 | "indexmap", 96 | "proc-macro-error2", 97 | "proc-macro2", 98 | "quote", 99 | "syn 2.0.99", 100 | "syn-solidity", 101 | "tiny-keccak", 102 | ] 103 | 104 | [[package]] 105 | name = "alloy-sol-macro-input" 106 | version = "1.1.0" 107 | source = "registry+https://github.com/rust-lang/crates.io-index" 108 | checksum = "f3de663412dadf9b64f4f92f507f78deebcc92339d12cf15f88ded65d41c7935" 109 | dependencies = [ 110 | "const-hex", 111 | "dunce", 112 | "heck", 113 | "macro-string", 114 | "proc-macro2", 115 | "quote", 116 | "syn 2.0.99", 117 | "syn-solidity", 118 | ] 119 | 120 | [[package]] 121 | name = "alloy-sol-type-parser" 122 | version = "1.1.0" 123 | source = "registry+https://github.com/rust-lang/crates.io-index" 124 | checksum = "251273c5aa1abb590852f795c938730fa641832fc8fa77b5478ed1bf11b6097e" 125 | dependencies = [ 126 | "serde", 127 | "winnow", 128 | ] 129 | 130 | [[package]] 131 | name = "alloy-sol-types" 132 | version = "1.1.0" 133 | source = "registry+https://github.com/rust-lang/crates.io-index" 134 | checksum = "5460a975434ae594fe2b91586253c1beb404353b78f0a55bf124abcd79557b15" 135 | dependencies = [ 136 | "alloy-json-abi", 137 | "alloy-primitives", 138 | "alloy-sol-macro", 139 | "const-hex", 140 | "serde", 141 | ] 142 | 143 | [[package]] 144 | name = "anyhow" 145 | version = "1.0.97" 146 | source = "registry+https://github.com/rust-lang/crates.io-index" 147 | checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" 148 | 149 | [[package]] 150 | name = "ark-bn254" 151 | version = "0.5.0" 152 | source = "registry+https://github.com/rust-lang/crates.io-index" 153 | checksum = "d69eab57e8d2663efa5c63135b2af4f396d66424f88954c21104125ab6b3e6bc" 154 | dependencies = [ 155 | "ark-ec", 156 | "ark-ff 0.5.0", 157 | "ark-r1cs-std", 158 | "ark-std 0.5.0", 159 | ] 160 | 161 | [[package]] 162 | name = "ark-crypto-primitives" 163 | version = "0.5.0" 164 | source = "registry+https://github.com/rust-lang/crates.io-index" 165 | checksum = "1e0c292754729c8a190e50414fd1a37093c786c709899f29c9f7daccecfa855e" 166 | dependencies = [ 167 | "ahash", 168 | "ark-crypto-primitives-macros", 169 | "ark-ec", 170 | "ark-ff 0.5.0", 171 | "ark-relations", 172 | "ark-serialize 0.5.0", 173 | "ark-snark", 174 | "ark-std 0.5.0", 175 | "blake2", 176 | "derivative", 177 | "digest 0.10.7", 178 | "fnv", 179 | "merlin", 180 | "sha2", 181 | ] 182 | 183 | [[package]] 184 | name = "ark-crypto-primitives-macros" 185 | version = "0.5.0" 186 | source = "registry+https://github.com/rust-lang/crates.io-index" 187 | checksum = "e7e89fe77d1f0f4fe5b96dfc940923d88d17b6a773808124f21e764dfb063c6a" 188 | dependencies = [ 189 | "proc-macro2", 190 | "quote", 191 | "syn 2.0.99", 192 | ] 193 | 194 | [[package]] 195 | name = "ark-ec" 196 | version = "0.5.0" 197 | source = "registry+https://github.com/rust-lang/crates.io-index" 198 | checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" 199 | dependencies = [ 200 | "ahash", 201 | "ark-ff 0.5.0", 202 | "ark-poly", 203 | "ark-serialize 0.5.0", 204 | "ark-std 0.5.0", 205 | "educe", 206 | "fnv", 207 | "hashbrown", 208 | "itertools 0.13.0", 209 | "num-bigint", 210 | "num-integer", 211 | "num-traits", 212 | "zeroize", 213 | ] 214 | 215 | [[package]] 216 | name = "ark-ff" 217 | version = "0.3.0" 218 | source = "registry+https://github.com/rust-lang/crates.io-index" 219 | checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" 220 | dependencies = [ 221 | "ark-ff-asm 0.3.0", 222 | "ark-ff-macros 0.3.0", 223 | "ark-serialize 0.3.0", 224 | "ark-std 0.3.0", 225 | "derivative", 226 | "num-bigint", 227 | "num-traits", 228 | "paste", 229 | "rustc_version 0.3.3", 230 | "zeroize", 231 | ] 232 | 233 | [[package]] 234 | name = "ark-ff" 235 | version = "0.4.2" 236 | source = "registry+https://github.com/rust-lang/crates.io-index" 237 | checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" 238 | dependencies = [ 239 | "ark-ff-asm 0.4.2", 240 | "ark-ff-macros 0.4.2", 241 | "ark-serialize 0.4.2", 242 | "ark-std 0.4.0", 243 | "derivative", 244 | "digest 0.10.7", 245 | "itertools 0.10.5", 246 | "num-bigint", 247 | "num-traits", 248 | "paste", 249 | "rustc_version 0.4.1", 250 | "zeroize", 251 | ] 252 | 253 | [[package]] 254 | name = "ark-ff" 255 | version = "0.5.0" 256 | source = "registry+https://github.com/rust-lang/crates.io-index" 257 | checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" 258 | dependencies = [ 259 | "ark-ff-asm 0.5.0", 260 | "ark-ff-macros 0.5.0", 261 | "ark-serialize 0.5.0", 262 | "ark-std 0.5.0", 263 | "arrayvec", 264 | "digest 0.10.7", 265 | "educe", 266 | "itertools 0.13.0", 267 | "num-bigint", 268 | "num-traits", 269 | "paste", 270 | "zeroize", 271 | ] 272 | 273 | [[package]] 274 | name = "ark-ff-asm" 275 | version = "0.3.0" 276 | source = "registry+https://github.com/rust-lang/crates.io-index" 277 | checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" 278 | dependencies = [ 279 | "quote", 280 | "syn 1.0.109", 281 | ] 282 | 283 | [[package]] 284 | name = "ark-ff-asm" 285 | version = "0.4.2" 286 | source = "registry+https://github.com/rust-lang/crates.io-index" 287 | checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" 288 | dependencies = [ 289 | "quote", 290 | "syn 1.0.109", 291 | ] 292 | 293 | [[package]] 294 | name = "ark-ff-asm" 295 | version = "0.5.0" 296 | source = "registry+https://github.com/rust-lang/crates.io-index" 297 | checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" 298 | dependencies = [ 299 | "quote", 300 | "syn 2.0.99", 301 | ] 302 | 303 | [[package]] 304 | name = "ark-ff-macros" 305 | version = "0.3.0" 306 | source = "registry+https://github.com/rust-lang/crates.io-index" 307 | checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" 308 | dependencies = [ 309 | "num-bigint", 310 | "num-traits", 311 | "quote", 312 | "syn 1.0.109", 313 | ] 314 | 315 | [[package]] 316 | name = "ark-ff-macros" 317 | version = "0.4.2" 318 | source = "registry+https://github.com/rust-lang/crates.io-index" 319 | checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" 320 | dependencies = [ 321 | "num-bigint", 322 | "num-traits", 323 | "proc-macro2", 324 | "quote", 325 | "syn 1.0.109", 326 | ] 327 | 328 | [[package]] 329 | name = "ark-ff-macros" 330 | version = "0.5.0" 331 | source = "registry+https://github.com/rust-lang/crates.io-index" 332 | checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" 333 | dependencies = [ 334 | "num-bigint", 335 | "num-traits", 336 | "proc-macro2", 337 | "quote", 338 | "syn 2.0.99", 339 | ] 340 | 341 | [[package]] 342 | name = "ark-groth16" 343 | version = "0.5.0" 344 | source = "registry+https://github.com/rust-lang/crates.io-index" 345 | checksum = "88f1d0f3a534bb54188b8dcc104307db6c56cdae574ddc3212aec0625740fc7e" 346 | dependencies = [ 347 | "ark-crypto-primitives", 348 | "ark-ec", 349 | "ark-ff 0.5.0", 350 | "ark-poly", 351 | "ark-relations", 352 | "ark-serialize 0.5.0", 353 | "ark-std 0.5.0", 354 | ] 355 | 356 | [[package]] 357 | name = "ark-poly" 358 | version = "0.5.0" 359 | source = "registry+https://github.com/rust-lang/crates.io-index" 360 | checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" 361 | dependencies = [ 362 | "ahash", 363 | "ark-ff 0.5.0", 364 | "ark-serialize 0.5.0", 365 | "ark-std 0.5.0", 366 | "educe", 367 | "fnv", 368 | "hashbrown", 369 | ] 370 | 371 | [[package]] 372 | name = "ark-r1cs-std" 373 | version = "0.5.0" 374 | source = "registry+https://github.com/rust-lang/crates.io-index" 375 | checksum = "941551ef1df4c7a401de7068758db6503598e6f01850bdb2cfdb614a1f9dbea1" 376 | dependencies = [ 377 | "ark-ec", 378 | "ark-ff 0.5.0", 379 | "ark-relations", 380 | "ark-std 0.5.0", 381 | "educe", 382 | "num-bigint", 383 | "num-integer", 384 | "num-traits", 385 | "tracing", 386 | ] 387 | 388 | [[package]] 389 | name = "ark-relations" 390 | version = "0.5.1" 391 | source = "registry+https://github.com/rust-lang/crates.io-index" 392 | checksum = "ec46ddc93e7af44bcab5230937635b06fb5744464dd6a7e7b083e80ebd274384" 393 | dependencies = [ 394 | "ark-ff 0.5.0", 395 | "ark-std 0.5.0", 396 | "tracing", 397 | "tracing-subscriber", 398 | ] 399 | 400 | [[package]] 401 | name = "ark-serialize" 402 | version = "0.3.0" 403 | source = "registry+https://github.com/rust-lang/crates.io-index" 404 | checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" 405 | dependencies = [ 406 | "ark-std 0.3.0", 407 | "digest 0.9.0", 408 | ] 409 | 410 | [[package]] 411 | name = "ark-serialize" 412 | version = "0.4.2" 413 | source = "registry+https://github.com/rust-lang/crates.io-index" 414 | checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" 415 | dependencies = [ 416 | "ark-std 0.4.0", 417 | "digest 0.10.7", 418 | "num-bigint", 419 | ] 420 | 421 | [[package]] 422 | name = "ark-serialize" 423 | version = "0.5.0" 424 | source = "registry+https://github.com/rust-lang/crates.io-index" 425 | checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" 426 | dependencies = [ 427 | "ark-serialize-derive", 428 | "ark-std 0.5.0", 429 | "arrayvec", 430 | "digest 0.10.7", 431 | "num-bigint", 432 | ] 433 | 434 | [[package]] 435 | name = "ark-serialize-derive" 436 | version = "0.5.0" 437 | source = "registry+https://github.com/rust-lang/crates.io-index" 438 | checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" 439 | dependencies = [ 440 | "proc-macro2", 441 | "quote", 442 | "syn 2.0.99", 443 | ] 444 | 445 | [[package]] 446 | name = "ark-snark" 447 | version = "0.5.1" 448 | source = "registry+https://github.com/rust-lang/crates.io-index" 449 | checksum = "d368e2848c2d4c129ce7679a7d0d2d612b6a274d3ea6a13bad4445d61b381b88" 450 | dependencies = [ 451 | "ark-ff 0.5.0", 452 | "ark-relations", 453 | "ark-serialize 0.5.0", 454 | "ark-std 0.5.0", 455 | ] 456 | 457 | [[package]] 458 | name = "ark-std" 459 | version = "0.3.0" 460 | source = "registry+https://github.com/rust-lang/crates.io-index" 461 | checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" 462 | dependencies = [ 463 | "num-traits", 464 | "rand 0.8.5", 465 | ] 466 | 467 | [[package]] 468 | name = "ark-std" 469 | version = "0.4.0" 470 | source = "registry+https://github.com/rust-lang/crates.io-index" 471 | checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" 472 | dependencies = [ 473 | "num-traits", 474 | "rand 0.8.5", 475 | ] 476 | 477 | [[package]] 478 | name = "ark-std" 479 | version = "0.5.0" 480 | source = "registry+https://github.com/rust-lang/crates.io-index" 481 | checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" 482 | dependencies = [ 483 | "num-traits", 484 | "rand 0.8.5", 485 | ] 486 | 487 | [[package]] 488 | name = "arrayvec" 489 | version = "0.7.6" 490 | source = "registry+https://github.com/rust-lang/crates.io-index" 491 | checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" 492 | 493 | [[package]] 494 | name = "auto_impl" 495 | version = "1.2.1" 496 | source = "registry+https://github.com/rust-lang/crates.io-index" 497 | checksum = "e12882f59de5360c748c4cbf569a042d5fb0eb515f7bea9c1f470b47f6ffbd73" 498 | dependencies = [ 499 | "proc-macro2", 500 | "quote", 501 | "syn 2.0.99", 502 | ] 503 | 504 | [[package]] 505 | name = "autocfg" 506 | version = "1.4.0" 507 | source = "registry+https://github.com/rust-lang/crates.io-index" 508 | checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" 509 | 510 | [[package]] 511 | name = "base16ct" 512 | version = "0.2.0" 513 | source = "registry+https://github.com/rust-lang/crates.io-index" 514 | checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" 515 | 516 | [[package]] 517 | name = "base64ct" 518 | version = "1.6.0" 519 | source = "registry+https://github.com/rust-lang/crates.io-index" 520 | checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" 521 | 522 | [[package]] 523 | name = "bit-set" 524 | version = "0.8.0" 525 | source = "registry+https://github.com/rust-lang/crates.io-index" 526 | checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" 527 | dependencies = [ 528 | "bit-vec", 529 | ] 530 | 531 | [[package]] 532 | name = "bit-vec" 533 | version = "0.8.0" 534 | source = "registry+https://github.com/rust-lang/crates.io-index" 535 | checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" 536 | 537 | [[package]] 538 | name = "bitflags" 539 | version = "1.3.2" 540 | source = "registry+https://github.com/rust-lang/crates.io-index" 541 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 542 | 543 | [[package]] 544 | name = "bitflags" 545 | version = "2.9.0" 546 | source = "registry+https://github.com/rust-lang/crates.io-index" 547 | checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" 548 | 549 | [[package]] 550 | name = "bitvec" 551 | version = "1.0.1" 552 | source = "registry+https://github.com/rust-lang/crates.io-index" 553 | checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" 554 | dependencies = [ 555 | "funty", 556 | "radium", 557 | "tap", 558 | "wyz", 559 | ] 560 | 561 | [[package]] 562 | name = "blake2" 563 | version = "0.10.6" 564 | source = "registry+https://github.com/rust-lang/crates.io-index" 565 | checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" 566 | dependencies = [ 567 | "digest 0.10.7", 568 | ] 569 | 570 | [[package]] 571 | name = "block" 572 | version = "0.1.6" 573 | source = "registry+https://github.com/rust-lang/crates.io-index" 574 | checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" 575 | 576 | [[package]] 577 | name = "block-buffer" 578 | version = "0.10.4" 579 | source = "registry+https://github.com/rust-lang/crates.io-index" 580 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 581 | dependencies = [ 582 | "generic-array", 583 | ] 584 | 585 | [[package]] 586 | name = "borsh" 587 | version = "1.5.5" 588 | source = "registry+https://github.com/rust-lang/crates.io-index" 589 | checksum = "5430e3be710b68d984d1391c854eb431a9d548640711faa54eecb1df93db91cc" 590 | dependencies = [ 591 | "borsh-derive", 592 | "cfg_aliases", 593 | ] 594 | 595 | [[package]] 596 | name = "borsh-derive" 597 | version = "1.5.5" 598 | source = "registry+https://github.com/rust-lang/crates.io-index" 599 | checksum = "f8b668d39970baad5356d7c83a86fee3a539e6f93bf6764c97368243e17a0487" 600 | dependencies = [ 601 | "once_cell", 602 | "proc-macro-crate", 603 | "proc-macro2", 604 | "quote", 605 | "syn 2.0.99", 606 | ] 607 | 608 | [[package]] 609 | name = "byte-slice-cast" 610 | version = "1.2.3" 611 | source = "registry+https://github.com/rust-lang/crates.io-index" 612 | checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" 613 | 614 | [[package]] 615 | name = "bytemuck" 616 | version = "1.22.0" 617 | source = "registry+https://github.com/rust-lang/crates.io-index" 618 | checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" 619 | dependencies = [ 620 | "bytemuck_derive", 621 | ] 622 | 623 | [[package]] 624 | name = "bytemuck_derive" 625 | version = "1.8.1" 626 | source = "registry+https://github.com/rust-lang/crates.io-index" 627 | checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a" 628 | dependencies = [ 629 | "proc-macro2", 630 | "quote", 631 | "syn 2.0.99", 632 | ] 633 | 634 | [[package]] 635 | name = "byteorder" 636 | version = "1.5.0" 637 | source = "registry+https://github.com/rust-lang/crates.io-index" 638 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 639 | 640 | [[package]] 641 | name = "bytes" 642 | version = "1.10.1" 643 | source = "registry+https://github.com/rust-lang/crates.io-index" 644 | checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" 645 | dependencies = [ 646 | "serde", 647 | ] 648 | 649 | [[package]] 650 | name = "cc" 651 | version = "1.2.16" 652 | source = "registry+https://github.com/rust-lang/crates.io-index" 653 | checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" 654 | dependencies = [ 655 | "shlex", 656 | ] 657 | 658 | [[package]] 659 | name = "cfg-if" 660 | version = "1.0.0" 661 | source = "registry+https://github.com/rust-lang/crates.io-index" 662 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 663 | 664 | [[package]] 665 | name = "cfg_aliases" 666 | version = "0.2.1" 667 | source = "registry+https://github.com/rust-lang/crates.io-index" 668 | checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" 669 | 670 | [[package]] 671 | name = "cobs" 672 | version = "0.2.3" 673 | source = "registry+https://github.com/rust-lang/crates.io-index" 674 | checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" 675 | 676 | [[package]] 677 | name = "const-hex" 678 | version = "1.14.0" 679 | source = "registry+https://github.com/rust-lang/crates.io-index" 680 | checksum = "4b0485bab839b018a8f1723fc5391819fea5f8f0f32288ef8a735fd096b6160c" 681 | dependencies = [ 682 | "cfg-if", 683 | "cpufeatures", 684 | "hex", 685 | "proptest", 686 | "serde", 687 | ] 688 | 689 | [[package]] 690 | name = "const-oid" 691 | version = "0.9.6" 692 | source = "registry+https://github.com/rust-lang/crates.io-index" 693 | checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" 694 | 695 | [[package]] 696 | name = "const_format" 697 | version = "0.2.34" 698 | source = "registry+https://github.com/rust-lang/crates.io-index" 699 | checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" 700 | dependencies = [ 701 | "const_format_proc_macros", 702 | ] 703 | 704 | [[package]] 705 | name = "const_format_proc_macros" 706 | version = "0.2.34" 707 | source = "registry+https://github.com/rust-lang/crates.io-index" 708 | checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" 709 | dependencies = [ 710 | "proc-macro2", 711 | "quote", 712 | "unicode-xid", 713 | ] 714 | 715 | [[package]] 716 | name = "core-foundation" 717 | version = "0.9.4" 718 | source = "registry+https://github.com/rust-lang/crates.io-index" 719 | checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" 720 | dependencies = [ 721 | "core-foundation-sys", 722 | "libc", 723 | ] 724 | 725 | [[package]] 726 | name = "core-foundation-sys" 727 | version = "0.8.7" 728 | source = "registry+https://github.com/rust-lang/crates.io-index" 729 | checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" 730 | 731 | [[package]] 732 | name = "core-graphics-types" 733 | version = "0.1.3" 734 | source = "registry+https://github.com/rust-lang/crates.io-index" 735 | checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" 736 | dependencies = [ 737 | "bitflags 1.3.2", 738 | "core-foundation", 739 | "libc", 740 | ] 741 | 742 | [[package]] 743 | name = "cpufeatures" 744 | version = "0.2.17" 745 | source = "registry+https://github.com/rust-lang/crates.io-index" 746 | checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" 747 | dependencies = [ 748 | "libc", 749 | ] 750 | 751 | [[package]] 752 | name = "crunchy" 753 | version = "0.2.3" 754 | source = "registry+https://github.com/rust-lang/crates.io-index" 755 | checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" 756 | 757 | [[package]] 758 | name = "crypto-bigint" 759 | version = "0.5.5" 760 | source = "registry+https://github.com/rust-lang/crates.io-index" 761 | checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" 762 | dependencies = [ 763 | "generic-array", 764 | "rand_core 0.6.4", 765 | "subtle", 766 | "zeroize", 767 | ] 768 | 769 | [[package]] 770 | name = "crypto-common" 771 | version = "0.1.6" 772 | source = "registry+https://github.com/rust-lang/crates.io-index" 773 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 774 | dependencies = [ 775 | "generic-array", 776 | "typenum", 777 | ] 778 | 779 | [[package]] 780 | name = "der" 781 | version = "0.7.9" 782 | source = "registry+https://github.com/rust-lang/crates.io-index" 783 | checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" 784 | dependencies = [ 785 | "const-oid", 786 | "zeroize", 787 | ] 788 | 789 | [[package]] 790 | name = "derivative" 791 | version = "2.2.0" 792 | source = "registry+https://github.com/rust-lang/crates.io-index" 793 | checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" 794 | dependencies = [ 795 | "proc-macro2", 796 | "quote", 797 | "syn 1.0.109", 798 | ] 799 | 800 | [[package]] 801 | name = "derive_more" 802 | version = "2.0.1" 803 | source = "registry+https://github.com/rust-lang/crates.io-index" 804 | checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" 805 | dependencies = [ 806 | "derive_more-impl", 807 | ] 808 | 809 | [[package]] 810 | name = "derive_more-impl" 811 | version = "2.0.1" 812 | source = "registry+https://github.com/rust-lang/crates.io-index" 813 | checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" 814 | dependencies = [ 815 | "proc-macro2", 816 | "quote", 817 | "syn 2.0.99", 818 | "unicode-xid", 819 | ] 820 | 821 | [[package]] 822 | name = "digest" 823 | version = "0.9.0" 824 | source = "registry+https://github.com/rust-lang/crates.io-index" 825 | checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" 826 | dependencies = [ 827 | "generic-array", 828 | ] 829 | 830 | [[package]] 831 | name = "digest" 832 | version = "0.10.7" 833 | source = "registry+https://github.com/rust-lang/crates.io-index" 834 | checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 835 | dependencies = [ 836 | "block-buffer", 837 | "const-oid", 838 | "crypto-common", 839 | "subtle", 840 | ] 841 | 842 | [[package]] 843 | name = "downcast-rs" 844 | version = "1.2.1" 845 | source = "registry+https://github.com/rust-lang/crates.io-index" 846 | checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" 847 | 848 | [[package]] 849 | name = "dunce" 850 | version = "1.0.5" 851 | source = "registry+https://github.com/rust-lang/crates.io-index" 852 | checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" 853 | 854 | [[package]] 855 | name = "ecdsa" 856 | version = "0.16.9" 857 | source = "registry+https://github.com/rust-lang/crates.io-index" 858 | checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" 859 | dependencies = [ 860 | "der", 861 | "digest 0.10.7", 862 | "elliptic-curve", 863 | "rfc6979", 864 | "signature", 865 | "spki", 866 | ] 867 | 868 | [[package]] 869 | name = "educe" 870 | version = "0.6.0" 871 | source = "registry+https://github.com/rust-lang/crates.io-index" 872 | checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" 873 | dependencies = [ 874 | "enum-ordinalize", 875 | "proc-macro2", 876 | "quote", 877 | "syn 2.0.99", 878 | ] 879 | 880 | [[package]] 881 | name = "either" 882 | version = "1.14.0" 883 | source = "registry+https://github.com/rust-lang/crates.io-index" 884 | checksum = "b7914353092ddf589ad78f25c5c1c21b7f80b0ff8621e7c814c3485b5306da9d" 885 | 886 | [[package]] 887 | name = "elf" 888 | version = "0.7.4" 889 | source = "registry+https://github.com/rust-lang/crates.io-index" 890 | checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" 891 | 892 | [[package]] 893 | name = "elliptic-curve" 894 | version = "0.13.8" 895 | source = "registry+https://github.com/rust-lang/crates.io-index" 896 | checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" 897 | dependencies = [ 898 | "base16ct", 899 | "crypto-bigint", 900 | "digest 0.10.7", 901 | "ff", 902 | "generic-array", 903 | "group", 904 | "pkcs8", 905 | "rand_core 0.6.4", 906 | "sec1", 907 | "subtle", 908 | "zeroize", 909 | ] 910 | 911 | [[package]] 912 | name = "embedded-io" 913 | version = "0.4.0" 914 | source = "registry+https://github.com/rust-lang/crates.io-index" 915 | checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" 916 | 917 | [[package]] 918 | name = "embedded-io" 919 | version = "0.6.1" 920 | source = "registry+https://github.com/rust-lang/crates.io-index" 921 | checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" 922 | 923 | [[package]] 924 | name = "enum-ordinalize" 925 | version = "4.3.0" 926 | source = "registry+https://github.com/rust-lang/crates.io-index" 927 | checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" 928 | dependencies = [ 929 | "enum-ordinalize-derive", 930 | ] 931 | 932 | [[package]] 933 | name = "enum-ordinalize-derive" 934 | version = "4.3.1" 935 | source = "registry+https://github.com/rust-lang/crates.io-index" 936 | checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" 937 | dependencies = [ 938 | "proc-macro2", 939 | "quote", 940 | "syn 2.0.99", 941 | ] 942 | 943 | [[package]] 944 | name = "equivalent" 945 | version = "1.0.2" 946 | source = "registry+https://github.com/rust-lang/crates.io-index" 947 | checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" 948 | 949 | [[package]] 950 | name = "errno" 951 | version = "0.3.10" 952 | source = "registry+https://github.com/rust-lang/crates.io-index" 953 | checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" 954 | dependencies = [ 955 | "libc", 956 | "windows-sys", 957 | ] 958 | 959 | [[package]] 960 | name = "fastrand" 961 | version = "2.3.0" 962 | source = "registry+https://github.com/rust-lang/crates.io-index" 963 | checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" 964 | 965 | [[package]] 966 | name = "fastrlp" 967 | version = "0.3.1" 968 | source = "registry+https://github.com/rust-lang/crates.io-index" 969 | checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" 970 | dependencies = [ 971 | "arrayvec", 972 | "auto_impl", 973 | "bytes", 974 | ] 975 | 976 | [[package]] 977 | name = "fastrlp" 978 | version = "0.4.0" 979 | source = "registry+https://github.com/rust-lang/crates.io-index" 980 | checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" 981 | dependencies = [ 982 | "arrayvec", 983 | "auto_impl", 984 | "bytes", 985 | ] 986 | 987 | [[package]] 988 | name = "ff" 989 | version = "0.13.0" 990 | source = "registry+https://github.com/rust-lang/crates.io-index" 991 | checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" 992 | dependencies = [ 993 | "rand_core 0.6.4", 994 | "subtle", 995 | ] 996 | 997 | [[package]] 998 | name = "fixed-hash" 999 | version = "0.8.0" 1000 | source = "registry+https://github.com/rust-lang/crates.io-index" 1001 | checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" 1002 | dependencies = [ 1003 | "byteorder", 1004 | "rand 0.8.5", 1005 | "rustc-hex", 1006 | "static_assertions", 1007 | ] 1008 | 1009 | [[package]] 1010 | name = "fnv" 1011 | version = "1.0.7" 1012 | source = "registry+https://github.com/rust-lang/crates.io-index" 1013 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 1014 | 1015 | [[package]] 1016 | name = "foldhash" 1017 | version = "0.1.4" 1018 | source = "registry+https://github.com/rust-lang/crates.io-index" 1019 | checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" 1020 | 1021 | [[package]] 1022 | name = "foreign-types" 1023 | version = "0.5.0" 1024 | source = "registry+https://github.com/rust-lang/crates.io-index" 1025 | checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" 1026 | dependencies = [ 1027 | "foreign-types-macros", 1028 | "foreign-types-shared", 1029 | ] 1030 | 1031 | [[package]] 1032 | name = "foreign-types-macros" 1033 | version = "0.2.3" 1034 | source = "registry+https://github.com/rust-lang/crates.io-index" 1035 | checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" 1036 | dependencies = [ 1037 | "proc-macro2", 1038 | "quote", 1039 | "syn 2.0.99", 1040 | ] 1041 | 1042 | [[package]] 1043 | name = "foreign-types-shared" 1044 | version = "0.3.1" 1045 | source = "registry+https://github.com/rust-lang/crates.io-index" 1046 | checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" 1047 | 1048 | [[package]] 1049 | name = "funty" 1050 | version = "2.0.0" 1051 | source = "registry+https://github.com/rust-lang/crates.io-index" 1052 | checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" 1053 | 1054 | [[package]] 1055 | name = "generic-array" 1056 | version = "0.14.7" 1057 | source = "registry+https://github.com/rust-lang/crates.io-index" 1058 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 1059 | dependencies = [ 1060 | "typenum", 1061 | "version_check", 1062 | "zeroize", 1063 | ] 1064 | 1065 | [[package]] 1066 | name = "getrandom" 1067 | version = "0.2.15" 1068 | source = "registry+https://github.com/rust-lang/crates.io-index" 1069 | checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" 1070 | dependencies = [ 1071 | "cfg-if", 1072 | "libc", 1073 | "wasi 0.11.0+wasi-snapshot-preview1", 1074 | ] 1075 | 1076 | [[package]] 1077 | name = "getrandom" 1078 | version = "0.3.1" 1079 | source = "registry+https://github.com/rust-lang/crates.io-index" 1080 | checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" 1081 | dependencies = [ 1082 | "cfg-if", 1083 | "libc", 1084 | "wasi 0.13.3+wasi-0.2.2", 1085 | "windows-targets", 1086 | ] 1087 | 1088 | [[package]] 1089 | name = "group" 1090 | version = "0.13.0" 1091 | source = "registry+https://github.com/rust-lang/crates.io-index" 1092 | checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" 1093 | dependencies = [ 1094 | "ff", 1095 | "rand_core 0.6.4", 1096 | "subtle", 1097 | ] 1098 | 1099 | [[package]] 1100 | name = "guests" 1101 | version = "0.1.0" 1102 | dependencies = [ 1103 | "alloy-primitives", 1104 | "alloy-sol-types", 1105 | "risc0-zkvm", 1106 | ] 1107 | 1108 | [[package]] 1109 | name = "hashbrown" 1110 | version = "0.15.2" 1111 | source = "registry+https://github.com/rust-lang/crates.io-index" 1112 | checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" 1113 | dependencies = [ 1114 | "allocator-api2", 1115 | "foldhash", 1116 | "serde", 1117 | ] 1118 | 1119 | [[package]] 1120 | name = "heck" 1121 | version = "0.5.0" 1122 | source = "registry+https://github.com/rust-lang/crates.io-index" 1123 | checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 1124 | 1125 | [[package]] 1126 | name = "hex" 1127 | version = "0.4.3" 1128 | source = "registry+https://github.com/rust-lang/crates.io-index" 1129 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 1130 | dependencies = [ 1131 | "serde", 1132 | ] 1133 | 1134 | [[package]] 1135 | name = "hex-literal" 1136 | version = "0.4.1" 1137 | source = "registry+https://github.com/rust-lang/crates.io-index" 1138 | checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" 1139 | 1140 | [[package]] 1141 | name = "hmac" 1142 | version = "0.12.1" 1143 | source = "registry+https://github.com/rust-lang/crates.io-index" 1144 | checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" 1145 | dependencies = [ 1146 | "digest 0.10.7", 1147 | ] 1148 | 1149 | [[package]] 1150 | name = "impl-codec" 1151 | version = "0.6.0" 1152 | source = "registry+https://github.com/rust-lang/crates.io-index" 1153 | checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" 1154 | dependencies = [ 1155 | "parity-scale-codec", 1156 | ] 1157 | 1158 | [[package]] 1159 | name = "impl-trait-for-tuples" 1160 | version = "0.2.3" 1161 | source = "registry+https://github.com/rust-lang/crates.io-index" 1162 | checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" 1163 | dependencies = [ 1164 | "proc-macro2", 1165 | "quote", 1166 | "syn 2.0.99", 1167 | ] 1168 | 1169 | [[package]] 1170 | name = "include_bytes_aligned" 1171 | version = "0.1.4" 1172 | source = "registry+https://github.com/rust-lang/crates.io-index" 1173 | checksum = "4ee796ad498c8d9a1d68e477df8f754ed784ef875de1414ebdaf169f70a6a784" 1174 | 1175 | [[package]] 1176 | name = "indexmap" 1177 | version = "2.7.1" 1178 | source = "registry+https://github.com/rust-lang/crates.io-index" 1179 | checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" 1180 | dependencies = [ 1181 | "equivalent", 1182 | "hashbrown", 1183 | "serde", 1184 | ] 1185 | 1186 | [[package]] 1187 | name = "itertools" 1188 | version = "0.10.5" 1189 | source = "registry+https://github.com/rust-lang/crates.io-index" 1190 | checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" 1191 | dependencies = [ 1192 | "either", 1193 | ] 1194 | 1195 | [[package]] 1196 | name = "itertools" 1197 | version = "0.13.0" 1198 | source = "registry+https://github.com/rust-lang/crates.io-index" 1199 | checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" 1200 | dependencies = [ 1201 | "either", 1202 | ] 1203 | 1204 | [[package]] 1205 | name = "itoa" 1206 | version = "1.0.15" 1207 | source = "registry+https://github.com/rust-lang/crates.io-index" 1208 | checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" 1209 | 1210 | [[package]] 1211 | name = "k256" 1212 | version = "0.13.4" 1213 | source = "registry+https://github.com/rust-lang/crates.io-index" 1214 | checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" 1215 | dependencies = [ 1216 | "cfg-if", 1217 | "ecdsa", 1218 | "elliptic-curve", 1219 | "once_cell", 1220 | "sha2", 1221 | ] 1222 | 1223 | [[package]] 1224 | name = "keccak" 1225 | version = "0.1.5" 1226 | source = "registry+https://github.com/rust-lang/crates.io-index" 1227 | checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" 1228 | dependencies = [ 1229 | "cpufeatures", 1230 | ] 1231 | 1232 | [[package]] 1233 | name = "keccak-asm" 1234 | version = "0.1.4" 1235 | source = "registry+https://github.com/rust-lang/crates.io-index" 1236 | checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" 1237 | dependencies = [ 1238 | "digest 0.10.7", 1239 | "sha3-asm", 1240 | ] 1241 | 1242 | [[package]] 1243 | name = "lazy_static" 1244 | version = "1.5.0" 1245 | source = "registry+https://github.com/rust-lang/crates.io-index" 1246 | checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" 1247 | dependencies = [ 1248 | "spin", 1249 | ] 1250 | 1251 | [[package]] 1252 | name = "libc" 1253 | version = "0.2.170" 1254 | source = "registry+https://github.com/rust-lang/crates.io-index" 1255 | checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" 1256 | 1257 | [[package]] 1258 | name = "libm" 1259 | version = "0.2.11" 1260 | source = "registry+https://github.com/rust-lang/crates.io-index" 1261 | checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" 1262 | 1263 | [[package]] 1264 | name = "linux-raw-sys" 1265 | version = "0.4.15" 1266 | source = "registry+https://github.com/rust-lang/crates.io-index" 1267 | checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" 1268 | 1269 | [[package]] 1270 | name = "log" 1271 | version = "0.4.26" 1272 | source = "registry+https://github.com/rust-lang/crates.io-index" 1273 | checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" 1274 | 1275 | [[package]] 1276 | name = "macro-string" 1277 | version = "0.1.4" 1278 | source = "registry+https://github.com/rust-lang/crates.io-index" 1279 | checksum = "1b27834086c65ec3f9387b096d66e99f221cf081c2b738042aa252bcd41204e3" 1280 | dependencies = [ 1281 | "proc-macro2", 1282 | "quote", 1283 | "syn 2.0.99", 1284 | ] 1285 | 1286 | [[package]] 1287 | name = "malloc_buf" 1288 | version = "0.0.6" 1289 | source = "registry+https://github.com/rust-lang/crates.io-index" 1290 | checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" 1291 | dependencies = [ 1292 | "libc", 1293 | ] 1294 | 1295 | [[package]] 1296 | name = "memchr" 1297 | version = "2.7.4" 1298 | source = "registry+https://github.com/rust-lang/crates.io-index" 1299 | checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" 1300 | 1301 | [[package]] 1302 | name = "merlin" 1303 | version = "3.0.0" 1304 | source = "registry+https://github.com/rust-lang/crates.io-index" 1305 | checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" 1306 | dependencies = [ 1307 | "byteorder", 1308 | "keccak", 1309 | "rand_core 0.6.4", 1310 | "zeroize", 1311 | ] 1312 | 1313 | [[package]] 1314 | name = "metal" 1315 | version = "0.29.0" 1316 | source = "registry+https://github.com/rust-lang/crates.io-index" 1317 | checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" 1318 | dependencies = [ 1319 | "bitflags 2.9.0", 1320 | "block", 1321 | "core-graphics-types", 1322 | "foreign-types", 1323 | "log", 1324 | "objc", 1325 | "paste", 1326 | ] 1327 | 1328 | [[package]] 1329 | name = "no_std_strings" 1330 | version = "0.1.3" 1331 | source = "registry+https://github.com/rust-lang/crates.io-index" 1332 | checksum = "a5b0c77c1b780822bc749a33e39aeb2c07584ab93332303babeabb645298a76e" 1333 | 1334 | [[package]] 1335 | name = "num-bigint" 1336 | version = "0.4.6" 1337 | source = "registry+https://github.com/rust-lang/crates.io-index" 1338 | checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" 1339 | dependencies = [ 1340 | "num-integer", 1341 | "num-traits", 1342 | ] 1343 | 1344 | [[package]] 1345 | name = "num-integer" 1346 | version = "0.1.46" 1347 | source = "registry+https://github.com/rust-lang/crates.io-index" 1348 | checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" 1349 | dependencies = [ 1350 | "num-traits", 1351 | ] 1352 | 1353 | [[package]] 1354 | name = "num-traits" 1355 | version = "0.2.19" 1356 | source = "registry+https://github.com/rust-lang/crates.io-index" 1357 | checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" 1358 | dependencies = [ 1359 | "autocfg", 1360 | "libm", 1361 | ] 1362 | 1363 | [[package]] 1364 | name = "objc" 1365 | version = "0.2.7" 1366 | source = "registry+https://github.com/rust-lang/crates.io-index" 1367 | checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" 1368 | dependencies = [ 1369 | "malloc_buf", 1370 | ] 1371 | 1372 | [[package]] 1373 | name = "once_cell" 1374 | version = "1.20.3" 1375 | source = "registry+https://github.com/rust-lang/crates.io-index" 1376 | checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" 1377 | 1378 | [[package]] 1379 | name = "parity-scale-codec" 1380 | version = "3.7.4" 1381 | source = "registry+https://github.com/rust-lang/crates.io-index" 1382 | checksum = "c9fde3d0718baf5bc92f577d652001da0f8d54cd03a7974e118d04fc888dc23d" 1383 | dependencies = [ 1384 | "arrayvec", 1385 | "bitvec", 1386 | "byte-slice-cast", 1387 | "const_format", 1388 | "impl-trait-for-tuples", 1389 | "parity-scale-codec-derive", 1390 | "rustversion", 1391 | "serde", 1392 | ] 1393 | 1394 | [[package]] 1395 | name = "parity-scale-codec-derive" 1396 | version = "3.7.4" 1397 | source = "registry+https://github.com/rust-lang/crates.io-index" 1398 | checksum = "581c837bb6b9541ce7faa9377c20616e4fb7650f6b0f68bc93c827ee504fb7b3" 1399 | dependencies = [ 1400 | "proc-macro-crate", 1401 | "proc-macro2", 1402 | "quote", 1403 | "syn 2.0.99", 1404 | ] 1405 | 1406 | [[package]] 1407 | name = "paste" 1408 | version = "1.0.15" 1409 | source = "registry+https://github.com/rust-lang/crates.io-index" 1410 | checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" 1411 | 1412 | [[package]] 1413 | name = "pest" 1414 | version = "2.7.15" 1415 | source = "registry+https://github.com/rust-lang/crates.io-index" 1416 | checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" 1417 | dependencies = [ 1418 | "memchr", 1419 | "thiserror", 1420 | "ucd-trie", 1421 | ] 1422 | 1423 | [[package]] 1424 | name = "pin-project-lite" 1425 | version = "0.2.16" 1426 | source = "registry+https://github.com/rust-lang/crates.io-index" 1427 | checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" 1428 | 1429 | [[package]] 1430 | name = "pkcs8" 1431 | version = "0.10.2" 1432 | source = "registry+https://github.com/rust-lang/crates.io-index" 1433 | checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" 1434 | dependencies = [ 1435 | "der", 1436 | "spki", 1437 | ] 1438 | 1439 | [[package]] 1440 | name = "postcard" 1441 | version = "1.1.1" 1442 | source = "registry+https://github.com/rust-lang/crates.io-index" 1443 | checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" 1444 | dependencies = [ 1445 | "cobs", 1446 | "embedded-io 0.4.0", 1447 | "embedded-io 0.6.1", 1448 | "serde", 1449 | ] 1450 | 1451 | [[package]] 1452 | name = "ppv-lite86" 1453 | version = "0.2.20" 1454 | source = "registry+https://github.com/rust-lang/crates.io-index" 1455 | checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" 1456 | dependencies = [ 1457 | "zerocopy", 1458 | ] 1459 | 1460 | [[package]] 1461 | name = "primitive-types" 1462 | version = "0.12.2" 1463 | source = "registry+https://github.com/rust-lang/crates.io-index" 1464 | checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" 1465 | dependencies = [ 1466 | "fixed-hash", 1467 | "impl-codec", 1468 | "uint", 1469 | ] 1470 | 1471 | [[package]] 1472 | name = "proc-macro-crate" 1473 | version = "3.2.0" 1474 | source = "registry+https://github.com/rust-lang/crates.io-index" 1475 | checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" 1476 | dependencies = [ 1477 | "toml_edit", 1478 | ] 1479 | 1480 | [[package]] 1481 | name = "proc-macro-error-attr2" 1482 | version = "2.0.0" 1483 | source = "registry+https://github.com/rust-lang/crates.io-index" 1484 | checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" 1485 | dependencies = [ 1486 | "proc-macro2", 1487 | "quote", 1488 | ] 1489 | 1490 | [[package]] 1491 | name = "proc-macro-error2" 1492 | version = "2.0.1" 1493 | source = "registry+https://github.com/rust-lang/crates.io-index" 1494 | checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" 1495 | dependencies = [ 1496 | "proc-macro-error-attr2", 1497 | "proc-macro2", 1498 | "quote", 1499 | "syn 2.0.99", 1500 | ] 1501 | 1502 | [[package]] 1503 | name = "proc-macro2" 1504 | version = "1.0.94" 1505 | source = "registry+https://github.com/rust-lang/crates.io-index" 1506 | checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" 1507 | dependencies = [ 1508 | "unicode-ident", 1509 | ] 1510 | 1511 | [[package]] 1512 | name = "proptest" 1513 | version = "1.6.0" 1514 | source = "registry+https://github.com/rust-lang/crates.io-index" 1515 | checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" 1516 | dependencies = [ 1517 | "bit-set", 1518 | "bit-vec", 1519 | "bitflags 2.9.0", 1520 | "lazy_static", 1521 | "num-traits", 1522 | "rand 0.8.5", 1523 | "rand_chacha 0.3.1", 1524 | "rand_xorshift", 1525 | "regex-syntax", 1526 | "rusty-fork", 1527 | "tempfile", 1528 | "unarray", 1529 | ] 1530 | 1531 | [[package]] 1532 | name = "quick-error" 1533 | version = "1.2.3" 1534 | source = "registry+https://github.com/rust-lang/crates.io-index" 1535 | checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" 1536 | 1537 | [[package]] 1538 | name = "quote" 1539 | version = "1.0.39" 1540 | source = "registry+https://github.com/rust-lang/crates.io-index" 1541 | checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801" 1542 | dependencies = [ 1543 | "proc-macro2", 1544 | ] 1545 | 1546 | [[package]] 1547 | name = "radium" 1548 | version = "0.7.0" 1549 | source = "registry+https://github.com/rust-lang/crates.io-index" 1550 | checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" 1551 | 1552 | [[package]] 1553 | name = "rand" 1554 | version = "0.8.5" 1555 | source = "registry+https://github.com/rust-lang/crates.io-index" 1556 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1557 | dependencies = [ 1558 | "libc", 1559 | "rand_chacha 0.3.1", 1560 | "rand_core 0.6.4", 1561 | ] 1562 | 1563 | [[package]] 1564 | name = "rand" 1565 | version = "0.9.1" 1566 | source = "registry+https://github.com/rust-lang/crates.io-index" 1567 | checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" 1568 | dependencies = [ 1569 | "rand_chacha 0.9.0", 1570 | "rand_core 0.9.3", 1571 | "serde", 1572 | ] 1573 | 1574 | [[package]] 1575 | name = "rand_chacha" 1576 | version = "0.3.1" 1577 | source = "registry+https://github.com/rust-lang/crates.io-index" 1578 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1579 | dependencies = [ 1580 | "ppv-lite86", 1581 | "rand_core 0.6.4", 1582 | ] 1583 | 1584 | [[package]] 1585 | name = "rand_chacha" 1586 | version = "0.9.0" 1587 | source = "registry+https://github.com/rust-lang/crates.io-index" 1588 | checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" 1589 | dependencies = [ 1590 | "ppv-lite86", 1591 | "rand_core 0.9.3", 1592 | ] 1593 | 1594 | [[package]] 1595 | name = "rand_core" 1596 | version = "0.6.4" 1597 | source = "registry+https://github.com/rust-lang/crates.io-index" 1598 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1599 | dependencies = [ 1600 | "getrandom 0.2.15", 1601 | ] 1602 | 1603 | [[package]] 1604 | name = "rand_core" 1605 | version = "0.9.3" 1606 | source = "registry+https://github.com/rust-lang/crates.io-index" 1607 | checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" 1608 | dependencies = [ 1609 | "getrandom 0.3.1", 1610 | "serde", 1611 | ] 1612 | 1613 | [[package]] 1614 | name = "rand_xorshift" 1615 | version = "0.3.0" 1616 | source = "registry+https://github.com/rust-lang/crates.io-index" 1617 | checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" 1618 | dependencies = [ 1619 | "rand_core 0.6.4", 1620 | ] 1621 | 1622 | [[package]] 1623 | name = "regex-syntax" 1624 | version = "0.8.5" 1625 | source = "registry+https://github.com/rust-lang/crates.io-index" 1626 | checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" 1627 | 1628 | [[package]] 1629 | name = "rfc6979" 1630 | version = "0.4.0" 1631 | source = "registry+https://github.com/rust-lang/crates.io-index" 1632 | checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" 1633 | dependencies = [ 1634 | "hmac", 1635 | "subtle", 1636 | ] 1637 | 1638 | [[package]] 1639 | name = "risc0-binfmt" 1640 | version = "2.0.1" 1641 | source = "registry+https://github.com/rust-lang/crates.io-index" 1642 | checksum = "f4fe7599ac55ad77515608ec42a9727001559fe4f579c533cb7c973b54800c05" 1643 | dependencies = [ 1644 | "anyhow", 1645 | "borsh", 1646 | "derive_more", 1647 | "elf", 1648 | "lazy_static", 1649 | "postcard", 1650 | "risc0-zkp", 1651 | "risc0-zkvm-platform", 1652 | "semver 1.0.26", 1653 | "serde", 1654 | "tracing", 1655 | ] 1656 | 1657 | [[package]] 1658 | name = "risc0-circuit-keccak" 1659 | version = "2.0.1" 1660 | source = "registry+https://github.com/rust-lang/crates.io-index" 1661 | checksum = "7cd8acfc84307ed1be64cf9fefc390963fc22b2865d027f03405977a0cfa9747" 1662 | dependencies = [ 1663 | "anyhow", 1664 | "bytemuck", 1665 | "paste", 1666 | "risc0-binfmt", 1667 | "risc0-circuit-recursion", 1668 | "risc0-core", 1669 | "risc0-zkp", 1670 | "tracing", 1671 | ] 1672 | 1673 | [[package]] 1674 | name = "risc0-circuit-recursion" 1675 | version = "2.0.1" 1676 | source = "registry+https://github.com/rust-lang/crates.io-index" 1677 | checksum = "3fdd1514e94440e2da301f48d345e1937b315147f58c5dc4992feb045324651d" 1678 | dependencies = [ 1679 | "anyhow", 1680 | "bytemuck", 1681 | "hex", 1682 | "metal", 1683 | "risc0-core", 1684 | "risc0-zkp", 1685 | "tracing", 1686 | ] 1687 | 1688 | [[package]] 1689 | name = "risc0-circuit-rv32im" 1690 | version = "2.0.3" 1691 | source = "registry+https://github.com/rust-lang/crates.io-index" 1692 | checksum = "23f6ed144d8b8f93c4a6096e3dd90f9dcbd91eff83eae690a72fd6e640760b94" 1693 | dependencies = [ 1694 | "anyhow", 1695 | "bit-vec", 1696 | "bytemuck", 1697 | "derive_more", 1698 | "paste", 1699 | "risc0-binfmt", 1700 | "risc0-core", 1701 | "risc0-zkp", 1702 | "serde", 1703 | "tracing", 1704 | ] 1705 | 1706 | [[package]] 1707 | name = "risc0-core" 1708 | version = "2.0.0" 1709 | source = "registry+https://github.com/rust-lang/crates.io-index" 1710 | checksum = "317bbf70a8750b64d4fd7a2bdc9d7d5f30d8bb305cae486962c797ef35c8d08e" 1711 | dependencies = [ 1712 | "bytemuck", 1713 | "bytemuck_derive", 1714 | "rand_core 0.6.4", 1715 | ] 1716 | 1717 | [[package]] 1718 | name = "risc0-groth16" 1719 | version = "2.0.1" 1720 | source = "registry+https://github.com/rust-lang/crates.io-index" 1721 | checksum = "4b31cb7b2a46f0cdaf71803ea7e0389af9f5bc1aea2531106f2972b241f26e98" 1722 | dependencies = [ 1723 | "anyhow", 1724 | "ark-bn254", 1725 | "ark-ec", 1726 | "ark-groth16", 1727 | "ark-serialize 0.5.0", 1728 | "bytemuck", 1729 | "hex", 1730 | "num-bigint", 1731 | "num-traits", 1732 | "risc0-binfmt", 1733 | "risc0-zkp", 1734 | "serde", 1735 | "stability", 1736 | ] 1737 | 1738 | [[package]] 1739 | name = "risc0-zkos-v1compat" 1740 | version = "2.0.1" 1741 | source = "registry+https://github.com/rust-lang/crates.io-index" 1742 | checksum = "f76c479b69d1987cb54ac72dcc017197296fdcd6daf78fafc10cbbd3a167a7de" 1743 | dependencies = [ 1744 | "include_bytes_aligned", 1745 | "no_std_strings", 1746 | ] 1747 | 1748 | [[package]] 1749 | name = "risc0-zkp" 1750 | version = "2.0.1" 1751 | source = "registry+https://github.com/rust-lang/crates.io-index" 1752 | checksum = "fa210a232361fd671b30918469856b64d715f2564956d0a5df97ab6cb116d28b" 1753 | dependencies = [ 1754 | "anyhow", 1755 | "blake2", 1756 | "borsh", 1757 | "bytemuck", 1758 | "cfg-if", 1759 | "digest 0.10.7", 1760 | "hex", 1761 | "hex-literal", 1762 | "metal", 1763 | "paste", 1764 | "rand_core 0.6.4", 1765 | "risc0-core", 1766 | "risc0-zkvm-platform", 1767 | "serde", 1768 | "sha2", 1769 | "stability", 1770 | "tracing", 1771 | ] 1772 | 1773 | [[package]] 1774 | name = "risc0-zkvm" 1775 | version = "2.0.2" 1776 | source = "registry+https://github.com/rust-lang/crates.io-index" 1777 | checksum = "6a049319790277845335445b549d49e66341f4a7ffba7f7aaa1e77e2fc4a9c19" 1778 | dependencies = [ 1779 | "anyhow", 1780 | "borsh", 1781 | "bytemuck", 1782 | "derive_more", 1783 | "getrandom 0.2.15", 1784 | "hex", 1785 | "risc0-binfmt", 1786 | "risc0-circuit-keccak", 1787 | "risc0-circuit-recursion", 1788 | "risc0-circuit-rv32im", 1789 | "risc0-core", 1790 | "risc0-groth16", 1791 | "risc0-zkos-v1compat", 1792 | "risc0-zkp", 1793 | "risc0-zkvm-platform", 1794 | "rrs-lib", 1795 | "semver 1.0.26", 1796 | "serde", 1797 | "sha2", 1798 | "stability", 1799 | "tracing", 1800 | ] 1801 | 1802 | [[package]] 1803 | name = "risc0-zkvm-platform" 1804 | version = "2.0.2" 1805 | source = "registry+https://github.com/rust-lang/crates.io-index" 1806 | checksum = "2e4de2938eaf24892ef927d9cef6e4acb6a19ce01c017cd498533896f633f332" 1807 | dependencies = [ 1808 | "bytemuck", 1809 | "cfg-if", 1810 | "getrandom 0.2.15", 1811 | "getrandom 0.3.1", 1812 | "libm", 1813 | "stability", 1814 | ] 1815 | 1816 | [[package]] 1817 | name = "rlp" 1818 | version = "0.5.2" 1819 | source = "registry+https://github.com/rust-lang/crates.io-index" 1820 | checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" 1821 | dependencies = [ 1822 | "bytes", 1823 | "rustc-hex", 1824 | ] 1825 | 1826 | [[package]] 1827 | name = "rrs-lib" 1828 | version = "0.1.0" 1829 | source = "registry+https://github.com/rust-lang/crates.io-index" 1830 | checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" 1831 | dependencies = [ 1832 | "downcast-rs", 1833 | "paste", 1834 | ] 1835 | 1836 | [[package]] 1837 | name = "ruint" 1838 | version = "1.14.0" 1839 | source = "registry+https://github.com/rust-lang/crates.io-index" 1840 | checksum = "78a46eb779843b2c4f21fac5773e25d6d5b7c8f0922876c91541790d2ca27eef" 1841 | dependencies = [ 1842 | "alloy-rlp", 1843 | "ark-ff 0.3.0", 1844 | "ark-ff 0.4.2", 1845 | "bytes", 1846 | "fastrlp 0.3.1", 1847 | "fastrlp 0.4.0", 1848 | "num-bigint", 1849 | "num-integer", 1850 | "num-traits", 1851 | "parity-scale-codec", 1852 | "primitive-types", 1853 | "proptest", 1854 | "rand 0.8.5", 1855 | "rand 0.9.1", 1856 | "rlp", 1857 | "ruint-macro", 1858 | "serde", 1859 | "valuable", 1860 | "zeroize", 1861 | ] 1862 | 1863 | [[package]] 1864 | name = "ruint-macro" 1865 | version = "1.2.1" 1866 | source = "registry+https://github.com/rust-lang/crates.io-index" 1867 | checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" 1868 | 1869 | [[package]] 1870 | name = "rustc-hash" 1871 | version = "2.1.1" 1872 | source = "registry+https://github.com/rust-lang/crates.io-index" 1873 | checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" 1874 | 1875 | [[package]] 1876 | name = "rustc-hex" 1877 | version = "2.1.0" 1878 | source = "registry+https://github.com/rust-lang/crates.io-index" 1879 | checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" 1880 | 1881 | [[package]] 1882 | name = "rustc_version" 1883 | version = "0.3.3" 1884 | source = "registry+https://github.com/rust-lang/crates.io-index" 1885 | checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" 1886 | dependencies = [ 1887 | "semver 0.11.0", 1888 | ] 1889 | 1890 | [[package]] 1891 | name = "rustc_version" 1892 | version = "0.4.1" 1893 | source = "registry+https://github.com/rust-lang/crates.io-index" 1894 | checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" 1895 | dependencies = [ 1896 | "semver 1.0.26", 1897 | ] 1898 | 1899 | [[package]] 1900 | name = "rustix" 1901 | version = "0.38.44" 1902 | source = "registry+https://github.com/rust-lang/crates.io-index" 1903 | checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" 1904 | dependencies = [ 1905 | "bitflags 2.9.0", 1906 | "errno", 1907 | "libc", 1908 | "linux-raw-sys", 1909 | "windows-sys", 1910 | ] 1911 | 1912 | [[package]] 1913 | name = "rustversion" 1914 | version = "1.0.20" 1915 | source = "registry+https://github.com/rust-lang/crates.io-index" 1916 | checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" 1917 | 1918 | [[package]] 1919 | name = "rusty-fork" 1920 | version = "0.3.0" 1921 | source = "registry+https://github.com/rust-lang/crates.io-index" 1922 | checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" 1923 | dependencies = [ 1924 | "fnv", 1925 | "quick-error", 1926 | "tempfile", 1927 | "wait-timeout", 1928 | ] 1929 | 1930 | [[package]] 1931 | name = "ryu" 1932 | version = "1.0.20" 1933 | source = "registry+https://github.com/rust-lang/crates.io-index" 1934 | checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" 1935 | 1936 | [[package]] 1937 | name = "sec1" 1938 | version = "0.7.3" 1939 | source = "registry+https://github.com/rust-lang/crates.io-index" 1940 | checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" 1941 | dependencies = [ 1942 | "base16ct", 1943 | "der", 1944 | "generic-array", 1945 | "pkcs8", 1946 | "subtle", 1947 | "zeroize", 1948 | ] 1949 | 1950 | [[package]] 1951 | name = "semver" 1952 | version = "0.11.0" 1953 | source = "registry+https://github.com/rust-lang/crates.io-index" 1954 | checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" 1955 | dependencies = [ 1956 | "semver-parser", 1957 | ] 1958 | 1959 | [[package]] 1960 | name = "semver" 1961 | version = "1.0.26" 1962 | source = "registry+https://github.com/rust-lang/crates.io-index" 1963 | checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" 1964 | dependencies = [ 1965 | "serde", 1966 | ] 1967 | 1968 | [[package]] 1969 | name = "semver-parser" 1970 | version = "0.10.3" 1971 | source = "registry+https://github.com/rust-lang/crates.io-index" 1972 | checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" 1973 | dependencies = [ 1974 | "pest", 1975 | ] 1976 | 1977 | [[package]] 1978 | name = "serde" 1979 | version = "1.0.218" 1980 | source = "registry+https://github.com/rust-lang/crates.io-index" 1981 | checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" 1982 | dependencies = [ 1983 | "serde_derive", 1984 | ] 1985 | 1986 | [[package]] 1987 | name = "serde_derive" 1988 | version = "1.0.218" 1989 | source = "registry+https://github.com/rust-lang/crates.io-index" 1990 | checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" 1991 | dependencies = [ 1992 | "proc-macro2", 1993 | "quote", 1994 | "syn 2.0.99", 1995 | ] 1996 | 1997 | [[package]] 1998 | name = "serde_json" 1999 | version = "1.0.140" 2000 | source = "registry+https://github.com/rust-lang/crates.io-index" 2001 | checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" 2002 | dependencies = [ 2003 | "itoa", 2004 | "memchr", 2005 | "ryu", 2006 | "serde", 2007 | ] 2008 | 2009 | [[package]] 2010 | name = "sha2" 2011 | version = "0.10.8" 2012 | source = "registry+https://github.com/rust-lang/crates.io-index" 2013 | checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" 2014 | dependencies = [ 2015 | "cfg-if", 2016 | "cpufeatures", 2017 | "digest 0.10.7", 2018 | ] 2019 | 2020 | [[package]] 2021 | name = "sha3" 2022 | version = "0.10.8" 2023 | source = "registry+https://github.com/rust-lang/crates.io-index" 2024 | checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" 2025 | dependencies = [ 2026 | "digest 0.10.7", 2027 | "keccak", 2028 | ] 2029 | 2030 | [[package]] 2031 | name = "sha3-asm" 2032 | version = "0.1.4" 2033 | source = "registry+https://github.com/rust-lang/crates.io-index" 2034 | checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" 2035 | dependencies = [ 2036 | "cc", 2037 | "cfg-if", 2038 | ] 2039 | 2040 | [[package]] 2041 | name = "shlex" 2042 | version = "1.3.0" 2043 | source = "registry+https://github.com/rust-lang/crates.io-index" 2044 | checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 2045 | 2046 | [[package]] 2047 | name = "signature" 2048 | version = "2.2.0" 2049 | source = "registry+https://github.com/rust-lang/crates.io-index" 2050 | checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" 2051 | dependencies = [ 2052 | "digest 0.10.7", 2053 | "rand_core 0.6.4", 2054 | ] 2055 | 2056 | [[package]] 2057 | name = "spin" 2058 | version = "0.9.8" 2059 | source = "registry+https://github.com/rust-lang/crates.io-index" 2060 | checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" 2061 | 2062 | [[package]] 2063 | name = "spki" 2064 | version = "0.7.3" 2065 | source = "registry+https://github.com/rust-lang/crates.io-index" 2066 | checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" 2067 | dependencies = [ 2068 | "base64ct", 2069 | "der", 2070 | ] 2071 | 2072 | [[package]] 2073 | name = "stability" 2074 | version = "0.2.1" 2075 | source = "registry+https://github.com/rust-lang/crates.io-index" 2076 | checksum = "d904e7009df136af5297832a3ace3370cd14ff1546a232f4f185036c2736fcac" 2077 | dependencies = [ 2078 | "quote", 2079 | "syn 2.0.99", 2080 | ] 2081 | 2082 | [[package]] 2083 | name = "static_assertions" 2084 | version = "1.1.0" 2085 | source = "registry+https://github.com/rust-lang/crates.io-index" 2086 | checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" 2087 | 2088 | [[package]] 2089 | name = "subtle" 2090 | version = "2.6.1" 2091 | source = "registry+https://github.com/rust-lang/crates.io-index" 2092 | checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" 2093 | 2094 | [[package]] 2095 | name = "syn" 2096 | version = "1.0.109" 2097 | source = "registry+https://github.com/rust-lang/crates.io-index" 2098 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 2099 | dependencies = [ 2100 | "proc-macro2", 2101 | "quote", 2102 | "unicode-ident", 2103 | ] 2104 | 2105 | [[package]] 2106 | name = "syn" 2107 | version = "2.0.99" 2108 | source = "registry+https://github.com/rust-lang/crates.io-index" 2109 | checksum = "e02e925281e18ffd9d640e234264753c43edc62d64b2d4cf898f1bc5e75f3fc2" 2110 | dependencies = [ 2111 | "proc-macro2", 2112 | "quote", 2113 | "unicode-ident", 2114 | ] 2115 | 2116 | [[package]] 2117 | name = "syn-solidity" 2118 | version = "1.1.0" 2119 | source = "registry+https://github.com/rust-lang/crates.io-index" 2120 | checksum = "3d0f0d4760f4c2a0823063b2c70e97aa2ad185f57be195172ccc0e23c4b787c4" 2121 | dependencies = [ 2122 | "paste", 2123 | "proc-macro2", 2124 | "quote", 2125 | "syn 2.0.99", 2126 | ] 2127 | 2128 | [[package]] 2129 | name = "tap" 2130 | version = "1.0.1" 2131 | source = "registry+https://github.com/rust-lang/crates.io-index" 2132 | checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" 2133 | 2134 | [[package]] 2135 | name = "tempfile" 2136 | version = "3.17.1" 2137 | source = "registry+https://github.com/rust-lang/crates.io-index" 2138 | checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230" 2139 | dependencies = [ 2140 | "cfg-if", 2141 | "fastrand", 2142 | "getrandom 0.3.1", 2143 | "once_cell", 2144 | "rustix", 2145 | "windows-sys", 2146 | ] 2147 | 2148 | [[package]] 2149 | name = "thiserror" 2150 | version = "2.0.12" 2151 | source = "registry+https://github.com/rust-lang/crates.io-index" 2152 | checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" 2153 | dependencies = [ 2154 | "thiserror-impl", 2155 | ] 2156 | 2157 | [[package]] 2158 | name = "thiserror-impl" 2159 | version = "2.0.12" 2160 | source = "registry+https://github.com/rust-lang/crates.io-index" 2161 | checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" 2162 | dependencies = [ 2163 | "proc-macro2", 2164 | "quote", 2165 | "syn 2.0.99", 2166 | ] 2167 | 2168 | [[package]] 2169 | name = "tiny-keccak" 2170 | version = "2.0.2" 2171 | source = "registry+https://github.com/rust-lang/crates.io-index" 2172 | checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" 2173 | dependencies = [ 2174 | "crunchy", 2175 | ] 2176 | 2177 | [[package]] 2178 | name = "toml_datetime" 2179 | version = "0.6.8" 2180 | source = "registry+https://github.com/rust-lang/crates.io-index" 2181 | checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" 2182 | 2183 | [[package]] 2184 | name = "toml_edit" 2185 | version = "0.22.24" 2186 | source = "registry+https://github.com/rust-lang/crates.io-index" 2187 | checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" 2188 | dependencies = [ 2189 | "indexmap", 2190 | "toml_datetime", 2191 | "winnow", 2192 | ] 2193 | 2194 | [[package]] 2195 | name = "tracing" 2196 | version = "0.1.41" 2197 | source = "registry+https://github.com/rust-lang/crates.io-index" 2198 | checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" 2199 | dependencies = [ 2200 | "log", 2201 | "pin-project-lite", 2202 | "tracing-attributes", 2203 | "tracing-core", 2204 | ] 2205 | 2206 | [[package]] 2207 | name = "tracing-attributes" 2208 | version = "0.1.28" 2209 | source = "registry+https://github.com/rust-lang/crates.io-index" 2210 | checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" 2211 | dependencies = [ 2212 | "proc-macro2", 2213 | "quote", 2214 | "syn 2.0.99", 2215 | ] 2216 | 2217 | [[package]] 2218 | name = "tracing-core" 2219 | version = "0.1.33" 2220 | source = "registry+https://github.com/rust-lang/crates.io-index" 2221 | checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" 2222 | dependencies = [ 2223 | "once_cell", 2224 | "valuable", 2225 | ] 2226 | 2227 | [[package]] 2228 | name = "tracing-subscriber" 2229 | version = "0.2.25" 2230 | source = "registry+https://github.com/rust-lang/crates.io-index" 2231 | checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" 2232 | dependencies = [ 2233 | "tracing-core", 2234 | ] 2235 | 2236 | [[package]] 2237 | name = "typenum" 2238 | version = "1.18.0" 2239 | source = "registry+https://github.com/rust-lang/crates.io-index" 2240 | checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" 2241 | 2242 | [[package]] 2243 | name = "ucd-trie" 2244 | version = "0.1.7" 2245 | source = "registry+https://github.com/rust-lang/crates.io-index" 2246 | checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" 2247 | 2248 | [[package]] 2249 | name = "uint" 2250 | version = "0.9.5" 2251 | source = "registry+https://github.com/rust-lang/crates.io-index" 2252 | checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" 2253 | dependencies = [ 2254 | "byteorder", 2255 | "crunchy", 2256 | "hex", 2257 | "static_assertions", 2258 | ] 2259 | 2260 | [[package]] 2261 | name = "unarray" 2262 | version = "0.1.4" 2263 | source = "registry+https://github.com/rust-lang/crates.io-index" 2264 | checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" 2265 | 2266 | [[package]] 2267 | name = "unicode-ident" 2268 | version = "1.0.18" 2269 | source = "registry+https://github.com/rust-lang/crates.io-index" 2270 | checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" 2271 | 2272 | [[package]] 2273 | name = "unicode-xid" 2274 | version = "0.2.6" 2275 | source = "registry+https://github.com/rust-lang/crates.io-index" 2276 | checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" 2277 | 2278 | [[package]] 2279 | name = "valuable" 2280 | version = "0.1.1" 2281 | source = "registry+https://github.com/rust-lang/crates.io-index" 2282 | checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" 2283 | 2284 | [[package]] 2285 | name = "version_check" 2286 | version = "0.9.5" 2287 | source = "registry+https://github.com/rust-lang/crates.io-index" 2288 | checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" 2289 | 2290 | [[package]] 2291 | name = "wait-timeout" 2292 | version = "0.2.1" 2293 | source = "registry+https://github.com/rust-lang/crates.io-index" 2294 | checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" 2295 | dependencies = [ 2296 | "libc", 2297 | ] 2298 | 2299 | [[package]] 2300 | name = "wasi" 2301 | version = "0.11.0+wasi-snapshot-preview1" 2302 | source = "registry+https://github.com/rust-lang/crates.io-index" 2303 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 2304 | 2305 | [[package]] 2306 | name = "wasi" 2307 | version = "0.13.3+wasi-0.2.2" 2308 | source = "registry+https://github.com/rust-lang/crates.io-index" 2309 | checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" 2310 | dependencies = [ 2311 | "wit-bindgen-rt", 2312 | ] 2313 | 2314 | [[package]] 2315 | name = "windows-sys" 2316 | version = "0.59.0" 2317 | source = "registry+https://github.com/rust-lang/crates.io-index" 2318 | checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" 2319 | dependencies = [ 2320 | "windows-targets", 2321 | ] 2322 | 2323 | [[package]] 2324 | name = "windows-targets" 2325 | version = "0.52.6" 2326 | source = "registry+https://github.com/rust-lang/crates.io-index" 2327 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 2328 | dependencies = [ 2329 | "windows_aarch64_gnullvm", 2330 | "windows_aarch64_msvc", 2331 | "windows_i686_gnu", 2332 | "windows_i686_gnullvm", 2333 | "windows_i686_msvc", 2334 | "windows_x86_64_gnu", 2335 | "windows_x86_64_gnullvm", 2336 | "windows_x86_64_msvc", 2337 | ] 2338 | 2339 | [[package]] 2340 | name = "windows_aarch64_gnullvm" 2341 | version = "0.52.6" 2342 | source = "registry+https://github.com/rust-lang/crates.io-index" 2343 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 2344 | 2345 | [[package]] 2346 | name = "windows_aarch64_msvc" 2347 | version = "0.52.6" 2348 | source = "registry+https://github.com/rust-lang/crates.io-index" 2349 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 2350 | 2351 | [[package]] 2352 | name = "windows_i686_gnu" 2353 | version = "0.52.6" 2354 | source = "registry+https://github.com/rust-lang/crates.io-index" 2355 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 2356 | 2357 | [[package]] 2358 | name = "windows_i686_gnullvm" 2359 | version = "0.52.6" 2360 | source = "registry+https://github.com/rust-lang/crates.io-index" 2361 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 2362 | 2363 | [[package]] 2364 | name = "windows_i686_msvc" 2365 | version = "0.52.6" 2366 | source = "registry+https://github.com/rust-lang/crates.io-index" 2367 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 2368 | 2369 | [[package]] 2370 | name = "windows_x86_64_gnu" 2371 | version = "0.52.6" 2372 | source = "registry+https://github.com/rust-lang/crates.io-index" 2373 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 2374 | 2375 | [[package]] 2376 | name = "windows_x86_64_gnullvm" 2377 | version = "0.52.6" 2378 | source = "registry+https://github.com/rust-lang/crates.io-index" 2379 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 2380 | 2381 | [[package]] 2382 | name = "windows_x86_64_msvc" 2383 | version = "0.52.6" 2384 | source = "registry+https://github.com/rust-lang/crates.io-index" 2385 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 2386 | 2387 | [[package]] 2388 | name = "winnow" 2389 | version = "0.7.3" 2390 | source = "registry+https://github.com/rust-lang/crates.io-index" 2391 | checksum = "0e7f4ea97f6f78012141bcdb6a216b2609f0979ada50b20ca5b52dde2eac2bb1" 2392 | dependencies = [ 2393 | "memchr", 2394 | ] 2395 | 2396 | [[package]] 2397 | name = "wit-bindgen-rt" 2398 | version = "0.33.0" 2399 | source = "registry+https://github.com/rust-lang/crates.io-index" 2400 | checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" 2401 | dependencies = [ 2402 | "bitflags 2.9.0", 2403 | ] 2404 | 2405 | [[package]] 2406 | name = "wyz" 2407 | version = "0.5.1" 2408 | source = "registry+https://github.com/rust-lang/crates.io-index" 2409 | checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" 2410 | dependencies = [ 2411 | "tap", 2412 | ] 2413 | 2414 | [[package]] 2415 | name = "zerocopy" 2416 | version = "0.7.35" 2417 | source = "registry+https://github.com/rust-lang/crates.io-index" 2418 | checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" 2419 | dependencies = [ 2420 | "byteorder", 2421 | "zerocopy-derive", 2422 | ] 2423 | 2424 | [[package]] 2425 | name = "zerocopy-derive" 2426 | version = "0.7.35" 2427 | source = "registry+https://github.com/rust-lang/crates.io-index" 2428 | checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" 2429 | dependencies = [ 2430 | "proc-macro2", 2431 | "quote", 2432 | "syn 2.0.99", 2433 | ] 2434 | 2435 | [[package]] 2436 | name = "zeroize" 2437 | version = "1.8.1" 2438 | source = "registry+https://github.com/rust-lang/crates.io-index" 2439 | checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" 2440 | dependencies = [ 2441 | "zeroize_derive", 2442 | ] 2443 | 2444 | [[package]] 2445 | name = "zeroize_derive" 2446 | version = "1.4.2" 2447 | source = "registry+https://github.com/rust-lang/crates.io-index" 2448 | checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" 2449 | dependencies = [ 2450 | "proc-macro2", 2451 | "quote", 2452 | "syn 2.0.99", 2453 | ] 2454 | -------------------------------------------------------------------------------- /methods/guest/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "guests" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [[bin]] 7 | name = "is-even" 8 | path = "src/bin/is_even.rs" 9 | 10 | [workspace] 11 | 12 | [dependencies] 13 | alloy-primitives = { version = "1.0", default-features = false, features = ["rlp", "serde", "std"] } 14 | alloy-sol-types = { version = "1.0" } 15 | risc0-zkvm = { version = "2.0.2", default-features = false, features = ['std'] } 16 | 17 | [profile.release] 18 | lto = "thin" 19 | -------------------------------------------------------------------------------- /methods/guest/README.md: -------------------------------------------------------------------------------- 1 | # Guest Programs 2 | 3 | Each file in the [`src/bin`](./src/bin) folder defines a program for the zkVM. 4 | We refer to the program running in the zkVM as the "[guest]". 5 | 6 | To learn more about writing guest programs, check out the zkVM [developer docs]. 7 | For zkVM API documentation, see the [guest module] of the [`risc0-zkvm`] crate. 8 | 9 | [guest]: https://dev.risczero.com/terminology#guest 10 | [developer docs]: https://dev.risczero.com/zkvm 11 | [guest module]: https://docs.rs/risc0-zkvm/latest/risc0_zkvm/guest/index.html 12 | [`risc0-zkvm`]: https://docs.rs/risc0-zkvm/latest/risc0_zkvm/index.html 13 | -------------------------------------------------------------------------------- /methods/guest/src/bin/is_even.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2023 RISC Zero, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | use std::io::Read; 16 | 17 | use alloy_primitives::U256; 18 | use alloy_sol_types::SolValue; 19 | use risc0_zkvm::guest::env; 20 | 21 | fn main() { 22 | // Read the input data for this application. 23 | let mut input_bytes = Vec::::new(); 24 | env::stdin().read_to_end(&mut input_bytes).unwrap(); 25 | // Decode and parse the input 26 | let number = ::abi_decode(&input_bytes).unwrap(); 27 | 28 | // Run the computation. 29 | // In this case, asserting that the provided number is even. 30 | assert!(!number.bit(0), "number is not even"); 31 | 32 | // Commit the journal that will be received by the application contract. 33 | // Journal is encoded using Solidity ABI for easy decoding in the app contract. 34 | env::commit_slice(number.abi_encode().as_slice()); 35 | } 36 | -------------------------------------------------------------------------------- /methods/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2023 RISC Zero, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | //! Generated crate containing the image ID and ELF binary of the build guest. 16 | include!(concat!(env!("OUT_DIR"), "/methods.rs")); 17 | 18 | #[cfg(test)] 19 | mod tests { 20 | use alloy_primitives::U256; 21 | use alloy_sol_types::SolValue; 22 | use risc0_zkvm::{default_executor, ExecutorEnv}; 23 | 24 | #[test] 25 | fn proves_even_number() { 26 | let even_number = U256::from(1304); 27 | 28 | let env = ExecutorEnv::builder() 29 | .write_slice(&even_number.abi_encode()) 30 | .build() 31 | .unwrap(); 32 | 33 | // NOTE: Use the executor to run tests without proving. 34 | let session_info = default_executor().execute(env, super::IS_EVEN_ELF).unwrap(); 35 | 36 | let x = U256::abi_decode(&session_info.journal.bytes).unwrap(); 37 | assert_eq!(x, even_number); 38 | } 39 | 40 | #[test] 41 | #[should_panic(expected = "number is not even")] 42 | fn rejects_odd_number() { 43 | let odd_number = U256::from(75); 44 | 45 | let env = ExecutorEnv::builder() 46 | .write_slice(&odd_number.abi_encode()) 47 | .build() 48 | .unwrap(); 49 | 50 | // NOTE: Use the executor to run tests without proving. 51 | default_executor().execute(env, super::IS_EVEN_ELF).unwrap(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /remappings.txt: -------------------------------------------------------------------------------- 1 | forge-std/=lib/risc0-ethereum/lib/forge-std/src/ 2 | openzeppelin/=lib/risc0-ethereum/lib/openzeppelin-contracts/ 3 | risc0/=lib/risc0-ethereum/contracts/src/ 4 | -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "1.85" 3 | components = ["clippy", "rustfmt", "rust-src"] 4 | targets = [] 5 | profile = "minimal" 6 | -------------------------------------------------------------------------------- /script/Deploy.s.sol: -------------------------------------------------------------------------------- 1 | // Copyright 2024 RISC Zero, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // SPDX-License-Identifier: Apache-2.0 16 | 17 | pragma solidity ^0.8.20; 18 | 19 | import {Script} from "forge-std/Script.sol"; 20 | import "forge-std/Test.sol"; 21 | import {RiscZeroCheats} from "risc0/test/RiscZeroCheats.sol"; 22 | import {IRiscZeroVerifier} from "risc0/IRiscZeroVerifier.sol"; 23 | import {RiscZeroGroth16Verifier} from "risc0/groth16/RiscZeroGroth16Verifier.sol"; 24 | import {ControlID} from "risc0/groth16/ControlID.sol"; 25 | 26 | import {EvenNumber} from "../contracts/EvenNumber.sol"; 27 | 28 | /// @notice Deployment script for the RISC Zero starter project. 29 | /// @dev Use the following environment variable to control the deployment: 30 | /// * Set one of these two environment variables to control the deployment wallet: 31 | /// * ETH_WALLET_PRIVATE_KEY private key of the wallet account. 32 | /// * ETH_WALLET_ADDRESS address of the wallet account. 33 | /// 34 | /// See the Foundry documentation for more information about Solidity scripts, 35 | /// including information about wallet options. 36 | /// 37 | /// https://book.getfoundry.sh/tutorials/solidity-scripting 38 | /// https://book.getfoundry.sh/reference/forge/forge-script 39 | contract EvenNumberDeploy is Script, RiscZeroCheats { 40 | // Path to deployment config file, relative to the project root. 41 | string constant CONFIG_FILE = "script/config.toml"; 42 | 43 | IRiscZeroVerifier verifier; 44 | 45 | function run() external { 46 | // Read and log the chainID 47 | uint256 chainId = block.chainid; 48 | console2.log("You are deploying on ChainID %d", chainId); 49 | 50 | // Read the config profile from the environment variable, or use the default for the chainId. 51 | // Default is the first profile with a matching chainId field. 52 | string memory config = vm.readFile(string.concat(vm.projectRoot(), "/", CONFIG_FILE)); 53 | string memory configProfile = vm.envOr("CONFIG_PROFILE", string("")); 54 | if (bytes(configProfile).length == 0) { 55 | string[] memory profileKeys = vm.parseTomlKeys(config, ".profile"); 56 | for (uint256 i = 0; i < profileKeys.length; i++) { 57 | if (stdToml.readUint(config, string.concat(".profile.", profileKeys[i], ".chainId")) == chainId) { 58 | configProfile = profileKeys[i]; 59 | break; 60 | } 61 | } 62 | } 63 | 64 | if (bytes(configProfile).length != 0) { 65 | console2.log("Deploying using config profile:", configProfile); 66 | string memory configProfileKey = string.concat(".profile.", configProfile); 67 | address riscZeroVerifierAddress = 68 | stdToml.readAddress(config, string.concat(configProfileKey, ".riscZeroVerifierAddress")); 69 | // If set, use the predeployed verifier address found in the config. 70 | verifier = IRiscZeroVerifier(riscZeroVerifierAddress); 71 | } 72 | 73 | // Determine the wallet to send transactions from. 74 | uint256 deployerKey = uint256(vm.envOr("ETH_WALLET_PRIVATE_KEY", bytes32(0))); 75 | address deployerAddr = address(0); 76 | if (deployerKey != 0) { 77 | // Check for conflicts in how the two environment variables are set. 78 | address envAddr = vm.envOr("ETH_WALLET_ADDRESS", address(0)); 79 | require( 80 | envAddr == address(0) || envAddr == vm.addr(deployerKey), 81 | "conflicting settings from ETH_WALLET_PRIVATE_KEY and ETH_WALLET_ADDRESS" 82 | ); 83 | 84 | vm.startBroadcast(deployerKey); 85 | } else { 86 | deployerAddr = vm.envAddress("ETH_WALLET_ADDRESS"); 87 | vm.startBroadcast(deployerAddr); 88 | } 89 | 90 | // Deploy the verifier, if not already deployed. 91 | if (address(verifier) == address(0)) { 92 | verifier = deployRiscZeroVerifier(); 93 | } else { 94 | console2.log("Using IRiscZeroVerifier contract deployed at", address(verifier)); 95 | } 96 | 97 | // Deploy the application contract. 98 | EvenNumber evenNumber = new EvenNumber(verifier); 99 | console2.log("Deployed EvenNumber to", address(evenNumber)); 100 | 101 | vm.stopBroadcast(); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /script/config.toml: -------------------------------------------------------------------------------- 1 | [profile.mainnet] 2 | # RISC Zero Verifier contract deployed on mainnet (see https://dev.risczero.com/api/blockchain-integration/contracts/verifier#deployed-verifiers) 3 | chainId = 1 4 | riscZeroVerifierAddress = "0x8EaB2D97Dfce405A1692a21b3ff3A172d593D319" 5 | 6 | [profile.sepolia] 7 | # RISC Zero Verifier contract deployed on sepolia (see https://dev.risczero.com/api/blockchain-integration/contracts/verifier#deployed-verifiers) 8 | chainId = 11155111 9 | riscZeroVerifierAddress = "0x925d8331ddc0a1F0d96E68CF073DFE1d92b69187" 10 | 11 | # You can add additional profiles here 12 | # [profile.custom] 13 | # chainId = 11155111 14 | # riscZeroVerifierAddress = 15 | -------------------------------------------------------------------------------- /tests/EvenNumber.t.sol: -------------------------------------------------------------------------------- 1 | // Copyright 2024 RISC Zero, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // SPDX-License-Identifier: Apache-2.0 16 | 17 | pragma solidity ^0.8.20; 18 | 19 | import {RiscZeroCheats} from "risc0/test/RiscZeroCheats.sol"; 20 | import {console2} from "forge-std/console2.sol"; 21 | import {Test} from "forge-std/Test.sol"; 22 | import {IRiscZeroVerifier} from "risc0/IRiscZeroVerifier.sol"; 23 | import {EvenNumber} from "../contracts/EvenNumber.sol"; 24 | import {Elf} from "./Elf.sol"; // auto-generated contract after running `cargo build`. 25 | 26 | contract EvenNumberTest is RiscZeroCheats, Test { 27 | EvenNumber public evenNumber; 28 | 29 | function setUp() public { 30 | IRiscZeroVerifier verifier = deployRiscZeroVerifier(); 31 | evenNumber = new EvenNumber(verifier); 32 | assertEq(evenNumber.get(), 0); 33 | } 34 | 35 | function test_SetEven() public { 36 | uint256 number = 12345678; 37 | (bytes memory journal, bytes memory seal) = prove(Elf.IS_EVEN_PATH, abi.encode(number)); 38 | 39 | evenNumber.set(abi.decode(journal, (uint256)), seal); 40 | assertEq(evenNumber.get(), number); 41 | } 42 | 43 | function test_SetZero() public { 44 | uint256 number = 0; 45 | (bytes memory journal, bytes memory seal) = prove(Elf.IS_EVEN_PATH, abi.encode(number)); 46 | 47 | evenNumber.set(abi.decode(journal, (uint256)), seal); 48 | assertEq(evenNumber.get(), number); 49 | } 50 | } 51 | --------------------------------------------------------------------------------