blog posts

Bitcoin

What is Lightening on Bitcoin?

There is a lot of debate these days about the monetary applications of Bitcoin and the development of the Lightning network. If you are also a network user of Bitcoin and use Bitcoin in your transactions and payments, or if you are a regular Bitcoin investor and you face problems in your transactions such as high fees and time delays, it is not bad in this article, with the network. Learn about Bitcoin Lightning and its capabilities.

You may think that using the Lightning network and paying with Lightning wallets is only for fanatical Bitcoin fans. Who this digital currency accepted as money and use in their daily payments. Not ordinary bitcoin investors! But if we take a look at some of the latest developments in the tech world, we can see that using bitcoin as money is not far off.

The government of El Salvador recognized bitcoin as its legal tender in June 2021, and similar whispers were heard from other Latin American countries; On September 24, Twitter added the ability to pay with Bitcoin to its platform as a way to reward users’ content and tweets. After all the controversial comments, Tesla CEO Ilan Musk has promised. That he will be able to buy Tesla with Bitcoin again if the problem of environmental pollution is solved.

Many reputable digital currency exchanges have also stated. That they are looking to implement Lightning services on their platforms to facilitate the deposit and withdrawal of bitcoins for their customers. Aside from all this, the Bitcoin network is now on the verge of a historic Taproot update. That will allow being created smart contracts financial on the network.

The problem of scalability is an obstacle in the way of the Bitcoin network

Many believe that bitcoin can change the future of the financial system in its favor; But for now, it has fallen into the trap of popularity. The fact is that to achieve this goal. There is a serious problem: design block China Bitcoin is such that scalability is devoted to security and decentralization.

Currently, the Visa Payment Network processes 4,000 transactions per second, which could potentially reach up to 65,000 transactions per second. But Bitcoin has only 7 transactions per second.

Problem 1: Low transaction speed

The blockchain consists of a set of blocks, each of which contains a group of transactions. The bitcoin blockchain is designed to accommodate a certain number of transactions in each block.

If the transaction that the user is doing is not in the current block (to be extracted ). It enters the queue of pending transactions, which we call the MemPool or pool of pending transactions. The processing speed of these transactions may take from a few minutes to even a few days, depending on the size of the container.

The second problem: the high cost of transactions

The Bitcoin network and other similar networks work with a consensus protocol called proof of work. Miners or miners in this consensus spend a lot of energy solving a difficult puzzle or riddle. To compensate for the cost of equipment and electricity consumed by miners in the computing process, they are charged a transaction fee.

As long as the system is small and the number of transactions requiring verification is low, the network works well and transaction costs are low. But as the network grows, so do transaction fees; Because there is limited space in each new block. So at the peak of network traffic, only transactions that pay a higher fee are processed.

At the end of 2017, when millions of people flocked to Bitcoin and the network was trying to cope with this high number of transactions, the problem of scalability became apparent. In December 2017, the average processing cost of a transaction in the Bitcoin blockchain (whether $ 1 or $ 1,000) was $ 37. This problem made bitcoin less economical as a currency; Because in many cases, the transaction fee was higher than the transaction amount itself.

For example, suppose you have a habit of buying a cup of coffee at a coffee shop every day before going to work. Using a credit card, you buy your coffee in a fraction of a second and with the lowest possible commission, and you leave the coffee shop. However, if you are going to pay for the same cup of coffee with Bitcoin, you will probably have to wait between 10 minutes and a few hours (!) For your transaction to take place. In addition, you will probably have to pay a transaction fee many times the price of coffee. The truth is that no vendor is waiting for the Chinese blockchain network to delay paying for a cup of coffee.

One of the solutions offered to solve the problem of scalability of Bitcoin is the Lightning Network. Lightning in English means lightning. Which is used as a metaphor for speed. But is this solution enough to solve the problems of the Bitcoin network? In the continuation of this article, we are looking for the answer to this question.

What is Lightning Network?

Lightning Network is a Second Layer or Off-Chain solution on the main bitcoin blockchain that allows users to send bitcoins to each other without commission or delay.

The Lightning Network creates payment channels on the main network that can accept part of the main network traffic like a two-story bridge. By doing so, the Bitcoin blockchain will have a greater ability to process transactions and a greater chance of being accepted by business owners as a payment system.

