Solving the Bitcoin scalability problem is no easy task. This problem has been studied for a long time and now The solution could be within us. Its name is Lightning Network and it could take Bitcoin to the pinnacle of scalability to cope with the massification of cryptocurrencies.
El protocol Lightning Network, is a protocol designed to improve the scalability of Bitcoin. This is possible because it works as a second layer on top of Bitcoin which allows you to do things you normally couldn't and more specifically; instant transactions with very low commissions.
The development of this protocol began with the work of Joseph Poon y Thaddeus Dryja. But today they are companies like Blockstream, Lightning Labs y AT FIVE those who promote its development. The whitepaper of this development can be found in that link from its main website.
To understand a little of the potential of this technology, we must keep in mind two things. The first is that Bitcoin was created as a digital money solution. The second is that That goal is impossible to achieve with the current state of the Bitcoin network and software.The reason for this is very simple: Bitcoin is having trouble scaling.
Today, Bitcoin can only process 7 to 8 transactions per second. This is a very small capacity and cannot cope with the massive use of cryptocurrency. As a result, The Bitcoin network is slow and very expensive when it comes to paying commissions.
For this reason, a new way of making transactions quickly was needed, one that was easy to use and compatible with Bitcoin without having to make major modifications. The answer to these needs is the Lightning Network.
Why do you need to improve Bitcoin's scalability?
If Bitcoin has such a powerful and extensive network then why should it improve its scalability? The short answer is; because by improving scalability, transactions are done faster and are less expensive.
To explain the answer in a long form, we will do a little exercise. Imagine that you make a transaction in Bitcoin. At that moment, the network has very little use and the cost in commissions of each transaction is very small.
However, Commission costs may increase as network usage increases. This is because a queue or excess of transactions is generated in the mempoolThis is when miners tend to prioritize transactions with higher fees in order to make more profit. So, if you want a transaction to be processed quickly, then you will have to pay more in fees.
But this last case also tells us that commission costs will increase to the point where we cannot make micropayments. For example, sending 1 dollar can cost you more than 1 dollar in commissions. This is a pointless situation and that scalability improvement can solve, hence the need to improve this feature.
How does Lightning Network work?
The functioning of the Lightning Network depends on several technical factors and a process to make it safe to use. First, Lightning Network depends on the non-malleability of the cryptocurrency being assured. In this way, it would be impossible for a third party to change the information about the transactions or cryptocurrencies during the verification or generation process.
In Bitcoin and Litecoin the property of no transaction malleability was introduced thanks to the arrival of SegWit (Segregated Witness). With this soft forkBitcoin solved this problem and laid the foundation for a new way to scale its capabilities.
This is how the development of the Lightning Network and its so-called payment channels began. These payment channels are the cornerstone of the network's operation and the key to enabling unprecedented scalability in Bitcoin.
What are payment channels?
The payment channels o payment channels they are the foundation of the Lightning Network. A payment channel is actually a multi-signature transaction on the blockchain with at least one of them sending funds. In such a channel, each person has a private key and each future transaction can only be carried out if the keys of both parties sign. This is a means of consensus that the transaction has been approved for execution by both parties.
Furthermore, Payment channels may be open for a certain period of time. Typically this is about 10 minutes or however long it takes to mine the next block in the chain. But once the channel is opened, participants in the channel can instantly exchange assets with each other using the funds stored in the channel. This in a nutshell means that Parties that are part of a Lightning Network payment channel can make payments to each other instantly.
Despite this behavior, the transactions made in this payment channel are completely valid in the blockchain, since once the channel is closed, the Transactions made are broadcast to the network, verified, and included in a Bitcoin block.
Advanced Bitcoin Course
Advanced levelAt Bit2Me Academy we bring you this advanced free Bitcoin course so that you become the next Satoshi Nakamoto.
Explaining step by step how the Lightning Network works
To understand how the Lightning Network works, it is best to break down the entire process step by step. For this reason, we will explain to you with a simple exercise how this process is carried out along with other points of interest to clear up any doubts you may have.
First, within Lightning we will have two participants who will create an initial transaction on the blockchain of $20. Of those $20, $10 will be Carmen's and $10 Aitor's. This distribution could be different and can vary within the channel we mentioned above, so Carmen could have $15 and Aitor $5 at the end of all the exchanges.
What Lightning does is take the technology behind the payment channels and create a network that shapes them using smart contracts to ensure that the network can operate in a decentralized manner.
In this sense, we would be left with the following breakdown of the process:
- Carmen opens a pay channel with Aitor who in turn has a channel with Laura, who in turn has an open channel with David.
- Right now we have 4 parties participating in different payment channels or payment channels.
- Carmen wants to exchange assets with David, so she can send funds through Aitor and Laura to ultimately reach David, the recipient.
- Due to the nature of the Lightning Network, Carmen would not have to trust Aitor and Laura in the process since cryptography is used to ensure that the funds David receives will be exactly the same as those Carmen sent. Otherwise, they will be automatically returned to Carmen.
Now we are left with a series of questions that are very important to answer: How is it possible to trust in step 3? What happens with availability? and How do you combat deception? These three questions will be answered below.
How is it possible to trust step 3?
Actually, Aitor and Laura act as nodes. Within the network we can equate them to the miners of the Bitcoin network.This is because they process all transactions in a decentralized manner without having control of the funds they help move.
For that reason, at no time could Aitor and Laura steal the funds. from Carmen since the funds to be sent will only be received if the outgoing transaction has already been made to the final recipient, which in this case is David.
What about availability?
If Aitor goes offline, the canal funds would not be trapped indefinitely in it, but within the Lightning Network smart contract mechanism, users can unilaterally close channels. This way, if Aitor were to disappear, Carmen could recover her money again thanks to the time attribute added to the contract.
When a channel is closed simultaneously after an indefinite number of trades have been made on it, the final funds of each party will be recorded on the blockchain for 10 minutes or as long as it takes for the next block to appear.
How do you combat deception?
If Carmen sent funds from her multi-signature address to David on the Lightning Network, but it does not comply and what it does is issue an old transaction on the blockchain to close the channel in the state it was in before sending the transaction to David, the software itself in search of this type of actions will make Carmen lose all her funds sent to David. This as a penalty for such an action, so anyone who tries to transmit an old and invalid transaction will be penalized.
Thanks to this network of person-to-person channels, it is possible to find a pattern within the network through which transactions can be transmitted outside the blockchain without limits. All this, without losing the confidence that later and after the channel is closed, it will be recorded within the Bitcoin blockchain.
Lightning Network Security
Regarding security, there is a paper published in 2019 that carries out a rather technical analysis on the robustness of this development.
The authors, Aggelos Kiayias (IOHK and University of Edinburgh) and Orfeas Stefanos Thyfronitis Litos (IOHK) performed a thorough review of Lightning network security and the result of it is a document of 84 pages that you can consult and download by clicking on the following image.
Advantages and disadvantages of the Lightning Network
Advantages
- First of all, Lightning offers one of the most powerful options to improve Bitcoin's scalability. Lightning can take Bitcoin up to levels close to 1 million transactions per second, much more than those managed by payment systems such as VISA o MasterCard.
- It offers high levels of security and anonymity. This is because transactions occur off-chain making payments virtually impossible to trace.
- lightning it is compatible with other cryptocurrency projects besides Bitcoin. For example, it is possible to use Lightning with Litecoin.
- It is capable of greatly reducing the level of transaction traffic within the Bitcoin network. This would make the network run much more efficiently.
- Transactions using the Lightning Network are done almost instantly.
- It allows the realization of micropayments and even allows their automation.
- Enables the ability to perform atomic swaps Cross-chain. This allows two blockchains that use the same hash function to exchange tokens without the need for an intermediary such as a exchange.
Disadvantages
- One of the main disadvantages of Lightning is that payments can only be made to users who are connected to a payment channelThis means that the user must be active and connected to the channel. Unlike this, traditional cryptocurrency transactions do not have this limitation.
- The Lightning Network is a protocol that is in constant development. Proof of this is that its creators still recommend not using Lightning for operations with large sums of money.
- The protocol limits the liquidity of the channel to the total of cryptocurrencies that all the parties hold.This is another situation that undermines high-value operations, as it leads users to divide their funds to have liquidity in the normal blockchain and in Lightning channels.