proof_gen 0.4.0

Generates block proofs from zero proof IR.
Documentation
//! This module contains type aliases and custom `Error` definition for
//! convenient proof generation.

use plonky2::{
    field::goldilocks_field::GoldilocksField,
    hash::poseidon::PoseidonHash,
    plonk::{self, config::PoseidonGoldilocksConfig, proof::ProofWithPublicInputs},
};

/// The base field on which statements are being proven.
pub type Field = GoldilocksField;
/// The recursive circuit configuration to be used to shrink and aggregate
/// proofs.
pub type Config = PoseidonGoldilocksConfig;
/// The extension degree of the field used in the proof system.
pub const EXTENSION_DEGREE: usize = 2;

/// A type alias for proofs generated by the zkEVM.
pub type PlonkyProofIntern = ProofWithPublicInputs<Field, Config, EXTENSION_DEGREE>;

pub type Hasher = PoseidonHash;

pub type Hash = <Hasher as plonk::config::Hasher<Field>>::Hash;

/// A type alias for the set of preprocessed circuits necessary to generate
/// succinct block proofs.
pub type AllRecursiveCircuits = evm_arithmetization::fixed_recursive_verifier::AllRecursiveCircuits<
    Field,
    Config,
    EXTENSION_DEGREE,
>;

/// A type alias for the verifier data necessary to verify succinct block
/// proofs.
/// While the prover state [`AllRecursiveCircuits`] can also verify proofs, this
/// [`VerifierData`] is much lighter, allowing anyone to verify block proofs,
/// regardless of the underlying hardware.
pub type VerifierData =
    plonky2::plonk::circuit_data::VerifierCircuitData<Field, Config, EXTENSION_DEGREE>;