or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
Circom-MPC
Circom-MPC is a PSE Research project that enables the use of the Circom language to develop MPC applications. In this project, we envisioned MPC as a broader paradigm, where MPC serves as an umbrella for generic techniques such as Zero-Knowledge Proof, Garbled Circuit, Secret-Sharing, or Fully Homomorphic Encryption.
Throughout this research the team produced some valuable resources and insights, including:
We decided to sunset the project for a few reasons:
Therefore, we will leave it as a paradigm, and we hope that any interested party will pick it up and continue its development.
In what follows we explain:
MPC as a Paradigm
Secure Multiparty Computation (MPC), as it is defined, allows mutually distrustful parties to jointly compute a functionality while keeping the inputs of the participants private.

An MPC protocol can be either application-specific or generic:

While it is clear that Threshold Signature exemplifies application-specific MPC, one can think of generic MPC as an efficient MPC protocol for a Virtual Machine (VM) functionality that takes the joint function as a common program and the private inputs as parameters to the program and the secure execution of the program is within the said VM.
For readers who are familiar with Zero-Knowledge Proof (ZKP), MPC is a generalization of ZKP in which the MPC consists of two parties namely the Prover and the Verifier, where only the Prover has a secret input which is the witness.

And yes, Fully Homomorphic Encryption (FHE) is among techniques (along side Garbled-Circuit and Secret-Sharing) that can be used for MPC construction in the most straightforward mental model:

Programmable MPC
That said, MPC is not a primitive but a collection of techniques aimed to achieve the above purpose. Efficient MPC protocols exist for specific functionalities from simple statistical aggregation such as mean aggregation (for ads), Private Set Intersection (PSI) to complex ones such as RAM (called Oblivious-RAM) and even Machine Learning (ML).

As each technique GC/SS/FHE and specialized MPC has its own advantage, it is typical to combine them into one's privacy preserving protocol for efficiency:

In what follows, we present work that enables the use of Circom as a front-end language for developing privacy-preserving systems, starting with the MP-SPDZ backend.
Detailed explanation of Progammable-MPC with Circom-MPC.
Circom-MPC
The Circom-MPC project aims to allow a developer to write a Circom program (a Circom circuit) and run it using an MPC backend.
The workflow
Circom-MP-SPDZ
Circom-MP-SDPZ allows parties to perform Multi-Party Computation (MPC) by writing Circom code using the MP-SPDZ framework. Circom code is compiled into an arithmetic circuit and then translated gate by gate to the corresponding MP-SPDZ operators.
The Circom-MP-SDPZ workflow is described here.
Circomlib-ML Patches and Benchmarks
With MPC we can achieve privacy-preserving machine learning (PPML). This can be done easily by reusing circomlib-ml stack with Circom-MPC. We demonstrated PoC with ml_tests - a set of ML circuits (fork of circomlib-ml).
More info on ML Tests here.
Patches
Basic Circom ops on circuit signals
Circom-2-arithc enables direct usage of comparisons and division on signals. Hence the original Circom templates for comparisons or the division-to-multiplication trick are no longer needed, e.g.
Scaling, Descaling and Quantized Aware Computation
Circomlib-ML "scaled" a float to int to maintain precision using \(10^{18}\):
For efficiency we replace this type of scaling with bit shifting, i.e.
The "all inputs" Circom template
Some of the Circomlib-ML circuits have no "output" signals; we patched them to treat the outputs as 'output' signals.
Following circuits were changed:
Some templates (Zanh, ZeLU and Zigmoid) are "unpatchable" due to their complexity for MPC computation.
Keras2Circom Patches
We forked keras2circom and create a compatible version.
Benchmarks
After patching Circomlib-ML we can run the benchmark separately for each patched layer above.
Docker Settings abd running MP-SPDZ on multiple machines
For all benchmarks we inject synthetic network latency inside a Docker container.
We have two settings with set latency & bandwidth:
We used
tc
to limit latency and set a bandwidth:Here we set delay to 2ms & rate to 5gb to imitate a running within the same region (the commands will be applied automatically when you run the script).
There's a Dockerfile, as well as different benchmark scripts in the repo, so that it's easier to test & benchmark.
If you want to run these tests yourself:
Benchmarks
Below we provide benchmark for each different layer separately, a model that combines different layers will yield corresponding combined performance.
Accuracy of the circuits compared to Keras reference implementation