Expand description
Verifier logic for the Wormhole circuit.
This module provides the WormholeVerifier type, which allows for the verification of
zero-knowledge proofs generated by the Wormhole circuit.
The typical usage flow involves:
- Initializing the verifier from pre-built circuit data via
WormholeVerifier::new_from_bytes(). - Deserializing a
ProofWithPublicInputs. - Verifying the proof using
WormholeVerifier::verify.
§Example
ⓘ
use qp_wormhole_verifier::{WormholeVerifier, ProofWithPublicInputs, C, D, F};
// Load verifier from pre-serialized bytes
let verifier = WormholeVerifier::new_from_bytes(verifier_bytes, common_bytes)?;
// Deserialize the proof
let proof = ProofWithPublicInputs::<F, C, D>::from_bytes(proof_bytes, &verifier.circuit_data.common)?;
// Verify
verifier.verify(proof)?;Structs§
- Block
Data - Block data (block_hash, block_number) in aggregated proofs.
- Bytes
Digest - A 32-byte digest that can be converted to/from field elements.
- Circuit
Config - Configuration to be used when building a circuit. This defines the shape of the circuit as well as its targeted security level and sub-protocol (e.g. FRI) parameters.
- Private
Batch Public Inputs - Aggregated public inputs from multiple wormhole proofs.
- Proof
With Public Inputs - Public
Batch Public Inputs - Public inputs from a public-batch aggregation proof.
- Public
Circuit Inputs - All of the public inputs required for a single wormhole proof. Supports two outputs (spend + change) from a single input.
- Public
Inputs ByAccount - Exit account data in aggregated proofs.
- Verifier
Circuit Data - Circuit data required by the verifier.
- Verifier
Only Circuit Data - Circuit data required by the verifier only (not the prover).
- Wormhole
Verifier - Verifier for Wormhole circuit proofs.
Constants§
- D
- The extension degree for the field extension (D=2 provides 100-bits of security)
- MAX_
VERIFIER_ ARTIFACT_ BYTES - Maximum size accepted for a serialized verifier artifact, whether loaded from a file or passed as bytes.
- MIN_
LEAF_ SECURITY_ BITS - Minimum acceptable security level (bits) for the canonical leaf circuit config.
Guards against a qp-plonky2 upgrade silently weakening
CircuitConfig::standard_recursion_config()below this floor. - PUBLIC_
INPUTS_ FELTS_ LEN - The total size of the public inputs field element vector. Layout: asset_id(1) + output_amount_1(1) + output_amount_2(1) + volume_fee_bps(1) + nullifier(4) + exit_account_1(4) + exit_account_2(4) + block_hash(4) + block_number(1) + input_amount(1) = 1 + 1 + 1 + 1 + 4 + 4 + 4 + 4 + 1 + 1 = 22
Functions§
- parse_
private_ batch_ public_ inputs - Parse aggregated public inputs from a proof.
- parse_
public_ batch_ public_ inputs - Parse public-batch public inputs from a proof.
- parse_
public_ inputs - Parse public inputs from a proof.
Type Aliases§
- C
- The standard Plonky2 configuration using Poseidon hash over Goldilocks field
- Common
Circuit Data - Type alias for backward compatibility.
- F
- The Goldilocks prime field