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
12
13namespace bb {
14
19template <typename Flavor> class ECCVMVerifier_ {
20 public:
21 using FF = Flavor::FF;
22 using BF = Flavor::BF;
33
34 static constexpr bool IsRecursive = Curve::is_stdlib_type;
36
43 OpeningClaim<Curve> ipa_claim; // IPA opening claim for deferred verification
44 bool reduction_succeeded = false; // Aggregate of sumcheck, consistency, and translation masking checks
45 };
46
47 // Unified constructor for both native and recursive verification
48 // For recursive case, extracts builder from proof elements via get_context()
49 ECCVMVerifier_(const std::shared_ptr<Transcript>& transcript, const Proof& proof)
50 : proof(proof)
52 {
53 // ECCVM VK is constant
55 if constexpr (IsRecursive) {
56 // Extract builder from proof - safe since transcript cannot hash non-witness elements
57 builder = proof.back().get_context();
59 vk_hash = stdlib::witness_t<Builder>(builder, native_vk->hash());
60 key->fix_witness();
61 vk_hash.fix_witness();
62 } else {
63 key = native_vk;
64 vk_hash = native_vk->hash();
65 }
66 }
67
79 [[nodiscard("Verification result must be checked")]] ReductionResult reduce_to_ipa_opening();
80
89
90 std::shared_ptr<VerificationKey> get_verification_key() const { return key; }
91 std::shared_ptr<Transcript> get_transcript() const { return transcript; }
92
93 private:
94 void compute_translation_opening_claims(const std::vector<Commitment>& translation_commitments);
96
97 std::shared_ptr<VerificationKey> key;
100 std::shared_ptr<Transcript> transcript;
101
102 // Builder pointer (only used for recursive, nullptr for native)
104
105 // Final ShplonkVerifier consumes an array consisting of Translation Opening Claims and a
106 // `multivariate_to_univariate_opening_claim`
109
111
112 // Translation evaluation and batching challenges. Propagated to TranslatorVerifier via get_translator_input_data()
116
117 // Intermediate verification state
120};
121
122// Type aliases
125
126} // 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.
The verification key is responsible for storing the commitments to the precomputed (non-witnessk) pol...
bb::VerifierCommitmentKey< Curve > VerifierCommitmentKey
typename Curve::ScalarField FF
VerifierCommitments_< Commitment, VerificationKey > VerifierCommitments
typename G1::affine_element Commitment
typename Curve::BaseField BF
curve::Grumpkin Curve
static constexpr size_t NUM_TRANSLATION_OPENING_CLAIMS
BaseTranscript< Codec, HashFunction > Transcript
Unified ECCVM verifier class for both native and recursive verification.
bool translation_masking_consistency_checked
std::shared_ptr< Transcript > transcript
std::conditional_t< IsRecursive, Builder *, void * > builder
void compute_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...
TranslationEvaluations_< FF > translation_evaluations
static constexpr size_t NUM_OPENING_CLAIMS
ECCVMVerifier_(const std::shared_ptr< Transcript > &transcript, const Proof &proof)
std::conditional_t< IsRecursive, typename Flavor::CircuitBuilder, void > Builder
std::shared_ptr< VerificationKey > key
static constexpr bool IsRecursive
std::shared_ptr< VerificationKey > get_verification_key() const
std::array< OpeningClaim< Curve >, NUM_OPENING_CLAIMS > opening_claims
TranslatorInputData get_translator_input_data() const
Get the data required by the TranslatorVerifier.
Flavor::Commitment Commitment
std::shared_ptr< Transcript > get_transcript() const
ReductionResult reduce_to_ipa_opening()
Reduce the ECCVM proof to an IPA opening claim.
IPA (inner product argument) commitment scheme class.
Definition ipa.hpp:93
Unverified claim (C,r,v) for some witness polynomial p(X) such that.
Definition claim.hpp:53
Representation of the Grumpkin Verifier Commitment Key inside a bn254 circuit.
static constexpr bool is_stdlib_type
Definition grumpkin.hpp:69
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
Result of reducing ECCVM proof to IPA opening claim.
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.