Lightning Network
Also called: Lightning, LN, Lightning payments, payment channels, layer 2.
The Lightning Network is a layer-2 payment network on Bitcoin: users pay through chains of off-chain channels and settle on-chain only when needed.
The Lightning Network is a network of payment channels built on top of Bitcoin. Two parties lock bitcoin in a shared 2-of-2 output, then pay each other by exchanging signed but unbroadcast transactions that update the balance. Payments can be routed across several channels, so you can pay anyone connected to the network. Only opening and closing a channel touch the blockchain, so payments are fast and can be very small. It was first described in a 2015 paper by Joseph Poon and Thaddeus Dryja.
How Lightning works
- Channels: each payment creates new commitment transactions that either side could broadcast. Old states are revoked: if someone broadcasts one, the other party can claim all the funds while the cheater's output is still locked by a CSV delay.
- Routing: payments travel through intermediaries using HTLCs, contracts that release funds when a secret is revealed or refund after a timelock, so either every hop is paid or none is.
- Fees: commitment transactions are signed long before they may be broadcast, so fees are added later with CPFP through anchor outputs.
BIPs Lightning depends on
Lightning's own protocol is specified in the BOLT documents, not in BIPs, but it relies on Bitcoin upgrades: BIP 65 and BIP 112 timelocks with BIP 68 relative locks, BIP 141 (SegWit) to fix malleability, Taproot and MuSig2 (BIP 327) for more private channels, and mempool work such as package relay (BIP 331), TRUC transactions (BIP 431) and P2A anchors (BIP 433). Proposals such as BIP 118 (ANYPREVOUT, for the "eltoo" channel design) aim to simplify channels further.
The Lightning BIPs guide goes through each one, and the Lightning topic lists related proposals.