Skip to main content

Recommended Workflow

We recommend the following workflow for developing with SP1.

tip

For fast and parallelized proof generation, use the Succinct Prover Network.

Step 1: Iterate on your program with execution only

While iterating on your SP1 program, you should only execute it with the RISC-V runtime. This allows you to verify the correctness of your program and test the SP1Stdin and the SP1PublicValues returned, without having to generate a proof (which can be slow or expensive). If execution succeeds, then proof generation should succeed as well!

Loading...

Note that printing the total number of executed cycles and the full execution report provides helpful insight into proof generation latency and cost—whether for local proving or when using the prover network.

Crate Setup: We recommend keeping the crate that defines the main function (wrapped with the sp1_zkvm::entrypoint! macro) minimal. Most of your business logic should reside in a separate crate (within the same repo/workspace), which can be tested independently and isn't tied to the SP1 zkVM. This allows you to unit test your logic without worrying about the zkvm compilation target and efficiently reuse types between your program crate and the crate responsible for proof generation.

Note: The ProverClient should be initialized once and reused for subsequent proving operations, rather than creating new instances each time. Initialization can be slow, as it involves loading proving parameters and setting up the environment. To share it across tasks, wrap the ProverClient in an Arc.

Step 2: Generate proofs

Once you’ve verified your program works correctly, you can generate proofs for end-to-end testing or production use.

Using the Succinct Prover Network is generally faster, cheaper, and more scalable than local proving, as it parallelizes proof generation across many GPUs. Follow the network docs to get started. Using the prover network only requires adding one environment variable to a standard SP1 proof generation script with the ProverClient.

Local Proof Generation

To generate proofs locally, you can use the sp1_sdk crate, as outlined in the Basics section. By default, the ProverClient generates proofs locally using your CPU. See the hardware requirements for local proving here.