Skip to main content

Wrap Proof

Re-encodes an existing STARK (VADCOP) proof into a smaller STARK proof or a pilfflonk final SNARK proof for on-chain verification. Covers the input, proving-key, output, and performance flags and the resulting proof formats.

Generate a final SNARK or minimal-STARK proof from an existing STARK (VADCOP) proof. wrap takes a previously generated full STARK proof file and re-encodes it into a smaller or differently-shaped proof.

cargo-zisk wrap --proof <PROOF> [OPTIONS]

Inputs​

FlagShortDefaultDescription
--proof <PROOF>-prequiredPath to the STARK (VADCOP) proof file to wrap.

Proving keys​

Reuse a precomputed 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-snark <PROVING_KEY_SNARK>-wcached keyPath to a precomputed SNARK proving key. Only consulted when --pilfflonk or --plonk is set. --proving-key-plonk is kept as an alias.

Proof output​

Where the wrapped proof is written and what shape it takes.

FlagShortDefaultDescription
--output <OUTPUT>-o<unix-ts>-proof.binFile path the wrapped proof is written to. The default name uses the current Unix time in seconds.
--minimal-cfalseWrap into a smaller STARK proof. Mutually exclusive with --pilfflonk and --plonk.
--pilfflonkfalseWrap into a pilfflonk final SNARK proof, the one the release SNARK proving key is set up for and the EVM verifier contracts take. Mutually exclusive with --plonk and --minimal.
--plonkfalseWrap into a PLONK final SNARK proof. Advanced: needs a Poseidon SNARK proving key you set up yourself with --final-snark plonk. Mutually exclusive with --pilfflonk and --minimal.

wrap has no default proof type. Without one of these flags it fails with Either --plonk, --pilfflonk or --minimal must be specified. The SNARK flag must name the protocol the SNARK proving key is set up for. See Choosing a proof format.

Performance​

FlagShortDefaultDescription
--gpu-gfalseUse GPU acceleration during the wrapping step. Requires a supported CUDA GPU. Only in the GPU build of cargo-zisk.
pilfflonk wrap memory

On CPU, wrap --pilfflonk has a peak working set of more than 60 GB; without that much RAM or enough swap the kernel OOM-kills the process. Use --gpu on a GPU build. The SNARK proving key it needs is installed with ziskup setup_snark, not by ziskup --provingkey, and is not available on macOS.

Diagnostics​

FlagShortDefaultDescription
--verbose-voffIncrease output verbosity. Repeat it for more detail, up to -vvv.

Examples​

Wrap a STARK proof into a pilfflonk final SNARK proof for on-chain verification:

cargo-zisk wrap --proof ./proofs/proof.bin --pilfflonk --output ./proofs/proof.snark

Wrap into a smaller STARK proof (slower to produce, smaller artifact):

cargo-zisk wrap --proof ./proofs/proof.bin --minimal --output ./proofs/proof.min

Wrap on a GPU using non-default proving keys:

cargo-zisk wrap \
--proof ./proofs/proof.bin \
--pilfflonk \
--proving-key-snark ./keys/my-snark-pk \
--gpu \
--output ./proofs/proof.snark

Outputs​

Writes the wrapped proof to the path specified by --output and logs Final <kind> proof saved to <path>, where <kind> is SNARK or minimal. The exact format depends on the type flag:

  • --minimal — a compact STARK proof with the same verification semantics as the original VADCOP proof.
  • --pilfflonk — a pilfflonk proof verifiable by the zisk-contracts/<family>/ZiskVerifier.sol contract that matches the proof's hash family (blake3, poseidon1 or poseidon2).
  • --plonk — a PLONK proof from a self-built Poseidon PLONK key. No PLONK verifier contract ships with the release.