A review of the features of this off-chain solution that speeds up transactions and enables the Bitcoin network to scale. Also, a review of the history of the method to get to know it thoroughly.
Index
What is Lightning Network?
Lightning Network is a network that operates on a blockchain to simplify and streamline peer-to-peer (P2P) transactions.
It is typically associated with Bitcoins, although other cryptocurrencies have integrated it, such as Litecoin.
Lightning Network is an off-chain or layer 2 solution. What is its practical use?
It is a second layer for making transactions without registering each one on the blockchain. We will explain in detail later what it is used for and how the Lightning Network works.
As explained in CoinTelegraph, this solution improves scalability by managing transactions outside the main blockchain network, which is the first layer. “At the same time, it deviates from the powerful decentralized security paradigm of the main network,” the source adds.
One detail before moving forward.
The English term “Lightning” means “lightning” or “flash”. That denotes the spirit of this technology, which aims to provide maximum speed to processes.
Lightning Network’s history
The history of the Lightning Network (also known as “LN”) dates back to 2015, when researchers Joseph Poon and Thaddeus Dryja published the paper The Bitcoin Lightning Network.
The text describes a secondary payment channel protocol, whose main advantage is relief of the main network, avoiding congestion.
Poon and Dryja used as a paradigm the transactions that the payment company Visa made during the 2013 holidays, aiming to make Bitcoin network reach those volumes.
The next chapter in this history takes us to 2016, when the aforementioned researchers founded the company Lightning Labs, which developed the protocol and sought its compatibility with Bitcoin’s main network.
A key step was Bitcoin’s SegWit fork in 2017, which served to make more transactions per block and also eliminated errors in previous operations.
After the tests, applications such as wallets and gaming platforms were created that took advantage of the advances of the Lightning Network. Towards 2018, Poon and Dryja’s company launched a beta version of their system.
The support of technological sector figures, including Jack Dorsey, the co-founder of Twitter and at the time CEO of that social network, was key.
In 2020, Lightning Network had over 12,000 nodes, over 30,000 active channels, and a capacity over 920 BTC.
Over the years, some companies have offered plug and play nodes which are ideal for users with no technical knowledge.
What is the Lightning Network used for?
The Lightning Network is basically a scalability solution. In other words, it increases the TPS (transactions per second) rate.
What other functions does this network operating above another main network have? Look.
- It allows transactions to be made without having to record each one in the blockchain.
- Payments do not need block confirmations and therefore the process is dynamic.
- Off-chain payment channels allow for multiple transactions without congesting the main network.
How does Lightning Network work?
The operation of the LN is independent of the main network, for example that of Bitcoin. It has its own software and nodes, communicating with the “mother” chain.
How is Lightning Network operated? To enter or leave this second layer, it is necessary to create special transactions in the blockchain.
Look.
What the user does in a transaction is to create a kind of smart contract, a protocol that executes, documents, and controls actions privately between the parties. That book or “ledger” is called a “channel”.
Let’s see how Lightning Network works with an example. Juan and Maria put 5 Bitcoins in the smart contract. In their channel, they will have the corresponding balance.
If Juan writes in the ledger “pay 1 BTC to Maria”, she will have 6 and he 4. Transactions can continue in the future and at any time the participants can publish the state of the channel on the blockchain.
Then, the balances are assigned to the parties on-chain, that is, within the chain.
Now let’s see some key concepts about the operation of Lightning Network:
Multisignature addresses: Multisig allows the use of different private keys. In the case of LN, users must leave funds blocked in a 2 of 2 scheme, in which there are two valid and required keys to move the cryptocurrencies.
Hash Timelock Contracts (HTLCs): It is a mechanism for the contract to be fulfilled by “secrets”. If one of the parties does not respect the rules, the other will continue to have access to withdraw their funds. It serves to solve uncooperative behaviors. It also establishes conditions, for example that the funds are not spent before a certain time.
Let’s return to Juan and Maria, and progress through points:
- When they deposit funds in the shared multisig address, the transactions are not yet published on the main blockchain.
- Both must sign a transaction and need each other’s approval to do so.
- The first step is to create a transaction and add the signature. When both do so, the operation is validated.
- To avoid funds being “trapped” if the other party does not comply with the rules, there is what is called a “secret”, which both Juan and Maria must reserve and generate in the form of a hash.
- Before the first transactions in the multisig address, the participants must create a set of consolidation transactions (commitment transactions), which serves as a resource in case the other party “kidnaps” the funds.
- Each transaction updates the ledger and adjusts the funds.
- A transaction made by Juan has two outputs: one for his own address and another for the new multisig. For it to be valid, Maria’s signature is required.
- As we noted, there are also time locks that establish that the parties can only use the funds after a certain established period.
- The payment channel becomes operational when the transactions are confirmed.
Keep in mind that the payment channel can remain open for hours, days, weeks, years, and even decades. When it closes, the final balance of the transactions made through the channel is recorded on the blockchain.
Advantages and disadvantages of Lightning Network
The LN has its pros and also some limitations. Let’s start with the first ones.
Scalability
As mentioned, the Lightning Network allows for more transactions per second, offering a notable advantage over the main blockchain.
Lower fees
In the Bitcoin blockchain, blocks are created every 10 minutes, approximately, and contain a limited number of transactions.
With the block space being scarce, participants have to bid. This means that miners initially include transactions with higher fees. Thus, the average significantly increases. Who wants to pay higher fees than the price of the product?
Lightning Network proposes a change here. Two fees are paid to open and close the channel, but the number of transactions is high and free of charge. Thus, costs are lower as the congestions of the main network are avoided.
More efficient
Off-chain solutions (one of which is LN) allow for more efficient use of each block space. They are perfect for low-value and high-frequency transactions.
Allows for minimum payments
In the Bitcoin network, there is a minimum amount per transaction, which is lower in the Lightning Network. This fosters micropayments with the possibility of performing operations that are fractions of fractions of the cryptocurrency.
Specifically, this network allows sending funds from 1 satoshi, which translates to 0.00000001 BTC.
Privacy in LN
This layer 2 offers a high degree of confidentiality to users, as it is not necessary to reveal the channels to the general network. Participants can decide to make the channel private.
Less risks
LN solves the problem of entrusting the custody of funds to trusted third parties.
Disadvantages of the Lightning Network:
- Limited capabilities: In LN, it is not possible to spend more than has been blocked in the channel.
- Usability barriers: While electronic wallets on the Bitcoin network (and other digital currencies) allow for intuitive use, in the Lightning Network this is not the case, at least in a generalized way. In this sense, use is somewhat more complex.
- Slow processes?: Although LN bets on dynamism, sometimes use becomes cumbersome as it is necessary to open channels before making payments, and for some users (especially for beginners) this can be difficult.
What wallet has the Lightning Network?
To operate on the Lightning Network, you must use a wallet that allows for smart contracts, with penalties for non-compliance and time details.
The Zap wallet allows for using the LN and also the Bitcoin main chain.
Another available wallet is Eclair, created by the developers of ACINQ.
Lightning Labs, the creators of this off-chain layer, offer the Lightning Desktop App tool, which is in a beta version.
A simpler option, although with fewer options, is HTLC.me.
Despite being in an experimental edition since 2018, the Lightning Network has had significant growth. Its advantages make it an interesting alternative for operating with cryptocurrencies, especially with Bitcoins.
What happens with its limitations? Although it is true that usability presents some obstacles, especially for those without knowledge in the area, developments are advancing to make this proposal even more accessible.