Skip to main content
The jolt new command creates a new Jolt project with a pre-configured workspace structure, including both host and guest code.

Usage

jolt new <NAME> [OPTIONS]

Arguments

NAME
string
required
The name of the project to create. This will be used as:
  • The directory name
  • The package name in Cargo.toml
  • The binary name
jolt new my-zkvm-app

Options

--wasm
boolean
default:"false"
Generate WASM-compatible files and configuration.When enabled, modifies the generated Cargo.toml to include WASM-specific dependencies and build configuration.
jolt new my-app --wasm
-w
boolean
Short form of --wasm.
jolt new my-app -w

Generated Project Structure

Running jolt new my-project creates the following structure:
my-project/
├── Cargo.toml           # Host workspace configuration
├── rust-toolchain.toml  # Rust toolchain specification
├── .gitignore
├── src/
│   └── main.rs         # Host code (prover/verifier)
└── guest/
    ├── Cargo.toml      # Guest package configuration
    └── src/
        ├── lib.rs      # Guest functions with #[jolt::provable]
        └── main.rs     # Guest entry point

Host Code (src/main.rs)

The generated host code demonstrates the complete prove/verify workflow:
use tracing::info;

pub fn main() {
    tracing_subscriber::fmt::init();

    let target_dir = "/tmp/jolt-guest-targets";
    let mut program = guest::compile_fib(target_dir);

    let shared_preprocessing = guest::preprocess_shared_fib(&mut program);

    let prover_preprocessing = guest::preprocess_prover_fib(shared_preprocessing.clone());
    let verifier_setup = prover_preprocessing.generators.to_verifier_setup();
    let verifier_preprocessing =
        guest::preprocess_verifier_fib(shared_preprocessing, verifier_setup);

    let prove_fib = guest::build_prover_fib(program, prover_preprocessing);
    let verify_fib = guest::build_verifier_fib(verifier_preprocessing);

    let (output, proof, io_device) = prove_fib(50);
    let is_valid = verify_fib(50, output, io_device.panic, proof);

    info!("output: {output}");
    info!("valid: {is_valid}");
}

Guest Code (guest/src/lib.rs)

The guest library contains provable functions:
#![cfg_attr(feature = "guest", no_std)]

#[jolt::provable(heap_size = 32768, max_trace_length = 65536)]
fn fib(n: u32) -> u128 {
    let mut a: u128 = 0;
    let mut b: u128 = 1;
    let mut sum: u128;
    for _ in 1..n {
        sum = a + b;
        a = b;
        b = sum;
    }

    b
}

Workspace Configuration

The generated Cargo.toml includes:
[package]
name = "my-project"
version = "0.1.0"
edition = "2021"

[workspace]
members = ["guest"]

[profile.release]
debug = 1
codegen-units = 1
lto = "fat"

[dependencies]
jolt-sdk = { git = "https://github.com/a16z/jolt", features = ["host"] }
guest = { path = "./guest" }
tracing = "0.1"
tracing-subscriber = "0.3"

[patch.crates-io]
ark-ff = { git = "https://github.com/a16z/arkworks-algebra", branch = "dev/twist-shout" }
ark-ec = { git = "https://github.com/a16z/arkworks-algebra", branch = "dev/twist-shout" }
jolt-optimizations = { git = "https://github.com/a16z/arkworks-algebra", branch = "dev/twist-shout" }
ark-serialize = { git = "https://github.com/a16z/arkworks-algebra", branch = "dev/twist-shout" }
ark-bn254 = { git = "https://github.com/a16z/arkworks-algebra", branch = "dev/twist-shout" }

Examples

Create a Standard Project

jolt new fibonacci-prover
cd fibonacci-prover
cargo run --release

Create a WASM Project

jolt new web-prover --wasm
cd web-prover
# Additional WASM setup required

Welcome Screen

When creating a project in an interactive terminal, Jolt displays:
     ██╗ ██████╗ ██╗  ████████╗
     ██║██╔═══██╗██║  ╚══██╔══╝
     ██║██║   ██║██║     ██║   
██   ██║██║   ██║██║     ██║   
╚█████╔╝╚██████╔╝███████╗██║   
 ╚════╝  ╚═════╝ ╚══════╝╚═╝   

Welcome to Jolt.
The most Snarky zkVM. Watch out for the lasso.

--------------------------------------------------------------------------------
OS:             Linux
version:        6.1.0
Host:           dev-machine
CPUs:           16
RAM:            64.00 GB

Next Steps

After creating a project:
  1. Navigate to the project directory:
    cd my-project
    
  2. Build the guest program:
    jolt build --release
    
  3. Run the host to prove and verify:
    cargo run --release
    
  4. View logs (optional):
    RUST_LOG=info cargo run --release
    

jolt build

Build the guest program

CLI Overview

Learn about all CLI commands

Build docs developers (and LLMs) love