Skip to content

Latest commit

 

History

History
89 lines (57 loc) · 2.48 KB

README.md

File metadata and controls

89 lines (57 loc) · 2.48 KB

SP1 Project Template

This is a template for creating an end-to-end SP1 project that can generate a proof of any RISC-V program.

Requirements

Running the Project

There are 3 main ways to run this project: execute a program, generate a core proof, and generate an EVM-compatible proof.

Build the Program

The program is automatically built through script/build.rs when the script is built.

Execute the Program

To run the program without generating a proof:

cd script
cargo run --release -- --execute

This will execute the program and display the output.

Generate an SP1 Core Proof

To generate an SP1 core proof for your program:

cd script
cargo run --release -- --prove

Generate an EVM-Compatible Proof

Warning

You will need at least 16GB RAM to generate a Groth16 or PLONK proof. View the SP1 docs for more information.

Generating a proof that is cheap to verify on the EVM (e.g. Groth16 or PLONK) is more intensive than generating a core proof.

To generate a Groth16 proof:

cd script
cargo run --release --bin evm -- --system groth16

To generate a PLONK proof:

cargo run --release --bin evm -- --system plonk

These commands will also generate fixtures that can be used to test the verification of SP1 proofs inside Solidity.

Retrieve the Verification Key

To retrieve your programVKey for your on-chain contract, run the following command in script:

cargo run --release --bin vkey

Using the Prover Network

We highly recommend using the Succinct Prover Network for any non-trivial programs or benchmarking purposes. For more information, see the key setup guide to get started.

To get started, copy the example environment file:

cp .env.example .env

Then, set the SP1_PROVER environment variable to network and set the NETWORK_PRIVATE_KEY environment variable to your whitelisted private key.

For example, to generate an EVM-compatible proof using the prover network, run the following command:

SP1_PROVER=network NETWORK_PRIVATE_KEY=... cargo run --release --bin evm