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

Rework CommitmentScheme abstraction #7

Closed
swasilyev opened this issue Jan 28, 2022 · 1 comment
Closed

Rework CommitmentScheme abstraction #7

swasilyev opened this issue Jan 28, 2022 · 1 comment
Assignees

Comments

@swasilyev
Copy link
Collaborator

Current trait requires self to be used for committing/opening and verification at the same time.

/// Polynomial commitment scheme.
pub trait CommitmentScheme<F: PrimeField, P> {
    type G: AdditiveCommitment<F>;
    fn commit(&self, poly: &P) -> Self::G;
    fn commit_const(&self, c: &F) -> Self::G;
    /// Verifies that `p(x) = y` given the commitment to `p` and a proof.
    fn verify(&self, commitment: &Self::G, x: &F, y: F, proof: &Self::G) -> bool; // TODO: generalize proof type
}

These types has to be separated as they may be very different pieces of data. For KZG verifier key is 1G1 + 2G2 elements, while committer key can be huge.

@swasilyev swasilyev self-assigned this Jan 28, 2022
@swasilyev
Copy link
Collaborator Author

Reworked in #8 Good enough so far. Makes sense to have a non-trivial implementation, before polishing further: #9

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

No branches or pull requests

1 participant