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: not started, auditors: [], date: YYYY-MM-DD }
3// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5// =====================
6
7// goblin.hpp
8#pragma once
9
21
22namespace bb {
23
24class Goblin {
27
28 public:
30 using Fr = bb::fr;
47
50
52
53 fq translation_batching_challenge_v; // challenge for batching the translation polynomials
54 fq evaluation_challenge_x; // challenge for evaluating the translation polynomials
55 std::shared_ptr<Transcript> transcript; // shared between ECCVM and Translator
56
57 std::deque<MergeProof> merge_verification_queue; // queue of merge proofs to be verified
58
59 // In AVM we only use Goblin for a single circuit (it's recursive verifier) whose proof is not required to be
60 // zero-knowledge. While Translator will still expect to find random ops at the beginning to ensure the accumulation
61 // result remains at a fixed row we opt for not adding random ops at the end of the op queue.
62 bool avm_mode = false;
63
69
71 const std::shared_ptr<Transcript>& transcript = std::make_shared<Transcript>());
72
79 void prove_merge(const std::shared_ptr<Transcript>& transcript = std::make_shared<Transcript>(),
80 const MergeSettings merge_settings = MergeSettings::PREPEND);
81
85 void prove_eccvm();
86
91 void prove_translator();
92
99
112 const RecursiveMergeCommitments& merge_commitments,
114 const MergeSettings merge_settings = MergeSettings::PREPEND);
115
127 static bool verify(const GoblinProof& proof,
128 const MergeCommitments& merge_commitments,
129 const std::shared_ptr<Transcript>& transcript,
130 const MergeSettings merge_settings = MergeSettings::PREPEND);
131
142};
143
144} // namespace bb
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
CommitmentKey object over a pairing group 𝔾₁.
Used to construct execution trace representations of elliptic curve operations.
The proving key is responsible for storing the polynomials used by the prover.
The verification key is responsible for storing the commitments to the precomputed (non-witnessk) pol...
ECCVMCircuitBuilder CircuitBuilder
fq evaluation_challenge_x
Definition goblin.hpp:54
void ensure_well_formed_op_queue_for_avm(MegaBuilder &builder) const
Translator requires the op queue to start with a no-op to ensure op queue polynomials are shiftable a...
Definition goblin.cpp:127
GoblinProof goblin_proof
Definition goblin.hpp:51
static bool verify(const GoblinProof &proof, const MergeCommitments &merge_commitments, const std::shared_ptr< Transcript > &transcript, const MergeSettings merge_settings=MergeSettings::PREPEND)
Verify a full Goblin proof (ECCVM, Translator, merge)
Definition goblin.cpp:93
std::pair< PairingPoints, RecursiveTableCommitments > recursively_verify_merge(MegaBuilder &builder, const RecursiveMergeCommitments &merge_commitments, const std::shared_ptr< RecursiveTranscript > &transcript, const MergeSettings merge_settings=MergeSettings::PREPEND)
Recursively verify the next merge proof in the merge verification queue.
Definition goblin.cpp:73
MergeRecursiveVerifier::Commitment RecursiveCommitment
Definition goblin.hpp:45
void prove_eccvm()
Construct an ECCVM proof and the translation polynomial evaluations.
Definition goblin.cpp:32
fq translation_batching_challenge_v
Definition goblin.hpp:53
MergeVerifier::TableCommitments TableCommitments
Definition goblin.hpp:41
void prove_merge(const std::shared_ptr< Transcript > &transcript=std::make_shared< Transcript >(), const MergeSettings merge_settings=MergeSettings::PREPEND)
Construct a merge proof for the goblin ECC ops in the provided circuit; append the proof to the merge...
Definition goblin.cpp:25
std::shared_ptr< OpQueue > op_queue
Definition goblin.hpp:48
void prove_translator()
Construct a translator proof.
Definition goblin.cpp:43
MegaFlavor::Commitment Commitment
Definition goblin.hpp:25
GoblinProof prove(const MergeSettings merge_settings=MergeSettings::PREPEND)
Constuct a full Goblin proof (ECCVM, Translator, merge)
Definition goblin.cpp:52
MergeProver::MergeProof MergeProof
Definition goblin.hpp:36
CommitmentKey< curve::BN254 > commitment_key
Definition goblin.hpp:49
bool avm_mode
Definition goblin.hpp:62
std::deque< MergeProof > merge_verification_queue
Definition goblin.hpp:57
std::shared_ptr< Transcript > transcript
Definition goblin.hpp:55
MergeRecursiveVerifier::TableCommitments RecursiveTableCommitments
Definition goblin.hpp:42
Curve::ScalarField FF
Curve::AffineElement Commitment
std::vector< FF > MergeProof
std::array< Commitment, NUM_WIRES > TableCommitments
TranslatorCircuitBuilder creates a circuit that evaluates the correctness of the evaluation of EccOpQ...
The verification key is responsible for storing the commitments to the precomputed (non-witnessk) pol...
stdlib::recursion::PairingPoints< CircuitBuilder > PairingPoints
AluTraceBuilder builder
Definition alu.test.cpp:123
Entry point for Barretenberg command-line interface.
field< Bn254FrParams > fr
Definition fr.hpp:174
MergeSettings
The MergeSettings define whether an current subtable will be added at the beginning (PREPEND) or at t...
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:66
std::shared_ptr< ECCVMVerificationKey > eccvm_verification_key
Definition goblin.hpp:65
An object storing two EC points that represent the inputs to a pairing check.