By creating a “payment channel” between each other and entering a certain amount of bitcoin into the channels. Lightning users can do as many transactions as they want in two-person (P2P), fast and very cheap. And for everyday payments such as buying coffee with bitcoin, Do not have to wait long to confirm the transaction.

This network has similarities to the current settlement system used in traditional payment networks such as Visa and MasterCard. When you make a payment through Lightning, it will not be settled immediately. Instead, the buyer (sender) funds and the seller (receiver) request will be approved quickly and the transaction light will turn green.

Lightning transactions may be settled in a few days or weeks, depending on how the parties agree. A network of nodes (nodes) is responsible for managing the Lightning network, which validates the payment.

Bitcoin Lightning Network History

The Lightning Network is rooted in the thinking of Satoshi Nakamoto, the creator of Bitcoin; The idea goes back to a time when there was talk of “payment channels” for exchanging bitcoins between two people. So that no one needed to know about the exchange or have the transaction approved by others. But Joseph Poon and Thaddeus Dryja endorsed the idea of ​​lightning with the release of a white paper on January 14, 2016.

The authors of this white paper claimed that instead of changing the bitcoin network itself for more transactions. A network of micropayment channels could solve the problem of bitcoin blockchain scalability. This idea was exactly the opposite of the idea of ​​increasing the block size that led to fork the bitcoin cache hard.

Lightning Labs is a blockchain engineering lab that, along with other individuals and companies including ACINQ and Blockstream, helped launch the beta version of Lightning Network in March 2018. The Lightning project was funded by a $ 2.5 million Seed Funding project, which also involved Twitter CEO, Jack Dorsey.

Advantages and limitations of Lightning

Benefits of Lightning

  • Lightning uses an out-of-chain solution to solve the scalability problem. If this network is successful, it will probably reduce the bitcoin network transaction traffic.
  • enables (almost) instant sending and receiving through two-way payment channels.
  • the network is suitable for micropayments due to reduced transaction costs.

Lightning restrictions

  • Unlike intra-chain transactions, it cannot receive money if the recipient is offline.
  • Network members must constantly monitor the bitcoin blockchain to avoid the risk of bitcoins being stolen from payment channels. Of course, some servers can also do this.
  • Lightning network is not yet suitable for high amounts. Because this network is made up of payment channels between individuals. It is not possible to transfer through intermediaries. If they do not have enough money in their channel.
  • Opening and closing payment channels requires in-chain transactions that require more fees and time to verify online.
  • Lightning and how to use it is still confusing for some new bitcoin users.

How does the Bitcoin Lightning network work?

The Lightning network speeds up transactions and reduces their costs by bypassing the main blockchain of Bitcoin. Lightning is an unstructured network built around the main bitcoin network.

The basis of the Lightning Network is the use of “two-way payment channels – “. Payment channels are the same as ” multi-signature wallets – ” with improved capabilities. That’s why the time it takes to make an exchange on the Lightning network takes as long as the connection of two wallets to each other, no more!

To start using Lightning Network, some bitcoins must be deposited and locked in a payment channel. Then, until the channel closes, bitcoins can be spent out-of-chain on the Lightning network.

The phrase “extra-chain” may seem confusing at first. And you might think that your bitcoins are taken out of the Chinese blockchain network and transferred to another space, But this is not the case, and your bitcoins will be in a multi-signature address registered in the blockchain as long as the channel remains open.

When two users want to end their exchanges, they close the channel and send a transaction to the blockchain, and the last balance of each is recorded in the blockchain. Of course, another transaction is recorded on the Chinese block when creating a channel between two users, in which the amount deposited by each person in the channel is specified.

But these exchanges are not always between you and your friend (whom you trust). In many cases, you probably want to trade with a stranger; How can he be trusted in this case?

The answer is that when creating a channel, each of you places a specific deposit in the channel that acts almost like collateral. This deposit must be equal to or greater than the amount transferred.

On the other hand, the nodes or nodes that direct payments are responsible for managing the network. Nodes are also managed by individuals or companies. This ensures that the Lightning network is decentralized.

How are Lightning transactions done? Explanation in simple language

To better understand how to conduct transactions in the Lightning Network. We can continue with the example of a coffee shop. In this example, you can create a Lightning payment channel between your and paying wallet, the coffee shop owner’s make small every day without even a Satoshi payments fee.

In this case, you and the seller decide to create a Lightning payment channel. A prerequisite for this is that both parties have access to a wallet that supports the Lightning network.