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
55
57
58 fq translation_batching_challenge_v; // challenge for batching the translation polynomials
59 fq evaluation_challenge_x; // challenge for evaluating the translation polynomials
60 std::shared_ptr<Transcript> transcript; // shared between ECCVM and Translator
61
62 std::deque<MergeProof> merge_verification_queue; // queue of merge proofs to be verified
63
69
70 Goblin(const std::shared_ptr<Transcript>& transcript = std::make_shared<Transcript>());
71
78 void prove_merge(const std::shared_ptr<Transcript>& transcript = std::make_shared<Transcript>(),
79 const MergeSettings merge_settings = MergeSettings::PREPEND);
80
86 void prove_eccvm();
87
92 void prove_translator();
93
100
113 const RecursiveMergeCommitments& merge_commitments,
115 const MergeSettings merge_settings = MergeSettings::PREPEND);
116};
117
118} // namespace bb
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
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:59
GoblinProof goblin_proof
Definition goblin.hpp:56
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:90
MergeRecursiveVerifier::Commitment RecursiveCommitment
Definition goblin.hpp:49
void prove_eccvm()
Construct an ECCVM proof and IPA opening proof.
Definition goblin.cpp:35
fq translation_batching_challenge_v
Definition goblin.hpp:58
MergeVerifier::TableCommitments TableCommitments
Definition goblin.hpp:45
GoblinProof prove()
Constuct a full Goblin proof (ECCVM, Translator, merge)
Definition goblin.cpp:61
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:28
std::shared_ptr< OpQueue > op_queue
Definition goblin.hpp:54
void prove_translator()
Construct a translator proof.
Definition goblin.cpp:52
MegaFlavor::Commitment Commitment
Definition goblin.hpp:23
MergeProver::MergeProof MergeProof
Definition goblin.hpp:40
bool avm_mode
Definition goblin.hpp:30
std::deque< MergeProof > merge_verification_queue
Definition goblin.hpp:62
std::shared_ptr< Transcript > transcript
Definition goblin.hpp:60
MergeRecursiveVerifier::TableCommitments RecursiveTableCommitments
Definition goblin.hpp:46
IPA (inner product argument) commitment scheme class.
Definition ipa.hpp:86
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_< 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
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
Data passed from ECCVM Verifier to Translator Verifier for verification.