How to generate your first proof on Succinct Network

Samarth SaxenaSamarth Saxena
8 min read

Introduction

If you've been exploring the zero-knowledge proof space recently, you've probably heard about Succinct Network and their SP1 proving system. Maybe you've read about how they're making ZK proofs accessible to regular developers, or seen projects using their technology. But if you're like most developers, you probably haven't actually generated a proof yourself yet.

In this tutorial, I'll show you exactly how to generate your first zero-knowledge proof on Succinct Network using a simple addition program. We'll take two numbers, add them together, and create a cryptographic proof that the computation happened correctly, all using normal Rust code instead of complex circuits.

This is a hands-on, step-by-step guide that gets you from setup to proof generation in about 10 minutes. Let’s get started! If you prefer learning from a video instead, go ahead and watch this tutorial I recorded:

Prerequisites

Before we dive into generating proofs, you'll need a few things set up on your machine. Don't worry, this is the boring part, but it's crucial for everything to work smoothly.

Development Environment: First, make sure you have Rust and Git installed. To check if you already have them, open your terminal and run:

git --version
rustc --version

If you get errors, you'll need to install them. For Rust, head to rustlang.org/tools/install and for Git, go to git-scm.com/downloads. Pretty straightforward stuff.

Wallet Setup (This Part is Critical!): Here's where you need to pay attention. You'll need a wallet account for Succinct's testnet, but here's the crucial part: make sure this account has zero mainnet funds. I'm serious about this one.

If your current account has any ETH or other tokens on mainnet, create a completely new account in MetaMask or whatever wallet you're using. We're dealing with private keys in this tutorial, and you absolutely don't want to risk your actual funds.

Succinct Network Access: You'll need some testnet credits to generate proofs. If you've played around on Succinct's testnet before and earned some credits, perfect. Those will show up in your balance. You can delegate those credits to your new, fresh dev wallet. If you don’t have any credits, you can manually deposit USDC in Succinct Network. You can access the Succinct Dashboard by using this link, connecting your wallet and then clicking on your balance.

That's it for setup. Once you've got Rust, Git, and a clean dev wallet ready, we're good to roll.

Project Structure

Instead of building everything from scratch, I've created a GitHub repository with all the code we need. This lets us focus on understanding how Succinct Network works rather than wrestling with boilerplate setup.

The repository contains a simple addition program that takes two numbers, adds them together, and generates a zero-knowledge proof of the computation. Here's what we're working with:

The Core Files: We'll be focusing on four main files that handle different parts of the proof generation process:

program/src/main.rs - This is our actual program that does the addition. It reads two numbers, adds them together, and outputs the sum. Super simple, but it demonstrates the core concept of proving program execution.

script/src/main.rs - This is the script that orchestrates everything. It takes our program, sets up the proving environment, and handles communication with Succinct Network. This is where the magic happens.

.env.example - Contains the environment variables we need to configure. We'll copy this to a .env file and add our private key and other settings.

build.rs - A build script that compiles our program with the right arguments. If you don't specify input numbers, it defaults to adding 5 and 7.

Supporting Files: There's also lib/src/lib.rs which defines the input/output structure for our program. This becomes important later when you want to verify proofs on Ethereum, but we won't dive into that today.

The beauty of this setup is that it's modular. You can swap out the addition program for any Rust code you want to prove, and the rest of the infrastructure stays the same. Let's get this code and start configuring it.

Environment Setup

Now let's get our hands dirty with the actual setup. First, clone the repository and navigate into it:

bashgit clone [repository-url]
cd succinct-addition-tutorial

Configuring Environment Variables: The most important step is setting up our .env file. Copy the example .env.example file and paste it into a new .env file in the same directory.

Open the .env file and you'll see three variables that need attention:

SP1_PROVER=network
NETWORK_RPC_URL=https://rpc.succinct.xyz/
PRIVATE_KEY=your_private_key_here

The first two values stay exactly as they are - SP1_PROVER=network tells the system to use Succinct Network instead of generating proofs locally, and the RPC URL points to Succinct's network.

