logo academy

The Lightning Network and Bitcoin Scalability Issues

September 22, 2021

7 min

The Lightning Network and Bitcoin Scalability Issues
Beginner

The Lightning Network is a decentralised network of nodes that allows a potentially unlimited number of transactions to be sent instantaneously.

This Layer 2 network is parallel to the Bitcoin blockchain, and performs some transactions on the blockchain and some off-chain.

Why was it invented?

Satoshi Nakamoto was very far-sighted in his planning of Bitcoin, but what he may not have foreseen was the volume of transactions that the blockchain would have to handle.

bitcoin transaction speed

Think of the 2017 boom, think of the glorious return in 2020. As you can see from the chart below, the burst of adoption has put a strain on the world’s first blockchain, which still takes around 10 minutes to confirm each transaction.

On top of that, in these jammed situations, it requires high fees, extended settlement time and fails to confirm some transactions.

bitcoin transaction fees

It is not really ready to compete in a future of dapps and decentralised finance.

In an early response to this limitation many altcoins have sprung up, however some solutions have emerged from within the Bitcoin ecosystem itself. See Bitcoin Cash, one of the forks of Bitcoin that has provided for a significant increase in block size.

The various Bitcoin forks have only made this kind of change, however it is not enough to increase the capacity of each block. The problem of slowness and possible congestion remains.

So in 2016 two developers published the Lightning Network whitepaper.

How the Lightning Network works

To understand the basic functioning of a lightning network, think of the transactions you make in a pub.

Alex arrives at the pub and orders a beer. If she only wants that, she will pay immediately. If, on the other hand, she is going to order several other things, it is better for her to have Andrea, the bartender, open up a tab for her.

So Alex decides to leave her tab open.

During the evening she orders drinks and food. At the end of the evening, she receives the total bill from Sam and pays.

Let’s take this logic into the dimension of the Lightning Network.

The transaction takes place on a so-called “payment channel“.

First of all, in order to open a payment channel on the Lightning Network, you need a multisignature wallet. This means that the cryptocurrencies in the wallet can only be spent with the permission of 2 (or more) owners, who hold the private key.

So Alex and Sam have a common wallet and they each put in 50% of the Bitcoins they plan to use in total.

This is a transaction on the blockchain, which is validated by a miner.

Once the channel is open, Alex and Sam can exchange the available Bitcoins in the wallet as they wish, for as long as they wish. All these exchanges will be off-chain, free and instantaneous.

When they decide to close the channel, they will have to make a closing transaction on the blockchain, authorising it with their private keys.

lightning network

Indirect Payment Channels

Through routing, it is possible to carry out transactions on the LN even with users to whom you are not directly connected.

In order to transact with a network node with which you do not have a direct payment channel, you must have however an indirect connection. So if A has a channel with B and B has one with C, A can send Bitcoin to C instantly.

Value exchanges are however always subject to the liquidity available within the various multi-sig wallets involved in the network path.

Is the Lightning Network secure?

Transactions to open and close a channel are on the blockchain, which makes them secure. Other off-chain transactions are recorded on both participants’ computers and communications between the two nodes are encrypted.

To protect indirect transactions from intervention by other nodes in the network, special smart contracts called Hash Time Locked Contract (HTLC) are used. This is a type of payment in which the transaction is blocked until a certain condition occurs.

To secure the payment, HTLC uses hashlock and timelock mechanisms.

Timelocks are used to limit the time a payment channel will remain open. This prevents a user from disappearing from the network, leaving wallet funds locked up. In the event that Alex disappears, Sam can still retrieve his funds when the timelock expires.

A hashlock, on the other hand, is a type of mechanism that restricts an expenditure until a certain piece of information is confirmed. For example, a payment is only sent when Alex provides her private key.

Use Cases and State of the Art

Since 2016, this technology has been the subject of continuous research and development. The network is fully operational, however vulnerabilities have been discovered in the code that have not been fully resolved. Furthermore, the need for a multisig wallet hinders access to the service in a context that requires fiat currencies, and in general the usability of this technology is still lacking.

Nevertheless, in 2021 El Salvador adopted Bitcoin as its official currency and was directly assisted in this procedure by Strike, a wallet for the Lightning Network.

Due to this and the increased adoption of LN by various companies and exchanges, in just two months since the announcement the network has grown by 46%.

The development of the LN paves the way for several applications, in addition to instant payments with the Bitcoin blockchain. For example, it will be possible to pay for a subscription service by the hour instead of every month, so that you actually pay by consumption.

In general, it will facilitate micro-transactions such as social media tips or in-store payments, because it does not require fees and payment confirmation is instant.

It is no coincidence that a McDonald’s in El Salvador already accepts payments in Bitcoin through the Lightning Network.

Related