Skip to main content

Documentation Index

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

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

Prerequisites

Before installing SnarkVM, ensure you have Rust installed on your system.

Install Rust

We recommend installing Rust using rustup.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
For macOS users, install additional dependencies:
brew install pkgconf
brew install openssl
SnarkVM requires Rust version 1.88.0 or higher. Verify your installation with:
rustc --version

Install SnarkVM as a Library

SnarkVM is primarily designed to be used as a library in Rust projects.

Add to Cargo.toml

Add SnarkVM to your project’s Cargo.toml:
[dependencies]
snarkvm = "4.4.0"

Using Specific Crates

For more granular control, you can depend on individual crates:
[dependencies]
snarkvm-console = "4.4.0"
snarkvm-circuit = "4.4.0"
snarkvm-synthesizer = "4.4.0"

Available Features

SnarkVM provides several feature flags:
FeatureDescription
defaultIncludes algorithms, circuit, console, ledger, synthesizer, and utilities
fullEnables all crates including curves and fields
wasmWASM bindings for browser support
cudaGPU acceleration for cryptographic operations
asyncAsync support for ledger and synthesizer
serialDisable parallel execution (useful for debugging)
Example with features:
[dependencies]
snarkvm = { version = "4.4.0", features = ["full", "async"] }

Build from Source

To build SnarkVM from source for development or testing:
1

Clone the Repository

git clone --branch staging --single-branch https://github.com/ProvableHQ/snarkVM.git
cd snarkVM
The staging branch contains the latest development code. For stable releases, use the mainnet branch.
2

Build the Library

cargo build --release
This will compile all workspace members. The release build is optimized and may take several minutes.
3

Run Tests

Verify the installation by running tests:
cargo test --release
Synthesizer tests can be slow. To run specific tests:
cargo test -p snarkvm-console -- test_name

Verify Installation

Create a simple program to verify your installation:
1

Create a New Project

cargo new snarkvm-test
cd snarkvm-test
2

Update Cargo.toml

[package]
name = "snarkvm-test"
version = "0.1.0"
edition = "2024"

[dependencies]
snarkvm = "4.4.0"
anyhow = "1.0"
3

Test the Installation

Replace src/main.rs with:
use snarkvm::prelude::*;
use anyhow::Result;

fn main() -> Result<()> {
    // Create a new private key
    let rng = &mut snarkvm_utilities::TestRng::default();
    let private_key = PrivateKey::<MainnetV0>::new(rng)?;
    
    // Derive the address
    let address = Address::try_from(&private_key)?;
    
    println!("Private Key: {}", private_key);
    println!("Address: {}", address);
    
    Ok(())
}
4

Run the Program

cargo run --release
You should see output showing a generated private key and address.

Development Tools

Code Formatting

SnarkVM requires nightly Rust for formatting:
rustup install nightly
cargo +nightly fmt --all

Linting

Run Clippy to catch common mistakes:
cargo clippy --all-targets --all-features -- -D warnings
Clippy warnings are treated as errors in SnarkVM. All code must pass Clippy checks before being committed.

Platform-Specific Notes

If you encounter OpenSSL errors:
export OPENSSL_DIR=/opt/homebrew/opt/openssl@3
export PKG_CONFIG_PATH=/opt/homebrew/opt/openssl@3/lib/pkgconfig

Next Steps

Quick Start Guide

Now that SnarkVM is installed, learn how to build your first application.

Build docs developers (and LLMs) love