The Lightning Network is a second layer payment protocol built on the bitcoin network. In other words, lightning network operates on its own but interacts with the bitcoin network to enable the transfer of bitcoins from one person to another.
It is a system of channels that allows people to transfer bitcoins to one another off-chain. During such payments, the bitcoin blockchain does not verify the transactions. The bitcoin network only confirms the transactions after the involved parties consent to the closure of the channel.
In simple terms, the lightning network is a system that allows parties to transfer bitcoins outside the bitcoin network.
Benefits of using the Lightning Network
Making transactions on the lightning network has several advantages such as quick transactions, low fees, and the ability to make micropayments.
- Quick transactions: Since transactions take place outside the bitcoin network, there is no congestion. Transactions are instant. The lightning network enables many more transactions per second compared to on-chain transactions.
- Low transaction fees: When carrying out transactions on the bitcoin network, there are fees payable to miners. However, since there are no miners on the Lightning Network, it means the fees are very low.
- Micropayments: Using the lightning network people can send very small fractions of the bitcoin, for minor purchases. For example, someone would be able to use bitcoins to pay for coffee at a restaurant.
- Privacy: Other people cannot access data on transactions between two or more people within a channel. Only members of a channel know the payment or transfer information.
- Getting a full node to run properly, getting in & outbound channels set up can be cumbersome for people who don’t have adequate know-how.
- Aside from the transaction fees to open and close channels, there are also separate routing fees to transfer payments between channels.
- Lightning Network does not support offline payments and since nodes on lightning network are required to be online in order for users to be able to send and receive payments, there’s always a possibility that coins can be stolen if the computers that store the private keys of the parties involved in a transaction are compromised.
- Payment channels can become congested.
- Vulnerability to flood-and-loot attacks.
Possible transaction censoring.
How to use Lightning Network
To participate in the channels individuals should have wallets supported by the lightning network. For example, you can use a web wallet such as HTLC.me. However, the parties should have wallets of the same nature. For instance, they can all use the HTLC.me wallet.
An individual can also use Desktop wallets, like Lightning-ape wallet and Zap. If you choose the lightning app you have to install it on your computer. In order to use the Zap you need to install the wallet as well. To do so, simply visit Zap.jackmallers.com, then download and install the wallet.
Alternatively, you can also use phone wallets such as LND, Éclair and C-Lightning which are available at Google Play Store.
In order to transfer bitcoins, the individuals create a lightning network channel, thereby having a multi-signature address. This means that two or more people with their private keys can spend the bitcoins “locked” in the channel.
Therefore, when you create the channel, you specify the number of private keys or individuals who can participate in it. By participating, we mean transferring and receiving the bitcoins. For example you can have 2 or 3 or 4 private keys that can sign a transaction.
If only two people participate in the channel, each should deposit an equal amount of bitcoin, say 5 BTC. After that, the two people will carry out transactions between them. The bitcoins will move between their wallets. If five people form a channel, it means that they can transfer bitcoins among themselves.
In order for the concerned people to move the funds out of the address (channel) they should agree and authorize that. Also, all transactions carried out off-chain remain private as they are not recorded on the blockchain.
When the participants complete their transactions, they can publish them on the bitcoin blockchain, resulting in finality of the payments.
Let’s conclude this discussion with an example. If Grace and Mariana intend to carry multiple transactions between them, they create a lightning network channel. Each of them makes a deposit, say 4 BTC. The bitcoins are locked in their channel.
Transaction 1: Grace transfers to Mariana 0.5 BTC as payment of a laptop.
Transaction 2: Grace pays 2 BTC for hiring a truck.
Third Transaction: Mariana pays Grace 1 BTC for renting an office.
At the end of the month, the two close the channel, thus finalizing their payments.
When they close the channel, Grace will have 2.5 BTC while Mariana has 5.5 BTC. During these internal channel transactions they pay very little fees.
Lightning is a timely invention that aims to solve the problems the bitcoin blockchain faces including scalability issues, traffic congestion and high transaction fees.