Lecture 18 · Tuesday 25 November 2025

Security of Bitcoin. Lightning networks.

The lecture states what Bitcoin actually guarantees, then builds the scripting language that makes outputs programmable and ends with payment channels and Lightning, the off-chain construction that removes the 7-transactions-per-second ceiling from everyday payments.

Deck: 06_Bitcoin.pdf Chapter 6

Before ThisWhere Lecture 17 Left Off

Lecture 17 gave Bitcoin its money mechanics and its threat model: transactions consuming Unspent Transaction Outputs (UTXOs) with signatures on every input, pools that amortize variance through shares, and attacks on the ledger, the pools and the users. Selfish mining (keeping found blocks private to release them later) closed it by breaking the fairness invariant whenever $\alpha > (1 - \gamma)/(3 - 2\gamma)$. This lecture asks what theorem the mechanism satisfies, and how to program it.

This LectureWhat It Adds

The security half is the Bitcoin backbone analysis. Eventual consensus means safety, a transaction buried $k$ blocks deep stays in the same position, and liveness, every valid transaction eventually commits. The backbone properties are common prefix (honest chains agree except near the tip), chain quality (honest blocks keep a fair share) and chain growth (the chain keeps growing). In the synchronous Poisson model (messages arrive within a fixed delay and blocks appear at random times) with delay bound $\Delta$, Nakamoto's consensus (Bitcoin's longest-chain protocol) satisfies both when $\alpha g^{2} > \beta$ with $g = e^{-\alpha\Delta}$; the proof counts non-tailgaters (honest blocks that advance the chain) for growth and loners (honest blocks mined alone in their round) for safety.

The programming half replaces the fixed signature condition with a general boolean predicate (a true/false condition) $C_i$ and a witness (data that makes it true) $W_i$. The scripting language is deliberately small, and contracts compose multisignature (several keys must sign), hash preimage (a secret that hashes to a given value) and timelock (funds locked until a set time) conditions. Micropayments motivate the final construction. A payment channel opens with one on-chain funding transaction, updates off-chain through signed commitments with descending timelocks and closes with one settlement. Hash locks (conditions that release funds when a secret is revealed) route payments across channels, which is the Lightning network. The deck closes with Plasma, committing an off-chain ledger to the chain by periodic hashes.

Study PlanWhat to Read, in Lecture Order

All sections are on the Chapter 6 page.

  1. Chapter 6 §11: Eventual consensus. Safety and liveness, common prefix, chain quality, chain growth, the theorem $\alpha g^{2} > \beta$ and the tailgater (a block mined right after another) and loner (a block mined alone) proof structure.
  2. §12: Scripts and contracts. Conditions and witnesses, the standard signature condition, the example factorization condition, the non-Turing-complete scripting language (it cannot express loops) and multisignature (several keys must sign) and timelock (funds locked until a set time) contracts.
  3. §13: Payment channels and Lightning. The funding transaction, the 30-day refund, 29-day and 28-day commitments, bidirectional channels, hash-locked routing (each hop pays when the same secret is revealed) and the Plasma appendix (an off-chain ledger anchored to the chain by periodic hashes). The stage walks through the channel states.

PracticeExercises for This Lecture