Skip to main content

Prove

Generates a cryptographic proof from a guest execution, emitting an aggregated STARK proof by default. Covers the input, proving-key, output, backend, and performance flags, including PLONK output for on-chain verification.

Generate a cryptographic proof from the execution of the guest program. prove re-executes the guest, generates arithmetic constraints over the resulting trace, and writes the proof file to disk. STARK proofs are emitted by default.

cargo-zisk prove [OPTIONS]

Inputs

Identify the program to prove and the data fed to it.

FlagShortDefaultDescription
--elf <ELF>-eauto-detectedPath to the program ELF. If omitted, the ELF is auto-detected from the current project.
--inputs <INPUTS>-iemptyInput fed to the guest. Accepts an inline string literal or a path to a binary file.
--hints <HINTS>Precompiles hints URI for the guest. Requires the ASM backend (--asm).
note

If no program setup files are found at the resolved location, prove invokes setup automatically before generating the proof, you can go straight from build to prove without an explicit setup step.

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

Use a proving key instead of pulling the one at the default location. Pick the right flag for the proof type you intend to generate.

FlagShortDefaultDescription
--proving-key <PROVING_KEY>-kcached keyPath to a precomputed STARK proving key.
--proving-key-plonk <PROVING_KEY_PLONK>-wcached keyPath to a precomputed PLONK proving key. Only consulted when --plonk is set.

Proof Output

Where the proof is written and what shape it takes.

FlagShortDefaultDescription
--output <OUTPUT>-oproofs/proof.binFile path the generated proof is written to.
--minimal-cfalseSmaller STARK proof at the cost of longer proving time. Mutually exclusive with --plonk.
--plonkfalseEmit a PLONK proof. Required for on-chain verification via the EVM verifier. Mutually exclusive with --minimal.
--verify-proof-yfalseVerify the proof immediately after generating it.

Execution Backend

By default prove runs the guest through the portable Rust emulator. On Linux x86_64 you can switch to the native Assembly emulator, which is significantly faster for large programs.

FlagShortDefaultDescription
--asm-afalseUse the native Assembly emulator instead of the default Rust emulator (Linux x86_64).

Performance

Flags that trade off speed against memory or unlock platform-specific acceleration.

FlagShortDefaultDescription
--gpu-gfalseUse GPU acceleration during proof generation. Requires a supported CUDA GPU.
--minimal-memory-mfalseReduce memory footprint during proving at the cost of speed.
--max-witness-stored <MAX_WITNESS_STORED>-xMaximum memory in bytes for witness storage during proving. Lowering this trades proving time for memory.
--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 an aggregated STARK proof from the auto-detected ELF and an input — the simplest invocation:

cargo-zisk prove --inputs ./inputs/data.bin

Generate a proof for a binary input file and write it to a specific path:

cargo-zisk prove --inputs ./inputs/data.bin --output ./proofs/my-proof.bin

Generate a PLONK proof for on-chain verification via the EVM verifier:

cargo-zisk prove --inputs ./inputs/data.bin --plonk

Generate a smaller STARK proof (slower to produce):

cargo-zisk prove --inputs ./inputs/data.bin --minimal

Prove on a GPU:

cargo-zisk prove --inputs ./inputs/data.bin --gpu

Cap witness memory at 4 GiB and reduce overall memory footprint on a small host:

cargo-zisk prove --inputs ./inputs/data.bin --minimal-memory --max-witness-stored 4294967296

Outputs

cargo-zisk prove forwards the guest's stdout to your terminal as it runs, then writes the resulting proof to the path specified by --output (default ./proof.bin).