Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
protogalaxy_prover.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#pragma once
13
14namespace bb {
15
16// TODO(https://github.com/AztecProtocol/barretenberg/issues/1437): Change template params back to DeciderProvingKeys
17template <IsUltraOrMegaHonk Flavor, size_t NUM_KEYS = 2> class ProtogalaxyProver_ {
18 public:
21 using FF = typename Flavor::FF;
23 using TupleOfTuplesOfUnivariates = typename Flavor::template ProtogalaxyTupleOfTuplesOfUnivariates<NUM_KEYS>;
28
34
35 // TODO(https://github.com/AztecProtocol/barretenberg/issues/1239): clean out broken support for multi-folding
36 static_assert(DeciderProvingKeys::NUM == 2, "Protogalaxy currently only supports folding one instance at a time.");
37
39
43
44 // the state updated and carried forward beween rounds
45 std::shared_ptr<Transcript> transcript = std::make_shared<Transcript>();
46 std::shared_ptr<DeciderPK> accumulator;
48 std::vector<FF> deltas;
53
55
56 ProtogalaxyProver_() = default;
57 ProtogalaxyProver_(const std::vector<std::shared_ptr<DeciderPK>>& keys,
58 const std::vector<std::shared_ptr<DeciderVK>>& vks,
59 const std::shared_ptr<Transcript>& transcript,
65 , pg_internal(trace_usage_tracker)
66 {
67 BB_ASSERT_EQ(keys.size(), NUM_KEYS, "Number of prover keys does not match the number of keys to fold");
69 vks.size(), NUM_KEYS, "Number of verification keys does not match the number of vks to Fiat-Shamir");
70 }
71
79 void run_oink_prover_on_one_incomplete_key(std::shared_ptr<DeciderPK>,
80 std::shared_ptr<DeciderVK>,
81 const std::string& domain_separator);
82
89
98
105 combiner_quotient_round(const std::vector<FF>& gate_challenges,
106 const std::vector<FF>& deltas,
107 const DeciderProvingKeys& keys);
108
119 const UnivariateRelationParameters& univariate_relation_parameters,
121
128 BB_PROFILE FoldingResult<Flavor> prove();
129};
130} // namespace bb
#define BB_ASSERT_EQ(actual, expected,...)
Definition assert.hpp:59
A DeciderProvingKey is normally constructed from a finalized circuit and it contains all the informat...
The DeciderVerificationKey encapsulates all the necessary information for a Mega Honk Verifier to ver...
Curve::ScalarField FF
bb::CommitmentKey< Curve > CommitmentKey
static constexpr size_t NUM_SUBRELATIONS
NativeTranscript Transcript
Structured polynomial class that represents the coefficients 'a' of a_0 + a_1 x .....
BB_PROFILE FoldingResult< Flavor > prove()
Execute the folding prover.
typename Flavor::Transcript Transcript
std::shared_ptr< DeciderPK > accumulator
CombinerQuotient combiner_quotient
UnivariateRelationParameters relation_parameters
void run_oink_prover_on_one_incomplete_key(std::shared_ptr< DeciderPK >, std::shared_ptr< DeciderVK >, const std::string &domain_separator)
For each key produced by a circuit, prior to folding, we need to complete the computation of its prov...
DeciderVerificationKeys vks_to_fold
DeciderProvingKeys_< Flavor, NUM_KEYS > DeciderProvingKeys
std::shared_ptr< Transcript > transcript
void update_target_sum_and_fold(const DeciderProvingKeys &keys, const CombinerQuotient &combiner_quotient, const UnivariateSubrelationSeparators &alphas, const UnivariateRelationParameters &univariate_relation_parameters, const FF &perturbator_evaluation)
Steps 12 - 13 of the paper plus the prover folding work.
std::array< Univariate< FF, DeciderProvingKeys::BATCHED_EXTENDED_LENGTH >, Flavor::NUM_SUBRELATIONS - 1 > UnivariateSubrelationSeparators
DeciderProvingKeys keys_to_fold
std::tuple< std::vector< FF >, UnivariateSubrelationSeparators, UnivariateRelationParameters, FF, CombinerQuotient > combiner_quotient_round(const std::vector< FF > &gate_challenges, const std::vector< FF > &deltas, const DeciderProvingKeys &keys)
Steps 6 - 11 of the paper.
ProtogalaxyProver_(const std::vector< std::shared_ptr< DeciderPK > > &keys, const std::vector< std::shared_ptr< DeciderVK > > &vks, const std::shared_ptr< Transcript > &transcript, ExecutionTraceUsageTracker trace_usage_tracker=ExecutionTraceUsageTracker{})
Univariate< FF, DeciderProvingKeys::BATCHED_EXTENDED_LENGTH, NUM_KEYS > CombinerQuotient
typename Flavor::template ProtogalaxyTupleOfTuplesOfUnivariates< NUM_KEYS > TupleOfTuplesOfUnivariates
ProtogalaxyProver_()=default
std::tuple< std::vector< FF >, Polynomial< FF > > perturbator_round(const std::shared_ptr< const DeciderPK > &accumulator)
Steps 2 - 5 of the paper.
bb::RelationParameters< Univariate< FF, DeciderProvingKeys::EXTENDED_LENGTH, 0, NUM_KEYS - 1 > > UnivariateRelationParameters
UnivariateSubrelationSeparators alphas
static constexpr size_t NUM_SUBRELATIONS
typename Flavor::CommitmentKey CommitmentKey
void run_oink_prover_on_each_incomplete_key()
Create inputs to folding protocol (an Oink interaction).
A univariate polynomial represented by its values on {domain_start, domain_start + 1,...
constexpr size_t NUM_KEYS
typename Flavor::Polynomial Polynomial
#define BB_PROFILE
Entry point for Barretenberg command-line interface.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
static constexpr size_t EXTENDED_LENGTH
DeciderProvingKey_< Flavor > DeciderPK
static constexpr size_t NUM_SUBRELATIONS
static constexpr size_t NUM
DeciderVerificationKey_< Flavor > DeciderVK
Tracks the cumulative usage of the execution trace across a series of circuits.
Container for parameters used by the grand product (permutation, lookup) Honk relations.