openvm_static_verifier/
lib.rs

1//! Static verifier circuit for OpenVM root STARK proof.
2//! The verifier circuit is implemented using Halo2 via the `halo2-base` eDSL.
3//!
4//! Static means that the circuit hard codes the following and does not allow them to vary as part
5//! of the input:
6//! - The child verifying key, including all system parameters
7//! - The trace heights of the root proof (the static verifier circuit's input) are **fixed**. The
8//!   heights of each AIR are fixed. Consequently the permutation order of AIRs sorted by height is
9//!   fixed.
10//! - The trace heights of the root proof are all nonzero. In other words no AIR in the child
11//!   verifying key is optional.
12//!
13//! End-to-end Halo2 tests that use full [`StaticVerifierCircuit::populate`] (continuations public
14//! values + symbolic DAG cached-commit pin) belong in `openvm-sdk` integration tests; this crate
15//! keeps a lighter FibFixture + KZG roundtrip via
16//! [`StaticVerifierCircuit::populate_verify_stark_constraints`].
17#![forbid(unsafe_code)]
18
19#[cfg(feature = "cell-profiling")]
20mod context_tree;
21pub mod profiling;
22
23mod circuit;
24#[cfg(feature = "evm-prove")]
25pub mod codec;
26pub mod config;
27pub mod field;
28pub mod hash;
29pub mod keygen;
30pub mod prover;
31pub mod stages;
32pub mod transcript;
33mod utils;
34#[cfg(feature = "evm-prove")]
35pub mod wrapper;
36
37pub use circuit::{compute_dag_onion_commit, StaticCircuitParamsError, StaticVerifierCircuit};
38pub use config::{
39    StaticVerifierShape, STATIC_VERIFIER_LOOKUP_ADVICE_COLS, STATIC_VERIFIER_NUM_ADVICE_COLS,
40};
41pub use halo2_base::halo2_proofs::halo2curves::bn256::Fr;
42pub use keygen::StaticVerifierProvingKey;
43pub use openvm_stark_sdk::config::baby_bear_bn254_poseidon2::{EF as RootEF, F as RootF};
44pub use prover::{Halo2Params, Halo2ProvingMetadata, Halo2ProvingPinning, StaticVerifierProof};
45pub use stages::proof_shape::log_heights_per_air_from_proof;
46#[cfg(feature = "evm-prove")]
47pub use wrapper::{
48    EvmVerifierByteCode, FallbackEvmVerifier, Halo2ParamsReader, Halo2WrapperProvingKey,
49};