Overview
A payment channel is the fundamental building block of the Lightning Network. It allows two parties to transact an unlimited number of times between themselves without broadcasting each transaction to the Bitcoin blockchain. Only the channel opening and closing transactions are recorded on-chain, dramatically reducing fees and enabling near-instant payments.
How Payment Channels Work
Channel Lifecycle:
1. OPEN 2. TRANSACT 3. CLOSE
┌───────────────────┐ ┌───────────────────┐ ┌───────────────────┐
│ On-chain funding │ │ Off-chain balance │ │ On-chain settle │
│ tx: 2-of-2 multisig│ │ updates (signed │ │ tx: final │
│ │ │ commitment txs) │ │ balances │
│ Alice: 0.5 BTC │ │ │ │ │
│ Bob: 0.0 BTC │ │ Alice: 0.3 BTC │ │ Alice: 0.2 BTC │
│ │ │ Bob: 0.2 BTC │ │ Bob: 0.3 BTC │
└───────────────────┘ └───────────────────┘ └───────────────────┘
│ │ │
▼ ▼ ▼
Blockchain No blockchain Blockchain
(1 transaction) activity needed (1 transaction)
Commitment Transactions
Each balance update creates a pair of commitment transactions — one for each party. These are valid Bitcoin transactions that could be broadcast at any time to close the channel, but they are held rather than broadcast. Each new state invalidates the previous one through a revocation mechanism.
Revocation and Security
When a channel state is updated, both parties exchange revocation keys for the previous state. If one party attempts to broadcast an old (revoked) commitment transaction, the other party can use the revocation key to claim all funds in the channel via a penalty transaction. This mechanism keeps both parties honest without trusting each other.
Bidirectional Payments
Modern payment channels (as used in Lightning) are fully bidirectional. Funds can flow back and forth between Alice and Bob as many times as needed, as long as neither party's balance goes below zero. The total channel capacity remains fixed until the channel is closed and re-opened.
Routing Across Multiple Channels
The true power of payment channels emerges when they are networked together. Through multi-hop payments using HTLCs, a payment can traverse multiple channels to reach a recipient the sender does not have a direct channel with. This is the core mechanism of the Lightning Network.