How Lightning Network Works

How Lightning Network Works

To speed up transactions and reduce fees, the Lightning Network was created

Bitcoin is not the most convenient tool for payments. Nevertheless, in some places it is recognized as a full-fledged currency, for example, in El Salvador. In everyday calculations, people tend to use hundredths or even thousandths of a bitcoin.

What is the Lightning Network?

It is a superstructure on top of the blockchain that helps make small transactions instantly with low fees. The fact is that the bitcoin network processes only about 5-7 transactions per second. By comparison, Visa has about 65,000. Bitcoin’s blockchain is designed in such a way that one block is formed in 10 minutes on average, and this cannot be changed. The Lightning Network writes only a portion of transactions into blocks, so the processing speed of each transaction increases by orders of magnitude.

How is it set up?

The Lightning Network is a peer-to-peer network where each node is a computer with a wallet. Coins are transferred through channels between nodes – there can be two or more. The blockchain records only the opening of the channel and the last transaction before closing, the intermediate operations are regulated by a smart contract.

When you open a channel, a smart contract creates a joint account in which the funds of both participants reside. They have two private keys to manage the account.

For example, Olga had 0.06 btc and Andrei had 0.08 btc. So, the total account will have a balance of 0.14 btc: 0.06 btc for Olga; 0.08 btc for Andrew.

If Andrew and Olga periodically transfer coins to each other, the total balance will not change, but the smart contract will mark how much of the deposit belongs to each of them.

Olga transferred 0.02 btc to Andrei. Total balance will remain unchanged, but 0.1 btc of this amount now belongs to Andrei. If he transfers Olga 0.03 btc later and closes the channel, he will get back the recalculated sum in his wallet: 0.08 + 0.02 – 0.03 = 0.07 btc, Olga will get 0.06 – 0.02 + 0.03 = 0.07 btc.

Two transactions are written to the blockchain:

  1. Channel opening;
  2. Transferring 0.03 btc to Olga and closing the channel.

Channel depletion

If all of the cryptocurrency in an account belongs to a single transaction participant, the channel is considered depleted because coins can only move in one direction.

If Olga transfers all of her funds to Andrei – that is, all 0.07 btc, then the channel will be considered depleted, because now the coins from Olga to Andrei can no longer move.

It is not necessary to open a direct channel between two nodes, you can use those already open between other participants in the network. In this case, the commissions in the “lightning” network are much lower than in blockchain.

What’s the benefit?

Bitcoin has little use for small day-to-day transactions, be they transfers, buying, selling, or swapping coins. The Lightning Network solves this problem: it speeds up small transactions, reduces fees, and simplifies atomic swaps. Here’s how it works.

  • Reduces the load on the main bitcoin network. Because only the initial and final transactions are written to blocks, intermediate transactions take place with no load on the main blockchain. Coin exchanges are almost instantaneous, as participants do not have to wait for each transfer to be verified. At the same time, the blockchain’s blockchain generation speed remains the same.
  • Reduces commissions. Since Lightning Network is designed for operations with hundredths and thousandths of bitcoin, commissions in the network are proportionally lower than in blockchain. To do this, bitcoin is converted into an LN token – satoshi, which is equal to 0.00000001 btc.
  • Simplifies frequent small transactions. Fast transfers with paltry commissions make small bitcoin transactions much more convenient than confirmed blockchain transactions.
  • It helps to exchange cryptocurrency without exchanges. Lightning Network supports atomic swap, so you don’t have to sell coins on exchanges to exchange them. Conversion will take place in the payment channel, just like any other transfer.

Disadvantages of the network

  • You can’t send a transfer on demand. The recipient must be online, otherwise the transaction will stall or be cancelled altogether. This is because the transaction is confirmed by both the sender and the recipient.
  • Not suitable for large transfers. The network is designed for transactions with small amounts: the average channel capacity at the beginning of 2022 is about $1500 (0.038 BTC).
  • It can become centralized. The danger is that one player could concentrate most of the network’s resources. In mid-January 2019, LNBIG.com was such a player. It owned almost 64% of the network’s capacity, while LNBIG.com’s share of nodes was only 0.7%.
https://bitcoinvisuals.com/

My opinion

Despite a number of drawbacks, the Lightning Network is gaining popularity for bitcoin micropayments. Channel capacity is growing, as is the number of nodes. Over time, Lightning Network could become a cryptocurrency alternative to Visa and Mastercard.

0 0 votes
Article Rating
Written by Kannnaf Mysterious
I am a very innovation-dependent form of life. I'm smart, but I don't wear glasses. I solve the Rubik's Cube in less than a minute. Probably the best beggy cryptomaniac in the world and my hobby is to start the day thinking that bitcoin will rise to $100k. To The Moon!
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments