Chapter 8 · Lectures 21 to 24
Secure Multiparty Computation
Mutually distrustful parties hold private inputs and want one number out of them, and nothing else. This chapter states what "nothing else" means, then builds protocols that achieve it: commitments, oblivious transfer, Yao's garbled circuits, Shamir secret sharing, the honest-majority arithmetic-circuit protocol and a blockchain that can be rewritten under public control.
Lecture 21 covers sections 1 to 7, Lecture 22 covers sections 8 to 10, Lecture 23 covers sections 11 to 12 and Lecture 24 covers section 13. Each section header repeats its lecture. Per-lecture study plans: 21, 22, 23, 24.
Section 1 · Lecture 21The Multiparty Computation (MPC) Problem
Two millionaires meet and each wants to know who is richer. Neither will state a number. Written as a computation, they hold $x_1, x_2 \in \mathbb{N}$ and want
History. Andrew Yao posed the millionaires' problem in 1982 in "Protocols for Secure Computations"; the garbled-circuit construction of §8 followed in 1986.
$$f(x_1, x_2) = \begin{cases} 1 & \text{if } x_1 > x_2, \\ 0 & \text{if } x_2 \ge x_1, \end{cases}$$and nothing more. Without a secure protocol, one party must reveal its input or both parties must entrust their fortunes to an intermediary that could lie about the result.
The variant with three parties makes the leak in the output itself visible. Three colleagues want the maximum of their salaries, $f(x_1, x_2, x_3) = \max(x_1, x_2, x_3)$, with no salary revealed. A perfect protocol still leaks what the output says: whoever earns the maximum sees their own salary come back as the answer and learns they hold it, while the other two learn only that they do not. That much is in the function, so no protocol can remove it.
The same shape recurs across applications.
- Secure dating computes $y = x_1 \wedge x_2$, so a one-sided attraction is never disclosed.
- Coin tossing outputs a value $y$ uniform on $\bits$ that neither party can bias, a functionality with no inputs at all.
- Digital auctions compute the winner and the clearing price from sealed bids; electronic voting computes a tally from ballots.
- Online poker deals a shuffled deck no player can see; cloud computing lets a server compute on data it never learns.
- Private set intersection lets two parties learn which of their records match and nothing about the rest, the same problem for a set-valued function.
History. The auction became real commerce in 2008, when Danish sugar beet contracts were traded in the first large commercial multiparty auction, with 1229 farmers bidding.
Formally, $n$ parties $P_1, \dots, P_n$ hold inputs $x_1, \dots, x_n$ and evaluate an $n$-input, $n$-output function $f(x_1,\dots,x_n) = (y_1, \dots, y_n)$, with $P_i$ receiving only $y_i$. The function may also be randomized.
With an incorruptible trusted party the problem is trivial: everyone sends its input up, the trusted party evaluates $f$ and sends each $y_i$ down. That is the ideal world, the standard against which any real protocol is measured. The real world has only the $n$ parties and a network among them.
Under standard cryptographic assumptions, every efficiently computable function can be computed securely. In the two-party semi-honest setting this follows from Yao's garbled-circuit protocol together with oblivious transfer, the primitive in which a receiver learns one of two sender strings and the sender learns nothing about the choice (§7, put to work in §8 to §9); in the multiparty setting with an honest majority it follows from the BGW/GMW line of work (BGW: Ben-Or, Goldwasser and Wigderson; GMW: Goldreich, Micali and Wigderson) (§12), which needs no computational assumption at all when private channels are given. Informally, every trusted party can be simulated.
Assumptions. Two-party garbled circuits rest on oblivious transfer. Honest-majority protocols can achieve information-theoretic security when private channels are available.
The founding results are due to Blum, Yao, Micali, Goldreich and Wigderson. The slides plot MPC on the same adoption curve as public-key encryption, trailing by about two decades. Both were invented in the 1980s. Public-key encryption became practical in the 1990s and ubiquitous in the 2000s; MPC became feasible in the 2000s, practical in the 2010s and is expected to become ubiquitous in the 2020s. The mathematics is shared by both; the lag is in the constants, which is why §9 tracks gates per second across a decade of implementations.
MPC asks when cryptography can replace the trusted party in the picture above. Auctions and elections are two instances. The rest of the chapter defines the guarantee, gives constructions and accounts for their costs.
Section 2 · Lecture 21What Security Has to Mean
Take a sealed-bid auction and enumerate what an attacker might want. Five properties cover the list.
- Privacy. Nothing beyond the prescribed output is revealed; the attacker may want to learn the other bids.
- Correctness. Each honest party receives the value the function actually prescribes on the inputs used; the attacker may want to win with a bid below the highest.
- Independence of inputs. A corrupted party cannot choose its input as a function of an honest party's input; the attacker may want to set its bid after seeing the others.
- Fairness. If one party receives the output, all do; the attacker may want to walk away once it sees it has lost.
- Guaranteed output delivery. Corrupted parties cannot prevent honest parties from receiving the output. This is strictly stronger than fairness, which a protocol in which nobody gets anything also satisfies.
Enumerating properties per application is a losing strategy: for elections the list shrinks to privacy, correctness and fairness. There is never an argument that any list is complete. The chapter instead adopts a single general definition (§3), once the adversarial model is pinned down.
The Power of the Adversary
A threshold adversary corrupts a set of at most $t < n$ parties. The adversary is taken to be monolithic, a single entity coordinating all corrupted parties, which is the right model because separate corrupted parties can always collude. Corruption is non-adaptive (static) when the corrupted set is fixed before the protocol starts, and adaptive when it is chosen during the execution, based on what the adversary has seen. The behavioral axis is a ladder: each rung allows more deviation and costs more to defend against. The ladder and the two corruption thresholds used later in the chapter, with the attacker's capability beside each:
| model | what the attacker can do | defense and cost |
|---|---|---|
| semi-honest (passive, honest-but-curious) | follows the protocol exactly and tries to infer extra information from what it sees | simulating its view suffices (§3); the cheapest rung |
| covert | deviates only when detection is unlikely; the detection probability is part of the specification | cut-and-choose (§10) is the working example: with half the circuits opened, a garbler who corrupts one circuit escapes detection with probability $1/2$, so cheating is a bet at known odds; raising the probability means opening more circuits, so the cost rises with it |
| malicious (active) | deviates arbitrarily | the defense must cover every deviation; the efficiency gap is measured in §9, where the semi-honest Fairplay implementation of 2004 ran 600 gates/sec and the first malicious cut-and-choose implementation of 2008 ran 4 |
| threshold $t < n/2$ (honest majority) | corrupts at most $t$ of the $n$ parties; the honest parties remain the majority | passive security with fairness and guaranteed output delivery; given private channels, no computational assumption (§12) |
| threshold $t < n/3$ | corrupts at most $t$ of the $n$ parties; fewer than one third | active security, using an active-secure BGW protocol with verifiable secret sharing (§12) |
The Execution Setting
Standalone security considers a single execution in isolation and, as a theorem, extends to sequential composition. It does not cover the Internet, where many instances of a protocol run concurrently alongside arbitrary other protocols. Concurrent composition covers many instances of the same protocol; universal composability (Canetti, 2001) covers arbitrary concurrent protocols and is the real goal.
Privacy is defined relative to the function. In the three-party salary maximum of §1, whoever earns the maximum learns that fact and the other two learn they do not; in the two-party version the loser learns a bound on the winner's salary. No protocol can prevent these leaks, because they are in $f$ and the implementation is clean. Choosing $f$ is a separate design problem, the one differential privacy (Chapter 5) addresses.
What went wrong. Repetition turns a small leak into full disclosure. Running two-party comparisons against one fixed salary is a binary search: about $\log_2 n$ runs reveal its exact value, with $n$ the number of candidate salaries.
What the Ideal Functionality Gives Away
Pick two private inputs and a function. The readout shows the output the ideal world reveals, then how many inputs of the first party remain consistent with what the second party sees. Everything outside that set has leaked.
Five properties, a ladder of three behavioral models and two corruption thresholds in one table, an adaptivity axis and a composition setting. Everything that follows tries to satisfy all of them at once within the impossibility results.
Section 3 · Lecture 21The Real/ideal Framework and Simulation
Define security by comparison: a protocol is secure if running it is as good as handing the inputs to the trusted party. Anything an adversary achieves in the real execution it could already have achieved in the ideal world, where by construction the only freedom it has is to choose its own input. The comparison is made through a simulator. Consider first the semi-honest two-party case, with $f(x_1,x_2) = (f_1(x_1,x_2), f_2(x_1,x_2))$.
Let $\pi$ be a two-party protocol for $f$. Write $\mathsf{view}^\pi_i(x_1,x_2)$ for the view of $P_i$ in an honest execution: its input, its random tape and every message it receives. The protocol is secure against semi-honest adversaries if for each $i$ there is an efficient simulator $\mathsf{S}_i$ with
$$\big\{\mathsf{S}_i\big(x_i,\, f_i(x_1,x_2)\big)\big\} \;\approx_c\; \big\{\mathsf{view}^\pi_i(x_1,x_2)\big\}$$for all inputs, where $\approx_c$ denotes computational indistinguishability of the two ensembles. Correctness (that honest executions output $f$) is required separately.
Read the definition as an argument. The simulator is given only what the corrupted party is entitled to, namely its own input and its own output. If it can nevertheless produce a transcript indistinguishable from the real one, then everything the adversary learned was already derivable from its input and output alone. In the semi-honest model correctness, independence of inputs and fairness need no separate treatment, because the adversary follows the protocol and the inputs are well defined.
Against malicious adversaries, simulating the view is insufficient. A malicious party's messages need not correspond to running the protocol on any $x_2$ at all, and view simulation says nothing about correctness, independence of inputs or fairness. The repair is to make the ideal world explicit: the ideal-world adversary may substitute an input $x_2'$ of its choosing (and that is all it may do), and security requires that the joint distribution of the honest party's output and the adversary's output in the real execution be indistinguishable from that pair in the ideal execution.
For an adversary $\Adv$ corrupting a set $I$ of parties in the real execution of $\pi$, let $\mathsf{REAL}_{\pi,\Adv,I}(\vec{x})$ be the tuple of outputs of all parties (honest parties output their protocol output; $\Adv$ outputs an arbitrary function of its view). Let $\mathsf{IDEAL}_{f,\mathsf{S},I}(\vec{x})$ be the same tuple in the ideal execution with the trusted party. Then $\pi$ securely computes $f$ if for every efficient $\Adv$ there is an efficient simulator $\mathsf{S}$ with
$$\big\{\mathsf{IDEAL}_{f,\mathsf{S},I}(\vec{x})\big\} \;\approx_c\; \big\{\mathsf{REAL}_{\pi,\Adv,I}(\vec{x})\big\}.$$Because the simulator interacts with the trusted party in the honest interface, every property of the ideal world transfers: privacy (only outputs are delivered), correctness (the trusted party evaluates $f$), independence of inputs (the simulator must fix $x_2'$ without seeing $x_1$), fairness and guaranteed output delivery (the trusted party answers everyone).
Security with Aborts
Fairness and guaranteed output delivery are frequently unattainable (§5), so the definition is then relaxed and kept. In the ideal world with aborts the corrupted party may send $\bot$ instead of an input, and may also, after receiving its own output and before the honest party receives anything, instruct the trusted party to abort. Privacy, correctness and independence of inputs survive; fairness does not. Almost every practical two-party protocol achieves this notion.
Composition
Sequential composition is proved through the hybrid model: each subprotocol is replaced by its ideal functionality, so a proof may treat oblivious transfer or a commitment as a trusted box and reason only about the surrounding messages. Every composed proof in this chapter is of that form. Universal composability strengthens the quantifier so that security holds in the presence of arbitrary concurrent protocols.
Security is a single comparison, real $\approx_c$ ideal. The comparison subsumes the whole property list. Its content is the simulator. The definition is complete because the ideal world is as good as it gets.
Section 4 · Lecture 21Coin Tossing and Commitments
The smallest non-trivial functionality has no inputs: output a uniform bit $y$ that neither party can bias. The obvious protocol is for Alice to pick $b_1 \getsr \bits$, Bob to pick $b_2 \getsr \bits$, both to publish and both to output $y = b_1 \oplus b_2$. If either bit is uniform and independent of the other, the XOR is uniform. Messages arrive in some order, and whoever speaks second sees $b_1$ and chooses $b_2 = b_1 \oplus y^\ast$ to force any $y^\ast$ it likes; the Internet offers no simultaneous transmission.
A commitment scheme supplies the missing simultaneity. The protocol runs:
| # | message |
|---|---|
| 1 | Alice $\to$ Bob: a commitment $c$ to a fresh bit $b_1 \getsr \bits$, revealing nothing |
| 2 | Bob $\to$ Alice: his bit $b_2 \getsr \bits$, in the clear |
| 3 | Alice $\to$ Bob: the opening of $c$, accepted iff it binds to $b_1$ |
| out | both output $y = b_1 \oplus b_2$ |
Bob chooses $b_2$ blind, and Alice is bound to the $b_1$ she fixed before seeing $b_2$. Against malicious parties, hiding protects Bob's ignorance before step 2 and binding stops Alice from changing $b_1$ after it. The guarantee has one hole. It is the subject of §5: nothing forces Alice to send step 3 at all.
A commitment scheme is a pair of algorithms: $\mathsf{Com}(b; r)$ produces a commitment $c$ to $b \in \bits$ using randomness $r$, and opening consists of revealing $(b, r)$, accepted iff $c = \mathsf{Com}(b; r)$. Two properties are required.
- Hiding. $\mathsf{Com}(0; r_0)$ and $\mathsf{Com}(1; r_1)$ are indistinguishable for uniform $r_0, r_1$: the commitment reveals nothing about $b$.
- Binding. No efficient sender can produce $c$ together with valid openings to both $0$ and $1$; that is, finding $(0, r_0)$ and $(1, r_1)$ with $\mathsf{Com}(0; r_0) = \mathsf{Com}(1; r_1)$ is infeasible.
Hiding protects the receiver's ignorance, binding protects against a sender who wants to change its mind. Both cannot hold unconditionally at once.
The construction used in the course models a hash function $\Hash$ (SHA-256, say) as a random oracle. To commit to $b$, pick $r \getsr \bits^{\lambda}$ and output $\Hash(b \,\|\, r)$; to open, send $(b, r)$. Hiding holds because a random oracle's output on an unqueried point is uniform, so the commitment is a uniform string independent of $b$ except with negligible probability that the adversary guesses $r$. Binding holds because a valid double opening is a collision $\Hash(0 \,\|\, r_0) = \Hash(1 \,\|\, r_1)$ on distinct points, and collisions in a random oracle require roughly $2^{\lambda/2}$ queries. The randomness $r$ is essential, since $\Hash(b)$ alone is trivially invertible over a two-element message space; collision resistance is developed in Chapter 1.
Coin tossing with commitments is also where the chapter's first genuine impossibility appears. It recurs throughout: Alice can refuse to open. She sees $b_2$, computes the outcome and stops if she does not like it. Bob learns nothing about $b_1$, so he cannot compute $y$ either; privacy survives, fairness does not. The next section is about that.
Commitments buy simultaneity, and simultaneity is what turns XOR into an unbiasable coin. They give no guarantee that the second message ever arrives.
Section 5 · Lecture 21Fairness, Aborts and Enforcement with Money
Two distinct things go wrong in the commitment-based coin toss.
Problem 1: fairness. Alice can abort after seeing $b_2$. The abort is inherent to the setting: in a two-party protocol somebody receives the last message, and whoever is one message ahead can stop. Cleve's theorem makes the impossibility quantitative: in any $r$-round two-party coin-tossing protocol one of the parties can bias the outcome by $\Omega(1/r)$, so a perfectly fair coin toss between two parties is impossible however many rounds are used. The standard achievable notion for two parties is therefore security with aborts (§3); fairness and guaranteed output delivery are reserved for the honest-majority setting of §12.
Problem 2: enforcement. A perfectly fair protocol only produces a number. Nothing in it makes the loser of a bet pay; the trusted party computes without enforcing.
Both problems accept a monetary attack. The mechanism is a deposit forfeited on abort, implemented with the Bitcoin scripting language of Chapter 6. A hash-locked transaction with $Y = \Hash(X)$ can be redeemed only by a spender who publishes $X$; here $X = (b_1, r)$ is the opening of Alice's commitment.
- Alice posts a
committransaction worth 1 BTC, spendable either by Alice's signature together with $(b_1, r)$ such that $Y = \Hash(b_1, r)$, or by Alice's and Bob's signatures jointly. - Before posting, Alice hands Bob a signed
refundtransaction that spendscommitto Bob after a one-day timelock. - If Alice opens the commitment within the day she redeems her own deposit and the
coin toss completes. If she does not, Bob posts
refundand takes the 1 BTC.
The abort remains possible; the mechanism puts a price on it. The same stake
can be made to move according to the computed result. In Ethereum
(Chapter 7) the same logic
is a short contract with three entry points: commit, which stores
the hash, sets a timeout and accepts the deposit; open, which checks
the opening and releases the deposit; refund, which after the
timeout returns the funds to the counterparty.
The general result is that any two-party stateless functionality can be realized this way with financial consequences attached. The construction extends to multiparty reactive functionalities. A worked application is selling secret information: the parties compute the union of their sets, with each newly learned element triggering a payment.
The deposit mechanism is due to Andrychowicz, Dziembowski, Malinowski and Mazurek (2014); Kumaresan, Moran and Bentov extend it to multiparty reactive functionalities.
Fairness is unachievable for two parties in the standard model, so protocols settle for security with aborts. Money prices the abort, a weaker and deployable guarantee.
Section 6 · Lecture 21Zero Knowledge
Identification by signature works and leaks. If the verifier sends a random message $m$ and the prover returns $\sigma = \mathbf{S}(sk, m)$, the verifier walks away with a transferable proof that the prover was there: the protocol is not deniable, since the signature convinces third parties who were never part of the exchange. The question is whether a verifier can be convinced while learning nothing it could not have produced alone.
Let $L$ be a language with witness relation $R$, so $x \in L$ iff $R(x,w) = 1$ for some $w$. In an interactive proof the prover holds $(x, w)$, the verifier holds $x$ and after the interaction the verifier outputs accept or reject.
- Completeness. If $x \in L$ and both parties are honest, the verifier accepts (with probability 1, or overwhelming probability).
- Soundness. If $x \notin L$, no prover, however malicious, makes the verifier accept except with small probability, the soundness error.
- Zero knowledge. For every efficient verifier there is an efficient simulator that, on input $x \in L$ alone, produces a transcript indistinguishable from the real interaction. Honest-verifier zero knowledge requires this only for the verifier that follows the protocol.
Zero knowledge is the same simulation framework as §3, applied to a two-party functionality whose output is one bit.
The Schnorr Protocol
Let $\mathbb{G}$ be a cyclic group of prime order $q$ with generator $g$, and let $x = g^w$. The prover knows $w$; the verifier holds $x$. The messages are:
| # | message |
|---|---|
| 1 | P $\to$ V: $\alpha = g^a$ for $a \getsr \Zq$ |
| 2 | V $\to$ P: challenge $\beta \getsr \Zq$ |
| 3 | P $\to$ V: $\gamma = \beta w + a \bmod q$ |
| check | V accepts iff $g^{\gamma} = \alpha \cdot x^{\beta}$ |
Completeness is a one-line computation: $g^{\beta w + a} = g^{a} \cdot (g^{w})^{\beta} = \alpha \cdot x^{\beta}$. Honest-verifier zero knowledge follows by simulating backwards: pick $\beta, \gamma \getsr \Zq$ and set $\alpha = g^{\gamma} \cdot x^{-\beta}$, which has exactly the real distribution. For soundness, note that every group element is a power of $g$, so the language is trivial and plain soundness is vacuous; the meaningful statement is knowledge soundness. Two accepting transcripts $(\alpha,\beta,\gamma)$ and $(\alpha,\beta',\gamma')$ with $\beta \ne \beta'$ yield $w = (\gamma - \gamma')(\beta - \beta')^{-1} \bmod q$, so a prover that succeeds on two challenges knows the discrete logarithm. The precise notion is a proof of knowledge.
Everything in NP
Assuming one-way functions exist, every language in NP has a zero-knowledge proof, obtained by giving one for an NP-complete language such as graph 3-coloring or Hamiltonicity and reducing.
A Construction from Homomorphic Encryption
The course also derives a protocol from Fully Homomorphic Encryption (FHE) (Chapter 4). Alice generates $(pk, sk)$, encrypts the witness as $\vec{c} \getsr \Enc(pk, w)$ and sends $(pk, \vec{c})$. Bob evaluates $f_{x,R}(w) = R(x,w)$ homomorphically, returning $c'$; Alice decrypts and sends $d = \Dec(sk, c')$; Bob accepts if $d = 1$. This is unsound as stated, because Alice performs the decryption and can send $d = 1$. Soundness is added by a coin flip: Bob picks $\beta \getsr \bits$ and returns either the real evaluation (if $\beta = 1$) or a fresh encryption of $0$ (if $\beta = 0$), then checks $d = \beta$. For $x \notin L$ the honest evaluation also encrypts $0$, so the two cases are indistinguishable to Alice and she cheats with probability at most $1/2$; repetition drives that down. Well-formedness of $pk$ and $\vec{c}$ is forced by openings: Alice generates two key pairs and Bob asks her to open one at random, and Alice encrypts shares $w_1 \oplus w_2 = w$ under the other, one of which Bob asks her to open. Last, the protocol so far is only honest-verifier zero knowledge, since a malicious Bob can return the first component of $\vec{c}$ itself, making $d$ the first bit of $w$. Commitments repair it: Alice commits to $d$, Bob reveals the randomness proving he evaluated as prescribed and only then does Alice open.
Fiat-Shamir
A three-move public-coin proof becomes non-interactive by computing the challenge as $\beta = \Hash(x, \alpha)$, so the proof is the single message $\zeta = (\alpha, \gamma)$. Security is in the random oracle model. Applications include revealing $m_2$ from a signed $m = m_1 \| m_2$ while keeping $m_1$ and the signature secret, and proving from a signed identity card that one is over 18 without revealing a date of birth. In this chapter the application is the GMW (Goldreich, Micali and Wigderson) compiler of §12, where each party proves in zero knowledge that its messages were computed correctly.
Zero-knowledge proofs and the result that every language in NP has one are due to Goldreich, Micali and Wigderson (1986).
Zero knowledge is MPC's proof technique as well as one of its applications: it is what forces a malicious party to behave semi-honestly without revealing why its messages were correct.
Section 7 · Lecture 21Oblivious Transfer
All of the above still leaves the central two-party difficulty untouched: Bob must obtain something that depends on his own secret choice, from a sender who must not learn what he chose. That primitive is oblivious transfer.
The sender holds $s_0, s_1$; the receiver holds a choice bit $b$. The functionality is $\mathcal{F}_{\mathsf{OT}}\big((s_0,s_1),\, b\big) = (\perp,\, s_b)$, so:
- the receiver learns $s_b$ and nothing about $s_{1-b}$;
- the sender learns nothing about $b$.
Common mistake. The sender never finds out which string was picked. The receiver obtains exactly one of the two strings, learns nothing about the other one and reveals nothing about its choice.
Why One Call Already Does Secure Computation
Set $(s_0, s_1) = (0, b')$ where $b'$ is the sender's private bit. The receiver's output is $s_b$, which is $1$ exactly when $b = b' = 1$: a single Oblivious Transfer (OT) computes the AND of two private bits, revealing nothing else. AND with negation generates every Boolean function, and OT is used once per gate, so OT is complete for secure computation; §8 and §9 make that concrete.
Why It Cannot Be Done with Information-Theoretic Security
The course proves that AND (and hence OT) is impossible to compute with unconditional security, even against passive adversaries. Say a transcript $T$ is consistent with $x_1$ if there exist $r_1$ and $(x_2, r_2)$ making $T$ the transcript of an honest execution on inputs $(x_1, r_1)$ and $(x_2, r_2)$. Consider an execution with $x_1 = 0$.
- If $x_2 = 0$, the output is $0$ in both cases $x_1 \in \bits$, so $T$ must also be consistent with $x_1 = 1$; otherwise Bob, who sees $T$, would learn $x_1$, violating privacy.
- If $x_2 = 1$, then $T$ cannot be consistent with $x_1 = 1$, because the prescribed output differs between $(0,1)$ and $(1,1)$ and correctness pins it down.
An unbounded Bob holding $x_2$ and $T$ simply tests whether $T$ is consistent with $x_1 = 1$: if it is, $x_2$ was $0$; if not, $x_2$ was $1$, and symmetrically he recovers $x_1$. The test is a search over all $r_1$, which is why the argument does not contradict computational security. Every secure protocol for AND must therefore rest on a computational assumption.
OT with Passive Security, from ElGamal
An ElGamal ciphertext under public key $h = g^{x}$ is $c = \big(g^{r},\, h^{r} \cdot m\big)$ (Chapter 2). A public key can be sampled obliviously: a uniform group element is a valid key whose secret key nobody knows. The transcript is:
| # | message |
|---|---|
| 1 | receiver $\to$ sender: pick $x \getsr \Zq$, set $h_b = g^{x}$, sample $h_{1-b}$ uniformly from $\mathbb{G}$ without learning its discrete logarithm, send $(h_0, h_1)$ |
| 2 | sender $\to$ receiver: $c_0 = (g^{r_0}, h_0^{r_0} s_0)$ and $c_1 = (g^{r_1}, h_1^{r_1} s_1)$ |
| out | receiver decrypts $c_b$ with $x$ and recovers $s_b$ |
Receiver privacy is perfect: $h_0$ and $h_1$ are both uniform, so the sender's view is independent of $b$. Sender privacy holds under the Decisional Diffie-Hellman (DDH) assumption, since $c_{1-b}$ is an ElGamal encryption under a key whose secret key nobody holds. The adversary is semi-honest; a malicious receiver could pick both keys knowing both discrete logarithms and decrypt both ciphertexts, which is the gap the next construction closes.
OT with Active Security, from Suitable Public-Key and Symmetric-Key Encryption
Let $(\mathbf{K}, \Enc, \Dec)$ be a public-key scheme and $(\Enc', \Dec')$ a symmetric one. The sender generates the keys, so the receiver never gets to cheat at key generation. The transcript is:
| # | message |
|---|---|
| 1 | sender $\to$ receiver: generate both key pairs $(pk_0, sk_0), (pk_1, sk_1) \getsr \mathbf{K}$, send $pk_0, pk_1$ |
| 2 | receiver $\to$ sender: pick a random symmetric key $k$, send $c \getsr \Enc(pk_b, k)$ |
| 3 | sender $\to$ receiver: decrypt under both secret keys to get $k_0 = \Dec(sk_0, c)$ and $k_1 = \Dec(sk_1, c)$ (exactly one is $k$, the other is garbage), send $c'_0 = \Enc'(k_0, s_0)$ and $c'_1 = \Enc'(k_1, s_1)$ |
| out | receiver recovers $s_b = \Dec'(k, c'_b)$ |
The receiver cannot obtain $s_{1-b}$, because it does not know $k_{1-b}$; the sender cannot tell which of $k_0, k_1$ is the receiver's key, so $b$ stays hidden. Nothing has to be assumed about the receiver's honesty in generating keys, because the receiver generates none. That is the gap the ElGamal protocol leaves open. The adversary here is malicious.
Strings, and How to Get Millions of OTs
If the sender's inputs are vectors $s_i = (s_i^1, \dots, s_i^m)$, the passive case runs basic OT on each pair $(s_0^j, s_1^j)$ with the same choice bit $b$; the active case needs more care, and generic constructions exist. The optimization that matters at scale is OT extension: it turns $\lambda$ base OTs into polynomially many using only symmetric-key operations, which is what makes garbled-circuit protocols with millions of input bits feasible; the base OTs cannot be avoided, since OT provably cannot be built from symmetric primitives alone.
Oblivious transfer was introduced by Rabin in 1981. Completeness of OT for secure computation is due to Kilian (1988). OT extension is due to Ishai, Kilian, Nissim and Petrank (2003).
OT is the exact point where public-key assumptions enter MPC. It is unattainable information-theoretically, cheap to obtain from any PKE, extensible to huge numbers with symmetric cryptography and complete: with OT, every function can be computed securely.
Section 8 · Lecture 22Garbling a Circuit
Oblivious Transfer (OT) computes one AND gate. A function is many gates, and running an interactive subprotocol per gate over a circuit with millions of gates is the cost to avoid. Yao's protocol sends the whole encrypted circuit in one shot and uses OT only for the evaluator's input bits.
Represent $f$ as a Boolean circuit, whose size is its number of gates. A single gate type suffices, since NAND is complete; the construction works verbatim for any gate with a two-by-two truth table. Alice, the garbler, encrypts the circuit together with her input and sends it. Bob, the evaluator, adds his own input and evaluates the encrypted circuit gate by gate. Everything on the internal wires stays hidden; only the output wires may be readable.
Common mistake. Garbling does not encrypt the parties' data as homomorphic encryption does. It garbles the computation itself. Each input bit becomes a random wire label; the evaluator walks the circuit using ordinary symmetric-key decryption at every gate.
Step 1: Wire Labels
For every wire $w$, input and internal wires alike, Alice picks two independent random keys $k_w^0, k_w^1 \getsr \bits^{\lambda}$, one per possible bit. These are not sent to Bob. A wire's semantics (which label means $0$) is known only to Alice.
Step 2: Double Encryption
A garbled gate must release a value only to someone holding two keys, so encrypt twice: $\Enc(k_1, \Enc(k_2, m))$. The construction needs two properties beyond ordinary security, because the evaluator will decrypt with wrong keys on purpose and must be able to tell.
- Elusive range. Without $k$ it is hard to produce a valid ciphertext under $k$.
- Verifiable range. Given $k$ and $c$ it is easy to test whether $c$ lies in the range of $\Enc(k, \cdot)$.
Both are supplied by a Pseudorandom Function (PRF) $\PRF$ mapping $n$ bits to $2n$ bits: to encrypt $x \in \bits^{n}$ under $k$, pick $r \getsr \bits^{n}$ and output
$$c = \big(r,\; \PRF(k, r) \oplus (x \,\|\, 0^{n})\big).$$Decryption XORs $\PRF(k,r)$ back and checks that the last $n$ bits are zero. Verifiable range is that check; elusive range holds because predicting the last $n$ bits of $\PRF(k, r)$ without $k$ is infeasible. The padding block is the tag that tells the evaluator which row worked.
Step 3: The Garbled Table
For a gate with input wires $x, y$ and output wire $z$, computing $z = x \barwedge y$, Alice writes the truth table and encrypts each row's output label under the two input labels of that row.
| $x$ | $y$ | $x \barwedge y$ | garbled row |
|---|---|---|---|
| 0 | 0 | 1 | $\Enc\big(k_x^0, \Enc(k_y^0,\, k_z^1)\big)$ |
| 0 | 1 | 1 | $\Enc\big(k_x^0, \Enc(k_y^1,\, k_z^1)\big)$ |
| 1 | 0 | 1 | $\Enc\big(k_x^1, \Enc(k_y^0,\, k_z^1)\big)$ |
| 1 | 1 | 0 | $\Enc\big(k_x^1, \Enc(k_y^1,\, k_z^0)\big)$ |
Holding $k_x^{a}$ and $k_y^{b}$, exactly one row decrypts successfully, the row for $(a,b)$, and it yields $k_z^{a \barwedge b}$. The other three fail the range check. For an output gate the same table is built with the plaintext bits $0$ and $1$ in place of the output labels, which is how Bob eventually receives a plaintext bit in place of another opaque key.
Step 4: Permute
The four ciphertexts are sent in random order. Without this the row index would reveal the input bits: Bob would see that the third row decrypted and read off $(1,0)$. After permutation he holds four ciphertexts $c_1, \dots, c_4$ per gate, learns which one decrypted and learns nothing from that fact.
A Worked Gate, with Numbers
The lab below garbles $f(x_1, x_2) = x_1 \wedge \neg x_2$ with 16-bit labels and a deterministic mixer standing in for $\PRF$. In its default state the wire labels are $k_x^0 = \texttt{2e5d}$, $k_x^1 = \texttt{886f}$ on Alice's wire, $k_y^0 = \texttt{e5bb}$, $k_y^1 = \texttt{e86e}$ on Bob's and $k_z^0 = \texttt{8b8f}$, $k_z^1 = \texttt{6e97}$ on the output wire. The garbled table in transmission order:
| $x$ | $y$ | $x \wedge \neg y$ | ciphertext | sent as |
|---|---|---|---|---|
| 0 | 0 | 0 | 8fdce058 | $c_1$ |
| 0 | 1 | 0 | 1de1ddc7 | $c_4$ |
| 1 | 0 | 1 | b15d3465 | $c_2$ |
| 1 | 1 | 0 | 45ca9fa1 | $c_3$ |
Take inputs $x_1 = 1$, $x_2 = 0$. Alice sends her label $k_x^1 = \texttt{886f}$; Bob obtains $k_y^0 = \texttt{e5bb}$ by one OT. He tries all four ciphertexts against the pair: $c_1$, $c_3$ and $c_4$ fail the range check, and $c_2$ decrypts to $k_z^1 = \texttt{6e97}$. The output gate publishes the decoding $\texttt{8b8f} \mapsto 0$, $\texttt{6e97} \mapsto 1$, so Bob reads output $1$: Alice is richer on one bit. At an internal gate no decoding is ever published, and Bob is left holding one opaque label.
Garble and Evaluate a One-Bit Millionaires' Gate
The gate is $f(x_1, x_2) = x_1 \wedge \neg x_2$, which is $1$ exactly when Alice is richer on one bit. Step through garbling and evaluation and watch which row of the permuted table survives the range check. Labels are 16 bits and the "PRF" is a small deterministic mixer, so the arithmetic is visible.
A garbled gate is a truth table encrypted so that each row needs both input labels, padded so that a wrong row is recognizably wrong and shuffled so that the right row's position says nothing. Everything else in Yao's protocol is delivery.
Section 9 · Lecture 22Yao's Protocol, End to End
The tables alone are useless: Bob cannot start without one label per input wire, since the input wires belong to two different people. That asymmetry is where Oblivious Transfer (OT) enters. The full message flow, for Alice's input bits $\alpha_1, \dots, \alpha_n$ and Bob's input bits $b_1, \dots, b_m$:
| # | message |
|---|---|
| 1 | Alice $\to$ Bob: the garbled tables for the whole circuit, four permuted ciphertexts per gate, with the plaintext decodings at the output gates |
| 2 | Alice $\to$ Bob: her input labels $k_{a_i}^{\alpha_i}$, one per her input wire |
| 3 | for each $j = 1, \dots, m$: one 1-out-of-2 OT in which Alice offers $(k_{b_j}^{0}, k_{b_j}^{1})$ and Bob chooses with $b_j$, receiving exactly one label |
| out | Bob processes the gates in topological order and reads plaintext bits at the output gates; that is the result |
A label is a uniform string, so step 2 reveals nothing: Bob has no way to associate it with a bit. The permutation of the tables means the position at which a row succeeds tells him nothing either. Step 3 is forced: Bob cannot reveal his bits, and Alice cannot send both labels for a wire, because with both Bob could evaluate $f$ at several inputs, learning $f(\vec{\alpha}, \cdot)$ on points he never held. During evaluation, at each gate Bob tries the four ciphertexts with his two labels, exactly one passes the range check and he obtains one label on the output wire. He never learns which bit any internal label represents. Alice, who receives nothing after the OTs, learns nothing at all.
Common mistake. Bob does learn something: the output. That is the point. The guarantee is that nothing beyond the output leaks; the circuit's shape and size stay public throughout.
If the double-encryption scheme is secure with elusive and verifiable ranges, and if the oblivious transfer is secure against semi-honest adversaries, then the protocol above securely computes any efficiently computable $f$ in the presence of semi-honest adversaries, with Bob receiving the output. It runs in a constant number of rounds and communication linear in the circuit size.
Common mistake. The theorem covers semi-honest parties only. A malicious garbler can build a circuit for the wrong function; cut-and-choose, where many copies are prepared and most are opened for checking, is the standard repair (§10).
Generalizations the Slides Supply
Randomized functionalities. To compute $f(x_1,x_2; r)$ for random $r$, define the deterministic $g\big((x_1, r_1), (x_2, r_2)\big) = f(x_1, x_2; r_1 \oplus r_2)$, let each party contribute its own half and run a protocol for $g$. If either party is honest its half is uniform, so $r$ is uniform. This works in the passive and the active setting.
Two outputs, semi-honest. Given a protocol delivering one output, put $f_1$ and $f_2$ behind one-time pads. Alice picks $r_1$, Bob picks $r_2$ and they evaluate
$$\tilde{f}\big((x_1,r_1),(x_2,r_2)\big) = \big(f_1(x_1,x_2) \oplus r_1\big) \,\big\|\, \big(f_2(x_1,x_2) \oplus r_2\big).$$Bob receives $u \| v$, forwards $u$ to Alice and outputs $v \oplus r_2$; Alice outputs $u \oplus r_1$. Each party's share of the output is masked by a pad only the other party lacks.
Two outputs, malicious. The construction above lets a malicious Bob send a wrong $u$, so a one-time Message Authentication Code (MAC) is added. Alice picks $r_1$ and MAC keys $\alpha, \beta$. The parties evaluate a one-output function returning $c_1 \| f_2(x_1,x_2) \| \gamma$ where $c_1 = f_1(x_1,x_2) \oplus r_1$ and $\gamma = \alpha \cdot c_1 + \beta$ over a finite field. Bob obtains $u \| v \| w$, forwards $u \| w$ and outputs $v$; Alice outputs $u \oplus r_1$ only if $w = \alpha u + \beta$. Since $\alpha, \beta$ are unknown to Bob, a forged $u$ passes with probability $1/\abs{\mathbb{F}}$.
The Cost, Historically
| Protocol | Security | gates | gates/sec |
|---|---|---|---|
| Fairplay (2004) | semi-honest | 4 k | 600 |
| Cut-and-choose (2008) | malicious | 1 k | 4 |
| AES circuit (2009) | malicious | 40 k | 35 |
| Cut-and-choose + Zero Knowledge (ZK) (2011) | malicious | 40 k | 130 |
| Cut-and-choose + ZK, parallel (2011) | malicious | 6 B | 130 |
| Cut-and-choose, parallel (2013) | malicious | 1 B | 1 M |
Optimizations Beyond the Slides
Two standard ones explain why garbled circuits are fast today. Point-and-permute attaches a random select bit to each label, arranged so that the two select bits held by the evaluator index the one row he must decrypt: one decryption per gate instead of four, with the permutation still hiding the semantics. Free XOR fixes a global offset $\Delta$ and sets $k_w^1 = k_w^0 \oplus \Delta$ for every wire, so an XOR gate needs no ciphertexts at all (the output label is the XOR of the input labels), at the price of a stronger assumption on the hash function.
Worked number. The Advanced Encryption Standard (AES) circuit for one block has about 6800 AND gates. At two 128-bit ciphertexts per AND gate (half-gates) with free XOR, a garbled AES-128 costs about 218 kilobytes.
Everything above holds for a single evaluation of a single garbled circuit. A circuit that is evaluated twice is not secure at any price: see exercise 3.
Section 10 · Lecture 22Yao Against Malicious Adversaries
Nothing in Yao's protocol forces Alice to garble the circuit she claims. She can garble a circuit for a different function that leaks Bob's input, or plant one bad gate whose behavior depends on a wire she cares about; Bob decrypts opaque strings and cannot tell. Two further gaps appear at the same time: Alice may cheat in the Oblivious Transfers (OTs), and, once the protocol acquires more rounds, she may use inconsistent inputs across them.
Cut-and-Choose
Alice sends $k$ independently garbled copies of the circuit. Bob picks a random challenge set of $t$ of them and asks for those to be opened completely (all labels and randomness) and checks each is a correct garbling of $f$, aborting if not. The remaining $\ell = k - t$ circuits are evaluated. With $t = k/2$ and $k = 80$ circuits, a garbler who corrupts one circuit escapes detection with probability $1/2$, and one who corrupts $40$ circuits is caught except with probability $2^{-40}$.
Suppose $c$ of the $k$ circuits are corrupted and the challenge set has size $t$. The garbler survives only if every corrupted circuit escapes the challenge set, which happens with probability
$$\frac{\binom{k-c}{t}}{\binom{k}{t}} = \prod_{i=0}^{c-1} \frac{k - t - i}{k - i} \;\overset{t = k/2}{=}\; \prod_{i=0}^{c-1} \frac{k/2 - i}{k - i} \;\le\; 2^{-c}.$$Taking $t = k/2$: corrupting $\Theta(k)$ circuits is caught except with negligible probability, but corrupting a constant number succeeds with noticeable probability. So cut-and-choose alone bounds cheating; it does not eliminate it.
What to Do with the Evaluated Copies
First idea: abort on disagreement. Bob evaluates all $\ell$ unopened circuits and aborts if the outputs differ. This is insecure. Alice corrupts a few circuits so that they compute $f$ when $b_1 = 1$ and $f + 1$ when $b_1 = 0$. If $b_1 = 1$ all outputs agree and Bob proceeds; if $b_1 = 0$ he aborts with noticeable probability. Whether Bob aborts is therefore a function of his private input, and no simulator, which does not know $b_1$, can reproduce that behavior.
Second idea: majority. Bob outputs the majority of the $\ell$ results. A constant number of corrupted circuits changes nothing, since flipping the majority takes more than $\ell/2$ of them, and corrupting that many is caught by the challenge except with negligible probability.
Input Consistency
Majority forces a reordering of the messages, which creates a new gap. Alice cannot send the labels for her own input together with the circuits, because opening a challenged circuit would then reveal, in the clear, which of the two labels she chose for each of her wires. Those choices are her input. So she sends her input labels after the challenge is answered, one set per evaluated circuit: $k_{\vec{a}}^{1}, \dots, k_{\vec{a}}^{\ell}$. Nothing ties those $\ell$ label sets to the same input.
The attack is concrete. Let $f(A, B) = \bigoplus_i a_i \cdot b_i$ and suppose Bob takes the majority of four evaluations. Alice feeds $A = 0001$ to the first circuit, $0010$ to the second, $0100$ to the third and $1000$ to the fourth. Each evaluation returns a single bit $b_i$ of Bob's input. The majority of those bits is the protocol output. Alice has, however, learned four bits of $B$ that no single evaluation of $f$ would ever have revealed. The fix is to have Alice commit to her input labels up front and prove in zero knowledge, twice, that the committed labels are consistent across all evaluated circuits ($\pi_1$ with the circuits, $\pi_2$ with the revealed labels).
Malicious OT and Selective Failure
The OT subprotocol must itself be secure against malicious adversaries, so the passively secure ElGamal variant of §7 will not do. Even a maliciously secure OT is not the end of it. In the selective failure attack Alice submits, for one of Bob's input wires, the correct label vector $\{k_{j,i}^{0}\}$ in the $b_j = 0$ slot and bogus keys in the $b_j = 1$ slot. If Bob's bit is $0$ everything works; if it is $1$ evaluation fails and he aborts. Whether the protocol completes is again a function of a single bit of Bob's private input, so that bit leaks. The remedy is OT on committed inputs, with a zero-knowledge proof ($\pi_1^{\mathsf{OT}}$, $\pi_2^{\mathsf{OT}}$) that the labels offered in the OTs are the ones committed to and used in the circuits.
What went wrong. Lindell and Pinkas (2007) named the selective failure attack: a malicious garbler ties aborts to the evaluator's input bits. The lesson reaches beyond oblivious transfer: a malicious-secure protocol must make its abort decision independent of the honest input.
The assembled protocol runs:
- OT on committed inputs, with a proof that the offered labels are the committed ones.
- $k$ garbled circuits, with consistency proofs.
- A challenge set of size $t$, opened and checked.
- The answer to the challenge, Alice's input labels for the unopened circuits and a second proof.
- Majority output over the evaluated circuits.
Malicious security requires four patches. Each is forced by an attack that leaks through the abort and leaves the transcript untouched. Any behavior that depends on an honest party's private input is a leak, whether or not it looks like a message.
Section 11 · Lecture 23Secret Sharing
Garbled circuits are two-party and constant-round. The $n$-party route is different: keep every intermediate value split among the parties so that no admissible coalition can read it, and compute on the pieces. That requires a sharing primitive with an exact threshold.
A dealer shares a secret $m$ among $P_1, \dots, P_n$, giving $s_i$ to $P_i$, such that
- privacy: any coalition of at most $t$ parties has zero information about $m$; the requirement is information-theoretic, against an unbounded but passive adversary;
- reconstruction: any set of at least $t+1$ parties recovers $m$ exactly.
The case $t = n-1$ (every party is needed) has a one-line solution. To share $m \in \bits^{\lambda}$, pick $s_2, \dots, s_n \getsr \bits^{\lambda}$ and set $s_1 = m \oplus s_2 \oplus \dots \oplus s_n$; then $m = s_1 \oplus \dots \oplus s_n$, and any $n-1$ shares are uniform and independent of $m$, exactly as in the one-time pad. This is additive sharing, and over a field $\mathbb{F}$ one writes it with $+$ instead of $\oplus$. It gives no intermediate threshold.
Worked number. Modulo 211, split the salary 30 into shares 40, 60 and 141, since $40 + 60 + 141 = 241 \equiv 30 \pmod{211}$. Any two shares alone are uniform noise; all three rebuild the secret.
The Integer Version Leaks
Try the polynomial idea over the integers before seeing why the field is needed. Let $t = 1$ and $n = 2$, share $m = 9$ by picking $a = 5$ and setting $p(X) = 9 + 5X$, and give $P_2$ the share $s_2 = p(2) = 19$. One share was supposed to reveal nothing, but $s_2 = m + 2a$ and $2a$ is even, so $s_2$ has the parity of $m$, so the eavesdropper reads off that the secret is odd. The share rules out half of all candidates outright, since $s_2 - m'$ must be even and non-negative.
Re-run the same numbers over the field $\mathbb{F}_{17}$: $p(X) = 9 + 5X$ with all arithmetic modulo $17$, so $s_2 = p(2) = 19 \bmod 17 = 2$. For every candidate $m' \in \mathbb{F}_{17}$ there is exactly one coefficient $a' = (2 - m') \cdot 2^{-1} \bmod 17$ with $m' + 2a' = 2$, so every candidate is equally consistent with the share. Parity is not a property of field elements, so the attack dies. The privacy proof below is this calculation for general $t$.
Shamir's Scheme
Shamir's construction gets every threshold from the fact that a polynomial of degree at most $t$ is determined by $t+1$ points and undetermined by $t$.
Work in a finite field $\mathbb{F}$ with $\abs{\mathbb{F}} > n$, and fix $n$ distinct non-zero evaluation points, conventionally $1, \dots, n$.
Share. The dealer picks $a_1, \dots, a_t \getsr \mathbb{F}$ and sets
$$p(X) = m + \sum_{i=1}^{t} a_i X^{i},$$a uniformly random polynomial of degree at most $t$ with $p(0) = m$. Party $P_i$ receives $s_i = p(i)$.
Reconstruct. From any $t+1$ pairs $(x_0,y_0), \dots, (x_t,y_t)$, Lagrange interpolation gives
$$p(X) = \sum_{i=0}^{t} y_i\, p_i(X), \qquad p_i(X) = \prod_{j \ne i} \frac{X - x_j}{x_i - x_j},$$ $$m = p(0) = \sum_{i=0}^{t} y_i\, p_i(0), \qquad p_i(0) = \prod_{j \ne i} \frac{x_j}{x_j - x_i}.$$Privacy. For any distinct non-zero $x_1, \dots, x_t$, any values $y_1, \dots, y_t$ and any candidate secret $m$, there is exactly one polynomial of degree at most $t$ with $p(0) = m$ and $p(x_i) = y_i$ for all $i$. Hence, conditioned on $M = m$,
$$\Pr\big[p(x_1) = y_1, \dots, p(x_t) = y_t \mid M = m\big] = \frac{1}{\abs{\mathbb{F}}^{t}},$$the same value for every $m$. The $t$ shares are therefore statistically independent of the secret, so the posterior on $m$ equals the prior.
Worked Reconstruction
Re-run the opening example with $t = 1$, $n = 2$ over $\mathbb{F}_{17}$: the polynomial is $p(X) = 9 + 5X$. The shares are
| party | share |
|---|---|
| $P_1$ | $s_1 = p(1) = 14$ |
| $P_2$ | $s_2 = p(2) = 19 \bmod 17 = 2$ |
Pooling both shares, the Lagrange coefficients at $0$ are $p_1(0) = \frac{2}{2-1} = 2$ and $p_2(0) = \frac{1}{1-2} = -1$, so
$$m = 14 \cdot 2 + 2 \cdot (-1) = 26 \equiv 9 \pmod{17},$$the secret $p(0)$ from the polynomial the shares came from. Any single share, as the opening example showed, is consistent with every $m \in \mathbb{F}_{17}$.
Shamir Sharing over a Real Prime Field
All arithmetic is modulo the prime $p = 65537$, with modular inverses computed by the extended Euclidean algorithm over the field itself; the rationals do not enter. Pick a subset of shares and watch reconstruction succeed at $t+1$ and fail at $t$.
Linearity
Shamir shares add. If $p$ and $q$ are degree-$\le t$ polynomials sharing $m$ and $m'$, then $p + q$ has degree at most $t$ and $(p+q)(0) = m + m'$, so the shares $p(i) + q(i)$, computed locally with no communication, share $m + m'$. The same holds for multiplication by a public constant $c$: the shares $c \cdot p(i)$ share $c \cdot m$. Additive sharing has the same property. This is the algebraic fact that makes the protocol of §12 possible. Its failure for products is what makes that protocol interactive.
Variants Named in the Course
- Computational secret sharing: relaxes privacy to computational, buying shorter shares.
- General access structures: the authorized sets need not be "all sets of size $> t$"; any monotone family can be realized.
- Verifiable secret sharing: lets the parties detect a malicious dealer distributing inconsistent shares.
- Robust and non-malleable secret sharing: handles malicious players submitting wrong shares at reconstruction time.
Threshold Cryptography
Secret sharing is useful on its own. A signing key $sk$ that must not sit on any one machine is shared among $n$ machines, which sign in a distributed manner by running a Multiparty Computation (MPC) protocol for the signing function, so that $sk$ is never reconstructed anywhere. This is standard practice for cryptocurrency wallets and certificate authorities. It returns in §13 as the way a redaction trapdoor is held.
Additive Sharing: Addition Is Free, Multiplication Is Not
Two secrets are additively shared among the parties modulo $p = 65537$. Adding shares componentwise shares the sum. Multiplying them componentwise does not share the product. The readout shows by how much.
A degree-$t$ polynomial gives the required threshold directly: $t+1$ points determine it, while $t$ points leave its value at $0$ uniform. The map from shares to secrets is linear, so parties can add shared values locally.
Section 12 · Lecture 23Multiparty Computation (MPC) with an Honest Majority
With $n$ parties the two-party impossibilities loosen. If a majority is honest, a protocol can compute any functionality with fairness and guaranteed output delivery and, given private channels, with no computational assumption at all. The thresholds of this section are $t < n/2$ for passive security and $t < n/3$ for active security. The protocol below is the BGW/GMW line of work (BGW: Ben-Or, Goldwasser and Wigderson; GMW: Goldreich, Micali and Wigderson), stated for a passive threshold adversary corrupting $t < n/2$ parties.
Represent the function as an arithmetic circuit over $\mathbb{F}$, built from addition gates, multiplication gates and multiplication by public constants. The invariant maintained throughout is that every wire value is Shamir-shared among the parties with threshold $t$. Write $[u]$ for a sharing of $u$.
Step 1: Share the Inputs
Each party shares its own input $u$ by picking a random polynomial $p$ of degree at most $t$ with $p(0) = u$ and sending $p(i)$ to $P_i$. At the end of this phase every party holds one share of every input. No coalition of $t$ parties knows any input but its own.
Step 2a: Addition and Public Constants, for Free
Given $[u] = (u_1,\dots,u_n)$ and $[v] = (v_1,\dots,v_n)$, each party locally computes $w_i = u_i + v_i$. By linearity, $w_i = (p+q)(i)$ where $p + q$ has degree at most $t$ and $(p+q)(0) = u + v$, so $(w_1,\dots,w_n)$ is a threshold-$t$ sharing of $u+v$. No messages are sent. Likewise $w_i = c \cdot u_i$ shares $c \cdot u$.
Step 2b: Multiplication, and Why It Costs a Round
Local multiplication almost works and then fails in one specific way. Each party computes $z_i = u_i \cdot v_i = (p \cdot q)(i)$. The polynomial $p \cdot q$ satisfies $(p \cdot q)(0) = u v$, so the product is still encoded, although its degree is $2t$. With $n > 2t$ that is still reconstructable from all $n$ shares, so one multiplication is survivable. Two are not: the degree becomes $4t$. It doubles again at every level of the circuit. The invariant must be restored.
The degree reduction uses the linearity of reconstruction. Let $\alpha_1, \dots, \alpha_n$ be the Lagrange coefficients for recovering the value at $0$ of a degree-$2t$ polynomial from its $n$ points, so that $uv = \sum_i \alpha_i z_i$. Each party $P_i$ picks a fresh random polynomial $p_i$ of degree at most $t$ with $p_i(0) = z_i$ and sends $z_{i,j} = p_i(j)$ to $P_j$; that is, it re-shares its own product share. Each $P_j$ then computes
$$w_j = \sum_{i=1}^{n} \alpha_i \, z_{i,j} = \sum_{i=1}^{n} \alpha_i\, p_i(j) = p^{*}(j), \qquad p^{*}(X) = \sum_{i=1}^{n} \alpha_i\, p_i(X).$$The polynomial $p^{*}$ is a linear combination of degree-$\le t$ polynomials, hence of degree at most $t$, and
$$p^{*}(0) = \sum_i \alpha_i\, p_i(0) = \sum_i \alpha_i z_i = u v .$$So $(w_1, \dots, w_n)$ is a threshold-$t$ sharing of the product, so the invariant holds again. The cost is one round of communication per multiplication layer; the circuit's multiplicative depth, not its size, sets the round complexity.
Step 3: Reconstruct the Output
Each party broadcasts its share of each output wire, and everyone interpolates. Because the adversary is a minority and each wire is shared with threshold $t < n/2$, the honest parties always hold enough shares: output delivery is guaranteed, and fairness comes with it.
From Passive to Active
The GMW compiler upgrades any passively secure protocol: every party runs the semi-honest protocol and, alongside each message, proves in zero knowledge (§6) that the message was computed correctly from its committed input and randomness. A malicious party is thereby reduced to a semi-honest one: it may still choose its input, which the ideal world permits. It may also abort, which is why the honest majority restores fairness. The actively secure version of the BGW line is where the stricter bound $t < n/3$ applies. The compiler is a feasibility result; efficient maliciously secure MPC is a separate literature.
Beaver Triples, and Where Homomorphic Encryption Enters
A Beaver triple is a triple of sharings $[a]$, $[b]$, $[c]$ with $c = ab$, prepared before the inputs are known. The efficient protocols that drop the honest majority (SPDZ, the protocol of Damgård, Pastro, Smart and Zakarias, plus its descendants) multiply with one. To multiply $[u]$ and $[v]$, the parties open $d = u - a$ and $e = v - b$ and locally compute $[uv] = [c] + e[a] + d[b] + de$, one round of openings per multiplication layer. Generating the triples is the offline problem, and SPDZ solves it with somewhat homomorphic encryption, the Chapter 4 primitive that evaluates circuits on encrypted data. MP-SPDZ implements this family of protocols.
Worked number. Work modulo 101 with $a = 4$, $b = 7$ and $c = 28$. To multiply shared $x = 9$ and $y = 5$, the parties open $d = 5$ and $e = 99$; their shares rebuild $28 + 35 - 8 - 10 = 45$, indeed $9 \cdot 5$.
The GMW compiler is Goldreich, Micali and Wigderson, "How to play any mental game" (1987); the actively secure BGW line is Ben-Or, Goldwasser and Wigderson (1988). The efficient maliciously secure MPC literature includes Damgård, Pastro, Smart and Zakarias (2012), Chandran, Garay, Mohassel and Vusirikala (2017) and Wang, Ranellucci and Katz (2017).
Sharing makes linear operations free and multiplication interactive. Honest majority keeps $n > 2t$ true after a product and restores the fairness two parties can never have.
Section 13 · Lecture 24Redactable Blockchain
Blockchains are proposed for healthcare records, identity and reputation management, IoT device registries, smart grids, supply chains and post-trade settlement of US cash equities. All of these presuppose something Bitcoin explicitly refuses: the ability to correct the record. The immutability of Chapter 6 is not always a feature.
The need is concrete. Hard forks already repair human error. The Decentralized Autonomous Organization (DAO) fork reversed a $60 million theft on Ethereum (Chapter 7). The GDPR (General Data Protection Regulation) right to be forgotten conflicts with an append-only ledger. A case stalled after a Dutch man's identity information was found on the Bitcoin chain; fines reach 4% of annual revenue or €20 million. The Open Data Institute notes that immutable storage "may be incompatible with legislation which requires changes to the official truth" and that metadata alone can be revealing even when personal data stays off-chain. The European Union Agency for Cybersecurity (ENISA) asks for standard methods for removing data from a ledger, and ESMA observes that immutability is ill-suited to securities markets where operational errors may require cancelling a transaction.
The goal is to retain ordinary blockchain validation while adding a controlled procedure for editing or removing a block. Editing block $B_1$ to $B_1'$ breaks the hash pointer held by $B_2$, and so does removing it. Repairing that pointer means producing a hash collision on demand, which is what a chameleon hash provides.
Chameleon Hashing
A chameleon hash function $\Hash(\cdot;\cdot)$ takes a message and a randomness, is collision resistant to anyone holding only the public hash key $hk$ and admits efficient collision finding for anyone holding the trapdoor $tk$: given $(m, r)$ and any $m'$, one computes $r'$ with $\Hash(m; r) = \Hash(m'; r')$.
Let $\mathbb{G}$ be a cyclic group of prime order $q$ with generator $g$, for instance the quadratic residues modulo a safe prime. Set $hk = g^{a}$ and $tk = a$, and define, for $r \getsr \Zq$,
$$\Hash(m; r) = g^{m} \cdot hk^{\,r} = g^{\,m + a r}.$$Given the trapdoor, a collision with any $m'$ is found by solving $m + a r = m' + a r' \pmod q$, that is $r' = r + (m - m')a^{-1}$. But the relation runs both ways: one published collision $(m,r), (m',r')$ with $m \ne m'$ reveals
$$a = (m' - m)\,(r - r')^{-1} \bmod q,$$so the trapdoor is exposed by the first redaction itself. Every subsequent block becomes editable by anyone. The slides say "after a few collisions"; a single one suffices.
The fix is a stronger notion. Enhanced collision resistance requires that finding a collision remain hard even for an adversary with access to a collision oracle: the adversary may request collisions on messages of its choice and still cannot produce a fresh one, and in particular cannot extract $tk$. The randomness then acts as a check value: a redaction is authorized by knowing the $r'$ that makes the block hash to its old digest. Constructions satisfying this notion are what the redactable blockchain is built from.
A redaction leaves a visible trace. The repaired link shows that it was recomputed, while a removed block leaves a marker in its place. The chain records that a change occurred without retaining the removed content.
Who Holds the Trapdoor
The design reuses the chapter's own primitives. The trapdoor is a key of the same criticality as a certificate authority's, so no single party holds it: it is secret-shared among the authorities (§11), none of whom knows $tk$, and when a redaction is approved the collision is computed by a secure distributed protocol (§12). The design is aimed at permissioned systems: the chain stays decentralized and immutable in the ordinary sense, while a quorum of administrators under agreed governance can edit, rewrite or remove blocks. Two objections are answered in advance: appending an amendment is usually pointless, since the harmful data remains; and storing only a hash does not help, because a hash still proves existence.
The Permissionless Variant
A trapdoor held by administrators is a non-starter for an open cryptocurrency. The permissionless variant gives a redaction procedure with no additional trust assumption, decided by consensus, publicly verifiable and accountable.
- Block structure. Each block carries two links instead of one: the old link and the new link.
- Request. A proposer publishes a candidate redacted block $B_1'$ and its hash $h$ to a candidate pool.
- Voting. Miners who retrieve the candidate vote by including $h$ in blocks they mint. The voting phase spans an epoch: 1024 blocks in Bitcoin, roughly two weeks. A policy such as "approved if 50% of the blocks in the epoch voted for it" decides the outcome.
- Validation. A standard block is checked as usual, plus the validity of both links. A redacted block is checked for proof of work with respect to the old link, for the new link being broken and the old link intact and for the redaction having been approved.
In the Bitcoin integration the old link is $\Hash(\mathit{prev\_hash}, TX, TY, \mathit{salt})$, where $TY$ comes from the previous block header. The new link is $\Hash(\mathit{prev\_hash}, TX', TY, \mathit{salt})$ with $TX'$ the redacted transaction root. A redacted transaction is replaced by its own hash inside the Merkle tree of Chapter 6, so the rest of the tree and every proof of inclusion for an untouched transaction still verify.
The permissioned redactable blockchain is due to Ateniese, Magri, Venturi and Andrade, building on enhanced collision-resistant chameleon hashes; the technology was developed and patented with Accenture. The permissionless variant is due to Deuber, Magri and Thyagarajan (IEEE S&P 2019).
Nothing here makes redaction invisible. That is the design. The permissioned scheme concentrates the power in a shared trapdoor and leaves a visible trace; the permissionless scheme distributes the power to the miners' voting policy and leaves both links on the chain. The tradeoff is over who can rewrite history and how visibly the rewrite happens; the rewriting power itself is present in both.
Section 14Further Resources
- Secure Multiparty Computation, Yehuda Lindell. The standard gentle survey for a general CS audience.
- Wikipedia: Secure multi-party computation. The millionaires problem, the real/ideal framework, the adversary taxonomy, thresholds and real deployments.
- Wikipedia: Shamir's secret sharing. A worked example and the integer-arithmetic leak fixed by a finite field.
- Wikipedia: Garbled circuit. The gate-by-gate protocol, where oblivious transfer fits, free XOR and cut-and-choose.
- Wikipedia: Oblivious transfer. Rabin and 1-out-of-2 OT, including the result that OT suffices for all of MPC.
- MP-SPDZ. A reference teaching framework with a protocol matrix across security models and technologies.
- Wikipedia: Homomorphic encryption. The taxonomy, Paillier additivity, the FHE history and libraries.
Further reading: Shai Halevi (2017), Homomorphic Encryption, Chapter 5 of Tutorials on the Foundations of Cryptography, Yehuda Lindell ed., Springer, which develops the primitive that §12 uses to generate multiplication triples.
Section 15Exercises
Answers are hidden. Where a claim needs an honest-majority or a semi-honest hypothesis, the hypothesis is stated.
Prove that $t$ shares of Shamir's scheme reveal nothing about the secret. Drill
Fix distinct non-zero evaluation points $x_1, \dots, x_t \in \mathbb{F}$ and values $y_1, \dots, y_t \in \mathbb{F}$. For every candidate secret $m \in \mathbb{F}$ there is exactly one polynomial $p$ of degree at most $t$ with
$$p(0) = m, \quad p(x_1) = y_1, \dots, p(x_t) = y_t:$$these are $t+1$ interpolation conditions at $t+1$ distinct points. The map sending a polynomial of degree $\le t$ to its values at $t+1$ fixed distinct points is a bijection $\mathbb{F}^{t+1} \to \mathbb{F}^{t+1}$ (it is linear, and injective because a non-zero polynomial of degree $\le t$ has at most $t$ roots). The dealer draws $p$ uniformly from the $\abs{\mathbb{F}}^{t}$ polynomials with $p(0) = m$, so the induced distribution on $(p(x_1), \dots, p(x_t))$ is uniform on $\mathbb{F}^{t}$ and
$$\Pr[p(x_1) = y_1, \dots, p(x_t) = y_t \mid M = m] = \abs{\mathbb{F}}^{-t}$$independently of $m$. Bayes then gives $\Pr[M = m \mid \text{shares}] = \Pr[M = m]$ for every prior on $M$. The guarantee is information-theoretic (it holds against an unbounded adversary). It requires the evaluation points to be non-zero and distinct; it also requires $\abs{\mathbb{F}} > n$ so that $n$ such points exist.
Why is oblivious transfer complete for secure computation? Theory
First, one OT computes a private AND. The sender sets $(s_0, s_1) = (0, b')$ with $b'$ its own bit; the receiver chooses with $b$ and obtains $s_b$, which equals $1$ iff $b = b' = 1$, i.e. $s_b = b \wedge b'$. The receiver learns nothing else, because OT hides $s_{1-b}$; the sender learns nothing, because OT hides $b$.
Second, AND together with XOR is a complete basis, so any efficiently computable $f$ is a circuit over those gates. Third, gates compose while keeping every wire hidden, by either of two standard routes:
- GMW (Goldreich, Micali and Wigderson). Keep every wire value $v$ XOR-shared as $v = v_A \oplus v_B$. XOR gates are local: $(v_A \oplus w_A)$ and $(v_B \oplus w_B)$ share $v \oplus w$. An AND gate takes one 1-out-of-4 OT (equivalently a constant number of 1-out-of-2 OTs) in which the receiver's choice is its two shares and the sender's four strings are its own share of the output masked by a fresh random bit. Output wires are reconstructed by exchanging shares.
- Yao. Garble the whole circuit and use one OT per evaluator input bit (§9).
Both give security against semi-honest adversaries from OT alone; Kilian (1988) shows OT is complete in the malicious setting too. OT is also necessary in a strong sense: §7 shows AND cannot be computed with information-theoretic security, so some OT-like assumption must be imported.
Why must a garbled circuit never be evaluated twice? Attack
Security of garbling rests on the evaluator holding one label per wire. Suppose the same garbled circuit (same tables, same labels) is used for two evaluations in which the evaluator supplies different inputs, say $\vec{b}$ and $\vec{b}^{\,*}$ differing in position $j$. Then the evaluator ends up holding both $k_{b_j}^{0}$ and $k_{b_j}^{1}$, and two things break at once.
- The function is evaluated at unauthorized points. With both labels on wire $j$ the evaluator mixes and matches: it computes $f(\vec{\alpha}, \vec{b}')$ for every $\vec{b}'$ in the sub-cube spanned by the positions where it holds two labels. The ideal functionality delivers $f(\vec{\alpha}, \vec{b})$ for one $\vec{b}$; anything more is a leak. For $f = $ inner product, two evaluations on unit vectors already reveal two bits of the garbler's input that no single evaluation would.
- Wire semantics leak. With two labels for a wire the evaluator decrypts two rows of every gate that wire feeds, learns which output labels they produce and correlates labels across gates. Propagating this reveals the truth-table structure and, at the output gates where labels map to plaintext bits, the semantics of internal wires that the protocol exists to hide.
The formal statement matches: the security proof simulates a garbled circuit with one label per wire. There is no simulator for two, since the second evaluation's output is not a function of the ideal-world output. Hence a fresh garbling per evaluation, which is also why cut-and-choose (§10) needs $k$ independent copies; reusing one garbling $k$ times is evaluating it $k$ times.
Exhibit a protocol that is secure against semi-honest adversaries but insecure against malicious ones. Attack
Take the ElGamal-based OT of §7. The receiver is supposed to pick $x \getsr \Zq$, set $h_b = g^{x}$ and sample $h_{1-b}$ obliviously, uniformly without learning its discrete logarithm. Against a semi-honest receiver this is secure: $c_{1-b}$ is an ElGamal ciphertext under a key whose secret key nobody holds, so $s_{1-b}$ is hidden under DDH.
A malicious receiver ignores the instruction. It picks $x_0, x_1 \getsr \Zq$ and sends $h_0 = g^{x_0}$, $h_1 = g^{x_1}$. The two messages are distributed exactly as an honest receiver's, so the sender cannot object. It then decrypts both ciphertexts and learns $s_0$ and $s_1$. No ideal-world adversary can do this, since in the ideal world it submits one bit $b$ and receives one string. Hence there is no simulator and the protocol is not maliciously secure.
The standard repair enforces the constraint algebraically: publish a group element $C$ with unknown discrete logarithm and require $h_0 \cdot h_1 = C$, so the receiver sets $h_b = g^{x}$ and $h_{1-b} = C / h_b$; knowing both discrete logarithms would give $\log_g C$. Alternatively, use the PKE-plus-SKE protocol of §7, in which the sender generates the keys and there is nothing for the receiver to cheat at.
The lesson: semi-honest security constrains only what an adversary learns from a prescribed execution; malicious security also constrains what it can do. Cut-and-choose, input-consistency proofs and committed-input OT in §10 close gaps of this kind.
What is fairness, and why is it unachievable in general without an honest majority? Theory
Fairness says that if any party obtains the output, then every honest party does. It is weaker than guaranteed output delivery, which also forbids corrupted parties from preventing honest parties from receiving the output; an all-abort protocol is fair but delivers nothing.
For two parties fairness is impossible in general. The cleanest witness is coin tossing. Cleve (1986) proves that for every two-party protocol computing a uniform bit in $r$ rounds there is an efficient malicious party that, by aborting at a well-chosen round, biases the honest party's output by $\Omega(1/r)$. The intuition is a hybrid argument on the round-by-round "expected outputs": the value starts at $1/2$ and ends at $0$ or $1$, so it must move by at least $1/(2r)$ in one step; the party who speaks at that round can abort or not, and one of the two choices pushes the conditional expectation away from $1/2$ by that amount. A fair coin-tossing protocol would give an unbiasable coin, so none exists, and coin tossing is a functionality, so fairness for general two-party MPC is impossible.
The obstruction is the asymmetry of rounds: somebody learns the output first, and with two parties there is no way to make that party's participation unnecessary. With $t < n/2$ the output is Shamir-shared with threshold $t$ (§12). The honest parties alone number $n - t > t$, enough to reconstruct without the corrupted set. Aborting withholds nothing, so fairness and guaranteed output delivery follow. Two caveats. First, the impossibility is about general functionalities; specific functions (Gordon, Hazay, Katz and Lindell, 2008) admit fair two-party protocols. Second, the practical workaround is penalties. The deposit-and-timeout construction of §5 prices the abort instead of preventing it.
In cut-and-choose with $k$ circuits and a challenge set of size $t = k/2$, bound the probability that a garbler corrupting $c$ circuits is not caught. Drill
The challenge set is a uniformly random $t$-subset of the $k$ circuits. The garbler escapes detection exactly when none of its $c$ corrupted circuits is challenged, i.e. when the challenge set lies inside the $k - c$ good circuits:
$$\Pr[\text{not caught}] = \frac{\binom{k-c}{t}}{\binom{k}{t}} = \prod_{i=0}^{c-1} \frac{k-t-i}{k-i}.$$(Write both binomials as falling factorials and cancel; the identity requires $t \le k - c$, otherwise the probability is $0$.) With $t = k/2$ each factor is
$$\frac{k/2 - i}{k - i} \;\le\; \frac{1}{2}, \qquad i = 0, 1, \dots, c-1,$$with equality only at $i = 0$, since $\tfrac{k/2 - i}{k - i} \le \tfrac12 \iff k - 2i \le k - i \iff i \ge 0$. Hence $\Pr[\text{not caught}] \le 2^{-c}$.
Two consequences. Corrupting $c = \Theta(k)$ circuits is caught except with probability $2^{-\Theta(k)}$, negligible in $k$. Corrupting $c = O(1)$ circuits succeeds with probability $\ge 2^{-O(1)}$, which is noticeable, so cut-and-choose must be combined with a rule that tolerates a few bad circuits. Taking the majority of the $\ell = k - t$ evaluated outputs does this: flipping the majority requires corrupting more than $\ell/2 = \Theta(k)$ circuits, which the bound rules out.
In the honest-majority protocol, why does multiplication need interaction, and why does the degree-reduction step preserve the secret? Drill
Let $[u]$ and $[v]$ be threshold-$t$ Shamir sharings, $u = p(0)$, $v = q(0)$, with $\deg p, \deg q \le t$. Local multiplication gives $z_i = u_i v_i = (pq)(i)$, and $(pq)(0) = uv$, so the product is encoded. Two problems.
- $\deg(pq) \le 2t$, so $2t + 1$ points are needed to interpolate; the invariant "degree $\le t$" is broken, and after a second multiplication the degree is $4t$, exceeding $n$ after a few levels. Honest majority ($n \ge 2t+1$) supplies enough shares for a single product but not for iterated ones.
- $pq$ is a product, so it is not a uniformly random polynomial of degree $\le 2t$ with the right constant term. Its shares carry more information than a fresh sharing would. Re-randomization is needed as well as degree reduction.
Both are fixed by re-sharing. Since $\deg(pq) \le 2t$ and $n \ge 2t + 1$, Lagrange coefficients $\alpha_1, \dots, \alpha_n$ depending only on the public evaluation points give
$$uv = (pq)(0) = \sum_{i=1}^{n} \alpha_i \,(pq)(i) = \sum_{i=1}^{n} \alpha_i z_i .$$Each $P_i$ picks a fresh random $p_i$ of degree $\le t$ with $p_i(0) = z_i$ and sends $p_i(j)$ to $P_j$ (the round of interaction). Each $P_j$ sets $w_j = \sum_i \alpha_i p_i(j)$. With $p^{*}(X) = \sum_i \alpha_i p_i(X)$, $\deg p^{*} \le t$ and
$$p^{*}(0) = \sum_i \alpha_i p_i(0) = \sum_i \alpha_i z_i = uv,$$while $w_j = p^{*}(j)$ by construction. So $(w_1,\dots,w_n)$ is a threshold-$t$ sharing of $uv$; the fresh $p_i$ supply the randomization. Privacy against $t$ passive corruptions follows because each honest re-sharing contributes $t$ uniform field elements to the corrupted view. The round count is one per multiplicative layer: multiplicative depth, not gate count, sets it.
Show that the textbook chameleon hash leaks its trapdoor after a single redaction, and say what property fixes it. Attack
The construction is $hk = g^{a}$, $tk = a$ and $\Hash(m; r) = g^{m} \cdot hk^{r} = g^{\,m + ar}$ in a group of prime order $q$. A collision is a pair $(m, r) \ne (m', r')$ with
$$m + a r \equiv m' + a r' \pmod q .$$Any such pair with $m \ne m'$ forces $r \ne r'$ and yields, by rearranging,
$$a \equiv (m' - m)\,(r - r')^{-1} \pmod q,$$where the inverse exists because $q$ is prime and $r - r' \not\equiv 0$. The first published redaction hands the trapdoor to every observer, and from then on anyone can rewrite any block. (The slides say the trapdoor is exposed "after a few collisions"; one is enough.)
The property that fixes it is enhanced collision resistance: it must be infeasible to produce a fresh collision even given access to a collision oracle that answers adaptive queries $(h, m, r, m')$ with a matching $r'$. Under that notion, published redactions do not help an adversary make new ones. In particular, do not reveal $tk$. The randomness acts as a check value certifying an authorized redaction. The trapdoor appears in no published equation. Two deployment consequences follow. The trapdoor is secret-shared among several authorities and used only through a distributed protocol, so no single party holds $a$ even momentarily (§11 and §12). In the permissionless variant the trapdoor is dispensed with entirely, redaction being authorized by miner voting over an epoch and made accountable by keeping both the old and the new link in the block (§13).