Skip to main content

Crate qp_wormhole_verifier

Crate qp_wormhole_verifier 

Source
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:

  1. Initializing the verifier from pre-built circuit data via WormholeVerifier::new_from_bytes().
  2. Deserializing a ProofWithPublicInputs.
  3. 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§

BlockData
Block data (block_hash, block_number) in aggregated proofs.
BytesDigest
A 32-byte digest that can be converted to/from field elements.
CircuitConfig
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.
PrivateBatchPublicInputs
Aggregated public inputs from multiple wormhole proofs.
ProofWithPublicInputs
PublicBatchPublicInputs
Public inputs from a public-batch aggregation proof.
PublicCircuitInputs
All of the public inputs required for a single wormhole proof. Supports two outputs (spend + change) from a single input.
PublicInputsByAccount
Exit account data in aggregated proofs.
VerifierCircuitData
Circuit data required by the verifier.
VerifierOnlyCircuitData
Circuit data required by the verifier only (not the prover).
WormholeVerifier
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
CommonCircuitData
Type alias for backward compatibility.
F
The Goldilocks prime field