What is this: 2-party computation that let 2 parties to compute agreed upon function with their private data forcing them to take some pre-defined on-chain action depending on the result of the computation. By using garbled circuit and some zkps, we can construct such scheme as publicly verifiable 2-party computation.
MPC is a cryptographic schemes that enable multiple parties to jointly compute a function on their private inputs without revealing any information about their inputs to the other parties.
Parties: P_1, …, P_n
Secret Inputs: x_1, …, x_n
Evaluate: f(x_1, x_2, …, x_n)
Use additive homomorphism of secret sharing scheme, parties can compute addition and constant multiplication on secret shares. Multiplication requires additional values and opening of the intermediary values (Beaver's trick).
LSSS based MPC requires number of rounds of communication between parties based on circuit size. (Rounds complexity)
**Additive homomorphism
[x] denotes share of x
[x] + [y] = [x+y]
c * [x] = [c*x] where c is some constant value
**Beaver's trick
goal: calculate [x*y] from [x], [y]
preparation: pick three random a, b and c s.t. c = a * b for each multiplication gate and distribute as shares.
Now, every party has [x], [y], [a], [b], [c]
calculate [d] = [x] - [a], [e] = [y] - [b] locally.
Open [d] and [e] to reconstruct d and e from shares. But parties keep [a] and [b] keep private so that no one learns about your [x] and [y].
d = x - a, e = y - b
now,
[x*y] = d * [b] + e * [a] + [c] (+ de)
**(1 party in a network has this +de term if additive sharing scheme is used)
2-party computation using encryption of a circuit gates and oblivious transfer. This scheme is efficient in 2-party settings. It requires only constant number of rounds communication.
Comparing to LSSS-based MPC, GC-based MPC requires only constant round of communication, but it requires more data size depending on the circuit.(Communication complexity)
n(>2)-party computation -> Efficiency of MPC degrades dramatically as number of parties increases. (LSSS-based, GC-based)
-> we focus on 2-party computation
Normally, the result of multi party computation can be verified by the parties who joined the computation. (LSSS-based, GC-based)
There is a construction called publicly verifiable(auditable) MPC. In this construction, we generate additional transcript along with the computation to prove the correctness of the computation to public. Usin this proof, we can convince the output correctness to anybody even who did not joined the computation.
[Briefly explain garbled circuit]
Suppose Alice and Bob want to compute a function f
on their secret inputs x_a
and x_b
.
x_a
so that Bob cannot learn about x_a
Alice sends the encrypted circuit to Bob
Bob evaluate the circuit using his private input x_b
. In this step, he asks Alie decryption key of gates corresponding to his secret inputs using Oblivious Transfer.
In this way, 2-party securely compute on a certain function over their private inputs. With constant rounds of communication.
Using garbled circuit, we can construct some interesting scheme called private binding computation.
It's a 2-party computation using garbled circuit with binding property.
Binding property: the two parties are enforced to execute some pre-defined on-chain activity after evaluation of the garbled circuit.
Create a circuit which produces signatures of both party under pre-defined condition. (for example, if price matches)
Use this template to create ideas of applications.
Dark Forest Plugin for Private Collaboration
ZK Federated Learning ZK Federated Learning
Public ML model
Private KYC model inference
International Trade Negotiation
Private auction