|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
HyperNova folding prover. Folds circuit instances into accumulators, deferring PCS verification. More...
#include <hypernova_prover.hpp>
Public Types | |
| using | FF = MegaFlavor::FF |
| using | Commitment = MegaFlavor::Commitment |
| using | Accumulator = MultilinearBatchingProverClaim |
| using | Transcript = MegaFlavor::Transcript |
Public Member Functions | |
| HypernovaFoldingProver (std::shared_ptr< Transcript > transcript) | |
| template<typename InstanceFlavor > | |
| Accumulator | instance_to_accumulator (const std::shared_ptr< ProverInstance_< InstanceFlavor > > &instance, const std::shared_ptr< typename InstanceFlavor::VerificationKey > &honk_vk=nullptr) |
| Turn an instance into an accumulator by running Sumcheck. | |
| template<typename InstanceFlavor > | |
| HonkProof | accumulate_instance (const std::shared_ptr< ProverInstance_< InstanceFlavor > > &instance, const std::shared_ptr< typename InstanceFlavor::VerificationKey > &honk_vk=nullptr) |
| Turn an instance into an accumulator and cache the resulting claim for the final batching. | |
| std::pair< HonkProof, Accumulator > | finalize (std::optional< Accumulator > previous_accumulator=std::nullopt) |
| Batch the previous accumulator (if any) and the cached claims into a single accumulator. | |
| HonkProof | export_proof () |
| Export the proof contained in the transcript. | |
| const std::vector< Accumulator > & | get_cached_claims () const |
Private Member Functions | |
| template<typename InstanceFlavor > | |
| Accumulator | sumcheck_output_to_accumulator (SumcheckOutput< InstanceFlavor > &sumcheck_output, const std::shared_ptr< ProverInstance_< InstanceFlavor > > &instance, const std::shared_ptr< typename InstanceFlavor::VerificationKey > &honk_vk) |
| Convert the output of the sumcheck run on the incoming instance into an accumulator. | |
Static Private Member Functions | |
| template<size_t N> | |
| static Polynomial< FF > | batch_polynomials (RefArray< Polynomial< FF >, N > polynomials_to_batch, const size_t &full_batched_size, const std::vector< FF > &challenges) |
| Batch prover polynomials. Batching happens in place into the first polynomial in the RefArray supplied. | |
| template<size_t N> | |
| static Commitment | batch_mul (std::span< Commitment, N > _points, std::vector< FF > &scalars) |
| Utility to perform batch mul of commitments. | |
Private Attributes | |
| std::shared_ptr< Transcript > | transcript |
| std::vector< Accumulator > | cached_claims |
HyperNova folding prover. Folds circuit instances into accumulators, deferring PCS verification.
See: chonk/README.md#hypernova-folding-details
An Accumulator represents batched polynomial evaluation claims from one or more circuits. Instead of verifying each circuit's PCS separately, we batch claims into an accumulator and defer verification to a final "decider" proof. This enables efficient recursion.
Each accumulator contains:
The batching formula: batched = Σᵢ ρᵢ·pᵢ where ρᵢ are Fiat-Shamir challenges.
InstanceFlavor template parameter so circuits of different flavors (e.g. MegaAppFlavor for apps and MegaKernelFlavor for kernels) can all be folded into the same Accumulator.Construct → accumulate_instance() once per incoming circuit → finalize(previous_accumulator) exactly once, where previous_accumulator is the previously-owned accumulator. SINGLE-USE: one prover drives exactly one folding group
Definition at line 57 of file hypernova_prover.hpp.
Definition at line 61 of file hypernova_prover.hpp.
Definition at line 60 of file hypernova_prover.hpp.
Definition at line 59 of file hypernova_prover.hpp.
Definition at line 62 of file hypernova_prover.hpp.
|
inline |
Definition at line 64 of file hypernova_prover.hpp.
|
inline |
Turn an instance into an accumulator and cache the resulting claim for the final batching.
Definition at line 115 of file hypernova_prover.hpp.
|
inlinestaticprivate |
Utility to perform batch mul of commitments.
Definition at line 253 of file hypernova_prover.hpp.
|
inlinestaticprivate |
Batch prover polynomials. Batching happens in place into the first polynomial in the RefArray supplied.
Definition at line 214 of file hypernova_prover.hpp.
|
inline |
Export the proof contained in the transcript.
Definition at line 155 of file hypernova_prover.hpp.
|
inline |
Batch the previous accumulator (if any) and the cached claims into a single accumulator.
The previous accumulator is claim 0, followed by the cached per-instance claims in order. With a single assembled claim there is nothing to batch: it is returned and an empty proof is returned. With two or more, the MultilinearBatching sumcheck is run and its proof returned.
Definition at line 128 of file hypernova_prover.hpp.
|
inline |
Definition at line 158 of file hypernova_prover.hpp.
|
inline |
Turn an instance into an accumulator by running Sumcheck.
Definition at line 71 of file hypernova_prover.hpp.
|
inlineprivate |
Convert the output of the sumcheck run on the incoming instance into an accumulator.
Definition at line 168 of file hypernova_prover.hpp.
|
private |
Definition at line 162 of file hypernova_prover.hpp.
|
private |
Definition at line 161 of file hypernova_prover.hpp.