Skip to content

Template for creating an SP1 project that can generate a proof of any RISC-V program and verify the proof on-chain.

License

Notifications You must be signed in to change notification settings

nugiexpres/sp1-project-template

 
 

Repository files navigation

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 three main ways to run this project: execute a program, generate a core proof, and generate an EVM-compatible proof.

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 a Core Proof

To generate a core proof for your program:

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

Generate an EVM-Compatible (PLONK) Proof

Warning

You will need at least 128GB RAM to generate the PLONK proof.

To generate a PLONK proof that is small enough to be verified on-chain and verifiable by the EVM:

cd script
cargo run --release --bin evm

This command also generates a fixture that can be used to test the verification of SP1 zkVM proofs inside Solidity.

Retrieve the Verification Key

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

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 setup guide.

To get started, copy the example environment file:

cp .env.example .env

Then, set the SP1_PROVER environment variable to network and set the SP1_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 SP1_PRIVATE_KEY=... cargo run --release --bin evm

About

Template for creating an SP1 project that can generate a proof of any RISC-V program and verify the proof on-chain.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 71.0%
  • Solidity 29.0%