Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
eccvm_verifier.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: Complete, auditors: [Sergei], commit: }
3// external_1: { status: not started, auditors: [], commit: }
4// external_2: { status: not started, auditors: [], commit: }
5// =====================
6
7#pragma once
14
15namespace bb {
16
21template <typename Flavor> class ECCVMVerifier_ {
22 public:
23 using FF = Flavor::FF;
24 using BF = Flavor::BF;
34 static constexpr bool IsRecursive = Curve::is_stdlib_type;
41
62
63 static bool verify_accumulator(const TripleIpaAccumulator& accumulator)
64 requires(!IsRecursive)
65 {
67 return TripleIPA::verify_accumulator(ipa_vk, accumulator);
68 }
69
76
85
86 // Unified constructor for both native and recursive verification
87 // For recursive case, extracts builder from proof elements via get_context()
88 ECCVMVerifier_(const std::shared_ptr<Transcript>& transcript, const Proof& proof)
89 : proof(proof)
91 {
92 // ECCVM VK is constant
94 // G1 identity is the first point of the SRS (used for PCS operations)
95 auto native_pcs_g1_identity = ECCVMFlavor::VerifierCommitmentKey(1).get_g1_identity();
96 if constexpr (IsRecursive) {
97 builder = proof.get_context();
99 vk_hash = key->get_hash();
100 pcs_g1_identity = Commitment(native_pcs_g1_identity);
101 } else {
102 key = native_vk;
103 vk_hash = native_vk->get_hash();
104 pcs_g1_identity = native_pcs_g1_identity;
105 }
106 }
107
117 [[nodiscard("Verification result must be checked")]] ReductionResult reduce_to_triple_ipa_claim();
118
127
128 std::shared_ptr<VerificationKey> get_verification_key() const { return key; }
129 std::shared_ptr<Transcript> get_transcript() const { return transcript; }
130
131 private:
132 // The verifier-side PCS pipeline mirrors the prover: collect all univariate opening claims, reduce them with one
133 // Shplonk, then combine the reduced univariate claim with the sumcheck multilinear claims into a TripleIPA claim.
134 bool append_libra_opening_claims(const std::array<Commitment, NUM_SMALL_IPA_COMMITMENTS>& libra_commitments,
135 const std::vector<FF>& multilinear_challenge,
136 const FF& claimed_libra_evaluation);
137 void append_translation_opening_claims(const std::vector<Commitment>& translation_commitments);
138 void append_sumcheck_round_opening_claims(const std::vector<Commitment>& sumcheck_round_commitments,
139 const std::vector<std::array<FF, 3>>& sumcheck_round_evaluations,
140 const std::vector<FF>& multilinear_challenge);
144 SumcheckOutput<Flavor>& sumcheck_output,
145 const OpeningClaim<Curve>& univariate_opening_claim);
147
148 std::shared_ptr<VerificationKey> key;
151 Commitment pcs_g1_identity; // G1 generator for PCS operations (Shplonk)
152 std::shared_ptr<Transcript> transcript;
153
154 // Builder pointer (only used for recursive, nullptr for native)
156
159
160 // Translation evaluation and batching challenges. Propagated to TranslatorVerifier via get_translator_input_data()
164
165 // Intermediate verification state
168};
169
170// Type aliases
173// Retained for call sites that name the TripleIPA verifier explicitly; the ECCVM verifier always uses it.
176
177} // namespace bb
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
A container for commitment labels.
static constexpr size_t ECCVM_FIXED_SIZE
bb::VerifierCommitmentKey< Curve > VerifierCommitmentKey
typename Curve::ScalarField FF
VerifierCommitments_< Commitment, VerificationKey > VerifierCommitments
typename G1::affine_element Commitment
typename Curve::BaseField BF
curve::Grumpkin Curve
FixedVKAndHash_< PrecomputedEntities< Commitment >, BF, ECCVMHardcodedVKAndHash > VerificationKey
The verification key stores commitments to the precomputed polynomials used by the verifier.
BaseTranscript< Codec, HashFunction > Transcript
Unified ECCVM verifier class for both native and recursive verification.
void append_pow_masking_opening_claim()
bool translation_masking_consistency_checked
TripleIpaClaim compute_triple_ipa_claim(VerifierCommitments &commitments, SumcheckOutput< Flavor > &sumcheck_output, const OpeningClaim< Curve > &univariate_opening_claim)
std::shared_ptr< Transcript > transcript
ReductionResult reduce_to_triple_ipa_claim()
Reduce the ECCVM proof to a compact TripleIPA verifier claim.
std::conditional_t< IsRecursive, Builder *, void * > builder
TranslationEvaluations_< FF > translation_evaluations
typename TripleIPA::TripleIpaClaim TripleIpaClaim
typename TripleIPA::VerifierAccumulator TripleIpaAccumulator
void append_sumcheck_round_opening_claims(const std::vector< Commitment > &sumcheck_round_commitments, const std::vector< std::array< FF, 3 > > &sumcheck_round_evaluations, const std::vector< FF > &multilinear_challenge)
bool append_libra_opening_claims(const std::array< Commitment, NUM_SMALL_IPA_COMMITMENTS > &libra_commitments, const std::vector< FF > &multilinear_challenge, const FF &claimed_libra_evaluation)
std::vector< OpeningClaim< Curve > > univariate_opening_claims
ECCVMVerifier_(const std::shared_ptr< Transcript > &transcript, const Proof &proof)
std::conditional_t< IsRecursive, typename Flavor::CircuitBuilder, void > Builder
static bool verify_accumulator(const TripleIpaAccumulator &accumulator)
OpeningClaim< Curve > reduce_univariate_opening_claims()
std::shared_ptr< VerificationKey > key
static constexpr bool IsRecursive
std::shared_ptr< VerificationKey > get_verification_key() const
std::conditional_t< IsRecursive, stdlib::Proof< UltraCircuitBuilder >, HonkProof > TripleIpaProof
TranslatorInputData get_translator_input_data() const
Get the data required by the TranslatorVerifier.
Flavor::VerifierCommitments VerifierCommitments
Flavor::Commitment Commitment
std::shared_ptr< Transcript > get_transcript() const
static bool batch_verify_accumulators(std::span< const TripleIpaAccumulator > accumulators)
void append_translation_opening_claims(const std::vector< Commitment > &translation_commitments)
To link the ECCVM Transcript wires op, Px, Py, z1, and z2 to the accumulator computed by the translat...
Simple verification key class for fixed-size circuits (ECCVM, Translator, AVM).
Definition flavor.hpp:104
IPA (inner product argument) commitment scheme class.
Definition ipa.hpp:87
Unverified claim (C,r,v) for some witness polynomial p(X) such that.
Definition claim.hpp:55
static NativeAccumulator reduce_to_accumulator(const TripleIpaClaim &claim, const auto &transcript)
static bool batch_verify_accumulators(const VK &vk, std::span< const NativeAccumulator > accumulators)
static bool verify_accumulator(const VK &vk, const NativeAccumulator &accumulator)
static bool reduce_verify(const VK &vk, const TripleIpaClaim &claim, const std::shared_ptr< Transcript > &transcript)
std::conditional_t< Curve::is_stdlib_type, typename IPAProtocol::VerifierAccumulator, NativeAccumulator > VerifierAccumulator
bb::TripleIpaClaim< Curve > TripleIpaClaim
Representation of the Grumpkin Verifier Commitment Key inside a bn254 circuit.
static constexpr bool is_stdlib_type
Definition grumpkin.hpp:67
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
std::vector< fr > HonkProof
Definition proof.hpp:15
ECCVMVerifier_< ECCVMRecursiveFlavor > ECCVMRecursiveVerifier
ECCVMVerifier_< ECCVMFlavor > ECCVMVerifier
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
TripleIpaAccumulator reduce_to_accumulator() const
Result of reducing ECCVM proof to a compact TripleIPA claim.
Contains the evaluations of multilinear polynomials at the challenge point . These are computed by S...
Stores the evaluations of op, Px, Py, z1, and z2 computed by the ECCVM Prover. These evaluations are ...
Data passed from ECCVM Verifier to Translator Verifier for verification.
The compact TripleIPA opening claim: the statement that crosses verifier boundaries.