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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Porting zk-kit Circom circuits to Noir - 1 #47

Open
RajeshRk18 opened this issue Apr 18, 2024 · 21 comments
Open

Proposal: Porting zk-kit Circom circuits to Noir - 1 #47

RajeshRk18 opened this issue Apr 18, 2024 · 21 comments
Assignees
Labels
Application Proposal Proposal submitted by applicants

Comments

@RajeshRk18
Copy link

RajeshRk18 commented Apr 18, 2024

General Grant Proposal

Project Overview 馃搫

Overview

This is a project to port circomlib circuits from Circom to Noir for integrating with zk-kit circuit repo for Noir. The circuits are;

  • Baby-JubJub curve
  • EdDSA Poseidon

Project Details

  • As Noir is improving day-by-day with new features added and bugs fixed, rigorous testing of circuits are required.
  • Provide detailed documentation on every circuit to be ported.
  • Optimize circuits by leveraging unconstrained functions wherever possible.

Team 馃懃

Team

Team Website

N/A

Team's experience

  • Implemented ECDH and KZG Commitment verifiers in Noir.
  • Contributor and maintainer of Cryptography library in Noir. Helped with refactoring, optimizing, and fixing bugs.
  • Built a Map like data structure which takes $O(1)$ constraint for insertion/removal.
  • Contributor of Halo2 Backend for Noir.

Team Code Repos

Development Roadmap 馃敥

Overview

  • Total Estimated Duration: 1 month
  • Total Estimated Working Hours: 60 hrs
  • Full-time equivalent (FTE): 0.25
  • Expected Start Date: May 20th 2024
  • Expected End Date: June 20th 2024

Milestone 1: Port circuits

  • Estimated Duration: 10 days
  • FTE: 0.25
  • Estimated delivery date: June 1st 2024

Milestone 2: Add tests

  • Estimated Duration: 10 days
  • FTE: 0.25
  • Estimated delivery date: June 20th 2024

Milestone 3: Optimize constraints

  • Estimated Duration: 10 days
  • FTE: 0.25
  • Estimated delivery date: June 20th 2024

Deliverables and Specifications

0a. Codebase (Milestone 1+Milestone 2+Milestone 3, mostly Milestone 1)

Will have noir circuits for Baby-JubJub Curve, and Eddsa poseidon.

0b. Documentation (Milestone 1+Milestone 2+Milestone 3)

I will provide inline documentation of the circuits.

0c. Testing Guide (Milestone 2)

The circuits will come with lots of unit tests and integration tests(wherever possible).

0d. Benchmarks (MIlestone 3)

I will try to add the number of constraints for each circuit.

@NOOMA-42 NOOMA-42 changed the title Project: Porting zk-kit Circom circuits to Noir Proposal: Porting zk-kit Circom circuits to Noir Apr 19, 2024
@NOOMA-42 NOOMA-42 added the Application Proposal Proposal submitted by applicants label Apr 19, 2024
@NOOMA-42
Copy link
Collaborator

NOOMA-42 commented Apr 19, 2024

Thanks for submission, I'll get the task detail out asap. A potential reviewer is currently ooo til 25th, please kindly wait till he come back

@RajeshRk18
Copy link
Author

@NOOMA-42 when it will be reviewed?

@NOOMA-42
Copy link
Collaborator

@NOOMA-42 when it will be reviewed?

We'll try to fill out the task detail this week and start to review. Thanks for your patience

@NOOMA-42
Copy link
Collaborator

@RajeshRk18 I've updated the task detail. the scope of first part covers eddsa-poseidon, baby-jubjub, and utils. Would you like to modify the proposal based on this?
We'll also have 2 more tasks covering the rest of the zk-kit circuit

@RajeshRk18
Copy link
Author

@RajeshRk18 I've updated the task detail. the scope of first part covers eddsa-poseidon, baby-jubjub, and utils. Would you like to modify the proposal based on this?
We'll also have 2 more tasks covering the rest of the zk-kit circuit

Ok, I'll adjust. Shall I also apply for the other 2 proposals?

@NOOMA-42
Copy link
Collaborator

NOOMA-42 commented Apr 30, 2024

I'd said let's focus on this one first. Let me know when you've modified the proposal

@RajeshRk18 I've updated the task detail. the scope of first part covers eddsa-poseidon, baby-jubjub, and utils. Would you like to modify the proposal based on this?
We'll also have 2 more tasks covering the rest of the zk-kit circuit

Ok, I'll adjust. Shall I also apply for the other 2 proposals?

@RajeshRk18
Copy link
Author

Hey @NOOMA-42 , I have updated the proposal.

@NOOMA-42
Copy link
Collaborator

NOOMA-42 commented May 2, 2024

Thank you! @aguzmant103 is looking for a grant liaison to review this proposal.

Hey @NOOMA-42 , I have updated the proposal.

@NOOMA-42 NOOMA-42 changed the title Proposal: Porting zk-kit Circom circuits to Noir Proposal: Porting zk-kit Circom circuits to Noir - 1 May 3, 2024
@NOOMA-42
Copy link
Collaborator

NOOMA-42 commented May 9, 2024

@cedoor would review this proposal

@cedoor
Copy link
Member

cedoor commented May 10, 2024

@NOOMA-42 would it be possible to update the description of this proposal?

EdDSA proof is actually just built on top of the Circomlib circuits (Baby Jubjub and Poseidon). We're also moving it to the Semaphore repo as it's actually quite specific (i.e. it's the Semaphore Identity schema). I don't think they should be included here.

"Baby-JubJub curve" and "EdDSA Poseidon" look fine, but their Circom implementation is not part of ZK-Kit, they're part of the Circomlib repo. The amount of time to build them in Noir defined in this proposal seems fine to me, depending on the dev's experience ofc.

Also, I'd suggest to anyone working on these circuits that they work on them in a personal repo, and then integrate them into zk-kit, which will soon provide a separate repo for Noir circuits only (zk-kit.noir).

@RajeshRk18
Copy link
Author

@NOOMA-42 would it be possible to update the description of this proposal?

EdDSA proof is actually just built on top of the Circomlib circuits (Baby Jubjub and Poseidon). We're also moving it to the Semaphore repo as it's actually quite specific (i.e. it's the Semaphore Identity schema). I don't think they should be included here.

Yeah, I thought of that. So, maybe porting zk-kit circuits will imply porting the circuits it builds on.

@RajeshRk18
Copy link
Author

"Baby-JubJub curve" and "EdDSA Poseidon" look fine, but their Circom implementation is not part of ZK-Kit, they're part of the Circomlib repo. The amount of time to build them in Noir defined in this proposal seems fine to me, depending on the dev's experience ofc.

Yeah, I can make it within the deadline!

@RajeshRk18
Copy link
Author

Also, I'd suggest to anyone working on these circuits that they work on them in a personal repo, and then integrate them into zk-kit, which will soon provide a separate repo for Noir circuits only (zk-kit.noir).

Sure

@NOOMA-42
Copy link
Collaborator

@cedoor I've updated it, @RajeshRk18 do you have anything you want to update?

@RajeshRk18
Copy link
Author

@cedoor I've updated it, @RajeshRk18 do you have anything you want to update?

Yeah I'll do that

@RajeshRk18
Copy link
Author

@NOOMA-42 I have updated the proposal!

@NOOMA-42
Copy link
Collaborator

LGTM @cedoor do you want to review again?

@RajeshRk18
Copy link
Author

@NOOMA-42 where to discuss the budget?

@NOOMA-42
Copy link
Collaborator

There will be a separate call after we finish the content wise review

@NOOMA-42 where to discuss the budget?

@cedoor
Copy link
Member

cedoor commented May 17, 2024

LGTM @cedoor do you want to review again?

Hey sorry for my late reply. I've reviewed it again and looked into it. The Noir team's already implemented these circuits:

What can be done in this proposal is to optimize them and make them more efficient, taking advantage of recursion perhaps, which should be the Noir's superpower. I would also add this idea to the proposal: https://aztecnetwork.notion.site/f06968995c124de1be359459775ca2cb?v=613d3cb893dd46899a5bd3793b01e63b, which is closely related to Baby Jubjub and another PSE project: https://github.com/cursive-team/babyjubjub-ecdsa.

Please let me know if this makes sense for you @NOOMA-42 @RajeshRk18 . It seems proportionate to the amount of work defined in this proposal to me.

@RajeshRk18
Copy link
Author

LGTM @cedoor do you want to review again?

Hey sorry for my late reply. I've reviewed it again and looked into it. The Noir team's already implemented these circuits:

What can be done in this proposal is to optimize them and make them more efficient, taking advantage of recursion perhaps, which should be the Noir's superpower. I would also add this idea to the proposal: https://aztecnetwork.notion.site/f06968995c124de1be359459775ca2cb?v=613d3cb893dd46899a5bd3793b01e63b, which is closely related to Baby Jubjub and another PSE project: https://github.com/cursive-team/babyjubjub-ecdsa.

Please let me know if this makes sense for you @NOOMA-42 @RajeshRk18 . It seems proportionate to the amount of work defined in this proposal to me.

Looks good to me! Here is my rough proposal idea:

  • Optimize baby jubjub and eddsa
  • Implement ECDSA on babyjub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Application Proposal Proposal submitted by applicants
Projects
None yet
Development

No branches or pull requests

3 participants