How Lightning Network Works
Lesson by Uvin Vindula
The Big Idea: Payment Channels
The Lightning Network is a Layer 2 payment protocol built on top of Bitcoin. Its core innovation is the payment channel — a private, off-chain connection between two parties that allows them to transact unlimited times without touching the blockchain. Only two on-chain transactions are needed: one to open the channel and one to close it. Everything in between happens off-chain, instantly, and with near-zero fees.
How a Payment Channel Works — Step by Step
Let us walk through a concrete example. Suppose Amal in Colombo regularly buys coffee from Nisha's cafe:
- Opening the channel: Amal and Nisha create a payment channel by depositing Bitcoin into a 2-of-2 multisig address on the blockchain. This is a special address that requires both Amal's and Nisha's signatures to spend from. Say Amal deposits 0.01 BTC. This opening transaction is recorded on the Bitcoin blockchain. Balance: Amal 0.01 BTC, Nisha 0 BTC.
- Transacting off-chain: Every time Amal buys a coffee (0.0002 BTC), they create a new commitment transaction — a signed agreement updating the balance. After the first coffee: Amal 0.0098, Nisha 0.0002. After the second: Amal 0.0096, Nisha 0.0004. These updates happen instantly (milliseconds) and cost nothing. They are just signed messages between two computers.
- Closing the channel: When they want to settle, either party can broadcast the latest commitment transaction to the blockchain. The Bitcoin is distributed according to the final balances. Only this closing transaction pays a normal on-chain fee.
If Amal bought 50 coffees before closing the channel, those 50 transactions were processed instantly and for free — with only 2 on-chain transactions total.
The Network Effect — Routing Payments
The real power of Lightning comes from routing. You do not need a direct channel with everyone you want to pay. If Amal has a channel with Nisha, and Nisha has a channel with Dinesh, then Amal can pay Dinesh through Nisha — even though Amal and Dinesh have never met.
This works through HTLCs (Hash Time-Locked Contracts) — smart contracts that ensure the payment either completes fully or fails completely. No one in the routing chain can steal funds. The mathematics guarantee this:
- The payment is locked with a cryptographic hash
- Each hop in the route can only claim funds by revealing a secret (preimage) that proves the next hop was paid
- If any hop fails, the entire payment reverses automatically after a timeout
- The sender and receiver are the only ones who know the full payment details — intermediary nodes only see their part
Lightning Network Properties
| Property | Lightning Network | Bitcoin Layer 1 |
|---|---|---|
| Speed | Milliseconds to seconds | 10-60 minutes |
| Fees | Fractions of a cent (often < 1 sat) | $0.50 to $50+ |
| Throughput | Millions+ TPS theoretically | ~7 TPS |
| Minimum amount | 1 satoshi (0.00000001 BTC) | ~546 sats (dust limit) |
| Privacy | Better (onion routing) | Pseudonymous (all txs public) |
| Finality | Probabilistic until settled on-chain | Final after ~6 confirmations |
Network Statistics (Early 2026)
The Lightning Network has grown significantly since its launch in 2018:
- Public capacity: ~5,500+ BTC (approximately $500M+ at current prices)
- Active nodes: ~16,000+
- Active channels: ~75,000+
- Largest node operators: ACINQ, River Financial, Wallet of Satoshi, Bitfinex
Note that these are only public channels. Private channels (which are increasingly common for privacy) are not counted, meaning the true capacity and usage is likely significantly higher.
Security Model
Lightning inherits Bitcoin's security, but with some additional considerations:
- Channel monitoring: You (or a service called a watchtower) must monitor the blockchain to ensure your channel partner does not try to broadcast an old, unfavorable commitment transaction. If they do, the penalty mechanism allows you to claim ALL funds in the channel.
- Inbound liquidity: You can only receive payments up to the amount of inbound capacity in your channels. This is a common friction point for new users.
- Hot wallet risk: Lightning requires keys to be online and accessible (in a "hot wallet") for signing channel updates. This is less secure than cold storage but necessary for the instant payment functionality.
Limitations and Trade-offs
Lightning is not perfect. Honest assessment of current limitations:
- Liquidity management: Ensuring you have sufficient inbound and outbound capacity in channels requires active management and can be confusing for beginners.
- Not ideal for large payments: Routing a $10,000 payment over Lightning is harder than routing a $10 payment because channels have limited capacity. For large transfers, Layer 1 remains more appropriate.
- Channel opens/closes require on-chain fees: While transacting on Lightning is nearly free, opening and closing channels still costs on-chain fees. During high-fee periods, this can be expensive.
- Receiving offline: You generally need to be online to receive a Lightning payment (though solutions like async payments are being developed).
Key Takeaways
- •Payment channels allow unlimited off-chain transactions between two parties with only two on-chain transactions (open and close)
- •Routing via HTLCs lets you pay anyone on the network through intermediary nodes without direct channels — trustlessly and atomically
- •Lightning transactions settle in milliseconds with fees of fractions of a cent, compared to 10-60 minute confirmation and $0.50-$50+ fees on Layer 1
- •Network capacity exceeds 5,500 BTC with 16,000+ active nodes and 75,000+ channels as of early 2026
- •Key trade-offs include liquidity management complexity, hot wallet requirement, and the need for on-chain fees to open/close channels
- •Watchtowers monitor the blockchain to prevent channel partners from broadcasting old, unfavorable commitment transactions
Quick Quiz
Question 1 of 3
0 correct so far
How many on-chain transactions are needed for 100 Lightning payments between two parties?