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

Proposal: Replicating circom-MP-SPDZ to support Lattigo #66

Open
tmors opened this issue Aug 12, 2024 · 3 comments
Open

Proposal: Replicating circom-MP-SPDZ to support Lattigo #66

tmors opened this issue Aug 12, 2024 · 3 comments
Labels
Application Proposal Proposal submitted by applicants

Comments

@tmors
Copy link

tmors commented Aug 12, 2024

General Grant Proposal

Replicating circom-MP-SPDZ to support Lattigo #54

Project Overview 📄

Overview

  1. write documentation for lattigo
  2. replicate circom-MP-SPDZ to support lattigo

Project Details

Team 👥

Team members

Team's experience

We have rich experience in cryptographic component development, including OT, PSI, GC, Beaver Triples, etc., and are familiar with golang and MP-SPDZ.

Development Roadmap 🔩

Overview

  • Total Estimated Duration: 10 weeks
  • Total Estimated Working Hours: 150 hr
  • Full-time equivalent (FTE): 0.4
  • Expected Start Date: Aug 16th 2024
  • Expected End Date: Oct 30th 2024

Milestone 1: Understanding Lattigo and Documentation

  • Estimated Duration: 3 weeks
  • FTE: 0.4
  • Estimated delivery date: Sep 8th, 2024
  • Total Estimated Working Hours: 45

Deliverables and Specifications

1a. Documentation
  • A comprehensive tutorial explaining Lattigo's domains, supported operations and data types (and how they are compatible with circom's operations, paying special attention to binary, arithmetic in prime field and ring $2^k$), security parameters, and number of parties supported.
  • Best practices and caveats.
  • Step-by-step guide on executing example scenarios (covering as much the discovered knowledge above as possible for demonstration purpose) with Lattigo.

Milestone 2 : Adaptation of circom-MP-SPDZ to circom-Lattigo

  • Estimated Duration: 7 weeks
  • FTE: 0.4
  • Estimated delivery date: Oct 30th 2024
  • Total Estimated Working Hours: 105

Deliverables and Specifications

2a. Functionality: Generate Circuits for Lattigo from Bristol Circuit

Modify circom-MP-SPDZ code to generate Lattigo circuit output from circom-2-arithc.

2b. Functionality: Generate Inputs for Lattigo from circom-MP-SPDZ Inputs

Modify circom-MP-SPDZ code to generate inputs for Lattigo from the inputs defined in circom-MP-SPDZ.

2c. Functionality: Run the Generated Lattigo Circuits and Inputs

Modify circom-MP-SPDZ code to run Lattigo and get parsed outputs.

Application

Component 2c runs Lattigo with the circuits generated by component 2a with the inputs generated from component 2b.

2d. Testing Guide
  • Proper unit test coverage (e.g. above 90%) for circuit generation, input generation, and circuit execution.
  • Integration tests for example circuits like op_tests, naive_search, two_outputs and nn_circuit_small (notice that you should expect some tricky issues here due to incompatibility between circom front end and Lattigo backend, and also some configurations are needed, see the original circom-MP-SPDZ for reference).
2e. Documentation
  • Inline documentation of the code.
  • Comprehensive documentation covering the entire workflow, from code modification to testing and execution.
@NOOMA-42 NOOMA-42 added the Application Proposal Proposal submitted by applicants label Aug 13, 2024
@NOOMA-42
Copy link
Collaborator

@mhchia could you review this. Feel free to use discord to discuss more in real time as well. cc @tmors

@mhchia
Copy link

mhchia commented Aug 21, 2024

@tmors

Could you please make a few adjustments to the milestones?

  1. The Total Estimated Duration is currently 8 weeks (8*40*0.4=128 hours), which is slightly shorter than the 150 hours required. Would you consider extending the duration to 10 weeks (160 hours) or more? This would provide a buffer. The working hours remain the same, but the due date would be adjusted accordingly. Of course, you can still finish earlier once the milestone is completed.

  2. For both milestones, could you add "Total Estimated Working Hours"?

    • Milestone 1: "Total Estimated Working Hours: 45"
    • Milestone 2: "Total Estimated Working Hours: 105"
  3. Could you please use the milestone deliverables and specifications we've provided instead?

Milestone 1:

#### Deliverables and Specifications

##### 1a. Documentation
- A comprehensive tutorial explaining Lattigo's domains, supported operations and data types (and how they are compatible with circom's operations, paying special attention to binary, arithmetic in prime field and ring $2^k$), security parameters, and number of parties supported.
- Best practices and caveats.
- Step-by-step guide on executing example scenarios (covering as much the discovered knowledge above as possible for demonstration purpose) with Lattigo.

Milestone 2:

#### Deliverables and Specifications

##### 2a. Functionality: Generate Circuits for Lattigo from Bristol Circuit
Modify circom-MP-SPDZ code to generate Lattigo circuit output from circom-2-arithc.

##### 2b. Functionality: Generate Inputs for Lattigo from circom-MP-SPDZ Inputs
Modify circom-MP-SPDZ code to generate inputs for Lattigo from the inputs defined in circom-MP-SPDZ.

##### 2c. Functionality: Run the Generated Lattigo Circuits and Inputs
Modify [circom-MP-SPDZ code](https://github.com/namnc/circom-mp-spdz/blob/4b5745c17c500903ccfbae0735370cd33283a0f6/main.py#L284-L314) to run Lattigo and get parsed outputs.

##### Application
Component 2c runs Lattigo with the circuits generated by component 2a with the inputs generated from component 2b.

##### 2d. Testing Guide
- Proper unit test coverage (e.g. above 90%) for circuit generation, input generation, and circuit execution.
- Integration tests for example circuits like `op_tests`, `naive_search`, `two_outputs` and `nn_circuit_small` (notice that you should expect some tricky issues here due to incompatibility between circom front end and Lattigo backend, and also some configurations are needed, see the original circom-MP-SPDZ for reference).

##### 2e. Documentation
- Inline documentation of the code.
- Comprehensive documentation covering the entire workflow, from code modification to testing and execution.

Please let me know if you have any concerns. Thanks!

NOTE: The "Expected Start Date" and "Expected End Date" might be subject to changes since they could be finalized after the grant is confirmed.

@mhchia
Copy link

mhchia commented Aug 23, 2024

Looks good to us! cc @NOOMA-42

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