Request Proofs
The Succinct Prover Network is currently in testnet. This means things are subject to change or break along the way.
This guide will walk you through requesting proofs on the Succinct Network, from setup to execution.
Prerequisites
Before you begin, ensure you have:
- Installed SP1 (Installation Guide)
- Created an SP1 Project (Quickstart Guide)
- USDC tokens for paying proof fees (from Step 2)
Quickstart
Want to generate your first proof ASAP? Follow these steps:
- Create a new project
cargo prove new fibonacci
- Set up your environment
export SP1_PROVER=network
export NETWORK_PRIVATE_KEY=<YOUR_PRIVATE_KEY>
export NETWORK_RPC_URL=https://rpc.production.succinct.xyz
- Request your proof
cd fibonacci/script
RUST_LOG=info cargo run --release --bin main
Using the SP1 SDK
Setup
The first step to requesting the generation of SP1 proofs on the network is creating a properly configured ProverClient
. This client is used to construct a proof request and submit it to the network.
Option A: ProverClient::from_env
. Creating the client is as simple as calling ProverClient::from_env()
. This function will automatically load the following environment variables:
SP1_PROVER
: The prover to use. This should be set tonetwork
.NETWORK_PRIVATE_KEY
: The private key of the account that will be used to pay for the proof request.NETWORK_RPC_URL
: The RPC URL of the network to use. This should be set tohttps://rpc.production.succinct.xyz
.
use sp1_prover::ProverClient;
let client = ProverClient::from_env().expect("failed to create client");
Option B: ProverClient::network
. You can also create a client by calling ProverClient::network
. This function will also automatically load the same environment variables as ProverClient::from_env
. However, it will also expose additional methods for configuring these options directly on the client.
use sp1_sdk::{ProverClient};
let prover = ProverClient::builder().network()
.private_key("<YOUR_PRIVATE_KEY>")
.rpc_url("https://rpc.production.succinct.xyz")
.build();
Request
Requesting proofs is as simple calling client.prove
and configuring the proof request.
use sp1_sdk::{ProverClient, SP1Stdin, Prover};
let elf = include_elf!("fibonacci");
let stdin = SP1Stdin::new();
let client = ProverClient::builder().network().build();
let (pk, vk) = client.setup(elf);
let builder = client.prove(&pk, &stdin)
.core()
.run();
Invoke the binary using cargo
and set the environment variables:
export SP1_PROVER=network
export NETWORK_PRIVATE_KEY=<YOUR_PRIVATE_KEY>
export NETWORK_RPC_URL=https://rpc.production.succinct.tools
cargo run --release --bin main
The output will look like this:
2025-01-08T01:43:40.903816Z INFO vk verification: true
n: 20
2025-01-08T01:43:45.520140Z INFO Registered program 0x0063663599d710a4f0b5cf9c426677e02c6b4492f9e6f7b2f64044c39759faa6
2025-01-08T01:43:45.522999Z INFO execute: clk = 0 pc = 0x2016e0
2025-01-08T01:43:45.524025Z INFO execute: close time.busy=3.81ms time.idle=5.88µs
2025-01-08T01:43:45.524114Z INFO Requesting proof:
2025-01-08T01:43:45.524127Z INFO ├─ Cycle limit: 9221
2025-01-08T01:43:45.524132Z INFO ├─ Proof mode: Core
2025-01-08T01:43:45.524138Z INFO ├─ Strategy: Hosted
2025-01-08T01:43:45.524143Z INFO ├─ Timeout: 14400 seconds
2025-01-08T01:43:45.524149Z INFO └─ Circuit version: v4.0.0-rc.3
2025-01-08T01:43:47.105244Z INFO Created request 0x7647102964f2c8116637472379dc8d427a4b267089fe961074bc223a7c4833dd in transaction 0x07e846999adf6edcfa885638d23c35b54c3caa2c40be51223ee7d1faef6b1543
2025-01-08T01:43:47.503440Z INFO Proof request assigned, proving...
Successfully generated proof!
2025-01-08T01:44:00.448830Z INFO verify: close time.busy=200ms time.idle=4.04µs
Successfully verified proof!
Common Issues
Insufficient Funds
When requesting proofs, you may encounter errors related to insufficient funds. This happens when your account doesn't have enough USDC to pay for the proof generation.
Error: Insufficient funds for proof request
To resolve this:
- Check your balance on the Succinct Network using the Explorer
- Deposit more funds to your account using the Account UI
- Wait for the deposit transaction to complete before retrying
Invalid Private Key
If you see an error about an invalid private key, ensure that:
- Your private key is properly formatted (starts with "0x" and is 64 characters long)
- The environment variable is correctly set:
export NETWORK_PRIVATE_KEY=0x...
- The account associated with this private key has funds
Network Connection Issues
If you encounter RPC connection errors:
Error: Failed to connect to RPC endpoint
Try the following:
- Verify your internet connection
- Ensure the
NETWORK_RPC_URL
is correct - Check if the Succinct Network status page reports any outages
- Try using a different RPC endpoint if available
Program Registration Failures
When registering your program, you might see:
Error: Failed to register program
Common causes include:
- Invalid ELF binary format
- Program size exceeds limits
- Network connectivity issues
- Insufficient funds for registration
Try rebuilding your project with cargo clean && cargo build --release
before retrying.