Skip to content

chore: Introduce data structures to hold inputs/outputs of the Merge verification#15735

Merged
federicobarbacovi merged 43 commits into
merge-train/barretenbergfrom
fb/merge_verifier_api
Jul 18, 2025
Merged

chore: Introduce data structures to hold inputs/outputs of the Merge verification#15735
federicobarbacovi merged 43 commits into
merge-train/barretenbergfrom
fb/merge_verifier_api

Conversation

@federicobarbacovi

@federicobarbacovi federicobarbacovi commented Jul 15, 2025

Copy link
Copy Markdown
Contributor

Introduce the classes SubtableWitnessCommitments which stores t_commitments (and in the future T_prev_commitments) and WitnessCommitments, which stores t_commitments, T_commitments (and in the future T_prev_commitments). The role of these classes is to facilitate the introduction of consistency checks between two consecutive merges, see #1351.

  • The value of t_commitments is populated by extracting the commitments from the VK of the PG verifier.
  • (Future work) The value of T_prev_commitments is populated by taking the previous value of T_commitments
  • The value of T_commitments is populated by the Merge verifier

AztecBot and others added 16 commits July 15, 2025 05:42
We modify the Merge protocol so that it enforces that the subtable
polynomial `t_j` has degree smaller than `subtable_size` as read from
the proof.

Closes AztecProtocol/barretenberg#1442

**Details**

As per the linked issue, we want to support ecc operations in app
circuits. To ensure that app ecc ops do not modify ecc ops that happened
before them, we need to ensure that the subtable length `t.size()` is
smaller than the constant `l` by which we right shift `T_prev`. This is
to ensure that `t + X^{l-1} T_prev` is indeed the polynomial
corresponding to the column `t || T_prev`.

We enforce this degree check in the merge protocol by requiring the
prover to commit to `g(X) := X^{l-1} t(1/X)` and provide openings `c`,
`d` of `t`, `g` at challenges `1/kappa`, `kappa`, respectively, for
which we check `c * kappa^{l-1} = d`.

To save on the number of MSMs performed, we use Shplonk to verify the
following claims:
- `t(X)` opens to `c` at `1/kappa`
- `p(X) = t(X) + X^{l-1} T_prev(X) - T(X)` opens to `0` at `kappa`
- `g(X) := X^{l-1} t(1/X)` opens to `d` at `kappa`

---------

Co-authored-by: AztecBot <tech@aztecprotocol.com>
Co-authored-by: sergei iakovenko <105737703+iakovenkos@users.noreply.github.com>
Co-authored-by: ludamad <adam.domurad@gmail.com>
Co-authored-by: Suyash Bagad <suyash@aztecprotocol.com>
Co-authored-by: Jonathan Hao <jonathan@aztec-labs.com>
Co-authored-by: ledwards2225 <98505400+ledwards2225@users.noreply.github.com>
Co-authored-by: Raju Krishnamoorthy <krishnamoorthy@gmail.com>
Co-authored-by: notnotraju <raju@aztec-labs.com>
Co-authored-by: Lucas Xia <lucasxia01@gmail.com>
Co-authored-by: Khashayar Barooti <khashayar@aztecprotocol.com>
Co-authored-by: Jean M <132435771+jeanmon@users.noreply.github.com>
Co-authored-by: Alex Gherghisan <alexghr@users.noreply.github.com>
Co-authored-by: Santiago Palladino <spalladino@users.noreply.github.com>
Co-authored-by: Santiago Palladino <santiago@aztec-labs.com>
Co-authored-by: ludamad <domuradical@gmail.com>
Co-authored-by: maramihali <mara@aztecprotocol.com>
@federicobarbacovi federicobarbacovi marked this pull request as ready for review July 15, 2025 15:38
@fcarreiro fcarreiro removed their request for review July 15, 2025 19:18
Comment thread barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp Outdated
Base automatically changed from merge-train/barretenberg to next July 16, 2025 16:20
@federicobarbacovi federicobarbacovi changed the base branch from next to merge-train/barretenberg July 17, 2025 12:06
@federicobarbacovi federicobarbacovi changed the title chore: Introduce MergeVerificationData chore: Introduce data structures to hold inputs/outputs of the Merge verification Jul 17, 2025
@federicobarbacovi federicobarbacovi self-assigned this Jul 17, 2025

