|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
Prover for the batched MegaZK circuit + translator sumcheck and PCS. More...
#include <batched_honk_translator_prover.hpp>
Public Types | |
| using | FF = MegaZKFlavor::FF |
| using | Curve = MegaZKFlavor::Curve |
| using | MegaZKCommitmentKey = MegaZKFlavor::CommitmentKey |
| using | MegaZKProverInstance = ProverInstance_< MegaZKFlavor > |
| using | MegaZKVK = MegaZKFlavor::VerificationKey |
| using | MegaZKProverRound = SumcheckProverRound< MegaZKFlavor > |
| using | MegaZKPartialEvals = MegaZKFlavor::PartiallyEvaluatedMultivariates |
| using | MegaZKSubrelationSeparators = std::array< FF, MegaZKFlavor::NUM_SUBRELATIONS - 1 > |
| using | TransProverRound = SumcheckProverRound< TranslatorFlavor > |
| using | TransPartialEvals = TranslatorFlavor::PartiallyEvaluatedMultivariates |
| using | TransSubrelationSeparators = std::array< FF, TranslatorFlavor::NUM_SUBRELATIONS - 1 > |
| using | ZKData = ZKSumcheckData< MegaZKFlavor > |
| using | Transcript = NativeTranscript |
| using | SumcheckRoundUnivariate = bb::Univariate< FF, MegaZKFlavor::BATCHED_RELATION_PARTIAL_LENGTH > |
Public Member Functions | |
| BatchedHonkTranslatorProver (std::shared_ptr< MegaZKProverInstance > mega_zk_instance, std::shared_ptr< MegaZKVK > mega_zk_vk, std::shared_ptr< Transcript > transcript) | |
| HonkProof | prove_mega_zk_oink () |
| HonkProof | prove (std::shared_ptr< TranslatorProvingKey > translator_proving_key) |
Static Public Attributes | |
| static constexpr size_t | JOINT_LOG_N = TranslatorFlavor::CONST_TRANSLATOR_LOG_N |
Private Member Functions | |
| void | execute_mega_zk_oink () |
| Run the MegaZK circuit's Oink phase. | |
| void | execute_translator_oink () |
| Run the translator's Oink phase on the shared transcript. | |
| void | execute_joint_sumcheck_rounds () |
| Execute the joint 17-round sumcheck. | |
| void | execute_joint_pcs () |
| Execute the joint Shplemini / KZG PCS over both circuits' polynomials. | |
Private Attributes | |
| std::shared_ptr< MegaZKProverInstance > | mega_zk_inst |
| std::shared_ptr< MegaZKVK > | mega_zk_vk |
| std::shared_ptr< TranslatorProvingKey > | translator_key |
| std::shared_ptr< Transcript > | transcript |
| bb::RelationParameters< FF > | translator_relation_parameters |
| ZKData | zk_sumcheck_data |
| std::vector< FF > | joint_challenge |
| MegaZKFlavor::AllValues | mega_zk_claimed_evals |
| TranslatorFlavor::AllValues | trans_claimed_evals |
| FF | claimed_libra_evaluation |
Prover for the batched MegaZK circuit + translator sumcheck and PCS.
Runs the MegaZK circuit (MegaZK) and translator pre-sumcheck phases on a shared transcript, then executes a single joint 17-round sumcheck and a single Shplemini/KZG reduction over both circuits' polynomials. The joint round univariate is:
U_joint(x) = U_MZK(x) + α^{K_H} · U_translator(x)
where K_H = MegaZKFlavor::NUM_SUBRELATIONS and α is drawn after all pre-sumcheck commitments.
The MegaZK circuit is treated as a 2^17 circuit via its RowDisablingPolynomial (padding_indicator = [1]*16 + [0]), so its contribution to round 16 is zero by construction.
Definition at line 32 of file batched_honk_translator_prover.hpp.
Definition at line 35 of file batched_honk_translator_prover.hpp.
Definition at line 34 of file batched_honk_translator_prover.hpp.
Definition at line 36 of file batched_honk_translator_prover.hpp.
| using bb::BatchedHonkTranslatorProver::MegaZKPartialEvals = MegaZKFlavor::PartiallyEvaluatedMultivariates |
Definition at line 40 of file batched_honk_translator_prover.hpp.
Definition at line 37 of file batched_honk_translator_prover.hpp.
Definition at line 39 of file batched_honk_translator_prover.hpp.
| using bb::BatchedHonkTranslatorProver::MegaZKSubrelationSeparators = std::array<FF, MegaZKFlavor::NUM_SUBRELATIONS - 1> |
Definition at line 41 of file batched_honk_translator_prover.hpp.
Definition at line 38 of file batched_honk_translator_prover.hpp.
| using bb::BatchedHonkTranslatorProver::SumcheckRoundUnivariate = bb::Univariate<FF, MegaZKFlavor::BATCHED_RELATION_PARTIAL_LENGTH> |
Definition at line 47 of file batched_honk_translator_prover.hpp.
Definition at line 46 of file batched_honk_translator_prover.hpp.
| using bb::BatchedHonkTranslatorProver::TransPartialEvals = TranslatorFlavor::PartiallyEvaluatedMultivariates |
Definition at line 43 of file batched_honk_translator_prover.hpp.
Definition at line 42 of file batched_honk_translator_prover.hpp.
| using bb::BatchedHonkTranslatorProver::TransSubrelationSeparators = std::array<FF, TranslatorFlavor::NUM_SUBRELATIONS - 1> |
Definition at line 44 of file batched_honk_translator_prover.hpp.
Definition at line 45 of file batched_honk_translator_prover.hpp.
| bb::BatchedHonkTranslatorProver::BatchedHonkTranslatorProver | ( | std::shared_ptr< MegaZKProverInstance > | mega_zk_instance, |
| std::shared_ptr< MegaZKVK > | mega_zk_vk, | ||
| std::shared_ptr< Transcript > | transcript | ||
| ) |
Definition at line 12 of file batched_honk_translator_prover.cpp.
|
private |
Execute the joint Shplemini / KZG PCS over both circuits' polynomials.
All polynomials from both circuits are combined into a single PolynomialBatcher and passed to ShpleminiProver_<Curve>::prove() at the joint sumcheck challenge (u_0,...,u_16). The MegaZK circuit's 2^16-size polynomials are treated as 17-variable by constructing the batcher with joint_circuit_size = 2^17; the upper half is implicitly zero.
Definition at line 259 of file batched_honk_translator_prover.cpp.
|
private |
Execute the joint 17-round sumcheck.
Draws "Sumcheck:alpha" — binding to all pre-sumcheck messages from both circuits — then runs 17 rounds, sending U_joint(x) = U_MZK(x) + α^{K_H} · U_translator(x) + L(x) where L(x) is the joint Libra masking univariate.
For rounds 0..mega_zk_log_n-1 ("real rounds"), the MegaZK contribution is computed via standard compute_univariate minus compute_disabled_contribution (row-disabling for ZK).
For rounds mega_zk_log_n..JOINT_LOG_N-1 ("virtual rounds"), the MegaZK polynomials are treated as zero-padded to 2^JOINT_LOG_N. The contribution is computed via compute_virtual_contribution (evaluating the relation at the only non-zero edge), scaled by the RDP factor from real rounds. After each virtual round, the partially-evaluated MegaZK polynomials are updated by multiplying by (1 - u_k), so the final claimed evaluations include the tau factor ∏(1 - u_k).
Definition at line 65 of file batched_honk_translator_prover.cpp.
|
private |
Run the MegaZK circuit's Oink phase.
Commits to witnesses and permutation polys. Alpha is NOT drawn here: a single joint alpha ("Sumcheck:alpha") is drawn in execute_joint_sumcheck_rounds() after all pre-sumcheck commitments from both circuits are on the transcript.
Definition at line 26 of file batched_honk_translator_prover.cpp.
|
private |
Run the translator's Oink phase on the shared transcript.
Delegates directly to TranslatorProver's public execute_*_round() methods, which handle VK hashing, wire commitments, and permutation grand products. This ensures the translator's commitment key is properly initialised and the proof transcript matches exactly what the standalone TranslatorProver would produce.
Definition at line 39 of file batched_honk_translator_prover.cpp.
| HonkProof bb::BatchedHonkTranslatorProver::prove | ( | std::shared_ptr< TranslatorProvingKey > | translator_proving_key | ) |
Definition at line 311 of file batched_honk_translator_prover.cpp.
| HonkProof bb::BatchedHonkTranslatorProver::prove_mega_zk_oink | ( | ) |
Definition at line 305 of file batched_honk_translator_prover.cpp.
|
private |
Definition at line 73 of file batched_honk_translator_prover.hpp.
|
private |
Definition at line 70 of file batched_honk_translator_prover.hpp.
|
staticconstexpr |
Definition at line 50 of file batched_honk_translator_prover.hpp.
|
private |
Definition at line 71 of file batched_honk_translator_prover.hpp.
|
private |
Definition at line 60 of file batched_honk_translator_prover.hpp.
|
private |
Definition at line 61 of file batched_honk_translator_prover.hpp.
|
private |
Definition at line 72 of file batched_honk_translator_prover.hpp.
|
private |
Definition at line 63 of file batched_honk_translator_prover.hpp.
|
private |
Definition at line 62 of file batched_honk_translator_prover.hpp.
|
private |
Definition at line 66 of file batched_honk_translator_prover.hpp.
|
private |
Definition at line 69 of file batched_honk_translator_prover.hpp.