diff --git a/book/docs/developers/common-issues.md b/book/docs/developers/common-issues.md index 5b06ec3b43..96a91eee54 100644 --- a/book/docs/developers/common-issues.md +++ b/book/docs/developers/common-issues.md @@ -8,7 +8,7 @@ If you are using a library that has an MSRV specified, you may encounter an erro package `alloy v0.1.1 cannot be built because it requires rustc 1.76 or newer, while the currently active rustc version is 1.75.0-nightly` ``` -This is due to the fact that your current Succinct Rust toolchain has been built with a lower version than the MSRV of the crates you are using. +This is due to the fact that your current Succinct Rust toolchain has been built with a lower version than the MSRV of the crates you are using. You can check the version of your local Succinct Rust toolchain by running `cargo +succinct --version`. The latest release of the Succinct Rust toolchain is **1.81**. You can update to the latest version by running [`sp1up`](../getting-started/install.md). @@ -51,7 +51,7 @@ This is likely due to two different versions of `alloy_sol_types` being used. To ```toml [dependencies] -sp1-sdk = { version = "3.0.0", default-features = false } +sp1-sdk = { version = "4.0.0-rc.8", default-features = false } ``` This will configure out the `network` feature which will remove the dependency on `alloy_sol_types` and configure out the `NetworkProver`. diff --git a/book/docs/developers/rv32im-deviations.md b/book/docs/developers/rv32im-deviations.md index e28f294450..9456c08aa8 100644 --- a/book/docs/developers/rv32im-deviations.md +++ b/book/docs/developers/rv32im-deviations.md @@ -15,6 +15,8 @@ deviations are outlined below: - LW/SW memory access must be word aligned. - LH/LHU/SH memory access must be half-word aligned. - The ECALL instruction is used for system calls and precompiles. Only valid syscall IDs should be called, and only using the specific convention of loading the ID into register T0 and arguments into registers A0 and A1. If the arguments are addresses, they must be word-aligned. Failure to follow this convention can result in undefined behavior. Correct usages can be found in the `sp1_zkvm` and `sp1_lib` crates. +- The instructions FENCE, WFI, MRET, and CSR related instructions will be categorized as not implemented, + and hence not allowed by the SP1 zkvm. ## Security Considerations diff --git a/book/docs/developers/rv32im-specification.md b/book/docs/developers/rv32im-specification.md deleted file mode 100644 index 84e8aa7584..0000000000 --- a/book/docs/developers/rv32im-specification.md +++ /dev/null @@ -1,8 +0,0 @@ -# RV32IM Specification - -SP1 implements the RISC-V RV32IM instruction set with some implementation details that make it more suitable for proving. - -- LW/SW memory access must be word aligned. -- LH/LHU/SH memory access must be half-word aligned. -- Memory access is only valid for addresses `0x20, 0x78000000`. Accessing addresses outside of this range will result in undefined behavior. The global heap allocator in `sp1_zkvm` will panic if memory exceeds this range. -- The ECALL instruction is used for system calls and precompiles. Only valid syscall IDs should be called, and only using the specific convention of loading the ID into register T0 and arguments into registers A0 and A1. If the arguments are addresses, they must be word-aligned. Failure to follow this convention can result in undefined behavior. Correct usages can be found in the `sp1_zkvm` and `sp1_lib` crates. diff --git a/book/docs/generating-proofs/advanced.mdx b/book/docs/generating-proofs/advanced.mdx index da9e3548ab..50ac3df8a8 100644 --- a/book/docs/generating-proofs/advanced.mdx +++ b/book/docs/generating-proofs/advanced.mdx @@ -47,7 +47,7 @@ RUSTFLAGS='-C target-cpu=native' cargo run --release Currently there is support for AVX512 and NEON SIMD instructions. For NEON, you must also enable the `sp1-sdk` feature `neon` in your script crate's `Cargo.toml` file. ```toml -sp1-sdk = { version = "3.0.0", features = ["neon"] } +sp1-sdk = { version = "...", features = ["neon"] } ``` ## Performance diff --git a/book/docs/generating-proofs/proof-types.md b/book/docs/generating-proofs/proof-types.md index dfdae364d5..62bc4ce90d 100644 --- a/book/docs/generating-proofs/proof-types.md +++ b/book/docs/generating-proofs/proof-types.md @@ -34,7 +34,7 @@ The trusted setup for the Groth16 circuit keys uses the [Aztec Ignition ceremony ```rust,noplayground let client = ProverClient::from_env(); -client.prove(&pk, stdin).groth16().run().unwrap(); +client.prove(&pk, &stdin).groth16().run().unwrap(); ``` ## PLONK diff --git a/book/docs/generating-proofs/prover-network/versions.md b/book/docs/generating-proofs/prover-network/versions.md index 3060a610ad..e69af7b9ba 100644 --- a/book/docs/generating-proofs/prover-network/versions.md +++ b/book/docs/generating-proofs/prover-network/versions.md @@ -2,9 +2,10 @@ The prover network currently only supports specific versions of SP1: -| Version | Description | -| ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| v3.X.X | V3 Release. Latest performant & production ready version. | +| Version | Description | +| ------- | ---------------------------------------------------------------- | +| v4.X.X | V4 Release. Latest performant & production ready version. | +| v3.X.X | V3 Release. Previous circuit version deprecated in January 2025. | `X` denotes that any minor and patch version is supported (e.g. `v2.1.0`, `v2.1.1`). @@ -16,14 +17,14 @@ You must switch to a supported version before submitting a proof. To do so, repl ```toml [dependencies] -sp1-zkvm = "3.0.0" +sp1-zkvm = "4.0.0-rc.8" ``` replace the `sp1-sdk` version in your script's `Cargo.toml`: ```toml [dependencies] -sp1-sdk = "3.0.0" +sp1-sdk = "4.0.0-rc.8" ``` Re-build your program and script, and then try again. diff --git a/book/docs/generating-proofs/setup.md b/book/docs/generating-proofs/setup.md index 52fc7f66f6..9055d15a80 100644 --- a/book/docs/generating-proofs/setup.md +++ b/book/docs/generating-proofs/setup.md @@ -32,7 +32,7 @@ name = "script" edition = "2021" [dependencies] -sp1-sdk = "3.0.0" +sp1-sdk = "4.0.0-rc.8" ``` The `sp1-sdk` crate includes the necessary utilities to generate, save, and verify proofs. diff --git a/book/docs/getting-started/install.md b/book/docs/getting-started/install.md index e58b9a624e..7c1a4ae85b 100644 --- a/book/docs/getting-started/install.md +++ b/book/docs/getting-started/install.md @@ -91,7 +91,7 @@ git clone git@github.com:succinctlabs/sp1.git cd sp1 cd crates cd cli -cargo install --locked --path . +cargo install --locked --force --path . cd ~ cargo prove build-toolchain ``` diff --git a/book/docs/verification/off-chain-verification.md b/book/docs/verification/off-chain-verification.md index 1b8fd1b9a5..1738301abd 100644 --- a/book/docs/verification/off-chain-verification.md +++ b/book/docs/verification/off-chain-verification.md @@ -16,7 +16,7 @@ the [Groth16 Example](https://github.com/succinctlabs/sp1/tree/main/examples/gro Import the following dependency in your `Cargo.toml`: ```toml -sp1-verifier = {version = "3.0.0", default-features = false} +sp1-verifier = {version = "4.0.0-rc.8", default-features = false} ``` ### Usage @@ -40,7 +40,7 @@ Here, the proof, public inputs, and vkey hash are read from stdin. See the follo -> Note that the SP1 SDK itself is *not* `no_std` compatible. +> Note that the SP1 SDK itself is _not_ `no_std` compatible. ## Wasm Verification diff --git a/book/docs/verification/onchain/contract-addresses.md b/book/docs/verification/onchain/contract-addresses.md index 6986d7cee8..fc5136c2d7 100644 --- a/book/docs/verification/onchain/contract-addresses.md +++ b/book/docs/verification/onchain/contract-addresses.md @@ -1,6 +1,6 @@ # Contract Addresses -> The current officially supported version of SP1 is **V3.0.0**. +> The current officially supported version of SP1 is **V4.0.0**. > > All previous versions are deprecated and may not work as expected on the gateways. @@ -15,35 +15,35 @@ must use the correct verifier gateway depending on if you are verifying a Groth1 ### Groth16 -| Chain ID | Chain | Gateway | -| -------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -| 1 | Mainnet | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://etherscan.io/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | -| 11155111 | Sepolia | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://sepolia.etherscan.io/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | -| 17000 | Holesky | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://holesky.etherscan.io/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | -| 42161 | Arbitrum One | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://arbiscan.io/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | -| 421614 | Arbitrum Sepolia | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://sepolia.arbiscan.io/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | -| 8453 | Base | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://basescan.org/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | -| 84532 | Base Sepolia | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://sepolia.basescan.org/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | -| 10 | Optimism | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://optimistic.etherscan.io/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | -| 11155420 | Optimism Sepolia | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://sepolia-optimism.etherscan.io/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | -| 534351 | Scroll Sepolia | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://sepolia.scrollscan.com/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | -| 534352 | Scroll | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://scrollscan.com/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | +| Chain ID | Chain | Gateway | +| -------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| 1 | Mainnet | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://etherscan.io/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | +| 11155111 | Sepolia | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://sepolia.etherscan.io/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | +| 17000 | Holesky | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://holesky.etherscan.io/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | +| 42161 | Arbitrum One | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://arbiscan.io/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | +| 421614 | Arbitrum Sepolia | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://sepolia.arbiscan.io/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | +| 8453 | Base | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://basescan.org/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | +| 84532 | Base Sepolia | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://sepolia.basescan.org/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | +| 10 | Optimism | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://optimistic.etherscan.io/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | +| 11155420 | Optimism Sepolia | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://sepolia-optimism.etherscan.io/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | +| 534351 | Scroll Sepolia | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://sepolia.scrollscan.com/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | +| 534352 | Scroll | [0x397A5f7f3dBd538f23DE225B51f532c34448dA9B](https://scrollscan.com/address/0x397A5f7f3dBd538f23DE225B51f532c34448dA9B) | ### PLONK -| Chain ID | Chain | Gateway | -| -------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -| 1 | Mainnet | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://etherscan.io/address/0x3B6041173B80E77f038f3F2C0f9744f04837185e) | -| 11155111 | Sepolia | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://sepolia.etherscan.io/address/0x3B6041173B80E77f038f3F2C0f9744f04837185e) | -| 17000 | Holesky | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://holesky.etherscan.io/address/0x3B6041173B80E77f038f3F2C0f9744f04837185e) | -| 42161 | Arbitrum One | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://arbiscan.io/address/0x3B6041173B80E77f038f3F2C0f9744f04837185e) | -| 421614 | Arbitrum Sepolia | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://sepolia.arbiscan.io/address/0x3B6041173B80E77f038f3F2C0f9744f04837185e) | -| 8453 | Base | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://basescan.org/address/0x3B6041173B80E77f038f3F2C0f9744f04837185e) | -| 84532 | Base Sepolia | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://sepolia.basescan.org/address/0x3B6041173B80E77f038f3F2C0f9744f04837185e) | -| 10 | Optimism | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://optimistic.etherscan.io/address/0x3b6041173b80e77f038f3f2c0f9744f04837185e) | -| 11155420 | Optimism Sepolia | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://sepolia-optimism.etherscan.io/address/0x3B6041173B80E77f038f3F2C0f9744f04837185e) | -| 534351 | Scroll Sepolia | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://sepolia.scrollscan.com/address/0x3B6041173B80E77f038f3F2C0f9744f04837185e) | -| 534352 | Scroll | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://scrollscan.com/address/0x3B6041173B80E77f038f3F2C0f9744f04837185e) | +| Chain ID | Chain | Gateway | +| -------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| 1 | Mainnet | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://etherscan.io/address/0x3B6041173B80E77f038f3F2C0f9744f04837185e) | +| 11155111 | Sepolia | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://sepolia.etherscan.io/address/0x3B6041173B80E77f038f3F2C0f9744f04837185e) | +| 17000 | Holesky | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://holesky.etherscan.io/address/0x3B6041173B80E77f038f3F2C0f9744f04837185e) | +| 42161 | Arbitrum One | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://arbiscan.io/address/0x3B6041173B80E77f038f3F2C0f9744f04837185e) | +| 421614 | Arbitrum Sepolia | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://sepolia.arbiscan.io/address/0x3B6041173B80E77f038f3F2C0f9744f04837185e) | +| 8453 | Base | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://basescan.org/address/0x3B6041173B80E77f038f3F2C0f9744f04837185e) | +| 84532 | Base Sepolia | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://sepolia.basescan.org/address/0x3B6041173B80E77f038f3F2C0f9744f04837185e) | +| 10 | Optimism | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://optimistic.etherscan.io/address/0x3b6041173b80e77f038f3f2c0f9744f04837185e) | +| 11155420 | Optimism Sepolia | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://sepolia-optimism.etherscan.io/address/0x3B6041173B80E77f038f3F2C0f9744f04837185e) | +| 534351 | Scroll Sepolia | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://sepolia.scrollscan.com/address/0x3B6041173B80E77f038f3F2C0f9744f04837185e) | +| 534352 | Scroll | [0x3B6041173B80E77f038f3F2C0f9744f04837185e](https://scrollscan.com/address/0x3B6041173B80E77f038f3F2C0f9744f04837185e) | The most up-to-date reference on each chain can be found in the [deployments](https://github.com/succinctlabs/sp1-contracts/blob/main/contracts/deployments) @@ -70,9 +70,9 @@ verifier contract by following the instructions in the Since both the `SP1VerifierGateway` and each `SP1Verifier` implement the [ISP1Verifier interface](https://github.com/succinctlabs/sp1-contracts/blob/main/contracts/src/ISP1Verifier.sol), you can choose to either: -* Deploy the `SP1VerifierGateway` and add `SP1Verifier` contracts to it. Then point to the +- Deploy the `SP1VerifierGateway` and add `SP1Verifier` contracts to it. Then point to the `SP1VerifierGateway` address in your contracts. -* Deploy just the `SP1Verifier` contract that you want to use. Then point to the `SP1Verifier` +- Deploy just the `SP1Verifier` contract that you want to use. Then point to the `SP1Verifier` address in your contracts. diff --git a/book/docs/writing-programs/compiling.mdx b/book/docs/writing-programs/compiling.mdx index 0bc50d9fd6..5d6d9ac6a2 100644 --- a/book/docs/writing-programs/compiling.mdx +++ b/book/docs/writing-programs/compiling.mdx @@ -61,7 +61,7 @@ The path passed in to `build_program` should point to the directory containing t ```toml [build-dependencies] -sp1-build = "3.0.0" +sp1-build = "4.0.0-rc.8" ``` You will see output like the following from the build script if the program has changed, indicating that the program was rebuilt: diff --git a/book/docs/writing-programs/cycle-tracking.mdx b/book/docs/writing-programs/cycle-tracking.mdx index f38f50d74d..f0808d33d6 100644 --- a/book/docs/writing-programs/cycle-tracking.mdx +++ b/book/docs/writing-programs/cycle-tracking.mdx @@ -14,7 +14,7 @@ Note that to use the macro, you must add the `sp1-derive` crate to your dependen ```toml [dependencies] -sp1-derive = "3.0.0" +sp1-derive = "4.0.0-rc.8" ``` In the script for proof generation, setup the logger with `utils::setup_logger()` and run the script with `RUST_LOG=info cargo run --release`. You should see the following output: @@ -79,7 +79,7 @@ Once you have your script it should look like the following: As well you must enable the profiling feature on the SDK: ```toml - sp1-sdk = { version = "3.0.0", features = ["profiling"] } + sp1-sdk = { version = "4.0.0-rc.8", features = ["profiling"] } ``` The `TRACE_FILE` env var tells the executor where to save the profile, and the `TRACE_SAMPLE_RATE` env var tells the executor how often to sample the program. diff --git a/book/docs/writing-programs/patched-crates.md b/book/docs/writing-programs/patched-crates.md index 0ebda21693..2feb3a5e57 100644 --- a/book/docs/writing-programs/patched-crates.md +++ b/book/docs/writing-programs/patched-crates.md @@ -9,8 +9,8 @@ Under the hood, we use [precompiles](./precompiles) to achieve tremendous perfor | Crate Name | Repository | Notes | Versions | |---------------------|---------------------------------------------------------------------------------------|------------------|-----------------------| -| sha2 | [sp1-patches/RustCrypto-hashes](https://github.com/sp1-patches/RustCrypto-hashes) | sha256 | 0.9.8, 0.10.6, 0.10.8 | -| sha3 | [sp1-patches/RustCrypto-hashes](https://github.com/sp1-patches/RustCrypto-hashes) | keccak256 | 0.9.8, 0.10.6, 0.10.8 | +| sha2 | [sp1-patches/RustCrypto-hashes](https://github.com/sp1-patches/RustCrypto-hashes) | sha256 | 0.10.6, 0.10.8 | +| sha3 | [sp1-patches/RustCrypto-hashes](https://github.com/sp1-patches/RustCrypto-hashes) | keccak256 | 0.10.8 | | bigint | [sp1-patches/RustCrypto-bigint](https://github.com/sp1-patches/RustCrypto-bigint) | bigint | 0.5.5 | | tiny-keccak | [sp1-patches/tiny-keccak](https://github.com/sp1-patches/tiny-keccak) | keccak256 | 2.0.2 | | curve25519-dalek | [sp1-patches/curve25519-dalek](https://github.com/sp1-patches/curve25519-dalek) | ed25519 verify | 4.1.3, 3.2.0 | @@ -28,34 +28,18 @@ To use the patched libraries, you can use corresponding patch entries in your pr ```toml [patch.crates-io] -sha2-v0-9-8 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha2", tag = "sha2-v0.9.8-patch-v1" } -sha2-v0-10-6 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha2", tag = "sha2-v0.10.6-patch-v1" } -sha2-v0-10-8 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha2", tag = "sha2-v0.10.8-patch-v1" } -sha3-v0-9-8 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha3", tag = "sha3-v0.9.8-patch-v1" } -sha3-v0-10-6 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha3", tag = "sha3-v0.10.6-patch-v1" } -sha3-v0-10-8 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha3", tag = "sha3-v0.10.8-patch-v1" } -crypto-bigint = { git = "https://github.com/sp1-patches/RustCrypto-bigint", tag = "crypto_bigint-v0.5.5-patch-v1" } -tiny-keccak = { git = "https://github.com/sp1-patches/tiny-keccak", tag = "tiny_keccak-v2.0.2-patch-v1" } -curve25519-dalek = { git = "https://github.com/sp1-patches/curve25519-dalek", tag = "curve25519_dalek-v4.1.3-patch-v1" } -curve25519-dalek-ng = { git = "https://github.com/sp1-patches/curve25519-dalek-ng", tag = "curve25519_dalek_ng-v4.1.1-patch-v1" } -ed25519-consensus = { git = "https://github.com/sp1-patches/ed25519-consensus", tag = "ed25519_consensus-v2.1.0-patch-v1" } -ecdsa-core = { git = "https://github.com/sp1-patches/signatures", package = "ecdsa", tag = "ecdsa-v0.16.9-patch-v1" } -secp256k1 = { git = "https://github.com/sp1-patches/rust-secp256k1", tag = "secp256k1-v0.29.0-patch-v1" } -substrate-bn = { git = "https://github.com/sp1-patches/bn", tag = "substrate_bn-v0.6.0-patch-v1" } -bls12_381 = { git = "https://github.com/sp1-patches/bls12_381", tag = "bls12_381-v0.8.0-patch-v1" } - -# For sp1 versions >= 3.4.0 -curve25519-dalek = { git = "https://github.com/sp1-patches/curve25519-dalek", tag = "patch-v4.1.3-v3.4.0" } -# For sp1 versions < 3.4.0 -curve25519-dalek = { git = "https://github.com/sp1-patches/curve25519-dalek", tag = "curve25519_dalek-v4.1.3-patch-v1" } -curve25519-dalek-ng = { git = "https://github.com/sp1-patches/curve25519-dalek-ng", tag = "curve25519_dalek_ng-v4.1.1-patch-v1" } -ed25519-consensus = { git = "https://github.com/sp1-patches/ed25519-consensus", tag = "ed25519_consensus-v2.1.0-patch-v1" } -# For sp1 versions >= 3.3.0 -ecdsa-core = { git = "https://github.com/sp1-patches/signatures", package = "ecdsa", tag = "ecdsa-v0.16.9-patch-v3.3.0" } -secp256k1 = { git = "https://github.com/sp1-patches/rust-secp256k1", tag = "secp256k1-v0.29.0-patch-v3.3.0" } -# For sp1 versions < 3.3.0 -ecdsa-core = { git = "https://github.com/sp1-patches/signatures", package = "ecdsa", tag = "ecdsa-v0.16.9-patch-v1" } -secp256k1 = { git = "https://github.com/sp1-patches/rust-secp256k1", tag = "secp256k1-v0.29.0-patch-v1" } +sha2-v0-10-6 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha2", tag = "patch-sha2-0.10.6-sp1-4.0.0-rc.3" } +sha2-v0-10-8 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha2", tag = "patch-sha2-0.10.8-sp1-4.0.0-rc.3" } +sha3-v0-10-8 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha3", tag = "patch-sha3-0.10.8-sp1-4.0.0-rc.3" } +crypto-bigint = { git = "https://github.com/sp1-patches/RustCrypto-bigint", tag = "patch-0.5.5-sp1-4.0.0-rc.3" } +tiny-keccak = { git = "https://github.com/sp1-patches/tiny-keccak", tag = "patch-2.0.2-sp1-4.0.0-rc.3 } +curve25519-dalek = { git = "https://github.com/sp1-patches/curve25519-dalek", tag = "patch-4.1.3-sp1-4.0.0-rc.3" } +curve25519-dalek-ng = { git = "https://github.com/sp1-patches/curve25519-dalek-ng", tag = "patch-4.1.1-sp1-4.0.0-rc.3" } +ecdsa-core = { git = "https://github.com/sp1-patches/signatures", package = "ecdsa", tag = "patch-0.16.9-sp1-4.0.0-rc.3" } +secp256k1 = { git = "https://github.com/sp1-patches/rust-secp256k1", tag = "patch-0.29.1-sp1-4.0.0"-rc.3 } +substrate-bn = { git = "https://github.com/sp1-patches/bn", tag = "patch-0.6.0-sp1-4.0.0-rc.3" } +bls12_381 = { git = "https://github.com/sp1-patches/bls12_381", tag = "patch-0.8.0-sp1-4.0.0-rc.3", features = ["groups"] } +rsa = { git = "https://github.com/sp1-patches/RustCrypto-RSA/", tag = "patch-0.9.6-sp1-4.0.0-rc.3" } ``` If you are patching a crate from Github instead of from crates.io, you need to specify the @@ -81,13 +65,9 @@ Apply the following patches based on what crates are in your dependencies. - `ed25519-consensus` ```toml - ed25519-consensus = { git = "https://github.com/sp1-patches/ed25519-consensus", tag = "ed25519_consensus-v2.1.0-patch-v1" } + curve25519-dalek-ng = { git = "https://github.com/sp1-patches/curve25519-dalek-ng", tag = "patch-4.1.1-sp1-4.0.0-rc.3" } ``` - Note: The curve operations for Ed25519 occur mainly inside of `curve25519-dalek-ng`, but the crate also exposes - a `u32_backend` feature flag which accelerates signature recovery by 10% over the default `u64_backend`, which is why - `ed25519-consensus` is patched rather than `ed25519-dalek`. - - `ed25519-dalek` If using `ed25519-dalek` version `2.1`, you can patch it with the following: @@ -96,28 +76,6 @@ Apply the following patches based on what crates are in your dependencies. curve25519-dalek = { git = "https://github.com/sp1-patches/curve25519-dalek", tag = "curve25519_dalek-v4.1.3-patch-v1" } ``` - If using `ed25519-dalek` version `1.0.1`, you can patch it with the following: - - ```toml - ed25519-dalek = { git = "https://github.com/sp1-patches/ed25519-dalek", tag = "ed25519_dalek-v1.0.1-patch-v1" } - ``` - - Note: We need to patch the underlying Ed25519 curve operations in the `curve25519-dalek` crate. `ed25519-dalek` - version `2.1` uses `curve25519-dalek` version `4.1.3`, while `1.0.1` uses `3.2.0`. For version `2.1`, we patch - `curve25519-dalek` directly, while for version `1.0.1`, we patch `ed25519-dalek`. - -- `curve25519-dalek` - - ```toml - curve25519-dalek = { git = "https://github.com/sp1-patches/curve25519-dalek", tag = "curve25519_dalek-v4.1.3-patch-v1" } - ``` - -- `curve25519-dalek-ng` - - ```toml - curve25519-dalek-ng = { git = "https://github.com/sp1-patches/curve25519-dalek-ng", tag = "curve25519_dalek_ng-v4.1.1-patch-v1" } - ``` - ## Secp256k1 Acceleration To accelerate Secp256k1 operations, you'll need to patch `k256` or `secp256k1` depending on your usage. @@ -140,8 +98,11 @@ Apply the following patches based on what crates are in your dependencies. ```toml secp256k1 = { git = "https://github.com/sp1-patches/rust-secp256k1", tag = "secp256k1-v0.29.0-patch-v1" } + ecdsa-core = { git = "https://github.com/sp1-patches/signatures", package = "ecdsa", tag = "patch-0.16.9-sp1-4.0.0-rc.3 } ``` +While `secp256k1` doesnt usually rely on `ecdsa-core` the patched version does, so you must patch it as well. + ## BN254 Acceleration To accelerate BN254 (Also known as BN128 and Alt-BN128), you will need to patch the `substrate-bn` crate. diff --git a/book/docs/writing-programs/setup.md b/book/docs/writing-programs/setup.md index 42ab5383bc..bca2706f69 100644 --- a/book/docs/writing-programs/setup.md +++ b/book/docs/writing-programs/setup.md @@ -32,7 +32,7 @@ name = "program" edition = "2021" [dependencies] -sp1-zkvm = "3.0.0" +sp1-zkvm = "4.0.0-rc.8" ``` The `sp1-zkvm` crate includes necessary utilities for your program, including handling inputs and outputs, diff --git a/book/sidebars.ts b/book/sidebars.ts index b2c0ce6812..c6248ee9b5 100644 --- a/book/sidebars.ts +++ b/book/sidebars.ts @@ -1,4 +1,4 @@ -import type {SidebarsConfig} from '@docusaurus/plugin-content-docs'; +import type { SidebarsConfig } from "@docusaurus/plugin-content-docs"; // This runs in Node.js - Don't use client-side code here (browser APIs, JSX...) @@ -16,34 +16,34 @@ const sidebars: SidebarsConfig = { docs: [ "introduction", { - type: 'category', - label: 'Getting Started', + type: "category", + label: "Getting Started", items: [ - 'getting-started/install', - 'getting-started/quickstart', - 'getting-started/hardware-requirements', - 'getting-started/project-template' + "getting-started/install", + "getting-started/quickstart", + "getting-started/hardware-requirements", + "getting-started/project-template", ], collapsed: false, }, { - type: 'category', - label: 'Writing Programs', + type: "category", + label: "Writing Programs", items: [ - 'writing-programs/basics', - 'writing-programs/compiling', - 'writing-programs/cycle-tracking', - 'writing-programs/inputs-and-outputs', - 'writing-programs/patched-crates', - 'writing-programs/precompiles', - 'writing-programs/proof-aggregation', - 'writing-programs/setup' + "writing-programs/basics", + "writing-programs/compiling", + "writing-programs/cycle-tracking", + "writing-programs/inputs-and-outputs", + "writing-programs/patched-crates", + "writing-programs/precompiles", + "writing-programs/proof-aggregation", + "writing-programs/setup", ], collapsed: true, }, { - type: 'category', - label: 'Generating Proofs', + type: "category", + label: "Generating Proofs", items: [ "generating-proofs/basics", "generating-proofs/setup", @@ -51,23 +51,23 @@ const sidebars: SidebarsConfig = { "generating-proofs/recommended-workflow", "generating-proofs/sp1-sdk-faq", { - type: 'category', - label: 'Hardware Acceleration', - link: { type: 'doc', id: 'generating-proofs/hardware-acceleration' }, + type: "category", + label: "Hardware Acceleration", + link: { type: "doc", id: "generating-proofs/hardware-acceleration" }, items: [ "generating-proofs/hardware-acceleration", "generating-proofs/hardware-acceleration/avx", - "generating-proofs/hardware-acceleration/cuda" + "generating-proofs/hardware-acceleration/cuda", ], }, { - type: 'category', - label: 'Prover Network', - link: { type: 'doc', id: 'generating-proofs/prover-network' }, + type: "category", + label: "Prover Network", + link: { type: "doc", id: "generating-proofs/prover-network" }, items: [ "generating-proofs/prover-network/key-setup", "generating-proofs/prover-network/usage", - "generating-proofs/prover-network/versions" + "generating-proofs/prover-network/versions", ], }, "generating-proofs/advanced", @@ -75,33 +75,33 @@ const sidebars: SidebarsConfig = { collapsed: true, }, { - type: 'category', - label: 'Verification', + type: "category", + label: "Verification", items: [ - 'verification/off-chain-verification', + "verification/off-chain-verification", { - type: 'category', - label: 'On-Chain Verification', + type: "category", + label: "On-Chain Verification", items: [ "verification/onchain/getting-started", "verification/onchain/contract-addresses", - "verification/onchain/solidity-sdk" + "verification/onchain/solidity-sdk", ], }, - ] + ], }, { - type: 'category', - label: 'Developers', + type: "category", + label: "Developers", items: [ "developers/common-issues", "developers/usage-in-ci", "developers/building-circuit-artifacts", - "developers/rv32im-specification", - ] + "developers/rv32im-deviations", + ], }, - 'what-is-a-zkvm', - 'why-use-sp1', + "what-is-a-zkvm", + "why-use-sp1", ], }; diff --git a/book/verification/onchain/getting-started.md b/book/verification/onchain/getting-started.md index 834a23dc18..8519d620a8 100644 --- a/book/verification/onchain/getting-started.md +++ b/book/verification/onchain/getting-started.md @@ -29,5 +29,5 @@ You can run the above script with `RUST_LOG=info cargo run --bin groth16_bn254 - If you would like to run the Groth16 or PLONK prover directly without Docker, you must have Go 1.22 installed and enable the `native-gnark` feature in `sp1-sdk`. This path is not recommended and may require additional native dependencies. ```toml -sp1-sdk = { version = "2.0.0", features = ["native-gnark"] } +sp1-sdk = { version = "3.0.0", features = ["native-gnark"] } ``` diff --git a/book/versioned_docs/version-3.4.0/developers/common-issues.md b/book/versioned_docs/version-3.4.0/developers/common-issues.md index 5d0a50e808..5b06ec3b43 100644 --- a/book/versioned_docs/version-3.4.0/developers/common-issues.md +++ b/book/versioned_docs/version-3.4.0/developers/common-issues.md @@ -51,7 +51,7 @@ This is likely due to two different versions of `alloy_sol_types` being used. To ```toml [dependencies] -sp1-sdk = { version = "2.0.0", default-features = false } +sp1-sdk = { version = "3.0.0", default-features = false } ``` This will configure out the `network` feature which will remove the dependency on `alloy_sol_types` and configure out the `NetworkProver`. diff --git a/book/versioned_docs/version-3.4.0/generating-proofs/advanced.mdx b/book/versioned_docs/version-3.4.0/generating-proofs/advanced.mdx index 192ab3cb92..da9e3548ab 100644 --- a/book/versioned_docs/version-3.4.0/generating-proofs/advanced.mdx +++ b/book/versioned_docs/version-3.4.0/generating-proofs/advanced.mdx @@ -47,7 +47,7 @@ RUSTFLAGS='-C target-cpu=native' cargo run --release Currently there is support for AVX512 and NEON SIMD instructions. For NEON, you must also enable the `sp1-sdk` feature `neon` in your script crate's `Cargo.toml` file. ```toml -sp1-sdk = { version = "2.0.0", features = ["neon"] } +sp1-sdk = { version = "3.0.0", features = ["neon"] } ``` ## Performance diff --git a/book/versioned_docs/version-3.4.0/generating-proofs/prover-network/versions.md b/book/versioned_docs/version-3.4.0/generating-proofs/prover-network/versions.md index 31503adb80..4190b713fe 100644 --- a/book/versioned_docs/version-3.4.0/generating-proofs/prover-network/versions.md +++ b/book/versioned_docs/version-3.4.0/generating-proofs/prover-network/versions.md @@ -17,14 +17,14 @@ You must switch to a supported version before submitting a proof. To do so, repl ```toml [dependencies] -sp1-zkvm = "2.0.0" +sp1-zkvm = "3.0.0" ``` replace the `sp1-sdk` version in your script's `Cargo.toml`: ```toml [dependencies] -sp1-sdk = "2.0.0" +sp1-sdk = "3.0.0" ``` Re-build your program and script, and then try again. diff --git a/book/versioned_docs/version-3.4.0/writing-programs/compiling.mdx b/book/versioned_docs/version-3.4.0/writing-programs/compiling.mdx index 0041ba8fae..54bf018114 100644 --- a/book/versioned_docs/version-3.4.0/writing-programs/compiling.mdx +++ b/book/versioned_docs/version-3.4.0/writing-programs/compiling.mdx @@ -61,7 +61,7 @@ The path passed in to `build_program` should point to the directory containing t ```toml [build-dependencies] -sp1-build = "2.0.0" +sp1-build = "3.0.0" ``` You will see output like the following from the build script if the program has changed, indicating that the program was rebuilt: diff --git a/book/versioned_docs/version-3.4.0/writing-programs/cycle-tracking.mdx b/book/versioned_docs/version-3.4.0/writing-programs/cycle-tracking.mdx index f29c303a08..0281f5fdc7 100644 --- a/book/versioned_docs/version-3.4.0/writing-programs/cycle-tracking.mdx +++ b/book/versioned_docs/version-3.4.0/writing-programs/cycle-tracking.mdx @@ -14,7 +14,7 @@ Note that to use the macro, you must add the `sp1-derive` crate to your dependen ```toml [dependencies] -sp1-derive = "2.0.0" +sp1-derive = "3.0.0" ``` In the script for proof generation, setup the logger with `utils::setup_logger()` and run the script with `RUST_LOG=info cargo run --release`. You should see the following output: diff --git a/book/versioned_docs/version-3.4.0/writing-programs/setup.md b/book/versioned_docs/version-3.4.0/writing-programs/setup.md index 2cd677f4a9..42ab5383bc 100644 --- a/book/versioned_docs/version-3.4.0/writing-programs/setup.md +++ b/book/versioned_docs/version-3.4.0/writing-programs/setup.md @@ -32,7 +32,7 @@ name = "program" edition = "2021" [dependencies] -sp1-zkvm = "2.0.0" +sp1-zkvm = "3.0.0" ``` The `sp1-zkvm` crate includes necessary utilities for your program, including handling inputs and outputs,