Last Updated on November 25, 2022
The Lightning Network (LN) is a layer-2 solution built on top of Bitcoin. It was created in response to scalability issues with Bitcoin, including the speed and cost of Bitcoin transactions. Read the white paper from 2016.
Bitcoin’s current maximum transactions per second is 10, though in reality it is between 3 and 7. Traditional payment processors like VISA can handle 6,000 transactions – based on their (unverifiable, but probably accurate) claim of 188 billion transactions a year.
Bitcoin’s transaction fees can vary depending on the current demand to use the network. For instance, on April 20th 2021 average transaction fees were in excess of $50, while on August 9th 2021, the average was around $2.50.
For large transactions, such as bank transfers or international remittance, Bitcoin’s speed and cost is comparable or superior to alternatives. But if Bitcoin is to be used for day-to-day micro-transactions, the speed must increase and costs must decrease.
One limiting factor of the current Bitcoin network is that every transaction must be put in a new block on chain. Since blocks are added to the chain approximately every 10 minutes, there is a hard limit to the number of transactions possible without significantly altering the Bitcoin protocol.
The Lightning Network, rather than creating a new blockchain via a hard fork, is a layer-2 solution. This means that it allows the Bitcoin protocol to remain relatively unchanged while providing the benefits of a hard fork.
How It Works
The Lightning Network works by setting up a payment channel between two parties, where the first and last transactions are put on the Bitcoin blockchain. Any transactions between the first and last happen off chain and not limited by the Bitcoin protocol.
- A Lightning node: separate software that communicates with each other and constitutes a new peer-to-peer network.
- Channels: a connection opened between two Lightning nodes, allowing for payments to flow between them. A channel is literally a Bitcoin base layer transaction, anchoring the channel to the secure chain.
- Once two nodes open a channel between one another, payments start flowing between them. Each subsequent payment modifies the channel’s state, cryptographically revoking the old one and checkpointing the new one in memory and on disk of both nodes, but critically, not to the base chain.
- Channels stay open for a long time (e.g., a year or more). If the nodes ever decide to close down their channel, their latest balance after all the off-chain payments is restored to their original wallets. This is cryptographically-secured by hashed time-locked contracts (HTLC) and digital signatures, which we won’t get into detail for the purposes of this article.
- This allows one to batch billions of payments into two on-chain transactions — one for opening the channel and one for closing it. Once a payment is complete, it is indisputable what the latest balance is between all parties (assuming nodes redundantly store their channel checkpoints).
- Lightning Network enabled wallets are not very user friendly, and many caution that since they are still in public testing stages, you shouldn’t deposit large amounts at this time.
- Non-custodial Lightning Network wallets are far less user friendly.
- Competition from Ethereum Network, and the upcoming Consensus Layer may render it obsolete.
Hacking Type Issues
- Griefing attacks: Funds aren’t lost, but it causes the victim’s Lightning funds to be frozen so that the payment channel cannot process any transactions.
- Flood and loot: An attacker forces many victims to claim their funds from the blockchain at the same time (flood). The attacker uses this congestion to steal funds that were unable to be claimed before the deadline (loot).
- Time-dilation attacks: An attacker lengthens the time a victim becomes aware of new blocks by delaying block delivery.
- Pinning attacks: An attacker tricks a victim into closing their LN channel improperly and steals individual transactions.