arkworks-rs / poly-commit

A Rust library for polynomial commitments
Apache License 2.0
336 stars 131 forks source link

`PolynomialCommitment` trait simplification #116

Open mmagician opened 1 year ago

mmagician commented 1 year ago

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:

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


For Admin Use

mmagician commented 1 year ago

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:

mmagician commented 1 year ago

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 commented 9 months ago

So far, the ChallengeGenerator was removed in #139.