Skip to main content

Crate polaris_zk

Crate polaris_zk 

Source

Structs§

ProofBundle
JSON shape of a proof emitted by the prover.
PublicInputs
JSON shape of the public inputs (verifier-visible).
WitnessInput
JSON shape of a witness file (private inputs to the prover).

Constants§

D
TREE_DEPTH
Tree depth — limits the maximum number of leaves to 2^TREE_DEPTH. v1 ships TREE_DEPTH=4 (supports up to 16 leaves) for demo-scale. The schema cap (10,000 leaves per epoch) is wider — production would re-run the SNARK setup with TREE_DEPTH=14 (supports 16,384). Trade-off is named in DEVNOTES/zk-snark.md.

Functions§

build_circuit
Build the circuit: prove “I know the leaf at index i in a Merkle tree whose root is R, where R + epoch_id + context_id + nonce are public.”
build_merkle_tree
Compute the Merkle root over a vector of leaf hashes (each a HashOut). Returns the root as a HashOut and the MerkleTree for proof generation.
compute_epoch_root
Compute the epoch Merkle root from the same leaf set the prover sees. This is the function polaris_web/zk.py’s “compute_root” subcommand shells out to.
prove
Generate a proof. Returns the serialized proof bytes + the public inputs.
verify
Verify a proof. Returns true iff the proof is valid AND the public inputs in the proof match the claimed (epoch_root, epoch_id, context_id, nonce).

Type Aliases§

C
F