> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/a16z/jolt/llms.txt
> Use this file to discover all available pages before exploring further.

# jolt new

> Create a new Jolt zkVM project

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

## Usage

```bash theme={null}
jolt new <NAME> [OPTIONS]
```

## Arguments

<ParamField path="NAME" type="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

  ```bash theme={null}
  jolt new my-zkvm-app
  ```
</ParamField>

## Options

<ParamField path="--wasm" type="boolean" default="false">
  Generate WASM-compatible files and configuration.

  When enabled, modifies the generated `Cargo.toml` to include WASM-specific dependencies and build configuration.

  ```bash theme={null}
  jolt new my-app --wasm
  ```
</ParamField>

<ParamField path="-w" type="boolean">
  Short form of `--wasm`.

  ```bash theme={null}
  jolt new my-app -w
  ```
</ParamField>

## 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:

```rust theme={null}
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:

```rust theme={null}
#![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:

```toml theme={null}
[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

```bash theme={null}
jolt new fibonacci-prover
cd fibonacci-prover
cargo run --release
```

### Create a WASM Project

```bash theme={null}
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**:
   ```bash theme={null}
   cd my-project
   ```

2. **Build the guest program**:
   ```bash theme={null}
   jolt build --release
   ```

3. **Run the host to prove and verify**:
   ```bash theme={null}
   cargo run --release
   ```

4. **View logs** (optional):
   ```bash theme={null}
   RUST_LOG=info cargo run --release
   ```

## Related Commands

<CardGroup cols={2}>
  <Card title="jolt build" icon="hammer" href="/cli/build">
    Build the guest program
  </Card>

  <Card title="CLI Overview" icon="terminal" href="/cli/overview">
    Learn about all CLI commands
  </Card>
</CardGroup>
