Skip to content

feat: improve Shplonk api#15422

Merged
federicobarbacovi merged 68 commits into
merge-train/barretenbergfrom
fb/shplonk_batched_claims
Jul 4, 2025
Merged

feat: improve Shplonk api#15422
federicobarbacovi merged 68 commits into
merge-train/barretenbergfrom
fb/shplonk_batched_claims

Conversation

@federicobarbacovi

@federicobarbacovi federicobarbacovi commented Jul 1, 2025

Copy link
Copy Markdown
Contributor

We enhance the Shplonk verifier api so that it can efficiently handle openings of polynomials that are linearly dependent

AztecBot and others added 30 commits June 27, 2025 02:02
…tered (#15313)

We make the folding of Apps share a transcript until a kernel is encountered.
Bigfield internal audit related cleanup/fixes.
- Simplified data structs: `non_native_multiplication_witnesses` and
`non_native_partial_multiplication_witnesses`
- Reduced code duplication with new functions like
`get_binary_basis_limb_witness_indices`
- Resolved/removed some of the TODOs

resolves #14662 #14660 
resolves AztecProtocol/barretenberg#999
resolves #14658
Final bigfield audit PR with a few circuit changes.

Modifications that don't change circuits:
- Change `MAXIMUM_LIMB_SIZE_THAT_WOULDNT_OVERFLOW = 86` from `87`
(explained in the code-comment). This only reduces our safety-margin
slightly, but we're already way below this so does not affect anything.
- Removed duplicated code and added a new function
`compute_partial_schoolbook_multiplication` to compute native limb
multiplication with documentation
- Refactored duplicated code to generate inputs to bigfield addition and
subtraction gates, should avoid copy-pasting!

Modifications that change circuits:
- Simplified `bigfield::conditional_negate` logic by just using
`bigfield::conditional_assign` without adding new gates. Note: Custom
logic of `bigfield::conditional_negate` had a bug in max value
calculations.
- Simplified `bigfield::conditional_select` using
`field::conditional_assign` instead of manually using `field_t::madd`
and subtraction.

resolves #14657 #14656 #14661 
resolves AztecProtocol/barretenberg#660
resolves #15091 
resolves #15088
Comment thread barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplonk.hpp Outdated
Comment thread barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplonk.hpp Outdated
Comment thread barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplonk.hpp Outdated
Comment thread barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplonk.hpp Outdated
Comment thread barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplonk.test.cpp Outdated
Comment thread barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplonk.test.cpp Outdated
Comment thread barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplonk.test.cpp Outdated
Comment thread barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/shplonk.test.cpp Outdated

@iakovenkos iakovenkos 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.

Nice work, thanks for making it more flexible and adding the tests! I left a couple of suggestions mostly related to the native/non-native specifics

@AztecBot AztecBot force-pushed the merge-train/barretenberg branch from 913ed6b to 4bc2037 Compare July 4, 2025 02:11
Comment thread barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplonk.hpp Outdated
Comment thread barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplonk.test.cpp Outdated

@iakovenkos iakovenkos 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.

lgtm!

@federicobarbacovi federicobarbacovi enabled auto-merge (squash) July 4, 2025 13:33
@federicobarbacovi federicobarbacovi merged commit f3526c9 into merge-train/barretenberg Jul 4, 2025
4 checks passed
@federicobarbacovi federicobarbacovi deleted the fb/shplonk_batched_claims branch July 4, 2025 13:42
github-merge-queue Bot pushed a commit that referenced this pull request Jul 4, 2025
See
[merge-train-readme.md](https://github.com/AztecProtocol/aztec-packages/blob/next/.github/workflows/merge-train-readme.md).

chore: stdlib bool internal audit  (#15070)
feat: improve Shplonk api (#15422)
fix(merge-train): don't queue merge if merge-train failed queue, pass on
rebase logic (#15508)
chore: nuke bit array (#15522)
chore: remove template parameters (#15530)

---------

Co-authored-by: AztecBot <tech@aztecprotocol.com>
Co-authored-by: sergei iakovenko <105737703+iakovenkos@users.noreply.github.com>
Co-authored-by: federicobarbacovi <171914500+federicobarbacovi@users.noreply.github.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>
github-merge-queue Bot pushed a commit that referenced this pull request Jul 9, 2025
See
[merge-train-readme.md](https://github.com/AztecProtocol/aztec-packages/blob/next/.github/workflows/merge-train-readme.md).

BEGIN_COMMIT_OVERRIDE
chore: stdlib bool internal audit  (#15070)
feat: improve Shplonk api (#15422)
fix(merge-train): don't queue merge if merge-train failed queue, pass on
rebase logic (#15508)
chore: nuke bit array (#15522)
chore: remove template parameters (#15530)
chore: no PK (#15386)
chore!: Correct public inputs propagation in the tube (#15547)
chore: use `batch_invert` in native IPA verifier (#15557)
chore: Move `stdlib::uint_plookup` to `stdlib::uint` (#15460)
chore: use const ref commitment keys (#15584)
fix: hiding circuit vk computed only once (#15589)
feat: transcript can hash objects independently (#15510)
chore: readme for benchmarking remotely (#15512)
chore: fix avm test (#15592)
chore: hash more stuff for IPA. (#15519)
chore: fix avm build in merge-train/bb (#15594)
feat!: structured public inputs via kernel io (#15383)
fix!: aggregate correct nested pairing points in the hiding circuit
(#15598)
fix: bb merge-train conflicts (#15617)
chore: Refactor shplonk verifier api (#15618)
chore!: databus consistency checks in the hiding circuit (#15599)
feat!: VK hash consistency check (#15591)
END_COMMIT_OVERRIDE

---------

Co-authored-by: AztecBot <tech@aztecprotocol.com>
Co-authored-by: sergei iakovenko <105737703+iakovenkos@users.noreply.github.com>
Co-authored-by: federicobarbacovi <171914500+federicobarbacovi@users.noreply.github.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>
danielntmd pushed a commit to danielntmd/aztec-packages that referenced this pull request Jul 16, 2025
See
[merge-train-readme.md](https://github.com/AztecProtocol/aztec-packages/blob/next/.github/workflows/merge-train-readme.md).

chore: stdlib bool internal audit  (AztecProtocol#15070)
feat: improve Shplonk api (AztecProtocol#15422)
fix(merge-train): don't queue merge if merge-train failed queue, pass on
rebase logic (AztecProtocol#15508)
chore: nuke bit array (AztecProtocol#15522)
chore: remove template parameters (AztecProtocol#15530)

---------

Co-authored-by: AztecBot <tech@aztecprotocol.com>
Co-authored-by: sergei iakovenko <105737703+iakovenkos@users.noreply.github.com>
Co-authored-by: federicobarbacovi <171914500+federicobarbacovi@users.noreply.github.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>
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.

6 participants