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

Commitments SRS breakup companion #632

Merged
merged 8 commits into from
Apr 21, 2023
Merged

Conversation

Tabaie
Copy link
Contributor

@Tabaie Tabaie commented Apr 8, 2023

Companion to Consensys/gnark-crypto#378 and Consensys/gnark-crypto#384.

The main idea is that by breaking up the KZG prover and verifier portions (who only have the generator of G1 in common) we get a lighter-weight Plonk verifying key.
In light of this, we will have the option to serialize and deserialize the KZG verifying key as part of the Plonk verifying key. The advantage to this is its obvious convenience. The (less tangible) disadvantage is that it muddies the conceptual separation between data structures that are resulting from a trusted setup (KZG stuff) and those that are merely precomputed (commitments to selectors etc.)

Similarly, in Groth16 circuits using commitments, the verifying key is best not polluted by the Pedersen proving key with twice as many group elements as there are committed variables.

@@ -8,7 +8,7 @@ import (
"github.com/consensys/gnark-crypto/ecc/{{toLower .Curve}}/fr/iop"
"github.com/consensys/gnark-crypto/ecc"

kzgg "github.com/consensys/gnark-crypto/kzg"
//kzgg "github.com/consensys/gnark-crypto/kzg" TODO Figure out why this is useful
Copy link
Collaborator

Choose a reason for hiding this comment

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

if it compiles without it, kill it :)

@@ -46,7 +46,7 @@ type VerifyingKey struct {
NbPublicVariables uint64

// Commitment scheme that is used for an instantiation of PLONK
KZGSRS *kzg.SRS
Kzg kzg.VerifyingKey
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe Kzg -> KZGPk ? to make it clear that the Kzg objects in the proving and verifying keys are different.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I felt that when we have pk.Kzg and vk.Kzg the context makes the type clear.

@Tabaie Tabaie requested a review from gbotrel April 20, 2023 18:54
@Tabaie Tabaie changed the title Refactor/kzg srs breakup companion Commitments SRS breakup companion Apr 20, 2023
@Tabaie Tabaie merged commit beff2e2 into develop Apr 21, 2023
@Tabaie Tabaie deleted the refactor/kzg-srs-breakup-companion branch April 21, 2023 18:09
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.

3 participants