Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::ChonkVerifier< IsRecursive > Class Template Reference

Verifier for Chonk IVC proofs (both native and recursive). More...

#include <chonk_verifier.hpp>

Classes

struct  ReductionResult
 Result of Chonk verification reduction (recursive mode only) More...
 

Public Types

using Output = std::conditional_t< IsRecursive, ReductionResult, bool >
 
using VKAndHash = typename HidingKernelVerifier::VKAndHash
 
using VK = typename HidingKernelVerifier::VerificationKey
 
using Commitment = typename HidingKernelVerifier::Commitment
 
using Proof = std::conditional_t< IsRecursive, ChonkStdlibProof, ChonkProof >
 

Public Member Functions

 ChonkVerifier (const std::shared_ptr< VKAndHash > &vk_and_hash)
 
Output verify (const Proof &proof)
 Verify a Chonk proof.
 
ChonkVerifier< false >::Output verify (const Proof &proof)
 Verifies a Chonk IVC proof (Native specialization).
 
ChonkVerifier< true >::Output verify (const Proof &proof)
 Verifies a Chonk IVC proof in-circuit.
 

Private Types

using Builder = std::conditional_t< IsRecursive, UltraCircuitBuilder, void >
 
using HidingKernelVerifier = std::conditional_t< IsRecursive, bb::MegaZKRecursiveVerifier, bb::MegaZKVerifier >
 
using GoblinVerifier = std::conditional_t< IsRecursive, bb::GoblinRecursiveVerifier, bb::GoblinVerifier >
 
using Transcript = typename GoblinVerifier::Transcript
 
using GoblinReductionResult = typename GoblinVerifier::ReductionResult
 
using HidingKernelIO = std::conditional_t< IsRecursive, stdlib::recursion::honk::HidingKernelIO< Builder >, bb::HidingKernelIO >
 
using PairingPoints = typename GoblinVerifier::ReductionResult::PairingPoints
 
using IPAClaim = typename GoblinVerifier::ReductionResult::IPAClaim
 
using IPAProof = typename GoblinVerifier::ReductionResult::IPAProof
 
using MergeCommitments = typename GoblinVerifier::MergeVerifier::InputCommitments
 

Private Attributes

std::shared_ptr< VKAndHashvk_and_hash
 
std::shared_ptr< Transcripttranscript
 

Static Private Attributes

static constexpr size_t NUM_PAIRING_POINTS = 4
 

Detailed Description

template<bool IsRecursive>
class bb::ChonkVerifier< IsRecursive >

Verifier for Chonk IVC proofs (both native and recursive).

Consists of:

  1. MegaZK proof of the hiding kernel
  2. Goblin proof (Merge + ECCVM + Translator) - note: IPA is NOT verified here in recursive mode

The hiding kernel proof is verified first to extract ECC op queue commitments, which are then used as inputs to Goblin verification. Databus consistency is checked between the kernel's return data and calldata commitments.

In recursive mode: Returns an Output containing deferred verification data: pairing points (BN254) and an IPA claim (Grumpkin). Pairing points are aggregated at each rollup level and verified on L1. IPA claims are carried in RollupIO through rollup levels, accumulated via IPA::accumulate, and verified in-circuit at root rollup via IPA::full_verify_recursive.

In native mode: Performs all verification including pairing check and IPA verification, returns bool.

Recursive mode uses Ultra arithmetization, as all ECC ops have to be performed in-circuit.

Definition at line 43 of file chonk_verifier.hpp.

Member Typedef Documentation

◆ Builder

template<bool IsRecursive>
using bb::ChonkVerifier< IsRecursive >::Builder = std::conditional_t<IsRecursive, UltraCircuitBuilder, void>
private

Definition at line 45 of file chonk_verifier.hpp.

◆ Commitment

template<bool IsRecursive>
using bb::ChonkVerifier< IsRecursive >::Commitment = typename HidingKernelVerifier::Commitment

Definition at line 75 of file chonk_verifier.hpp.

◆ GoblinReductionResult

template<bool IsRecursive>
using bb::ChonkVerifier< IsRecursive >::GoblinReductionResult = typename GoblinVerifier::ReductionResult
private

Definition at line 49 of file chonk_verifier.hpp.

◆ GoblinVerifier

template<bool IsRecursive>
using bb::ChonkVerifier< IsRecursive >::GoblinVerifier = std::conditional_t<IsRecursive, bb::GoblinRecursiveVerifier, bb::GoblinVerifier>
private

Definition at line 47 of file chonk_verifier.hpp.

◆ HidingKernelIO

template<bool IsRecursive>
using bb::ChonkVerifier< IsRecursive >::HidingKernelIO = std::conditional_t<IsRecursive, stdlib::recursion::honk::HidingKernelIO<Builder>, bb::HidingKernelIO>
private

Definition at line 50 of file chonk_verifier.hpp.

◆ HidingKernelVerifier

