Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
goblin.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: Planned, auditors: [], commit: }
3// external_1: { status: not started, auditors: [], commit: }
4// external_2: { status: not started, auditors: [], commit: }
5// =====================
6
7#pragma once
8
21
22namespace bb {
23
24class Goblin {
27
28 protected:
29 // In AVM we only use Goblin for a single circuit whose proof is not required to be zero-knowledge. While Translator
30 // will still expect to find random ops at the beginning to ensure the accumulation result remains at a fixed row we
31 // opt for not adding random ops at the end of the op queue.
32 bool avm_mode = false;
33
34 public:
36 using Fr = bb::fr;
58
60
62
63 fq translation_batching_challenge_v; // challenge for batching the translation polynomials
64 fq evaluation_challenge_x; // challenge for evaluating the translation polynomials
65 std::shared_ptr<Transcript> transcript; // shared between ECCVM and Translator
66
67 BatchMergeProof batch_merge_proof; // delayed batch merge proof for Chonk
68
74
75 Goblin(const std::shared_ptr<Transcript>& transcript = std::make_shared<Transcript>());
76
82 MergeProof prove_merge(const std::shared_ptr<Transcript>& transcript = std::make_shared<Transcript>()) const;
83
89 void prove_eccvm();
90
95 void prove_translator();
96
103
116 const RecursiveMergeCommitments& merge_commitments,
118
124 void prove_batch_merge();
125
133};
134
135} // namespace bb
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
std::vector< FF > MergeProof
Unified batch verifier for the batch Goblin ECC op queue merge protocol.
typename Curve::ScalarField FF
std::array< Commitment, NUM_WIRES > TableCommitments
Manages ECC operations for the Goblin proving system.
The proving key is responsible for storing the polynomials used by the prover.
ECCVMCircuitBuilder CircuitBuilder
FixedVKAndHash_< PrecomputedEntities< Commitment >, BF, ECCVMHardcodedVKAndHash > VerificationKey
The verification key stores commitments to the precomputed polynomials used by the verifier.
Simple verification key class for fixed-size circuits (ECCVM, Translator, AVM).
Definition flavor.hpp:101
fq evaluation_challenge_x
Definition goblin.hpp:64
GoblinProof goblin_proof
Definition goblin.hpp:61
MergeRecursiveVerifier::Commitment RecursiveCommitment
Definition goblin.hpp:54
MergeProof prove_merge(const std::shared_ptr< Transcript > &transcript=std::make_shared< Transcript >()) const
Construct a single-step merge proof for the most recently merged subtable.
Definition goblin.cpp:28
void prove_eccvm()
Construct an ECCVM proof and IPA opening proof.
Definition goblin.cpp:35
fq translation_batching_challenge_v
Definition goblin.hpp:63
MergeVerifier::TableCommitments TableCommitments
Definition goblin.hpp:49
GoblinProof prove()
Constuct a full Goblin proof (ECCVM, Translator, merge)
Definition goblin.cpp:69
void prove_batch_merge()
Construct a batched merge proof for all subtables accumulated during the IVC.
Definition goblin.cpp:98
MergeRecursiveVerifier::PairingPoints PairingPoints
Definition goblin.hpp:48
BatchMergeRecursiveVerifier::TableCommitments BatchRecursiveTableCommitments
Definition goblin.hpp:51
BatchMergeProof batch_merge_proof
Definition goblin.hpp:67
std::shared_ptr< OpQueue > op_queue
Definition goblin.hpp:59
void prove_translator()
Construct a translator proof.
Definition goblin.cpp:60
MegaFlavor::Commitment Commitment
Definition goblin.hpp:25
MergeProver::MergeProof MergeProof
Definition goblin.hpp:42
bool avm_mode
Definition goblin.hpp:32
BatchMergeProver::MergeProof BatchMergeProof
Definition goblin.hpp:43
std::pair< PairingPoints, RecursiveTableCommitments > recursively_verify_merge(MegaBuilder &builder, const RecursiveMergeCommitments &merge_commitments, const std::shared_ptr< RecursiveTranscript > &transcript)
Recursively verify the most recent single-step merge proof.
std::shared_ptr< Transcript > transcript
Definition goblin.hpp:65
MergeRecursiveVerifier::TableCommitments RecursiveTableCommitments
Definition goblin.hpp:50
std::pair< PairingPoints, BatchRecursiveTableCommitments > recursively_verify_batch_merge(MegaBuilder &builder, const BatchMergeRecursiveVerifier::FF &hash) const
Recursively verify the batched merge proof inside the hiding kernel.
Definition goblin.cpp:115
IPA (inner product argument) commitment scheme class.
Definition ipa.hpp:86
Curve::ScalarField FF
Curve::AffineElement Commitment
std::vector< FF > MergeProof
Verifier for the single-step Goblin ECC op queue merge protocol.
typename Curve::AffineElement Commitment
std::conditional_t< Curve::is_stdlib_type, stdlib::recursion::PairingPoints< Curve >, bb::PairingPoints< Curve > > PairingPoints
std::array< Commitment, NUM_WIRES > TableCommitments
TranslatorCircuitBuilder creates a circuit that evaluates the correctness of the evaluation of EccOpQ...
FixedVKAndHash_< VKEntities< Commitment >, FF, TranslatorHardcodedVKAndHash > VerificationKey
The verification key stores commitments to the precomputed polynomials used by the verifier.
AluTraceBuilder builder
Definition alu.test.cpp:124
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
field< Bn254FrParams > fr
Definition fr.hpp:155
BaseTranscript< FrCodec, bb::crypto::Poseidon2< bb::crypto::Poseidon2Bn254ScalarFieldParams > > NativeTranscript
MegaCircuitBuilder_< field< Bn254FrParams > > MegaCircuitBuilder
BaseTranscript< stdlib::StdlibCodec< stdlib::field_t< MegaCircuitBuilder > >, stdlib::poseidon2< MegaCircuitBuilder > > MegaStdlibTranscript
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
std::shared_ptr< TranslatorVerificationKey > translator_verification_key
Definition goblin.hpp:71
std::shared_ptr< ECCVMVerificationKey > eccvm_verification_key
Definition goblin.hpp:70
Data passed from ECCVM Verifier to Translator Verifier for verification.