Overview
The verification functions allow you to verify that a zero-knowledge proof is valid. The#[jolt::provable] macro generates two verification-related functions:
build_verifier_<function_name>- Creates a reusable verifier closure (recommended)- Internal verification logic used by the verifier closure
Function Signature
build_verifier
Parameters
Preprocessing:preprocessing- Verifier preprocessing data (obtained frompreprocess_verifier_<function_name>)
- Public inputs - The same public inputs provided to the prover
output- The claimed output valuepanic- Whether the program panicked during executiontrusted_advice_commitment(optional) - Commitment to trusted advice, if presentproof- The zero-knowledge proof to verify
Return Value
Returnstrue if the proof is valid, false otherwise.
Verification Process
The verifier:- Reconstructs the expected I/O device state from public inputs and claimed outputs
- Verifies the proof against the preprocessing data
- Checks that all constraints are satisfied
- Returns a boolean indicating validity
Usage Examples
Basic Verification
With Multiple Inputs
With Trusted Advice
Preprocessing Conversion
You can obtain verifier preprocessing from prover preprocessing:Generated From
For a function annotated with#[jolt::provable]:
build_verifier_fib that creates verification closures.
Important Notes
- The verifier is deterministic - the same inputs and proof always produce the same result
- The verifier is thread-safe (
Sync + Send) and can be used concurrently - Verification is typically much faster than proof generation
- The verifier does not need access to trusted advice data, only its commitment
- The
panicflag fromio_device.panicmust be passed to the verifier
Related Functions
prove- Generates proofs that can be verifiedpreprocess- Generates preprocessing data for verificationanalyze- Analyzes execution without generating a proof