Skip to main content

verify_block

Function verify_block 

Source
pub fn verify_block(
    header: &MinaBlockHeaderStableV2,
    verifier_index: &VerifierIndex<Fq>,
    srs: &SRS<Vesta>,
) -> bool
Expand description

Verifies a block’s SNARK proof using the Kimchi proof system.

This function validates that a block header contains a valid zero-knowledge proof by performing two checks:

  1. Accumulator check: Validates the polynomial commitment opening proofs
  2. Proof verification: Verifies the blockchain SNARK proof against the protocol state hash. The blockchain SNARK proves the validity of the protocol state transaction (consensus). Defined in the OCaml codebase at https://github.com/MinaProtocol/mina/tree/compatible/src/lib/blockchain_snark. This function verifies proofs generated by this circuit.

On verification failure, the block data is dumped to a file for debugging purposes.

§Arguments

  • header - The block header containing the protocol state and its proof
  • verifier_index - Pre-computed verification key derived from the Blockchain SNARK
  • srs - Structured Reference String (SRS) for the polynomial commitment scheme

§Returns

true if both the accumulator check and proof verification succeed, false otherwise.