Easy Explanation: The Lightning Network

lightning network

Lightning Network - A bit of history

The bitcoin community experienced some panic in the months leading up to August 1st, 2017 as the scaling debate threatened to create a schism in the bitcoin community at the time. This was all about choosing between the two main solutions proposed to solve the problems of congestion and high transaction fees on the bitcoin network.

Some community members opted to simply increase the 1-megabyte blocksize limit on the bitcoin network. This meant the size of transaction data that could be included in a block had to be increased from 1 megabyte to reduce congestion and transaction fees as a result. The bitcoin blockchain is basically made up of cryptographically linked blocks.

Conversely, others with more long-term goals in sight called for a second layer solution. This post delves into the second layer solution known as the Lightning network and breaks down how it works in simple terms.

The Problem and How Lightning Fixes it

Towards the end of 2017, during the peak of the previous bitcoin bull run, Elizabeth Stark, the co-founder, and CEO of Lightning Labs, aptly described the then congested bitcoin network as a traffic jam where road users had to pay more to get through.

When it comes to transactions per second (TPS), the bitcoin network (7 TPS) does not compete favorably with VISA (up to 24,000 TPS). Even without making comparisons, it is obvious that 7 TPS is woefully inadequate if the bitcoin is to become the main global medium of exchange.

The network is therefore designed as a solution to the scaling problem. The idea behind the Lightning network is to make it possible for the bitcoin blockchain to handle more transactions at a fast rate without the need to increase the blocksize. This is achieved by having a second layer (the Lightning network) handle smaller recurrent transactions.

The end result is that not every tiny transaction needs to be recorded on the main chain. Freeing space on the primary chain means there would be less congestion and no need for users to overpay to have their transactions confirmed.

Another benefit of Lightning is that the security of the Bitcoin blockchain is not unnecessarily compromised by a blocksize increase. Maintaining the small blocksize makes it difficult for bad actors to spam the bitcoin network. Future forks of the bitcoin network would also be impossible with Lightning. The technology is also said to help in block propagation which leads to more decentralization as miners will receive blocks with minimum latency.

A combination of the main chain and the lightning network on bitcoin is expected to be capable of handling in the millions per second. This gives the network true potential to become the global currency.

Using the same road network analogy, the Lightning network becomes an overpass that relieves traffic congestion and makes it cheaper for more vehicles to get through instantly.

There is also the added benefit of more privacy on the Lightning network since the network uses onion routing which was popularized by the TOR network.

Other blockchains can also implement the technology.

Off Chain Approach: How a Transaction on the Lightning Network Works

While parallels between bitcoin and savings accounts have been drawn, Lightning has often been likened to a chequing account. How exactly does this work?

The following is what would ensue if an individual named Alice wanted to use the Lightning network to purchase some bread from a bakery shop.

Alice would first have to set up her lightning node (a user on the network is known as a node) and open a channel with the bakery shop or any other node connected to the bakery shop on the lightning network. Alice does not have to necessarily connect directly to the bakery shop’s node since her payment for a loaf of bread can be relayed by other nodes connected to the bakery shop. The web of interconnected nodes makes it possible for a payment to hop from channel to channel before reaching its destination. Hence, Alice does not have to concern herself with how her payment gets to the bakery shop.

The two nodes that create the said payment channel do so by creating a multi-signature transaction on the blockchain and deposit some bitcoin into it. For instance, Alice deposits 0.3 BTC whiles the bakery shop deposits 0.1 BTC for possible refunds. A record of these amounts is created and broadcasted on the bitcoin network as soon as the payment channel between Alice and the bakery shop is opened.

Both Alice and bakery shop can now transact endlessly between each other with funds going back and forth instantly each time bread is bought or a refund is made. For example, to buy the first loaf of bread for 0.05BTC, Alice will change the record/balance sheet of the channel to indicate that she now has 0.05 less bitcoin and the coffee shop’s balance will have 0.05 BTC added to it. Both parties will then sign the updated balance sheet with their private keys and keep them without having them broadcasted on the main bitcoin blockchain. The balance sheet would be updated and signed each time a transaction takes place between the two parties.

To close the payment channel, either Alice or the bakery shop will simply have to broadcast the most current balance sheet signed by both parties on the bitcoin blockchain. Following this, both parties would receive their balance after miners have validated their transaction.

Like it is in the example above, only two transactions (the one used to open the channel and the other to close it) are recorded on the bitcoin blockchain. The thousands or millions of transactions in between did not have to be recorded on the public bitcoin ledger. This is precisely how congestion is reduced on the bitcoin blockchain with the Lightning network.

The Lightning network has been growing considerably since its mainnet launch on 15th March 2018. The network had 3695 nodes, 12387 channels and a capacity of 115.78 BTC at the time of writing. Its proponents are also excited to see the technology gain more adoption from different merchants.

Based on the statistics and potential adoption, most experts see Lightning as a positive game changer and expect it to improve the bitcoin user experience. The technology allows the store of value and medium of exchange property of bitcoin to be fulfilled - the Lightning network serves as the medium of exchange whiles bitcoin is used as a store of value. This leaves out only the unit of account property which should be solved when bitcoin becomes more stable in terms of price.

You have successfully subscribed to the newsletter

There was an error while trying to send your request. Please try again.

CryptoFish will use the information you provide on this form to be in touch with you and to provide updates and marketing.