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
19
20namespace bb {
21
22class Goblin {
25
26 protected:
27 // In AVM we only use Goblin for a single circuit whose proof is not required to be zero-knowledge. While Translator
28 // will still expect to find random ops at the beginning to ensure the accumulation result remains at a fixed row we
29 // opt for not adding random ops at the end of the op queue.
30 bool avm_mode = false;
31
32 public:
34 using Fr = bb::fr;
53
56
58
59 fq translation_batching_challenge_v; // challenge for batching the translation polynomials
60 fq evaluation_challenge_x; // challenge for evaluating the translation polynomials
61 std::shared_ptr<Transcript> transcript; // shared between ECCVM and Translator
62
63 std::deque<MergeProof> merge_verification_queue; // queue of merge proofs to be verified
64
70
72 const std::shared_ptr<Transcript>& transcript = std::make_shared<Transcript>());
73
80 void prove_merge(const std::shared_ptr<Transcript>& transcript = std::make_shared<Transcript>(),
81 const MergeSettings merge_settings = MergeSettings::PREPEND);
82
88 void prove_eccvm();
89
94 void prove_translator();
95
102
115 const RecursiveMergeCommitments& merge_commitments,
117 const MergeSettings merge_settings = MergeSettings::PREPEND);
118};
119
120} // 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 𝔾₁.
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).
Definition flavor.hpp:136
fq evaluation_challenge_x
Definition goblin.hpp:60
GoblinProof goblin_proof
Definition goblin.hpp:57
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:91
MergeRecursiveVerifier::Commitment RecursiveCommitment
Definition goblin.hpp:49
void prove_eccvm()
Construct an ECCVM proof and IPA opening proof.
Definition goblin.cpp:36
fq translation_batching_challenge_v
Definition goblin.hpp:59
MergeVerifier::TableCommitments TableCommitments
Definition goblin.hpp:45
GoblinProof prove()
Constuct a full Goblin proof (ECCVM, Translator, merge)
Definition goblin.cpp:62
MergeRecursiveVerifier::PairingPoints PairingPoints
Definition goblin.hpp:44
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:29
std::shared_ptr< OpQueue > op_queue
Definition goblin.hpp:54
void prove_translator()
Construct a translator proof.
Definition goblin.cpp:53
MegaFlavor::Commitment Commitment
Definition goblin.hpp:23
MergeProver::MergeProof MergeProof
Definition goblin.hpp:40
CommitmentKey< curve::BN254 > commitment_key
Definition goblin.hpp:55
bool avm_mode
Definition goblin.hpp:30
std::deque< MergeProof > merge_verification_queue
Definition goblin.hpp:63
std::shared_ptr< Transcript > transcript
Definition goblin.hpp:61
MergeRecursiveVerifier::TableCommitments RecursiveTableCommitments
Definition goblin.hpp:46
IPA (inner product argument) commitment scheme class.
Definition ipa.hpp:92
Curve::ScalarField FF
Curve::AffineElement Commitment
std::vector< FF > MergeProof
Unified verifier class for the Goblin ECC op queue transcript 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_< PrecomputedEntities< 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: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:67
std::shared_ptr< ECCVMVerificationKey > eccvm_verification_key
Definition goblin.hpp:66
Data passed from ECCVM Verifier to Translator Verifier for verification.