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

Open Task RFP for Replicating circom-MP-SPDZ to support tfhe-rs #55

Open
mhchia opened this issue May 29, 2024 · 4 comments
Open

Open Task RFP for Replicating circom-MP-SPDZ to support tfhe-rs #55

mhchia opened this issue May 29, 2024 · 4 comments
Labels
Round 3 June 1, 2024, to Aug 31, 2024 Task Be Taken Someone's proposal has passed and they work on this task Task This is a task open to everyone

Comments

@mhchia
Copy link

mhchia commented May 29, 2024

Open Task RFP for Replicating circom-MP-SPDZ to support tfhe-rs

Executive Summary

Project Details

  • Motivation:
    • This project will allow people to write Circom code and run FHE with the tfhe-rs framework, enabling more options for benchmarks and different use cases.
    • How to do it?
      • We can reuse the code in the circom-MP-SPDZ repo. Since the input files are generic and not limited to MP-SPDZ, we should be able to adapt the functions to generate circuits and inputs for tfhe-rs, allowing parties to easily run the tfhe-rs framework with the generated files.
        image
  • Scope of Work:
    • Task 0: Understand circom-MP-SPDZ
    • Task 1: Understand tfhe-rs and produce documentation for:
      • Supported features:
        • Types of gates (e.g., +, -, *, /, etc.)
        • Types of input (e.g., secret/constant integer, secret/constant fixed-point, etc.)
        • Security parameters
        • Number of parties supported
        • Best practices
        • etc.
      • How to use it with an example.
    • Task 2: Replicate circom-MP-SPDZ to circom-tfhe-rs
      • Fork the circom-MP-SPDZ repo and replace the dependency on MP-SPDZ with tfhe-rs.
      • Modify the code to generate circuits and inputs for tfhe-rs.
      • Modify the code to run the generated circuits and inputs with tfhe-rs.
      • Write unit tests for circuit generation, input generation, and circuit execution.
      • Write integration tests for the entire workflow for the example circuits: two_outputs and nn_circuit_small.
      • Write documentation for the entire workflow.
  • Expected Outcomes: [Clearly state what successful completion of the project looks like.]
    • A library for people to run FHE with tfhe-rs, supporting the same functionality as circom-MP-SPDZ:
      • All operators defined here are supported.
        • If any operation is not supported, discuss with the grant liaison.
      • Documentation on how to use the library.
      • Tests that run example circuits correctly.
      • Support for secret integers and fixed-points, unless limited by the framework.

Qualifications

  • Skills Required:
    • Circom, python
    • Knowledge in MPC/FHE, e.g. attended a course or similar experience
  • Preferred Qualifications:
    • Experience in using tfhe-rs or other MPC/FHE frameworks

Administrative Details

  • Grant Liaison(s):
  • Estimated Project Duration:
    • Estimation: 150 hours in total
      • Task 0 (30 hours): Understand circom-MP-SPDZ and how to adapt it to work with tfhe-rs.
      • Task 1 (30 hours): Understand tfhe-rs and produce documentation for what is supported and how to use it (with an example).
      • Task 2 (90 hours): Replicate circom-MP-SPDZ to circom-tfhe-rs.
  • Project Complexity: Hard
    The grantee will need to
    • Understand the entire flow of circom-MP-SPDZ.
    • Know how tfhe-rs works from a high-level perspective and learn how to write circuits properly.

Additional Information

Submission Details

  • Proposal Deadline: The deadline for submitting proposals is the end of this round of the Acceleration Program. Refer to current round
  • Submission Instructions: Please submit your proposal as an issue and link back to this issue in your proposal. Refer to proposal template for more details.
@NOOMA-42 NOOMA-42 added Task This is a task open to everyone Round 2 February 29, 2024, to May 31, 2024 labels May 31, 2024
@NOOMA-42 NOOMA-42 added Round 3 June 1, 2024, to Aug 31, 2024 and removed Round 2 February 29, 2024, to May 31, 2024 labels Jun 30, 2024
@hanbu97
Copy link

hanbu97 commented Aug 5, 2024

Hi, I'm interested in this project, but I'm a bit confused - how does tfhe-rs support MPC?

@mhchia
Copy link
Author

mhchia commented Aug 14, 2024

@hanbu97

how does tfhe-rs support MPC

Ah, that's my mistake. I meant to say FHE instead of MPC.

@NOOMA-42
Copy link
Collaborator

@hanbu97 @mhchia Feel free to use discord channel to have a more real-time discussion

@NOOMA-42 NOOMA-42 added the Proposal Pending Proposal has been submitted by other applicants. You can compete within deadline label Aug 15, 2024
@mhchia
Copy link
Author

mhchia commented Aug 19, 2024

Added milestones.

Milestones

Milestone 1: Understanding tfhe-rs and Documentation

  • Estimated Duration: 45 hours
  • FTE: 1
  • Estimated Delivery Date: [Insert Date]

Deliverables and Specifications

1a. Documentation
  • A comprehensive tutorial explaining tfhe-rs'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 of the discovered knowledge above as possible for demonstration purposes) with tfhe-rs.

Milestone 2: Adaptation of circom-MP-SPDZ to circom-tfhe-rs

  • Estimated Duration: 105 hours
  • FTE: 1
  • Estimated Delivery Date: [Insert Date]

Deliverables and Specifications

2a. Functionality: Generate Circuits for tfhe-rs from Bristol Circuit

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

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

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

2c. Functionality: Run the Generated tfhe-rs Circuits and Inputs

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

Application

Component 2c runs tfhe-rs 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 tfhe-rs 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 Task Be Taken Someone's proposal has passed and they work on this task and removed Proposal Pending Proposal has been submitted by other applicants. You can compete within deadline labels Sep 7, 2024
@NOOMA-42 NOOMA-42 assigned mhchia and unassigned mhchia Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Round 3 June 1, 2024, to Aug 31, 2024 Task Be Taken Someone's proposal has passed and they work on this task Task This is a task open to everyone
Projects
None yet
Development

No branches or pull requests

3 participants