Skip to main content

Setup

Pre-generates the proving key for a compiled guest ELF, which must exist before prove can produce a proof and must be regenerated whenever the ELF changes. Covers the input, proving-key, and backend flags and where the setup files are cached.

Generate the proving key for a compiled guest ELF. The proving key encodes the arithmetic structure of the program and must exist before cargo-zisk prove can produce a proof. Re-run setup whenever the ELF changes — the key is tied to the exact compiled program.

cargo-zisk setup [OPTIONS]

Inputs

Identify the program to set up.

FlagShortDefaultDescription
--elf <ELF>-eauto-detectedPath to the program ELF. If omitted, the ELF is auto-detected from the current project.

Binary and profile selection

When the ELF is auto-detected (no --elf), these flags choose which build to use, just like selecting a Cargo target. All three are mutually exclusive with --elf.

FlagDefaultDescription
--releaseUse the release-profile build.
--debugdefaultUse the debug-profile build (the default).
--bin <BIN>Select the binary when the crate defines more than one.

Proving keys

Reuse a precomputed key instead of generating one at the default location.

FlagShortDefaultDescription
--proving-key <PROVING_KEY>-kPath to a precomputed proving key.
--proving-key-plonk <PROVING_KEY_PLONK>-wPath to a precomputed PLONK proving key.

Execution backend

The setup needed for proving depends on the executor it will run with.

FlagShortDefaultDescription
--asm-afalseGenerate the setup for the native Assembly emulator (Linux x86_64) rather than the default Rust emulator.
--hintsfalseEnable precompiles hints support for this program. Requires --asm.
--unlock-mapped-memory-ufalseUnlock the memory map for the ROM file. Only applies with --asm.

Diagnostics

FlagShortDefaultDescription
--verbose-voffIncrease output verbosity. Pass -v for info, -vv for debug-level detail.

Examples

Generate the proving key from the auto-detected ELF, the typical post-build invocation:

cargo-zisk setup

Point at a specific ELF outside the current project:

cargo-zisk setup --elf ./dist/guest.elf

Generate the Assembly-backend setup with precompile hint support (the guest must have been built with the matching hints feature):

cargo-zisk setup --asm --hints

Outputs

The setup files are written to the standard cache directory:

~/.zisk/cache/<program_name>/

Downstream commands (cargo-zisk prove, etc.) pick up the setup files from this location automatically. If no setup exists yet for the target ELF, those commands invoke setup themselves on first use; running it explicitly is mainly a way to prewarm the cache so the next call to prove doesn't pay for setup time.