Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::MergeVerifier Class Reference

Verifier class for the Goblin ECC op queue transcript merge protocol. More...

#include <merge_verifier.hpp>

Classes

struct  InputCommitments
 

Public Types

using Commitment = typename Curve::AffineElement
 
using TableCommitments = std::array< Commitment, NUM_WIRES >
 

Public Member Functions

 MergeVerifier (const MergeSettings settings=MergeSettings::PREPEND, const std::shared_ptr< Transcript > &transcript=std::make_shared< Transcript >())
 
std::pair< bool, TableCommitmentsverify_proof (const HonkProof &proof, const InputCommitments &input_commitments)
 Verify proper construction of the aggregate Goblin ECC op queue polynomials T_j, j = 1,2,3,4.
 

Public Attributes

std::shared_ptr< Transcripttranscript
 
MergeSettings settings
 

Private Types

using Curve = curve::BN254
 
using FF = typename Curve::ScalarField
 
using PCS = bb::KZG< Curve >
 
using VerifierCommitmentKey = bb::VerifierCommitmentKey< Curve >
 
using Transcript = NativeTranscript
 

Static Private Attributes

static constexpr size_t NUM_WIRES = MegaExecutionTraceBlocks::NUM_WIRES
 

Detailed Description

Verifier class for the Goblin ECC op queue transcript merge protocol.

Definition at line 22 of file merge_verifier.hpp.

Member Typedef Documentation

◆ Commitment

Definition at line 34 of file merge_verifier.hpp.

◆ Curve

Definition at line 23 of file merge_verifier.hpp.

◆ FF

using bb::MergeVerifier::FF = typename Curve::ScalarField
private

Definition at line 24 of file merge_verifier.hpp.

◆ PCS

Definition at line 25 of file merge_verifier.hpp.

◆ TableCommitments

Definition at line 35 of file merge_verifier.hpp.

◆ Transcript

Definition at line 27 of file merge_verifier.hpp.

◆ VerifierCommitmentKey

Constructor & Destructor Documentation

◆ MergeVerifier()

bb::MergeVerifier::MergeVerifier ( const MergeSettings  settings = MergeSettings::PREPEND,
const std::shared_ptr< Transcript > &  transcript = std::make_shared<Transcript>() 
)
explicit

Definition at line 14 of file merge_verifier.cpp.

Member Function Documentation

◆ verify_proof()

std::pair< bool, typename MergeVerifier::TableCommitments > bb::MergeVerifier::verify_proof ( const HonkProof proof,
const InputCommitments input_commitments 
)

Verify proper construction of the aggregate Goblin ECC op queue polynomials T_j, j = 1,2,3,4.

Let \(l_j\), \(r_j\), \(m_j\) be three vectors. The Merge wants to convince the verifier that the polynomials l_j, r_j, m_j for which they have sent commitments [l_j], [r_j], [m_j] satisfy

  • m_j(X) = l_j(X) + X^l r_j(X) (1)
  • deg(l_j(X)) < k (2) where k = shift_size.

To check condition (1), the verifier samples a challenge kappa and request from the prover a proof that the polynomial p_j(X) = l_j(kappa) + kappa^k r_j(kappa) - m_j(kappa) opens to 0 at kappa.

To check condition (2), the verifier requests from the prover the commitment to a polynomial g_j, and then requests proofs that l_j(1/kappa) = c g_j(kappa) = d Then, they verify c * kappa^{k-1} = d, which implies, up to negligible probability, that g_j(X) = X^{l-1} l_j(1/X), which means that deg(l_j(X)) < l.

The verifier must therefore check 12 opening claims: p_j(kappa) = 0, l_j(1/kappa), g_j(kappa) We use Shplonk to verify the claims with a single MSM (instead of computing [p_j] from [l_j], [r_j], [m_j] and then open it). We initialize the Shplonk verifier with the following commitments: [l_1], [r_1], [m_1], [g_1], ..., [l_4], [r_4], [m_4], [g_4] Then, we verify the various claims:

  • p_j(kappa) = 0: The commitment to p_j is constructed from the commitments to l_j, r_j, m_j, so the claim passed to the Shplonk verifier specifies the indices of these commitments in the above vector: {4 * (j-1), 4 * (j-1) + 1, 4 * (j-1) + 2}, the coefficients reconstructing p_j from l_j, r_j, m_j: {1, kappa^k, -1}, and the claimed evaluation: 0.
  • l_j(1/kappa) = v_j: The index in this case is {4 * (j-1)}, the coefficient is { 1 }, and the evaluation is v_j.
  • g_j(kappa) = w_j: The index is {3 + 4 * (j-1)}, the coefficient is { 1 }, and the evaluation is w_j. The claims are passed in the following order: {kappa, 0}, {kappa, 0}, {kappa, 0}, {kappa, 0}, {1/kappa, v_1}, {kappa, w_1}, .., {1/kappa, v_4}, {kappa, w_4}

In the Goblin scenario, we have:

  • \(l_j = t_j, r_j = T_{prev,j}, m_j = T_j\) if we are prepending the subtable
  • \(l_j = T_{prev,j}, r_j = t_j, m_j = T_j\) if we are appending the subtable
Parameters
proof
inputs_commitmentsThe commitments used by the Merge verifier
Returns
std::pair<bool, TableCommitments> Pair of verification result and the commitments to the merged tables as read from the proof

Definition at line 62 of file merge_verifier.cpp.

Member Data Documentation

◆ NUM_WIRES

constexpr size_t bb::MergeVerifier::NUM_WIRES = MegaExecutionTraceBlocks::NUM_WIRES
staticconstexprprivate

Definition at line 31 of file merge_verifier.hpp.

◆ settings

MergeSettings bb::MergeVerifier::settings

Definition at line 49 of file merge_verifier.hpp.

◆ transcript

std::shared_ptr<Transcript> bb::MergeVerifier::transcript

Definition at line 48 of file merge_verifier.hpp.


The documentation for this class was generated from the following files: