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

Improve groth16 encode API #179

Merged
merged 11 commits into from
Aug 7, 2024
Merged

Improve groth16 encode API #179

merged 11 commits into from
Aug 7, 2024

Conversation

capossele
Copy link
Contributor

@capossele capossele commented Jul 18, 2024

Pending #185

Attempt at solving #174 and #176.

Closes #174
Closes #176

@capossele capossele requested a review from a team as a code owner July 18, 2024 11:33
@capossele capossele self-assigned this Jul 18, 2024
/// Encoding of a [Groth16Receipt][risc0_zkvm::Groth16Receipt] by prefixing it with the verifier selector,
/// taken from the first 4 bytes of the hash of the verifier parameters including the Groth16
/// verification key and the control IDs that commit to the RISC Zero circuits.
pub fn encode(receipt: &Groth16Receipt<ReceiptClaim>) -> Vec<u8> {
Copy link
Contributor

Choose a reason for hiding this comment

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

How will we recommend going from https://docs.rs/bonsai-sdk/0.9.0/bonsai_sdk/responses/struct.SnarkReceipt.html, given we still recommend using bonsai-sdk over the zkvm for production use cases?

Copy link
Contributor

@nategraf nategraf left a comment

Choose a reason for hiding this comment

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

We are going rework this one based on discussion

@nategraf nategraf self-assigned this Jul 23, 2024
@capossele capossele requested a review from nategraf August 5, 2024 08:52
@capossele capossele marked this pull request as draft August 5, 2024 11:59
@nategraf nategraf changed the base branch from main to feat/alloy August 6, 2024 23:25
Copy link
Contributor

@nategraf nategraf left a comment

Choose a reason for hiding this comment

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

The new method for encoding a seal on input of a Receipt is the right direction. I don't think we should introduce a new type though. I've made some modifications and rebased this PR onto #183

@capossele capossele marked this pull request as ready for review August 7, 2024 08:32
@capossele capossele merged commit a42c5e3 into feat/alloy Aug 7, 2024
@capossele capossele deleted the capossele/improve-groth16 branch August 7, 2024 08:32
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.

Unintuitive groth16::encode API [BUG] groth16::encode takes a owned Vec<u8> when it could take a slice
3 participants