Solving the scalability problem of Bitcoin is not an easy task. It has taken a long time of research and development, although the solution could already be among us. Its name is the Lightning Network and it could take Bitcoin to a new level of scalability and face the massification of cryptocurrencies.
El protocol Lightning Network, is intended to improve the scalability of Bitcoin. This is possible thanks to the fact that it works as a second layer over Bitcoin, It allows you to do things you normally couldn't. 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, microstrategy, Block y AT FIVE who drive its development.
If you are interested in the more technical part of this project, your whitepaper can be found in this link.
To understand a bit the potential of this technology, we must keep two things in mind:
- Bitcoin was created as a digital money solution.
- That goal is impossible to achieve in the current state of the Bitcoin network and software, as it has scalability issues.
Today, Bitcoin can only process 7 to 8 transactions per second. With such little capacity, it 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 way to carry out transactions quickly was needed, which was easy to use and compatible with Bitcoin without major modifications. The answer to these needs and more is the Lightning Network, a protocol that you will learn a little more about below.
Why do you need to improve Bitcoin's scalability?
Surely you are asking yourself the same question and you are within your rights. You will think that if Bitcoin has such a powerful and extensive network why it needs to improve its scalability. The simple answer is: because by improving scalability, transactions are done faster and are less expensive.
To explain the long-form answer, let's do this little exercise: Imagine that you make a transaction in Bitcoin. At that time, the network has very little use and the commission cost of each transaction is very small.
However, the cost of commissions may increase as the use of the network also increases. This is because a queue, or excess of transactions, is generated in the mempool. It is there, where miners tend to prioritize transactions with higher commissions, since they offer them greater benefits. In this way, if you want a transaction to be processed quickly, you will have to pay more commissions.
However, this last case brings to the table another problem: the costs of the commissions can increase to the point of not allowing us to make micro payments. For example, the fees for sending $1 can be more than $1.
This is a pointless situation and that scalability improvement can solve, hence the need to improve this feature.
How the Lightning Network works
How the Lightning Network works depends on various technical factors and a process to make it secure. 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 fork, Bitcoin solved this problem and laid the first bricks for the construction of a new way of scaling.
This is how the development of the Lightning Network and its so-called paid channels began. These payment channels are the cornerstone of how the Lightning Network works and the key to offering unprecedented scalability in Bitcoin.
What are payment channels?
The payment channels or payment channels they are the foundation of the Lightning Network.
A payment channel is 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 be carried out only if the keys of the two parties sign. It is a means of consensus that demonstrates that the transaction has been approved by both parties to be able to execute.
In addition, payment channels can be open for a certain period of time. Normally, this is about 10 minutes or whatever it takes to mine the next block on the blockchain. But once the channel is open, its participants can instantly exchange assets with each other using the funds stored in it. This in a nutshell means that The parties that make up a Lightning Network payment channel can make payments to each other instantly.
Despite this behavior, the transactions carried out in said payment channel are completely valid in the blockchain. This is because once the channel is closed, the Transactions made are sent to the network, verified and included in a Bitcoin block.
Explaining step by step how the Lightning Network works
To understand how the Lightning Network works, it is best to break down its entire operation process step by step. For this reason, we will explain to you with a simple exercise how it is done, together with other points of interest to clear all your doubts.
First of all, within Lightning we will have two participants who will create an initial transaction on the $20 blockchain. Of those $20, $10 will go to Carmen and $10 to Aitor. This distribution could be different and may vary within the channel that 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 make sure that it can work in a decentralized way.
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 will be able to 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 will receive will be exactly the same as those sent by Carmen. 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 step 3? What happens with availability? And how do you combat deception?
We will answer these three questions below.
How is it possible to trust step 3?
Actually, Aitor and Laura act as nodes within the network, something similar to the miners of the Bitcoin network. They process all transactions in a decentralized way without having control of the funds that they help to move.
For this reason, at no time could Aitor and Laura steal the funds. de Carmen, since the funds to be sent will only be received if the output 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. If Aitor disappeared, Carmen could recover her money thanks to the added time attribute in the contract.
When a channel is closed at the same time, after having carried out an indefinite number of exchanges in it, the final funds of each part will appear in the blockchain in 10 minutes or whatever it takes for the next block to appear in the network.
How do you combat deception?
If Carmen sent funds from her multi-signature address to David in the Lightning Network, but it does not comply and what it does is issue an old transaction in 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 cause Carmen to lose all of her funds sent to David. This as a penalty for such an action, so Anyone attempting 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 to transmit transactions outside the chain of blocks without limits. All this without losing confidence that later and after the channel is closed it will be included in the Bitcoin blockchain.
Lightning Network Security
Regarding security, there is a paper published in 2019 that performs a rather technical analysis of 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.
- Offers high levels of security and anonymity, since transactions occur off-chain, so payments are practically 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, thereby improving the efficiency of the network.
- 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 using the same hash function to exchange tokens without the need for an intermediary such as an exchange.
Disadvantages
- One of the main disadvantages of Lightning is that payments can only be made to users who are connected to a payment channel. This means that the user must be active and connected to a channel. 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 high 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 threatens high-value operations, as it leads users to divide their funds to have liquidity on the normal blockchain and Lightning channels.
Although the Lightning Network is still in an early stage of its development, the Bitcoin scalability solutions it offers are a huge step forward for cryptocurrency adoption. By creating an instant and cost-free payment channel, Bitcoin has the potential to replace credit cards and even fiat money.
Bitcoin 101 Course
Medium levelIn Bit101Me Academy's Bitcoin 2 Course you can continue your crypto education and learn what Bitcoin is, where it comes from and how to obtain it.