Proof Types
There are a few different types of proofs that can be generated by the SP1 zkVM. Each proof type has its own tradeoffs in terms of proof generation time, verification cost, and proof size.
The ProverClient
follows a "builder" pattern that allows you to configure the proof type and other options after creating a ProverClient
and calling prove
on it.
For a full list of options, see the following docs.
Core (Default)
The default prover mode generates a list of STARK proofs that in aggregate have size proportional to the size of the execution. Use this in settings where you don't care about verification cost / proof size.
let client = ProverClient::from_env();
client.prove(&pk, stdin).run().unwrap();
Compressed
The compressed prover mode generates STARK proofs that have constant size. Use this in settings where you care about verification cost / proof size, but not onchain verification. Compressed proofs are also useful because they can be cheaply recursively verified within SP1 itself (see the proof aggregation section).
let client = ProverClient::from_env();
client.prove(&pk, stdin).compressed().run().unwrap();
Groth16 (Recommended)
The Groth16 prover mode generates a SNARK proof that is ~260 bytes large and can be verified onchain for around ~270k gas.
The trusted setup for the Groth16 circuit keys uses the Aztec Ignition ceremony + entropy contributions from members of the Succinct team. If you are uncomfortable with the security assumptions of the ceremony, you can use the PLONK proof type instead.
let client = ProverClient::from_env();
client.prove(&pk, stdin).groth16().run().unwrap();
PLONK
The PLONK prover mode generates a SNARK proof that is ~868 bytes large and can also be verified onchain for around ~300k gas. Plonk proofs take about ~1m30s longer to generate over a compressed proof.
PLONK does not require a trusted setup and reuses contributions from the Aztec Ignition ceremony.
let client = ProverClient::from_env();
client.prove(&pk, stdin).plonk().run().unwrap();