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

Unified Goblin verifier for both native and recursive verification. More...

#include <goblin_verifier.hpp>

Classes

struct  ReductionResult
 Result of Goblin verification with mode-specific semantics. More...
 

Public Types

using MergeVerifier = MergeVerifier_< Curve >
 
using ECCVMVerifier = ECCVMVerifier_< std::conditional_t< IsRecursive, ECCVMRecursiveFlavor, ECCVMFlavor > >
 
using TranslatorVerifier = TranslatorVerifier_< std::conditional_t< IsRecursive, TranslatorRecursiveFlavor, TranslatorFlavor > >
 
using GoblinProof = std::conditional_t< IsRecursive, GoblinStdlibProof, bb::GoblinProof >
 
using MergeCommitments = typename MergeVerifier::InputCommitments
 
using Transcript = std::conditional_t< IsRecursive, UltraStdlibTranscript, NativeTranscript >
 

Public Member Functions

 GoblinVerifier_ (std::shared_ptr< Transcript > transcript, const GoblinProof &proof, const MergeCommitments &merge_commitments, MergeSettings merge_settings)
 Construct a Goblin verifier.
 
ReductionResult reduce_to_pairing_check_and_ipa_opening ()
 Reduce Goblin proof to pairing check and IPA opening claim.
 

Static Public Attributes

static constexpr bool IsRecursive = Curve::is_stdlib_type
 

Private Attributes

std::shared_ptr< Transcripttranscript
 
GoblinProof proof
 
MergeCommitments merge_commitments
 
MergeSettings merge_settings
 

Detailed Description

template<typename Curve>
class bb::GoblinVerifier_< Curve >

Unified Goblin verifier for both native and recursive verification.

Orchestrates verification of the three Goblin sub-protocols:

  1. Merge protocol - Proves correct concatenation of op queue tables (see MERGE_PROTOCOL.md)
  2. ECCVM verification - Proves correct execution of elliptic curve operations
  3. Translator verification - Proves consistency between BN254 ↔ Grumpkin field element representations

This verifier does NOT perform final verification - it returns reduction results for deferred verification.

Template Parameters
CurveThe BN254 curve type (either curve::BN254 for native or stdlib::bn254<Builder> for recursive)

Definition at line 33 of file goblin_verifier.hpp.

Member Typedef Documentation

◆ ECCVMVerifier

◆ GoblinProof

Definition at line 44 of file goblin_verifier.hpp.

◆ MergeCommitments

template<typename Curve >
using bb::GoblinVerifier_< Curve >::MergeCommitments = typename MergeVerifier::InputCommitments

Definition at line 45 of file goblin_verifier.hpp.

◆ MergeVerifier

template<typename Curve >
using bb::GoblinVerifier_< Curve >::MergeVerifier = MergeVerifier_<Curve>

Definition at line 38 of file goblin_verifier.hpp.

◆ Transcript

◆ TranslatorVerifier

Definition at line 40 of file goblin_verifier.hpp.

Constructor & Destructor Documentation

◆ GoblinVerifier_()

template<typename Curve >
bb::GoblinVerifier_< Curve >::GoblinVerifier_ ( std::shared_ptr< Transcript transcript,
const GoblinProof proof,
const MergeCommitments merge_commitments,
MergeSettings  merge_settings 
)
inline

Construct a Goblin verifier.

Parameters
transcriptShared transcript for Fiat-Shamir
proofThe complete Goblin proof containing Merge, ECCVM, IPA, and Translator proofs
merge_commitmentsThe input commitments for the Merge verifier (t and T_prev tables)
merge_settingsHow the ecc op subtable was merged (PREPEND or APPEND)

Definition at line 76 of file goblin_verifier.hpp.

Member Function Documentation

◆ reduce_to_pairing_check_and_ipa_opening()

template<typename Curve >
GoblinVerifier_< Curve >::ReductionResult bb::GoblinVerifier_< Curve >::reduce_to_pairing_check_and_ipa_opening ( )

Reduce Goblin proof to pairing check and IPA opening claim.

Orchestrates three sub-verifiers in sequence: Merge → ECCVM → Translator

  • Merge: reduces to KZG pairing check
  • ECCVM: reduces to IPA opening claim (Grumpkin curve)
  • Translator: reduces to KZG pairing check

Pairing points from Merge and Translator are aggregated. In native mode, performs immediate pairing checks for early rejections. IPA verification is always deferred.

Returns
ReductionResult with all_checks_passed indicating:
  • Native: reduction checks + pairing checks passed, IPA verification still needed
  • Recursive: reduction checks only (pairing and IPA both deferred)
Warning
Caller must verify ipa_claim using ipa_proof (deferred in both modes)

Processes Merge, ECCVM, and Translator sub-proofs sequentially. In native mode, performs immediate pairing checks for early rejections and returns the default ReductionResult on failure.

Definition at line 18 of file goblin_verifier.cpp.

Member Data Documentation

◆ IsRecursive

template<typename Curve >
constexpr bool bb::GoblinVerifier_< Curve >::IsRecursive = Curve::is_stdlib_type
staticconstexpr

Definition at line 35 of file goblin_verifier.hpp.

◆ merge_commitments

template<typename Curve >
MergeCommitments bb::GoblinVerifier_< Curve >::merge_commitments
private

Definition at line 107 of file goblin_verifier.hpp.

◆ merge_settings

template<typename Curve >
MergeSettings bb::GoblinVerifier_< Curve >::merge_settings
private

Definition at line 108 of file goblin_verifier.hpp.

◆ proof

template<typename Curve >
GoblinProof bb::GoblinVerifier_< Curve >::proof
private

Definition at line 106 of file goblin_verifier.hpp.

◆ transcript

template<typename Curve >
std::shared_ptr<Transcript> bb::GoblinVerifier_< Curve >::transcript
private

Definition at line 105 of file goblin_verifier.hpp.


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