Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions how-coti-works/introduction/garbled-circuits.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
# Conceptual Overview


#### 1. What is Multi-Party Computation (MPC)?

MPC is a subfield of cryptography with a powerful and general goal:

> To enable a group of parties, each with their own private data, to jointly compute a function on that data without revealing their individual inputs to one another. The only thing that should be revealed is the final result of the computation.

**Key Characteristics of MPC:**

* **The Problem:** It defines the security properties required.
* **Privacy:** No party learns anything about other parties' inputs, beyond what can be inferred from the output itself.
* **Correctness:** The output of the joint computation is guaranteed to be correct.
* **Generality:** It can, in theory, compute *any* function.
* **Multiple Techniques:** There are several different ways to achieve MPC. The two most famous families of protocols are:
1. **Garbled Circuits:** (Which we will detail next).
2. **Secret Sharing:** Protocols where inputs are split into "shares" and distributed among parties. Computations are then performed on these shares. (Examples: BGW, GMW, SPDZ).


### Garbled Circuits and how they preserve privacy <a href="#eca7" id="eca7"></a>

Garbled Circuits is a specific protocol, pioneered by Andrew Yao, to solve the MPC problem. It is the canonical solution for **two-party computation (2PC)**. The core idea is to represent the function you want to compute as a **Boolean circuit** (made of AND, OR, XOR, NOT gates). Then, one party "garbles" (encrypts) this circuit, and the other party can evaluate it without learning any of the intermediate values.


As a privacy-preserving cryptographic technique, garbled circuits were essentially designed to solve one problem: The Millionaires problem created by Andrew Yao. In this theoretical scenario, two millionaires, Alice and Bob, want to work out which one of them is richer without disclosing their actual net worth.


To do this, they can use a garbled circuit which can be simplified into the following steps:

* **Step 1** — The problem or “function” (i.e. who is richer) is written as a type of program that uses logical gates, (aka a Boolean circuit). In the Millionaires Problem, suppose that the millionaires’ wealth can fit into 8-bit integers (recall that such integers can accommodate numbers between 0 and 2⁸-1=255). Then the Boolean circuit has 2x8=16 input wires (first set of 8 input wires \`belong’ to Alice and the second set \`belongs’ to Bob). The circuit structure is such that it takes the first and second sets of input wires, interprets them as numbers X and Y, and computes MAX(X,Y). The result goes to an output wire that encodes a single bit B. If B=0 then we have X > Y and otherwise (B=1) we have X ≤ Y.
Expand Down