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
| Flag | Short | Default | Description |
|---|---|---|---|
--proof <PROOF> | -p | required | Path 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.
| Flag | Short | Default | Description |
|---|---|---|---|
--proving-key <PROVING_KEY> | -k | cached key | Path to a precomputed STARK proving key. |
--proving-key-snark <PROVING_KEY_SNARK> | -w | cached key | Path 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.
| Flag | Short | Default | Description |
|---|---|---|---|
--output <OUTPUT> | -o | <unix-ts>-proof.bin | File path the wrapped proof is written to. The default name uses the current Unix time in seconds. |
--minimal | -c | false | Wrap into a smaller STARK proof. Mutually exclusive with --pilfflonk and --plonk. |
--pilfflonk | false | Wrap 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. | |
--plonk | false | Wrap 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
| Flag | Short | Default | Description |
|---|---|---|---|
--gpu | -g | false | Use GPU acceleration during the wrapping step. Requires a supported CUDA GPU. Only in the GPU build of cargo-zisk. |
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
| Flag | Short | Default | Description |
|---|---|---|---|
--verbose | -v | off | Increase 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 thezisk-contracts/<family>/ZiskVerifier.solcontract that matches the proof's hash family (blake3,poseidon1orposeidon2).--plonk— a PLONK proof from a self-built Poseidon PLONK key. No PLONK verifier contract ships with the release.