Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PolynomialCommitment trait simplification #116

Open
3 of 11 tasks
mmagician opened this issue Jun 11, 2023 · 3 comments
Open
3 of 11 tasks

PolynomialCommitment trait simplification #116

mmagician opened this issue Jun 11, 2023 · 3 comments
Labels
breaking-change Breaking change D-hard Difficulty: hard T-design Type: discuss API design and/or research

Comments

@mmagician
Copy link
Member

mmagician commented Jun 11, 2023

Summary

The PolynomialCommitment trait is a little cumbersome with all the wrapper types.
See if we can simplify the trait and then implement it for all schemes. Some ideas:

  • rename check -> verify- there are a lot of name variations in the literature for the same algorithm, though check seems to be used less frequently. verify is more intuitive IMO.
  • LabeledPolynomial construction is cumbersome: introduce a from conversion on Polynomial<F> with some reasonable defaults, or:
  • combine it with the trim function, which would take the parameters from the max degree of all labeled polys we are working with.
  • infer QuerySet from a vector of (vectors of?) points. Construct Evaluations from QuerySet and a Vec<Polynomial>.
  • can we construct the ChallengeGenerator automatically? We know the sponge, and we know whether the poly is uni- or multi-variate, so this can be part of e.g. setup.
  • split the trait into a "base" trait and "batched" trait (?)
  • document all the methods

See also jellyfish PCS trait, although the Espresso traits aren't as generic as they are mostly tailored for KZG.
@alxiong


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@mmagician mmagician added D-hard Difficulty: hard T-design Type: discuss API design and/or research breaking-change Breaking change labels Jun 11, 2023
@mmagician
Copy link
Member Author

We'll use this issue to keep track of various pain points in the interface so maybe we can iterate on it.
Some more ideas:

  • trim function only supports univariate polys (since degree is always 1 for ML). E.g. the only multilinear PCS in the crate doesn't follow the PolynomialCommitment trait pattern (perhaps this is one of the reasons) and instead implements the same methods (more or less, but with simplified signatures) as stand-alone on the struct.

@mmagician
Copy link
Member Author

Actually, one very natural extension of a point I already describe in that issue: split the trait into a "base" trait and "batched" trait is the following: split the commit/open/verify functions into being able to work with single vs. multiple polys. Place the {commit/open/verify}_single into the base PolynomialCommitment trait and {commit/open/verify}_multiintoPolynomialCommitmentMultiPoly: PolynomialCommitment`.

Note that this is different than batched, which refers to num of points being opened, IIUC.

That simplification automatically removes the need to be generic on S: CryptographicSponge (since the sponge is used for taking RLC of polys) and allows for a much more natural interface like the one that multilinear_pc offers.
TBD how much boilerplate around combined_polynomial += (curr_challenge, polynomial.polynomial()); can be re-used later in the _multi methods.

@autquis
Copy link
Contributor

autquis commented Jan 15, 2024

So far, the ChallengeGenerator was removed in #139.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Breaking change D-hard Difficulty: hard T-design Type: discuss API design and/or research
Projects
None yet
Development

No branches or pull requests

2 participants