Skip to main content
Jolt zkVM follows a guest/host architecture that separates the program being proven (guest) from the environment that generates and verifies proofs (host).

Guest Programs

Guest programs are RISC-V binaries that execute inside the zkVM. These programs:
  • Are compiled to RISC-V (RV64IMAC) instruction set
  • Run in a constrained environment with limited memory
  • Cannot directly perform I/O operations
  • Have all execution traced and proven

Compilation Targets

Guest code compiles to different targets depending on the mode:
Feature flags:
  • guest - Compiles for RISC-V target, runs in zkVM
  • guest-std - Enables std library support in guest (uses custom allocator)
  • Without guest features - Compiles for native execution

Memory Layout

Guests have a structured memory space defined by MemoryLayout:
  • Program code - Read-only executable instructions
  • Stack - Grows downward, configurable size
  • Heap - Dynamic allocation, configurable size
  • Input region - Public inputs from host
  • Output region - Results written back to host
  • Advice regions - Trusted and untrusted advice data

Host Environment

The host is the native (x86/ARM) environment that:
  • Compiles guest programs to RISC-V
  • Executes the guest in the tracer/emulator
  • Generates zero-knowledge proofs
  • Verifies proofs
  • Manages memory and I/O

Host-Only Operations

These operations only exist in the host (feature-gated with #[cfg(not(feature = "guest"))]): Program management:
Preprocessing:
Proving:
Verification:

Communication Between Guest and Host

Public Inputs and Outputs

Data flows through serialized memory regions: Host side:
Guest side:

Advice (Non-Deterministic Hints)

Guests can receive additional data via the advice mechanism (see Runtime Advice).

Dual-Mode Execution

Many functions in Jolt support both guest and host execution:
In host mode: Compiles to native code, runs directly In guest mode: Compiles to RISC-V, executes in zkVM

Example: Complete Guest/Host Flow

Guest (guest/src/lib.rs):
Host (src/main.rs):

Key Takeaways

Guest = Proven

Guest code runs in the zkVM and every instruction is traced and proven

Host = Prover/Verifier

Host code manages compilation, proof generation, and verification

Memory Isolation

Guests have isolated memory with explicit I/O regions

Dual Compilation

Same Rust code can compile for both native (host) and RISC-V (guest)