|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
Verifier for the batched MegaZK circuit + translator sumcheck and PCS. More...
#include <batched_honk_translator_verifier.hpp>
Classes | |
| struct | OinkResult |
| Result of Phase 1 (MegaZK Oink verification). More... | |
| struct | ReductionResult |
| Result of the batched sumcheck/PCS reduction. More... | |
Public Types | |
| using | MegaZKFlavorT = std::conditional_t< IsRecursive, MegaZKRecursiveFlavor_< UltraCircuitBuilder >, MegaZKFlavor > |
| using | TransFlavor = std::conditional_t< IsRecursive, TranslatorRecursiveFlavor, TranslatorFlavor > |
| using | FF = typename MegaZKFlavorT::FF |
| using | Commitment = typename MegaZKFlavorT::Commitment |
| using | MegaZKVerifierInstance = VerifierInstance_< MegaZKFlavorT > |
| using | MegaZKVKAndHash = typename MegaZKFlavorT::VKAndHash |
| using | Transcript = std::conditional_t< IsRecursive, UltraStdlibTranscript, NativeTranscript > |
| using | MegaZKVerifierCommitments = typename MegaZKFlavorT::VerifierCommitments |
| using | TransVerifierCommitments = typename TransFlavor::VerifierCommitments |
| using | Proof = std::conditional_t< IsRecursive, stdlib::Proof< UltraCircuitBuilder >, HonkProof > |
| using | PairingPoints = std::conditional_t< IsRecursive, stdlib::recursion::PairingPoints< Curve >, bb::PairingPoints< Curve > > |
| using | TransBF = typename TransFlavor::BF |
Public Member Functions | |
| BatchedHonkTranslatorVerifier_ (std::shared_ptr< MegaZKVKAndHash > mega_zk_vk_and_hash, std::shared_ptr< Transcript > transcript) | |
| Construct the batched verifier with minimal state. | |
| OinkResult | verify_mega_zk_oink (const Proof &mega_zk_proof) |
| Phase 1: Verify the MegaZK Oink phase on the shared transcript. | |
| ReductionResult | verify (const Proof &joint_proof, const TransBF &evaluation_input_x, const TransBF &batching_challenge_v, const TransBF &accumulated_result, const std::array< Commitment, TranslatorFlavor::NUM_OP_QUEUE_WIRES > &op_queue_wire_commitments) |
| Phase 2: Verify translator Oink + joint sumcheck + joint PCS. | |
Static Public Attributes | |
| static constexpr bool | IsRecursive = Curve::is_stdlib_type |
| static constexpr RepeatedCommitmentsData | REPEATED_COMMITMENTS |
Private Member Functions | |
| TransVerifierCommitments | verify_translator_oink (const Proof &joint_proof, const TransBF &evaluation_input_x, const TransBF &batching_challenge_v, const TransBF &accumulated_result, const std::array< Commitment, TranslatorFlavor::NUM_OP_QUEUE_WIRES > &op_queue_wire_commitments) |
| Verify the translator's Oink phase. | |
| bool | verify_joint_sumcheck () |
| Verify the joint 17-round sumcheck. | |
| ReductionResult | verify_joint_pcs (bool sumcheck_verified, MegaZKVerifierCommitments &mega_zk_commitments, TransVerifierCommitments &trans_commitments) |
| Execute the joint Shplemini / KZG PCS reduction. | |
Private Attributes | |
| std::shared_ptr< MegaZKVKAndHash > | mega_zk_vk_and_hash |
| std::shared_ptr< Transcript > | transcript |
| std::shared_ptr< MegaZKVerifierInstance > | mega_zk_verifier_instance |
| std::conditional_t< IsRecursive, UltraCircuitBuilder *, std::nullptr_t > | builder = nullptr |
| bb::RelationParameters< FF > | mega_zk_relation_parameters |
| bb::RelationParameters< FF > | translator_relation_parameters |
| std::vector< FF > | joint_challenge |
| MegaZKFlavorT::AllValues | mega_zk_evals |
| TransFlavor::AllValues | trans_evals |
| std::array< Commitment, NUM_LIBRA_COMMITMENTS > | libra_commitments |
| FF | libra_evaluation |
| FF | libra_challenge |
Verifier for the batched MegaZK circuit + translator sumcheck and PCS.
Mirrors BatchedHonkTranslatorProver in the verification direction. Processes the MegaZK circuit's Oink proof and the translator's pre-sumcheck commitments on a shared transcript, then verifies a single joint 17-round sumcheck and a single Shplemini / KZG reduction.
The final joint relation check is: FRV_joint = rdp_MZK · FRV_MZK(u) + α^{K_H} · FRV_translator(u) + libra_eval · libra_challenge
where rdp_H is the row-disabling polynomial for the MegaZK circuit evaluated at the joint sumcheck challenge, and TranslatorFlavor does not use row-disabling (UseRowDisablingPolynomial is false for TranslatorFlavor).
| Curve | curve::BN254 for native verification, stdlib::bn254<Builder> for recursive. |
Definition at line 32 of file batched_honk_translator_verifier.hpp.
| using bb::BatchedHonkTranslatorVerifier_< Curve >::Commitment = typename MegaZKFlavorT::Commitment |
Definition at line 42 of file batched_honk_translator_verifier.hpp.
| using bb::BatchedHonkTranslatorVerifier_< Curve >::FF = typename MegaZKFlavorT::FF |
Definition at line 41 of file batched_honk_translator_verifier.hpp.
| using bb::BatchedHonkTranslatorVerifier_< Curve >::MegaZKFlavorT = std::conditional_t<IsRecursive, MegaZKRecursiveFlavor_<UltraCircuitBuilder>, MegaZKFlavor> |
Definition at line 37 of file batched_honk_translator_verifier.hpp.
| using bb::BatchedHonkTranslatorVerifier_< Curve >::MegaZKVerifierCommitments = typename MegaZKFlavorT::VerifierCommitments |
Definition at line 46 of file batched_honk_translator_verifier.hpp.
| using bb::BatchedHonkTranslatorVerifier_< Curve >::MegaZKVerifierInstance = VerifierInstance_<MegaZKFlavorT> |
Definition at line 43 of file batched_honk_translator_verifier.hpp.
| using bb::BatchedHonkTranslatorVerifier_< Curve >::MegaZKVKAndHash = typename MegaZKFlavorT::VKAndHash |
Definition at line 44 of file batched_honk_translator_verifier.hpp.
| using bb::BatchedHonkTranslatorVerifier_< Curve >::PairingPoints = std::conditional_t<IsRecursive, stdlib::recursion::PairingPoints<Curve>, bb::PairingPoints<Curve> > |
Definition at line 53 of file batched_honk_translator_verifier.hpp.
| using bb::BatchedHonkTranslatorVerifier_< Curve >::Proof = std::conditional_t<IsRecursive, stdlib::Proof<UltraCircuitBuilder>, HonkProof> |
Definition at line 50 of file batched_honk_translator_verifier.hpp.
| using bb::BatchedHonkTranslatorVerifier_< Curve >::TransBF = typename TransFlavor::BF |
Definition at line 57 of file batched_honk_translator_verifier.hpp.
| using bb::BatchedHonkTranslatorVerifier_< Curve >::Transcript = std::conditional_t<IsRecursive, UltraStdlibTranscript, NativeTranscript> |
Definition at line 45 of file batched_honk_translator_verifier.hpp.
| using bb::BatchedHonkTranslatorVerifier_< Curve >::TransFlavor = std::conditional_t<IsRecursive, TranslatorRecursiveFlavor, TranslatorFlavor> |
Definition at line 39 of file batched_honk_translator_verifier.hpp.
| using bb::BatchedHonkTranslatorVerifier_< Curve >::TransVerifierCommitments = typename TransFlavor::VerifierCommitments |
Definition at line 47 of file batched_honk_translator_verifier.hpp.
| bb::BatchedHonkTranslatorVerifier_< Curve >::BatchedHonkTranslatorVerifier_ | ( | std::shared_ptr< MegaZKVKAndHash > | mega_zk_vk_and_hash, |
| std::shared_ptr< Transcript > | transcript | ||
| ) |
Construct the batched verifier with minimal state.
Only stores the VK and transcript. Proof data and ECCVM-derived params are passed to the two-phase verification methods.
Definition at line 22 of file batched_honk_translator_verifier.cpp.
| BatchedHonkTranslatorVerifier_< Curve >::ReductionResult bb::BatchedHonkTranslatorVerifier_< Curve >::verify | ( | const Proof & | joint_proof, |
| const TransBF & | evaluation_input_x, | ||
| const TransBF & | batching_challenge_v, | ||
| const TransBF & | accumulated_result, | ||
| const std::array< Commitment, TranslatorFlavor::NUM_OP_QUEUE_WIRES > & | op_queue_wire_commitments | ||
| ) |
Phase 2: Verify translator Oink + joint sumcheck + joint PCS.
Called after merge and ECCVM verification have been performed on the shared transcript. Loads joint_proof, runs translator oink, joint sumcheck, and joint PCS.
Definition at line 343 of file batched_honk_translator_verifier.cpp.
|
private |
Execute the joint Shplemini / KZG PCS reduction.
Combines commitments and evaluations from both circuits into a single batch opening claim, then reduces to a KZG pairing check.
Definition at line 273 of file batched_honk_translator_verifier.cpp.
|
private |
Verify the joint 17-round sumcheck.
Draws joint alpha, processes 17 sumcheck rounds, receives evaluations from both circuits, computes the joint full-relation purported value, and performs final verification. Populates joint_challenge, mega_zk_evals, trans_evals, libra_commitments, libra_evaluation, libra_challenge.
Definition at line 98 of file batched_honk_translator_verifier.cpp.
| BatchedHonkTranslatorVerifier_< Curve >::OinkResult bb::BatchedHonkTranslatorVerifier_< Curve >::verify_mega_zk_oink | ( | const Proof & | mega_zk_proof | ) |
Phase 1: Verify the MegaZK Oink phase on the shared transcript.
Verify the MegaZK circuit's Oink phase.
Loads mega_zk_proof into the transcript, runs OinkVerifier, stores verifier instance.
Loads the hiding proof, runs OinkVerifier, and returns the data callers need between Phase 1 and Phase 2 (public inputs, calldata commitment, ECC op wires). Populates mega_zk_relation_parameters.
Definition at line 35 of file batched_honk_translator_verifier.cpp.
|
private |
Verify the translator's Oink phase.
Delegates to TranslatorVerifier_::receive_pre_sumcheck(), which loads the translator proof, hashes the VK, sets relation parameters, and receives wire + permutation commitments. Populates translator_relation_parameters.
Definition at line 69 of file batched_honk_translator_verifier.cpp.
|
private |
Definition at line 154 of file batched_honk_translator_verifier.hpp.
|
staticconstexpr |
Definition at line 34 of file batched_honk_translator_verifier.hpp.
|
private |
Definition at line 161 of file batched_honk_translator_verifier.hpp.
|
private |
Definition at line 166 of file batched_honk_translator_verifier.hpp.
|
private |
Definition at line 164 of file batched_honk_translator_verifier.hpp.
|
private |
Definition at line 165 of file batched_honk_translator_verifier.hpp.
|
private |
Definition at line 162 of file batched_honk_translator_verifier.hpp.
|
private |
Definition at line 157 of file batched_honk_translator_verifier.hpp.
|
private |
Definition at line 151 of file batched_honk_translator_verifier.hpp.
|
private |
Definition at line 147 of file batched_honk_translator_verifier.hpp.
|
staticconstexpr |
Definition at line 66 of file batched_honk_translator_verifier.hpp.
|
private |
Definition at line 163 of file batched_honk_translator_verifier.hpp.
|
private |
Definition at line 148 of file batched_honk_translator_verifier.hpp.
|
private |
Definition at line 158 of file batched_honk_translator_verifier.hpp.