Deep diving into Lightning Network
What is going on with the main Bitcoin scaling solution?
In previous Deep Diving research, we explained the difference between all types of layer 2 solutions and analyzed their current state. We’ve introduced you to Sidechains, State channels, Plasma and Rollups. Now it is time to dive in even deeper; we are going to analyze the main state channel in the space, the Lightning Network.
Lightning Network (LN) is the Bitcoin scaling solution, functioning as a distributed network of nodes connected by payment channels.
LN is designed to address the scalability issues of the Bitcoin blockchain, which has a maximum capacity of 7 TPS and block creation time of 10 minutes, which makes it impossible to use as a payment system. LN increases Bitcoin’s capacity to millions of TPS while maintaining a basic transaction fee of only 1 satoshi (0.00000001 BTC).
– How does LN work?
– Features and vulnerabilities
– LN ecosystem
– Current state and possible game changer
– Output
How does LN work?
Lightning Network is a system of P2P payment channels that are opened between two parties. To create a channel, a certain number of BTC is required to be blocked, which will later be used in the exchange between the parties. Once the channel is opened, all further transactions are moved off-chain and don’t require miner confirmations.
As long as the channel is open, the parties can endlessly transfer transactions to each other without informing the Bitcoin blockchain. The channel can be closed either by mutual consent or at the request of one of the parties. To close the channel, a “closing” on-chain transaction is performed on the Bitcoin network, which records the final balances of the parties.
Schematically it looks like this:
Features and vulnerabilities
Apart from the obvious increase in transaction speed and lower fees, the main advantage of LN is the ability to make micropayments. The current state of Bitcoin network makes micropayments impractical: the commission might go up 5–10 times higher than the smallest amount of Bitcoin you can send or receive in a transaction, which is 0.0000546 BTC. Thus, it becomes possible to buy bread or a cup of coffee with BTC via LN. Also, it potentially opens up new markets, such as per-second payments for streaming and other content-creation services.
The advantages are clear, and it makes no sense to describe them in detail, but the vulnerabilities are worth elaborating on:
1. Possibility of Spam attack
Regardless of the channel capacity, it isn’t capable of storing more than 483 hashes at a time. This means that an attacker can perform a micropayment attack by sending 483 micropayments to a channel. Although this vulnerability doesn’t result in the theft of money, it does result in the blocking of funds deposited in the channel for up to 2 weeks. Currently, there is no solution to this problem.
2. Possibility of Flood & Loot attack
While on LN there are only two on-chain transactions (one to open a payment channel, and one to close it), potential problems can arise when multiple channels are closed at the same time; the Bitcoin blockchain may not be able to handle the volume of transactions at peak times. And this can be exploited. Without going into technical details, in this attack, an attacker forces many victims at once to flood the blockchain with claims for their funds. He is then able to leverage the congestion that they create to steal any funds that were not claimed before the deadline. The results of one study suggest that a simultaneous attack on 85 channels is enough to guarantee one successful attack.
3. Possibility of Time-Dilation Attack
An attacker can deploy hundreds of nodes and isolate the victim from real users. Once the isolation has occurred, the attacker can transmit the node’s transaction data to the victim at a slower rate than normal. Because the victim doesn’t receive transaction information in a timely manner, the attacker can steal funds from the channel by taking advantage of the fact that the victim doesn’t see the channel closure transaction in the Bitcoin blockchain.
LN ecosystem
Lightning technology is widely used in various business segments, including wallets, streaming services, and the financial sector. Also, LN is being actively implemented by exchanges; the most well-known are Bitfinex, Kraken, and Okex. You can see the map of the LN ecosystem below:
Current state
Key network metrics:
- Network Capacity indicates the number of locked BTC on the Lightning Network. As of the end of September 2023, the network capacity is 5,412 BTC or ~$124 million at the current exchange rate:
As you can see, this technology hasn’t become widely used yet; the total TVL of all Ethereum’s L2s is dozens of times higher.
2. Number of payment channels. The more payment channels, the wider the network, which means the transaction route can be more flexible and cheaper. At the time of writing, there are almost 72K open payment channels.
The graph shows an exponential growth in the number of open channels from mid-2021 to early 2022. This growth was largely driven by the legalization of BTC as a means of payment in El Salvador. This led to many stores and cafés in the country starting to open their payment channels on the Lightning Network.
As can be seen from the infographics, the growth of these two key indicators hasn’t been parabolic even during the bull run. The ease of use so far does not compare to the usability of Ethereum rollups. But what’s more remarkable is that with the arrival of crypto winter, there has been no major decline in activity on Lightning Network, as there has been on every other network. This is an indicator that growth has been organic and sustainable, and only a lack of use cases is holding back further growth.
A possible game changer?
Bringing stablecoins to the Lightning Network could be the game changer that triggers parabolic growth. Is it possible? Yes, this became possible thanks to Taproot’s update to the Bitcoin network. In 2022, Lightning Labs announced a protocol called Taro that allows creating a wide range of assets on the Bitcoin network, including stablecoins, and moving them to the LN. The alpha version of Taro is already available on Testnet.
It will be a few years before stablecoins are implemented on Lightning in a secure and convenient way. But when it happens, it could be for Bitcoin what email was for the early Internet — the main tool for mass adoption.
Output
Lightning Network is the technology that solves the problem of scalability and high fees on the Bitcoin network. However, in the six years of its existence, it hasn’t yet become widespread. The current LN implementation is prone to many vulnerabilities and attacks, but if the ways to solve these problems are found and more user cases become available, this is going to change.
The successful implementation of stablecoins on Lightning could encourage the masses to use Bitcoin. Also, another key driver of growth lies in the area of government regulation; the case of El Salvador is proof of that.