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

cleanup commitment scheme bounds #39

Merged
merged 1 commit into from
Jan 19, 2024
Merged

Conversation

slumber
Copy link
Contributor

@slumber slumber commented Jan 17, 2024

Basically, get rid of , Commitment = Projective<G> bound everywhere + move Into + From into the Commitment trait.

@@ -19,7 +19,7 @@ where
impl<G: CurveGroup, PC: PolyCommitmentScheme<G>> CommitmentScheme<G> for PolyVectorCommitment<G, PC>
where
G: CurveGroup,
PC::Commitment: Copy,
PC::Commitment: Copy + Into<G> + From<G>,
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 believe we still have to carry these 2 bounds, as we can't put it into PC::Commitment definition.

Copy link
Contributor

Choose a reason for hiding this comment

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

this seems reasonable to me. adding these bounds to PolyCommitmentScheme in spartan would break the hyrax implementation (commitments are sqrt-sized vecs of G elements). the hyrax implementation was mostly a way for me to develop this trait before implementing zeromorph, but we might as well keep it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

arkworks-rs/poly-commit#130 might get merged soon

Copy link
Contributor

@tess-eract tess-eract left a comment

Choose a reason for hiding this comment

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

Fantastic! these trait bounds were causing me plenty of headaches earlier, and this is much cleaner.

@@ -90,7 +93,7 @@ where
G: CurveGroup,
G::BaseField: PrimeField + Absorb,
G::Affine: Absorb,
C: CommitmentScheme<G, Commitment = G>,
Copy link
Contributor

Choose a reason for hiding this comment

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

good catch - i guess this impl is only used for the secondary circuit, so the compiler didn't catch this one.

@@ -19,7 +19,7 @@ where
impl<G: CurveGroup, PC: PolyCommitmentScheme<G>> CommitmentScheme<G> for PolyVectorCommitment<G, PC>
where
G: CurveGroup,
PC::Commitment: Copy,
PC::Commitment: Copy + Into<G> + From<G>,
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems reasonable to me. adding these bounds to PolyCommitmentScheme in spartan would break the hyrax implementation (commitments are sqrt-sized vecs of G elements). the hyrax implementation was mostly a way for me to develop this trait before implementing zeromorph, but we might as well keep it.

@slumber slumber merged commit ae0b3b4 into main Jan 19, 2024
4 checks passed
@slumber slumber deleted the slumber-cleanup-trait-bounds branch July 3, 2024 11:02
sjudson pushed a commit that referenced this pull request Feb 5, 2025
I noticed an image is missing in README. I'm adding it.
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.

2 participants