Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/risc0/risc0/llms.txt

Use this file to discover all available pages before exploring further.

RISC Zero offers a fully open-source prover that runs on your local machine. You can generate proofs using your own hardware without relying on external services, which is especially important when working with private data.

When to Use Local Proving

For most use cases, we recommend remote proving using Boundless. However, local proving is essential when:
  • Working with private data: Whoever generates the proofs can see all information involved. With local proof generation, your private data never leaves your machine.
  • Development and testing: Quickly iterate on your zkVM applications without network latency.
  • Custom infrastructure: You need full control over the proving environment.

Supported Hardware

RISC Zero’s proving system supports multiple hardware targets for optimal performance.
The Groth16 prover currently only works on x86 architecture. Apple Silicon is currently unsupported, even via Docker. See issues #1520 and #1749 for more information.
When memory is constrained (less than 10 GB available), you may need to adjust the segment size limit.

CPU Proving

RISC Zero proving runs on nearly any modern CPU (x86 or ARM). This is the easiest to set up and most portable option, though it may not provide the highest performance.
use risc0_zkvm::{default_prover, ExecutorEnv, ProverOpts};
use methods::METHOD_ELF;

fn main() {
    let env = ExecutorEnv::builder()
        .write(&input_data).unwrap()
        .build().unwrap();
    
    // Uses CPU proving by default
    let receipt = default_prover()
        .prove(env, METHOD_ELF)
        .unwrap()
        .receipt;
}

NVIDIA GPU Proving

RISC Zero is highly optimized for NVIDIA GPUs using the CUDA framework. This provides significant performance improvements over CPU proving.
1
Install CUDA Dependencies
2
On Ubuntu, install the necessary CUDA dependencies:
3
# Install driver install tool
sudo apt install ubuntu-drivers-common

# Install NVIDIA drivers
sudo ubuntu-drivers install

# Install build tools
sudo apt install build-essential libssl-dev -y

# Install CUDA toolkit
sudo apt install cuda-toolkit -y
4
Configure Environment
5
Set up your shell environment for CUDA:
6
echo 'export PATH=/usr/local/cuda/bin:$PATH' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc
7
Build with CUDA Support
8
Compile your zkVM application with the cuda feature flag:
9
# Build with CUDA acceleration
RUSTFLAGS="-C target-cpu=native" cargo run -F cuda --release
10
Building the GPU kernels may take several minutes on first run due to JIT compilation. Subsequent runs will be faster.

Apple Metal Proving

On macOS with Apple Silicon (M-series processors), RISC Zero automatically uses the integrated Metal compute cores for acceleration. No additional configuration is required - Metal support is automatically detected and enabled on compatible hardware.
// On Apple Silicon Macs, this automatically uses Metal acceleration
let receipt = default_prover()
    .prove(env, METHOD_ELF)
    .unwrap()
    .receipt;

Basic Proving Example

Here’s a complete example showing local proof generation:
use risc0_zkvm::{default_prover, ExecutorEnv, ProverOpts};
use methods::{METHOD_ELF, METHOD_ID};

fn main() {
    // Prepare input data for the guest program
    let input: u32 = 42;
    
    // Build the executor environment
    let env = ExecutorEnv::builder()
        .write(&input).unwrap()
        .build().unwrap();
    
    // Generate proof using local prover
    let prove_info = default_prover()
        .prove(env, METHOD_ELF)
        .expect("Failed to prove");
    
    // Verify the receipt
    prove_info.receipt
        .verify(METHOD_ID)
        .expect("Verification failed");
    
    println!("Proof generated and verified successfully!");
}

Choosing Receipt Types

Local proving supports different receipt types depending on your needs:
let opts = ProverOpts::composite();
let receipt = default_prover()
    .prove_with_opts(env, METHOD_ELF, &opts)
    .unwrap()
    .receipt;
See Groth16 SNARK Generation for more details on generating blockchain-ready proofs.

Performance Considerations

  • GPU vs CPU: GPU proving can be 10-100x faster than CPU proving, depending on the workload
  • Memory: Ensure sufficient RAM for large computations (minimum 8GB recommended, 16GB+ for complex proofs)
  • Segment Size: Adjust the segment limit if you encounter memory constraints

Next Steps

Remote Proving

Learn about Boundless for scalable remote proving

Proof Composition

Compose multiple proofs together efficiently