Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
chonk_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// Recursive Chonk verifier for in-circuit verification of Chonk IVC proofs.
8// See: chonk/README.md
9//
10#pragma once
22
23namespace bb {
24
44template <bool IsRecursive> class ChonkVerifier {
45 // Conditional types based on recursion
53 using PairingPoints = typename GoblinVerifier::ReductionResult::PairingPoints;
54 using IPAClaim = typename GoblinVerifier::ReductionResult::IPAClaim;
55 using IPAProof = typename GoblinVerifier::ReductionResult::IPAProof;
56 using MergeCommitments = typename GoblinVerifier::MergeVerifier::InputCommitments;
57
58 // Number of pairing point sets aggregated in recursive verification (PI, Merge, Batched PCS)
59 static constexpr size_t NUM_PAIRING_POINTS = 3;
60
61 public:
67 PairingPoints pairing_points; // Aggregated pairing points (PI + PCS + Merge + Translator)
68 IPAClaim ipa_claim; // IPA opening claim from ECCVM (Grumpkin curve)
69 IPAProof ipa_proof; // IPA proof for verifying the claim
70 bool all_checks_passed; // Reduction checks passed (sumcheck, evaluations, etc.)
71 };
72
74 using VKAndHash = typename HidingKernelVerifier::VKAndHash;
75 using VK = typename HidingKernelVerifier::VerificationKey;
76 using Commitment = typename HidingKernelVerifier::Commitment;
78
79 ChonkVerifier(const std::shared_ptr<VKAndHash>& vk_and_hash)
81 , transcript(std::make_shared<Transcript>())
82 {}
83
106 [[nodiscard("IPA claim and pairing points must be accumulated")]] Output verify(const Proof& proof);
107
118
129
130 private:
131 // VK and hash of the hiding kernel
132 std::shared_ptr<VKAndHash> vk_and_hash;
133 // Shared transcript for all verifiers
134 std::shared_ptr<Transcript> transcript;
135};
136
137// Type aliases for ease of use
140
141} // namespace bb
Verifier for Chonk IVC proofs (both native and recursive).
std::shared_ptr< Transcript > transcript
ChonkVerifier(const std::shared_ptr< VKAndHash > &vk_and_hash)
std::conditional_t< IsRecursive, ReductionResult, bool > Output
typename HidingKernelVerifier::VerificationKey VK
std::shared_ptr< VKAndHash > vk_and_hash
std::conditional_t< IsRecursive, bb::MegaZKRecursiveVerifier, bb::MegaZKVerifier > HidingKernelVerifier
typename GoblinVerifier::Transcript Transcript
IPAReductionResult reduce_to_ipa_claim(const Proof &proof)
Run Chonk verification up to but not including IPA, returning the IPA claim for deferred verification...
typename GoblinVerifier::ReductionResult::PairingPoints PairingPoints
typename GoblinVerifier::MergeVerifier::InputCommitments MergeCommitments
typename GoblinVerifier::ReductionResult::IPAProof IPAProof
static constexpr size_t NUM_PAIRING_POINTS
Output verify(const Proof &proof)
Verify a Chonk proof.
std::conditional_t< IsRecursive, stdlib::recursion::honk::HidingKernelIO< Builder >, bb::HidingKernelIO > HidingKernelIO
typename GoblinVerifier::ReductionResult GoblinReductionResult
typename HidingKernelVerifier::VKAndHash VKAndHash
std::conditional_t< IsRecursive, bb::GoblinRecursiveVerifier, bb::GoblinVerifier > GoblinVerifier
std::conditional_t< IsRecursive, UltraCircuitBuilder, void > Builder
typename HidingKernelVerifier::Commitment Commitment
std::conditional_t< IsRecursive, ChonkStdlibProof, ChonkProof > Proof
typename GoblinVerifier::ReductionResult::IPAClaim IPAClaim
std::conditional_t< IsRecursive, UltraStdlibTranscript, NativeTranscript > Transcript
Manages the data that is propagated on the public inputs of of a hiding kernel circuit.
Unverified claim (C,r,v) for some witness polynomial p(X) such that.
Definition claim.hpp:55
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
std::vector< fr > HonkProof
Definition proof.hpp:15
STL namespace.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
Result of reducing Chonk verification to an IPA opening claim (native mode only).
OpeningClaim< curve::Grumpkin > ipa_claim
Result of Chonk verification reduction (recursive mode only)
Result of Goblin verification with mode-specific semantics.