Proof format and keys
The byte layout zisk-verifier reads, the release keys compiled
into the crate, and the trust model: which two keys a verification
must pin, and why the key a proof carries is never used.
Proof format
The crate reads the flat layout cargo-zisk prove saves, as
little-endian u64 words:
[minimal][n_publics][publics][proof][vadcop_final_vk(4)][hash_tag]
A file may end with the execution's seed, as
[seed(4)][SEED_TRAILER_TAG]. The seed is unauthenticated metadata:
decode_saved reads it and verify_saved ignores it.
verify_saved_words, which guests call, refuses it, so a guest sees
one encoding per proof.
See Proof file format
for every field. SNARK files (ZISKPLNK) are not read by this crate.
Release keys and trust model
The crate's keys module holds the keys of this release's setup, one
per hash family and stage. A vadcop_final key is the root of a
stage's constant tree. It is shared by every ZisK program, so it
identifies the prover, not the program.
Verification needs two things you trust, never values read off the proof:
| Key | Pins | Where it comes from |
|---|---|---|
| Setup key | That a genuine ZisK prover produced the proof. | verify_saved picks the release key with vadcop_vk(hash, compressed). The proof only chooses which one. |
| Program VK | Which program ran. | Your trusted ELF: GuestProgram::vk(), or a published 4-word file. |
A proof checked only against the setup key proves that some ZisK
program produced those outputs. Always pin the program too, either
with expected_program_vk or by checking Verified::program_vk.
The key the proof carries (claimed_vadcop_vk) is never used.
Before the STARK runs, the crate checks the proof's shape, that its
publics are canonical, the leaf flag, the program VK, that leaf
outputs fit in u32, and the proof length.
pilfflonk_vkey_digest pins the release's pilfflonk key: the
digest is keccak256 of the rest of the key. The SDK uses it to
accept a pilfflonk proof's carried key only when it is the release's.