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
21
22namespace bb {
23
43template <bool IsRecursive> class ChonkVerifier {
44 // Conditional types based on recursion
52 using PairingPoints = typename GoblinVerifier::ReductionResult::PairingPoints;
53 using IPAClaim = typename GoblinVerifier::ReductionResult::IPAClaim;
54 using IPAProof = typename GoblinVerifier::ReductionResult::IPAProof;
55 using MergeCommitments = typename GoblinVerifier::MergeVerifier::InputCommitments;
56
57 // Number of pairing point sets aggregated in recursive verification (PI, PCS, Merge, Translator)
58 static constexpr size_t NUM_PAIRING_POINTS = 4;
59
60 public:
66 PairingPoints pairing_points; // Aggregated pairing points (PI + PCS + Merge + Translator)
67 IPAClaim ipa_claim; // IPA opening claim from ECCVM (Grumpkin curve)
68 IPAProof ipa_proof; // IPA proof for verifying the claim
69 bool all_checks_passed; // Reduction checks passed (sumcheck, evaluations, etc.)
70 };
71
73 using VKAndHash = typename HidingKernelVerifier::VKAndHash;
74 using VK = typename HidingKernelVerifier::VerificationKey;
75 using Commitment = typename HidingKernelVerifier::Commitment;
77
78 ChonkVerifier(const std::shared_ptr<VKAndHash>& vk_and_hash)
80 , transcript(std::make_shared<Transcript>())
81 {}
82
105 [[nodiscard("IPA claim and pairing points must be accumulated")]] Output verify(const Proof& proof);
106
107 private:
108 // VK and hash of the hiding kernel
109 std::shared_ptr<VKAndHash> vk_and_hash;
110 // Shared transcript for all verifiers
111 std::shared_ptr<Transcript> transcript;
112};
113
114// Type aliases for ease of use
117
118} // 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
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.
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)
Result of Goblin verification with mode-specific semantics.