The Private Key Setup : For the PRIVATE_KEY field, you need to grab the private key from your dev account (the one that has zero mainnet funds). I'm repeating this because it's that important.

Quick Verification: Before we move on, double-check that your dev account shows up on Succinct's explorer at /explorer/account. If you've delegated credits from your main account, you should see a balance there. If not, you might need to set up delegation first.

That's it for environment setup. The .env file handles all the configuration we need, and now our script knows how to communicate with Succinct Network using your dev account.

Execution and Proof Generation

Here's where things get interesting. Succinct Network gives you two options: you can either just execute your program to see the output, or you can generate a full zero-knowledge proof of the execution. Let's try both to understand the difference.

Simple Execution First: Let's start by just running our addition program to make sure everything works. The command for execution is:

RUST_LOG=info cargo run --release -- --execute

The RUST_LOG=info part shows us what's happening behind the scenes, and --execute tells the system we just want to run the program without generating a proof.

When you run this, you'll see the build process happen (this takes a bit the first time), and then you'll get output showing the program reading the values (5 and 7 by default), performing the addition, and outputting the sum. The logs will show something like "a is equal to 5, b is equal to 7" and verify the computation worked correctly.

This is just normal program execution. No cryptography, no proofs, just your code running and showing results.

Generating the Actual Proof: Now for the real deal. To generate a zero-knowledge proof of our program's execution, we use:

RUST_LOG=info cargo run --release -- --prove

The key difference is --prove instead of --execute. This command takes our program, our inputs, and sends everything to Succinct Network to generate a cryptographic proof that the computation happened correctly.

You'll see more detailed output this time - gas estimates, request IDs, transaction IDs, and eventually a confirmation that the proof was generated and verified successfully. The network assigns your request to a prover, generates the proof, and returns both the proof and verification.

The beauty here is that both commands run the exact same program logic, the only difference is whether we're just executing or creating a verifiable proof of that execution.

Seeing Your Proof on Succinct Explorer

Once your proof generation completes successfully, you'll get a request ID in your terminal output. This is your proof's unique identifier on Succinct Network, and we can use it to see everything that happened during the proving process.

Finding Your Proof: Copy the request ID from your terminal - it'll look something like a long string of characters.

Head over to Succinct's explorer and paste this ID into the search bar. When you navigate to your proof's page, you'll see a detailed breakdown of what happened. The explorer shows you the status, the address that requested the proof (your dev account), timing information, and technical details about the proof generation process. A successful proof page tells you several important things: your program executed correctly, a cryptographic proof was generated that anyone can verify, and the entire process was recorded on Succinct Network. You can see which prover handled your request, how long it took, and even gas costs associated with the proof generation.

This is the moment where it all clicks - you've just created a zero-knowledge proof that demonstrates your program ran correctly without revealing the actual computation details. Anyone can verify this proof without re-running your program or knowing your private inputs.

The Bigger Picture: While our addition example is simple, this same workflow applies to any Rust program you want to prove. Whether you're building a complex financial calculation, a game state transition, or verifying AI model outputs, the process remains the same: write normal code, run it through Succinct Network, and get back a verifiable proof.

The explorer serves as your proof of concept (literally) that this whole zero-knowledge thing actually works in practice, not just in theory.

Conclusion

And there you have it - you've successfully generated your first zero-knowledge proof on Succinct Network! What started as a simple addition program is now a cryptographically verified computation that anyone can validate without seeing your original inputs or re-running the code.

This same workflow applies to any Rust program you want to prove - write your logic in normal code, send it to Succinct Network, and get back a verifiable proof. No circuit writing, no cryptography PhD required, just the programming languages you already know.

Thank you so much for reading to the end! I hope you enjoyed this tutorial and learned something new. Until the next one 🫡

0
Subscribe to my newsletter

Read articles from Samarth Saxena directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Samarth Saxena
Samarth Saxena

I am a Web3 Developer and Technical Writer from India. I love to write about the things I learn and understand. I believe that being serious is not required as long as one is sincere. I thus tend to have fun in everything that I do.