From 896ee505e067af91d3a6d9d075b95c9c80cfcd96 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Fri, 31 May 2024 11:26:13 -0700 Subject: [PATCH 1/6] contracts --- book/verifying-proofs/solidity-and-evm.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/book/verifying-proofs/solidity-and-evm.md b/book/verifying-proofs/solidity-and-evm.md index 294023c5b8..425e9f8862 100644 --- a/book/verifying-proofs/solidity-and-evm.md +++ b/book/verifying-proofs/solidity-and-evm.md @@ -44,4 +44,8 @@ fn main() { sp1_sdk::artifacts::export_solidity_plonk_bn254_verifier(contracts_src_dir) .expect("failed to export verifier"); } -``` \ No newline at end of file +``` + +## Installing SP1 Contracts + +To install the SP1 contracts with [Foundry](https://github.com/foundry-rs/foundry), follow the instructions in the [SP1 Contracts README](https://github.com/succinctlabs/sp1-contracts). \ No newline at end of file From 90d97e20c86b8a4f362684dcd367a55e5c4f63f6 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Fri, 31 May 2024 12:50:06 -0700 Subject: [PATCH 2/6] clean --- book/verifying-proofs/solidity-and-evm.md | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/book/verifying-proofs/solidity-and-evm.md b/book/verifying-proofs/solidity-and-evm.md index 425e9f8862..98cd3768a0 100644 --- a/book/verifying-proofs/solidity-and-evm.md +++ b/book/verifying-proofs/solidity-and-evm.md @@ -23,29 +23,6 @@ sp1-sdk = { features = ["plonk"] } You can run the above script with `RUST_LOG=info cargo run --bin plonk_bn254 --release` in `examples/fibonacci/script`. -## Exporting the Verifier Contract - -To export the verifier contract, you can use the export function in the `sp1_sdk` crate. - -### Example - -```rust,noplayground -//! Builds the proving artifacts and exports the solidity verifier. -//! -//! You can run this script using the following command: -//! ```shell -//! RUST_LOG=info cargo run --package fibonacci-script --bin artifacts --release -//! ``` - -use std::path::PathBuf; - -fn main() { - let contracts_src_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../contracts/src"); - sp1_sdk::artifacts::export_solidity_plonk_bn254_verifier(contracts_src_dir) - .expect("failed to export verifier"); -} -``` - ## Installing SP1 Contracts To install the SP1 contracts with [Foundry](https://github.com/foundry-rs/foundry), follow the instructions in the [SP1 Contracts README](https://github.com/succinctlabs/sp1-contracts). \ No newline at end of file From 166e243e342d5c32db3c6d875afd2db75636b789 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Fri, 31 May 2024 14:40:09 -0700 Subject: [PATCH 3/6] fix --- book/verifying-proofs/solidity-and-evm.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/book/verifying-proofs/solidity-and-evm.md b/book/verifying-proofs/solidity-and-evm.md index 98cd3768a0..1efb9b7a89 100644 --- a/book/verifying-proofs/solidity-and-evm.md +++ b/book/verifying-proofs/solidity-and-evm.md @@ -14,7 +14,6 @@ To use PLONK proving & verification locally, enable the `plonk` feature flag in sp1-sdk = { features = ["plonk"] } ``` - ### Example ```rust,noplayground @@ -23,6 +22,6 @@ sp1-sdk = { features = ["plonk"] } You can run the above script with `RUST_LOG=info cargo run --bin plonk_bn254 --release` in `examples/fibonacci/script`. -## Installing SP1 Contracts +## Install SP1 Contracts To install the SP1 contracts with [Foundry](https://github.com/foundry-rs/foundry), follow the instructions in the [SP1 Contracts README](https://github.com/succinctlabs/sp1-contracts). \ No newline at end of file From 5e15886a20306a7f285992762b95513af806eda4 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Fri, 31 May 2024 14:50:50 -0700 Subject: [PATCH 4/6] clean --- book/verifying-proofs/solidity-and-evm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/verifying-proofs/solidity-and-evm.md b/book/verifying-proofs/solidity-and-evm.md index 1efb9b7a89..99ba2cbeb1 100644 --- a/book/verifying-proofs/solidity-and-evm.md +++ b/book/verifying-proofs/solidity-and-evm.md @@ -24,4 +24,4 @@ You can run the above script with `RUST_LOG=info cargo run --bin plonk_bn254 --r ## Install SP1 Contracts -To install the SP1 contracts with [Foundry](https://github.com/foundry-rs/foundry), follow the instructions in the [SP1 Contracts README](https://github.com/succinctlabs/sp1-contracts). \ No newline at end of file +To install the SP1 contracts with [Foundry](https://github.com/foundry-rs/foundry), follow the instructions in the [sp1-contracts repo](https://github.com/succinctlabs/sp1-contracts). \ No newline at end of file From 47b8901b32088e0e26525d7b81098433d18a0749 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Fri, 31 May 2024 15:05:00 -0700 Subject: [PATCH 5/6] try permalink --- book/verifying-proofs/solidity-and-evm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/verifying-proofs/solidity-and-evm.md b/book/verifying-proofs/solidity-and-evm.md index 99ba2cbeb1..599955e71e 100644 --- a/book/verifying-proofs/solidity-and-evm.md +++ b/book/verifying-proofs/solidity-and-evm.md @@ -24,4 +24,4 @@ You can run the above script with `RUST_LOG=info cargo run --bin plonk_bn254 --r ## Install SP1 Contracts -To install the SP1 contracts with [Foundry](https://github.com/foundry-rs/foundry), follow the instructions in the [sp1-contracts repo](https://github.com/succinctlabs/sp1-contracts). \ No newline at end of file +https://github.com/succinctlabs/sp1-contracts/blob/f74ad2963bbb09ac283af8d10152765ab8e07111/README.md?plain=1#L1-L34 \ No newline at end of file From 362e3972a2ee6b1e215f2c30fb93d3729d352bb2 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Fri, 31 May 2024 15:05:59 -0700 Subject: [PATCH 6/6] fix --- book/verifying-proofs/solidity-and-evm.md | 37 ++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/book/verifying-proofs/solidity-and-evm.md b/book/verifying-proofs/solidity-and-evm.md index 599955e71e..e75c988f14 100644 --- a/book/verifying-proofs/solidity-and-evm.md +++ b/book/verifying-proofs/solidity-and-evm.md @@ -24,4 +24,39 @@ You can run the above script with `RUST_LOG=info cargo run --bin plonk_bn254 --r ## Install SP1 Contracts -https://github.com/succinctlabs/sp1-contracts/blob/f74ad2963bbb09ac283af8d10152765ab8e07111/README.md?plain=1#L1-L34 \ No newline at end of file +# SP1 Contracts + +This repository contains the smart contracts for verifying [SP1](https://github.com/succinctlabs/sp1) EVM proofs. + +## Installation + +> [!WARNING] +> [Foundry](https://github.com/foundry-rs/foundry) installs the latest release version initially, but subsequent `forge update` commands will use the `main` branch. This branch is the development branch and should be avoided in favor of tagged releases. The release process matches a specific SP1 version. + +To install the latest release version: + +```bash +forge install succinctlabs/sp1-contracts +``` + +To install a specific version: +```bash +forge install succinctlabs/sp1-contracts@ +``` + +Add `@sp1-contracts/=lib/sp1-contracts/contracts/src/` in `remappings.txt.` + +### Usage + +Once installed, you can use the contracts in the library by importing them: + +```solidity +pragma solidity ^0.8.25; + +import {SP1Verifier} from "@sp1-contracts/SP1Verifier.sol"; + +contract MyContract is SP1Verifier { +} +``` + +For more details on the contracts, refer to the [sp1-contracts](https://github.com/succinctlabs/sp1-contracts) repo. \ No newline at end of file