Skip to content

Conversation

mariuslp
Copy link

Description

This PR adds the method commit_sparse to the KZG10 module. Its API is equivalent to the one of commit but accepts sparse polynomials instead of dense polynomials.
This optimisation allows to replace the MSM by a naive version, which in the case of sparse polynomials such as X^n - 1, X - alpha etc. is order of magnitudes faster. This can significantly reduce verifier time.

Important note: this PR can only be merged after the merge of arkworks-rs/algebra#1035.

Results from a quick benchmark, where the verifier checks if e(comm, h) = e(comm, h) for some point h from the SRS:

Comm = X^n - 1
commit time is down by 64.7%, total verifier time (1 commit + 2 pairings) is down by 32.7%

Comm = X - alpha
commit time is down by 75.0%, total verifier time (1 commit + 2 pairings) is down by 17.8%

Comm = X^(n-k)
commit time is down by 99.7%, total verifier time (1 commit + 2 pairings) is down by 27.6%

closes: #169


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (master)
  • Linked to Github issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

@mariuslp mariuslp requested a review from a team as a code owner September 23, 2025 15:24
@mariuslp mariuslp requested review from z-tech, Pratyush and mmagician and removed request for a team September 23, 2025 15:24
Copy link
Member

@Pratyush Pratyush left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@Pratyush Pratyush enabled auto-merge September 23, 2025 18:13
@mariuslp mariuslp changed the title Add commitments to sparse polynomials in KZG (#169) Add commitments to sparse polynomials in KZG Sep 29, 2025
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.

Add possibility to commit to sparse polynomials in KZG
2 participants