Skip to main content

Request Proofs

warning

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:

  1. Installed SP1 (Installation Guide)
  2. Created an SP1 Project (Quickstart Guide)
  3. USDC tokens for paying proof fees (from Step 2)

Quickstart

Want to generate your first proof ASAP? Follow these steps:

  1. Create a new project
cargo prove new fibonacci
  1. Set up your environment
export SP1_PROVER=network
export NETWORK_PRIVATE_KEY=<YOUR_PRIVATE_KEY>
export NETWORK_RPC_URL=https://rpc.production.succinct.xyz
  1. 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 to network.
  • 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 to https://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:

  1. Check your balance on the Succinct Network using the Explorer
  2. Deposit more funds to your account using the Account UI
  3. 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:

  1. Verify your internet connection
  2. Ensure the NETWORK_RPC_URL is correct
  3. Check if the Succinct Network status page reports any outages
  4. 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.