Skip to main content

Cryptocurrencies operate in a very unique way. They are digital currencies that can’t be easily manipulated or shut down. Anybody can use them to purchase items or services online without the involvement of a third party. Substantial trade-offs must be made to ensure that features remain functional. Considering the fact that nodes are the ones used to run the cryptocurrency network, there’s a need to keep advancing the technology. That’s why the number of transactions per second (TSP) that a blockchain network can process is lower for a digital currency that aims to be used globally.

To be able to address the limitations posed by blockchain technology, a number of proposals have been made. The proposals are aimed at increasing the number of transactions the technology can process.

What is the Lightning Network?

The lightning network can be described as a second layer network for Bitcoin that makes use of micropayment channels to improve the ability of the blockchain to perform more transactions. It’s important to note that the technology is not exclusive to Bitcoin – other cryptocurrencies such as Litecoin are using it as well.

The process of temporarily outside of the primary blockchain is designed to allow the lightning process to reduce pressure from Bitcoin’s blockchain and lower related transaction fees. All transactions processed from the network are immediate and meant to make Bitcoin an ideal digital currency for everyday use.

The Lightning Network explained

The idea of the lightning network was first introduced by Thaddeus Dryja and Joseph Poon in 2016.

If Bitcoin is to attain its objective of becoming a leading global digital payment service, then it has to be able to handle millions of transactions every day. Apparently, its decentralized technology (that needs consensus from every node on the network) poses a big challenge.

Payment Channels

For instance, restoring and approving transactions is time-consuming, and costly if the amount of Bitcoin used to transact increase over time. A rise in the number of transactions needs significant improvement in terms of computer processing power – whether they are located at work or at home to be able to execute Bitcoin transactions.

The Bitcoin lightning network offers a solution to the problem of scaling by creating another layer on top of the main Bitcoin blockchain. The layer created consists of several payment channels between Bitcoin users or parties. In other words, the Bitcoin lightning network channel is a mechanism to facilitate transactions between Bitcoin users. Parties or users can use the channels to receive or send payments between each other.

Off-chain Transactions

However, the transactions are processed differently compared to the way they are done in the Bitcoin’s main blockchain. The transaction can only be updated from the main blockchain after two parties or users have closed a channel. In this process, the two parties are able to move funds between each other as many times as possible without necessarily updating the blockchain about their transaction.

The end effect of this approach is that it quickens the speed of transactions – since not all transactions need approval from all the nodes in the BTC network. Payment channels between different parties or users are combined to create a network of lightning nodes that are able to direct transactions among themselves. The eventual interconnection between different payment channels in what is referred to as the lightning network.

How does the Lightning Network work?

The network operates almost like blockchain. It dis-intermediates all transactions that are responsible for routing transactions.

Multi-signanature addresses

Multi-signature address is the place where several private keys can be spent. When generating one, a user specifies how many private keys are able to spend the money and how many of the generated keys are needed to sign off a transaction.

For example, a 1-of-5 scheme implies that 5 keys have the ability to generate a valid signature and that just one is required. A 3-of-5 scheme shows that from the available 5 keys – any three are needed to spend the funds.

In order to start a Lightning channel, users lock funds in a 2-of-2 scheme. Note that there are only two available private keys able with the ability of signing and all of them are required to move the coins.

Example of a Lightning Network transaction

Let’s see a classical example of how the Bitcoin lightning network works.

Jane creates a channel with her favorite restaurant and puts $100 worth of Bitcoin. The transactions she makes with the restaurant are immediate since she has a direct channel with them.

On the other hand, John has also opened a channel with a boutique he frequents to but also happens to purchase food at a restaurant where Alice opened her channel.

The connection that exists between Jane, the restaurant, and John makes it possible for Jane to use the balance from the restaurant to purchase clothing from John’s Boutique. Similarly, John can use the balance from his favorite boutique to purchase foot at Jane’s restaurant.

Technically speaking, a lighting network uses multi-signature scripts and smart contracts to accomplish its purpose. When one or to users open a channel, an initial transaction known as the Funding Transaction is formed. In a normal multi-signature situation, two master – private and public are exchanged. It is this exchange that gives a user or users the ability to access the funds and spend if they want.

Facilitating P2P (Peer-to-Peer) transactions

However, in a situation where a lightning node is used, then there is no exchange of signatures. This is to avoid notifying the main blockchain of the funds accessed or spent. What happens is that the two users exchange a single key that is used to validate transactions. This also depends on the Bitcoin lightning network stats at that particular time.

The two users can, therefore, carry out numerous transactions between them as well as nodes from other lightning networks. As the Bitcoin lightning network progress continues, there is a possibility that more users will join and facilitate more transactions per second.