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#![deny(unsafe_code)]
18
19#[cfg(feature = "cell-profiling")]
20mod context_tree;
21pub mod profiling;
22
23pub mod backend;
24pub mod chip_traits;
25mod circuit;
26#[cfg(feature = "evm-prove")]
27pub mod codec;
28pub mod config;
29pub mod field;
30pub mod hash;
31pub mod keygen;
32pub mod prover;
33pub mod stages;
34#[cfg(test)]
35mod test_fixtures;
36pub mod tracegen;
37pub mod transcript;
38mod utils;
39#[cfg(feature = "evm-prove")]
40pub mod wrapper;
41
42pub use circuit::{compute_dag_onion_commit, StaticCircuitParamsError, StaticVerifierCircuit};
43pub use config::{
44    StaticVerifierShape, STATIC_VERIFIER_LOOKUP_ADVICE_COLS, STATIC_VERIFIER_NUM_ADVICE_COLS,
45};
46pub use halo2_base::halo2_proofs::halo2curves::bn256::Fr;
47pub use keygen::StaticVerifierProvingKey;
48pub use openvm_stark_sdk::config::baby_bear_bn254_poseidon2::{EF as RootEF, F as RootF};
49pub use prover::{Halo2Params, Halo2ProvingMetadata, Halo2ProvingPinning, StaticVerifierProof};
50pub use stages::proof_shape::log_heights_per_air_from_proof;
51#[cfg(feature = "evm-prove")]
52pub use wrapper::{
53    EvmVerifierByteCode, FallbackEvmVerifier, Halo2ParamsReader, Halo2WrapperProvingKey,
54};