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
43template <bool IsRecursive> class ChonkVerifier {
44 // Conditional types based on recursion
52 using PairingPoints = typename GoblinVerifier::ReductionResult::PairingPoints;
53 using MergeCommitments = typename GoblinVerifier::MergeVerifier::InputCommitments;
58
59 // Number of pairing point sets aggregated in recursive verification (PI, Merge, Batched PCS)
60 static constexpr size_t NUM_PAIRING_POINTS = 3;
61
62 public:
68 PairingPoints pairing_points; // Aggregated pairing points (PI + PCS + Merge + Translator)
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
107 [[nodiscard("TripleIPA opening and pairing points must be accumulated")]] Output verify(const Proof& proof);
108
119
130
131 private:
132 // VK and hash of the hiding kernel
133 std::shared_ptr<VKAndHash> vk_and_hash;
134 // Shared transcript for all verifiers
135 std::shared_ptr<Transcript> transcript;
136};
137
138// Type aliases for ease of use
141
142} // 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
TripleIpaReductionResult reduce_to_triple_ipa_opening(const Proof &proof)
Run Chonk verification up to but not including TripleIPA verification.
typename HidingKernelVerifier::VerificationKey VK
typename ECCVMVerifier::DeferredTripleIpaOpening NativeDeferredTripleIpaOpening
std::shared_ptr< VKAndHash > vk_and_hash
std::conditional_t< IsRecursive, bb::MegaZKRecursiveVerifier, bb::MegaZKVerifier > HidingKernelVerifier
typename GoblinVerifier::Transcript Transcript
typename GoblinVerifier::ReductionResult::PairingPoints PairingPoints
typename GoblinVerifier::MergeVerifier::InputCommitments MergeCommitments
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, typename ECCVMRecursiveVerifier::DeferredTripleIpaOpening, typename ECCVMVerifier::DeferredTripleIpaOpening > DeferredTripleIpaOpening
std::conditional_t< IsRecursive, ChonkStdlibProof, ChonkProof > Proof
std::conditional_t< IsRecursive, UltraStdlibTranscript, NativeTranscript > Transcript
Manages the data that is propagated on the public inputs of of a hiding kernel circuit.
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
STL namespace.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
Result of Chonk verification reduction (recursive mode only)
DeferredTripleIpaOpening triple_ipa_opening
Result of reducing Chonk verification to a deferred TripleIPA opening (native mode only).
NativeDeferredTripleIpaOpening triple_ipa_opening