@ledwards2225 ledwards2225 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for the updates. I think this is ready to get merged - any further updates to the model can be done in follow ons

Comment thread barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.hpp Outdated
Comment thread barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.hpp Outdated
// Recursively verify the corresponding merge proof
PairingPoints pairing_points = goblin.recursively_verify_merge(
circuit, decider_vk->witness_commitments.get_ecc_op_wires(), accumulation_recursive_transcript);
circuit, merge_commitments, merge_commitments.T_commitments, accumulation_recursive_transcript);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate what you've done here but I do still find it to be a bit funny because we're passing in the same data (T_commitments) twice, albeit as a const ref in one case. It does make it slightly clearer because I know exactly what data might be altered.

Is it eventually the case that we'll always pass in {t, T_prev} and always return T? If so it seems pretty natural to have those inputs passed in to the method (as a const) and have the output passed out (making the output {pairing_points, T}. FWIW I'm perfectly happy to merge this as it is and continue to iterate. I think it will become clearer what to do as this work progresses

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is always going to be the case that we pass in {t, T_prev}, and return T. I thought it would be better to have them all in one structure (mostly for ClientIVC), but maybe you're right and it's better to simply return T. We can discuss in next iterations.

Base automatically changed from merge-train/barretenberg to next July 17, 2025 20:46
@federicobarbacovi federicobarbacovi changed the base branch from next to merge-train/barretenberg July 18, 2025 08:21
@federicobarbacovi federicobarbacovi merged commit 0b82e77 into merge-train/barretenberg Jul 18, 2025
6 checks passed
@federicobarbacovi federicobarbacovi deleted the fb/merge_verifier_api branch July 18, 2025 08:22
github-merge-queue Bot pushed a commit that referenced this pull request Jul 21, 2025
See
[merge-train-readme.md](https://github.com/AztecProtocol/aztec-packages/blob/next/.github/workflows/merge-train-readme.md).

BEGIN_COMMIT_OVERRIDE
chore!: Remove circuit_size from all VKs (#15747)
chore: Introduce data structures to hold inputs/outputs of the Merge
verification (#15735)
chore: replace asserts with runtime errors. (#15671)
chore: kernels start with eq and reset (#15734)
chore: Introduce Native IO mechanism (#15820)
fix: Update Cargo.lock in avm-transpiler (#15837)
END_COMMIT_OVERRIDE

---------

Co-authored-by: AztecBot <tech@aztecprotocol.com>
Co-authored-by: ledwards2225 <98505400+ledwards2225@users.noreply.github.com>
Co-authored-by: federicobarbacovi <171914500+federicobarbacovi@users.noreply.github.com>
Co-authored-by: sergei iakovenko <105737703+iakovenkos@users.noreply.github.com>
Co-authored-by: ludamad <adam.domurad@gmail.com>
Co-authored-by: Suyash Bagad <suyash@aztecprotocol.com>
Co-authored-by: Jonathan Hao <jonathan@aztec-labs.com>
Co-authored-by: Raju Krishnamoorthy <krishnamoorthy@gmail.com>
Co-authored-by: notnotraju <raju@aztec-labs.com>
Co-authored-by: Lucas Xia <lucasxia01@gmail.com>
Co-authored-by: Khashayar Barooti <khashayar@aztecprotocol.com>
Co-authored-by: Jean M <132435771+jeanmon@users.noreply.github.com>
Co-authored-by: Alex Gherghisan <alexghr@users.noreply.github.com>
Co-authored-by: Santiago Palladino <spalladino@users.noreply.github.com>
Co-authored-by: Santiago Palladino <santiago@aztec-labs.com>
Co-authored-by: ludamad <domuradical@gmail.com>
Co-authored-by: maramihali <mara@aztecprotocol.com>
Co-authored-by: Sarkoxed <75146596+Sarkoxed@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants