Skip to main content

Overview

The verification functions allow you to verify that a zero-knowledge proof is valid. The #[jolt::provable] macro generates two verification-related functions:
  1. build_verifier_<function_name> - Creates a reusable verifier closure (recommended)
  2. Internal verification logic used by the verifier closure

Function Signature

build_verifier

Parameters

Preprocessing:
  • preprocessing - Verifier preprocessing data (obtained from preprocess_verifier_<function_name>)
Verifier Closure Parameters:
  • Public inputs - The same public inputs provided to the prover
  • output - The claimed output value
  • panic - Whether the program panicked during execution
  • trusted_advice_commitment (optional) - Commitment to trusted advice, if present
  • proof - The zero-knowledge proof to verify

Return Value

Returns true if the proof is valid, false otherwise.

Verification Process

The verifier:
  1. Reconstructs the expected I/O device state from public inputs and claimed outputs
  2. Verifies the proof against the preprocessing data
  3. Checks that all constraints are satisfied
  4. 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]:
The macro generates 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 panic flag from io_device.panic must be passed to the verifier
  • prove - Generates proofs that can be verified
  • preprocess - Generates preprocessing data for verification
  • analyze - Analyzes execution without generating a proof