New
Scaffolds a new ZisK project 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 project 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 project named my-program:
cargo-zisk new my-program
Outputs
Creates a <name>/ directory in the current working directory with
the following structure:
my-program/
├── 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.
├── build.rs Compiles the guest ELF and embeds it into the host.
└── src/
└── main.rs
The default template has no root Cargo.toml: guest/, host/, and
common/ are independent crates linked by path dependencies.
host/build.rs calls zisk_sdk::build_program("../guest"), so building
the host also compiles the guest.
Environment variables
| Variable | Description |
|---|---|
ZISK_TEMPLATE_BRANCH | Branch of the zisk_template repository to clone. Defaults to feature/blank-template (the blank project shown above). An empty value falls back to the default. |
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.