template<bool IsRecursive>
using bb::ChonkVerifier< IsRecursive >::HidingKernelVerifier = std::conditional_t<IsRecursive, bb::MegaZKRecursiveVerifier, bb::MegaZKVerifier>
private

Definition at line 46 of file chonk_verifier.hpp.

◆ IPAClaim

template<bool IsRecursive>
using bb::ChonkVerifier< IsRecursive >::IPAClaim = typename GoblinVerifier::ReductionResult::IPAClaim
private

Definition at line 53 of file chonk_verifier.hpp.

◆ IPAProof

template<bool IsRecursive>
using bb::ChonkVerifier< IsRecursive >::IPAProof = typename GoblinVerifier::ReductionResult::IPAProof
private

Definition at line 54 of file chonk_verifier.hpp.

◆ MergeCommitments

template<bool IsRecursive>
using bb::ChonkVerifier< IsRecursive >::MergeCommitments = typename GoblinVerifier::MergeVerifier::InputCommitments
private

Definition at line 55 of file chonk_verifier.hpp.

◆ Output

template<bool IsRecursive>
using bb::ChonkVerifier< IsRecursive >::Output = std::conditional_t<IsRecursive, ReductionResult, bool>

Definition at line 72 of file chonk_verifier.hpp.

◆ PairingPoints

template<bool IsRecursive>
using bb::ChonkVerifier< IsRecursive >::PairingPoints = typename GoblinVerifier::ReductionResult::PairingPoints
private

Definition at line 52 of file chonk_verifier.hpp.

◆ Proof

template<bool IsRecursive>
using bb::ChonkVerifier< IsRecursive >::Proof = std::conditional_t<IsRecursive, ChonkStdlibProof, ChonkProof>

Definition at line 76 of file chonk_verifier.hpp.

◆ Transcript

template<bool IsRecursive>
using bb::ChonkVerifier< IsRecursive >::Transcript = typename GoblinVerifier::Transcript
private

Definition at line 48 of file chonk_verifier.hpp.

◆ VK

template<bool IsRecursive>
using bb::ChonkVerifier< IsRecursive >::VK = typename HidingKernelVerifier::VerificationKey

Definition at line 74 of file chonk_verifier.hpp.

◆ VKAndHash

template<bool IsRecursive>
using bb::ChonkVerifier< IsRecursive >::VKAndHash = typename HidingKernelVerifier::VKAndHash

Definition at line 73 of file chonk_verifier.hpp.

Constructor & Destructor Documentation

◆ ChonkVerifier()

template<bool IsRecursive>
bb::ChonkVerifier< IsRecursive >::ChonkVerifier ( const std::shared_ptr< VKAndHash > &  vk_and_hash)
inline

Definition at line 78 of file chonk_verifier.hpp.

Member Function Documentation

◆ verify() [1/3]

ChonkVerifier< false >::Output bb::ChonkVerifier< false >::verify ( const Proof proof)

Verifies a Chonk IVC proof (Native specialization).

Definition at line 16 of file chonk_verifier.cpp.

◆ verify() [2/3]

ChonkVerifier< true >::Output bb::ChonkVerifier< true >::verify ( const Proof proof)

Verifies a Chonk IVC proof in-circuit.

Definition at line 67 of file chonk_verifier.cpp.

◆ verify() [3/3]

template<bool IsRecursive>
Output bb::ChonkVerifier< IsRecursive >::verify ( const Proof proof)

Verify a Chonk proof.

Recursive mode (IsRecursive=true): Creates circuit constraints that verify:

  1. MegaZK proof of the hiding kernel
  2. Databus consistency (kernel return data == calldata)
  3. Goblin proof (Merge + ECCVM + Translator) - reduces to pairing points and IPA claim Returns Output (GoblinVerifier::ReductionResult) containing pairing points and IPA claim for deferred verification. Both pairing verification and IPA verification are deferred.

Native mode (IsRecursive=false): Performs full verification including:

  1. MegaZK proof of the hiding kernel
  2. Databus consistency (kernel return data == calldata)
  3. Goblin proof (Merge + ECCVM + Translator) with immediate pairing check
  4. IPA verification Returns bool indicating whether verification succeeded.
Parameters
proofChonk proof (ChonkStdlibProof for recursive, ChonkProof for native mode)
Returns
Output (ReductionResult for recursive, bool for native)

Member Data Documentation

◆ NUM_PAIRING_POINTS

template<bool IsRecursive>
constexpr size_t bb::ChonkVerifier< IsRecursive >::NUM_PAIRING_POINTS = 4
staticconstexprprivate

Definition at line 58 of file chonk_verifier.hpp.

◆ transcript

template<bool IsRecursive>
std::shared_ptr<Transcript> bb::ChonkVerifier< IsRecursive >::transcript
private

Definition at line 111 of file chonk_verifier.hpp.

◆ vk_and_hash

template<bool IsRecursive>
std::shared_ptr<VKAndHash> bb::ChonkVerifier< IsRecursive >::vk_and_hash
private

Definition at line 109 of file chonk_verifier.hpp.


The documentation for this class was generated from the following file: