Skip to main content

New

Scaffolds a new ZisK workspace from a template, generating a ready-to-build project with wired-up guest, host, and shared (common) crates. Explains the generated directory structure and the role of each crate.

Scaffold a new ZisK workspace from a template. Generates a ready-to-build project with guest, host, and shared crates wired up and configured for the ZisK toolchain.

cargo-zisk new <name>

Examples

Scaffold a default workspace named my-program:

cargo-zisk new my-program

Outputs

Creates a <name>/ directory in the current working directory with the following structure:

hash/
├── Cargo.toml
├── common/ => Crate to define shared types and functionalities
│ ├── Cargo.toml between guest and host crates.
│ └── src/
| └── lib.rs
├── guest/ => The guest program is the one that is executed and
│ ├── Cargo.toml proven inside the zkVM.
│ └── src/
| └── main.rs
└── host/ => The host program is the one that drives execution
├── Cargo.toml and proving from outside the zkVM. It is not proven.
└── src/
└── main.rs

guest/ — the program that runs inside the zkVM. src/main.rs is the guest entry point: it reads private inputs from the input stream, executes the computation, and commits public outputs. It is compiled to a RISC-V ELF by the ZisK toolchain.

host/ — the program that runs on your machine and drives the proving pipeline. src/main.rs prepares inputs, calls the ZisK SDK to execute, prove, and verify the guest.

common/ — shared types and utilities depended on by both guest and host. Defining input and output structs as well as shared logic.