Lightning Network: what it is and how Bitcoin layer 2 works
Lightning Network is an excellent Layer 2 that solves the slow and wasteful problems of the bitcoin blockchain by expanding its use cases.
We all know bitcoin, the undisputed queen of the crypto universe. From an experiment and “toy” for geeks, this cryptocurrency has over time garnered more and more acceptance, becoming a steadily adopting store of value.
However, the Bitcoin blockchain has several limitations related mainly to the issue of scalability:
The creation of a block takes 10 minutes. It also contains a limited number of movements.
Related to the previous point, Bitcoin has a maximum threshold of 7 transactions per second. Therefore, queues are easily created.
As slowdowns form, a single transaction can take a very long time in times of high congestion.
Finally, given that “the more you pay in fees the better off you are,” the cost of a transaction can be significantly high. In addition, this mechanism contributes to even longer queues.
Summed up in a nutshell: for everyday payments, especially those involving small amounts, Bitcoin is not efficient.
As is well known, mass adoption of cryptocurrencies also comes through everyday use. Actions such as shopping for groceries, buying a book or selling one’s products should also be able to be accomplished by these means.
Given these assumptions, Bitcoin does not stand out as the best solution in this regard.
Blockchain technology lends itself to integrations, modifications and applications that enhance what already exists. Thus, here comes Lightning Network, the ingenious remedy to Bitcoin’s limitations.
What is the Lightning Network
Lightning is a decentralized, layer 2 network of Bitcoin. By using smart contract features in the blockchain, instant payments can be processed.
Let’s start with a fundamental concept: layer 2. Lightning is a network built on top of Bitcoin, its layer 1; it could not exist without the parent blockchain and would serve no purpose anyway.
Layer 2s are solutions designed to enhance the underlying network in some way. For example, Ethereum has several such networks (such as Arbitrum and Polygon) that overcome its limitations and expand the proposition. Lightning has precisely this role: to give something more to Bitcoin.
In the previous paragraph, we listed the limitations of Bitcoin, concluding that it is not exactly the best technology available for the world of micropayments.
Who would want to wait tens of minutes, if not hours, before being able to complete a payment?
What individual would be willing to spend high fees, perhaps higher than the good purchased?
In general, how can one expect the crypto revolution to come to every business if the underlying technology supports only 7 transactions per second? VISA, the famous electronic payment circuit, processes thousands.
Lightning Network is the technical solution that makes Bitcoin a blockchain absolutely capable of coping with high traffic loads, far exceeding that of the just-mentioned VISA.
This layer 2 has solid and important strengths:
Speed: it is a very fast network, capable of completing transactions instantly.
Cost-effectiveness: gas fees are negligible, almost zero.
Number of transactions: in addition to being fast, this Layer 2 could potentially support hundreds of thousands and even millions of movements per second.
Finally, let us add that it is constantly growing.
To understand how Lightning Network works, we need to resort to a few examples and introduce Payment Channels.
First, let’s imagine that we go to a coffee shop for coffee, deciding to pay for it in bitcoin.
Given the issues we have already discussed, we will spend significantly more than the amount of the drink in gas fees.
I mean, it’s not the best to drop almost €5 for a coffee, is it? At other times it could easily have cost as much as 20, 30 0 50: if there is a lot of demand, gas fees soar.
Let’s take it one step further: we have coffee at the café every day.
Here, here the problem would be further amplified: for once we could even spend 5€ but every day just no!
However, we find a solution by asking the barista to keep an account open. At the end of the month we will pay for all the coffees consumed, compressing them into a single transaction and dramatically lowering the cost of gas fees.
Of course, there are still limits: it is not possible to open an account at every business attended. Even if it were, at the end of the month we would have to travel halfway across town just to pay off our debts. Barriers would still remain: for example, how to make a single purchase?
So we need to find a method that really contains gas fees for each movement, usable anywhere and applicable to any type of buying and selling.
Payment Channels: the starting point to problem solving
Payment Channels partially meet this profile. These are precisely payment channels that trace the bar account model.
Two parties open a channel on the blockchain through a multisig transaction, paying a certain initial capital.
At this point, they can send as many transactions to each other as they want without paying any fees. Absurdly, they could spend the day bouncing each other an amount; there would be no problem. This is because the channel operates off-chain, not interacting in any way with the blockchain until it is closed.
When you get to the point where you want to end the transactions, the channel is terminated, the transaction sent to layer 1 and the sums updated.
By doing so, the number of transactions is lowered and, consequently, the associated costs. Not only that, the blockchain is not burdened as most of the work is done off-chain.
As we said, this system takes inspiration from the classic bar tab: it accomplishes transactions but does not record them until the channel is closed. Exactly what the bartender does: he marks the consumptions on a sheet of paper and periodically comes right to claim what is due.
Payment channels have limitations, however:
They support only two parties: me and the bartender, you and the mechanic, and Satoshi and his friend Vitalik. This is a huge stumbling block: how many channels would have to be opened if we wanted to pay for all our purchases with bitcoin?
Continuous opening and closing: payment channels have limited uptime and still require continuous opening and closing. Therefore, they are not practical as an extended form of payment: the goal is to reduce time and cost, and opening channels go-go would achieve neither.
So what is the remedy?
Lightning Network: instant bitcoin payments at negligible cost.
The Lightning network takes advantage of the payment channels mechanism but removes its limitations. The result is a reliable and sustainable system designed for bitcoin micropayments.
Lightning is a network of nodes that share liquidity and leverage smart contracts to work in synergy.
There is no longer a need to open a channel with each person; we will rely on others to get our BTC to its destination.
We will in fact be leveraging existing channels, the only key is that the recipient has at least one.
For example, if Alice were to send bitcoins to Dan, they could go through Bob’s node, bounce to Carol’s node, and finally reach their destination.
One does not have to open a channel with each counterparty. Doing so cuts down on time and costs: initiating a channel would in fact require a transaction on the blockchain. Same goes for its subsequent closure.
Movements are very fast, virtually instantaneous. This is critical for everyday payments.
Transactions are priced negligibly. My €1 coffee will come to cost a few thousandths more, not €5!
By operating off-chain, privacy is assured.
The blockchain provides security. If one party were to attempt to make tampering, Layer 1 would be able to detect the problem.
In these situations, the blockchain becomes a kind of “judge” and assigns punishment to the offender, i.e., the forced withdrawal of a share or even all of its funds, turned over to the offending party.
Obviously, the system needs two basic elements for proper functioning: paid-up capital and a large catchment area.
On capital, this is important because it is through it that transactions are reduced to the bone.
Going back to the example brought up just now, if Bob and Carol had not deposited bitcoins, sending funds from Alice to Dan would not be possible through this system. A dedicated channel would have to be set up, with all the costs and timing that entails.
The larger the network, the more widespread it would be. Also, related to the previous point, there is superior availability of funds.
Maintaining a channel on Lightning Network is incentivized by fees. In fact, the reduced gas fees end up with those who make stability and operation of the system possible. These are small amounts in recognition of the service provided.
Weaknesses of Lightning Network
As good a service as it is, Lightning is not without its weaknesses.
Specifically, the main ones are two:
Sender and receiver of a transaction must both be online. This is because a double check must be performed between the parties during the transaction so that security and fairness can be guaranteed.
Issues due to the centralization of capital. The network needs funds in order to function; therefore, large players with substantial resources could take over, increasing its centralization.
However, as far as we have seen so far, Lightning is an excellent remedy to Bitcoin’s known limitations. Through it, the famous cryptocurrency becomes truly expendable in everyday life. Thankfully, use cases and intrinsic value grow.
How to interact with the Lightning Network
Entering the world of Lightning Network is not complex: you just need to know and download the correct tools.
There are several options available, but here we will explore only the most popular and easy to configure ones.
As a first choice we can opt for Blue Wallet. This is a mobile wallet that offers several services; among them is, of course, full support for the Lightning network.
Simply go to bluewallet.io and click on the desired version button between Android and IOS.
Once downloaded it will require a quick setup but no fear: the procedure is simple and guided.
An alternative is Electrum, available in mobile and desktop formats.
The former is a version that is not without flaws.
In contrast, the desktop variant is well developed. However, Lightning was created specifically for everyday micropayments; therefore, it would be somewhat limited to exploit it only from a computer.
There are also mobile wallets native to the network such as Breez, Eclair, and Phoenix.
The former is still in the testing phase, so it is not suitable for ordinary users.
The other two, however, are downloadable and immediately available. Be careful, however: while Blue Wallet is widely used, these variants are far from famous and proven. Therefore, handle with care.
Tether(USDT) as stablecoin for micropayments on lightning network.
Synonym, a Bitcoin-based service provider, demonstrated the first Tether(USDT) transaction in a Lightning channel. This was the first time a stablecoin mainnet was connected to Lightning. The transaction was performed using Omni, a platform for creating customized digital assets on Bitcoin’s blockchain.
Typically, users transfer bitcoin to the Lightning network via a time-locked transaction on the Bitcoin mainnet. This initial transaction commits bitcoin over a Lightning channel between two nodes, and the channel is established only after the counterparty has confirmed the funding transaction. The timelock contract will eventually distribute the funds after the Lightning transactions are cleared and the channel is closed.
The Omni protocol incorporates custom assets such as USDT into Bitcoin’s blockchain through the use of the OP_RETURN operating code, which can be used to carry arbitrary data in a transaction. Omni operates off-chain and interprets this data on a separate platform.
When engaging USDTs on the Lightning network, participants must use Omnilayer addresses created by Omnicore software. Counterparties follow the usual sequence of creating a funding transaction to open a channel, but a second transaction is also required to commit USDT to the channel through a similar timelock mechanism. Payment routing and other activities then take place on the Lightning network between Omnilayer-enabled nodes.
Tether wants to launch this service, which will be called Holepunch, within its P2P platform for micropayments with its tokens using Bitcoin. So Holepunch will go alongside Keet, the first product to come out of the P2P project, for making video calls.
The advantages of using USDT on Lightning include lower transaction costs, greater privacy, and speed. Stablecoins on the Lightning network have the potential to enhance circular economies, where Lightning is the primary means of payment and alternatives are no longer needed.
Taproot is a technology that aims to improve Bitcoin’s privacy and ability to create complex smart contracts. This is in order to improve its performance and help the evolution of its growing ecosystem.
Taproot’s soft fork among other things has added Schnorr signatures, but more importantly it has changed the way Bitcoin scripts operate, with the goal of raising the level of on-chain privacy, improving its scalability and security, and most importantly allowing new scripts to be created that were previously too complex or expensive.
The first point on which Taproot could make a difference is privacy.
Indeed, to date the privacy level of Bitcoin’s blockchain is not particularly high, with all transactions public, and with all data in the clear.
Instead, using the new Schnorr signatures it is possible to use several private keys from different public addresses to generate several signatures that can be combined into a single signature within a single complex transaction. In this way, signatures created with the private keys of the wallets would no longer be stored on the blockchain, only the overall signature.
While not hiding the addresses of the senders and receivers, however, the transaction would be indistinguishable from a normal multi-address transaction, making it impossible to know whether it was a complex transaction generated by multiple users, or a normal multi-address transaction created by a single user.
This will be true for any on-chain transaction, because using Schnorr signatures it will be impossible to distinguish the various types of transactions, which will all look similar to each other.
The creation of complex smart contracts on Bitcoin thanks to Taproot
Probably the biggest advantage will be in being able to create complex scripts, for even very complex transactions or transaction packages that can be reduced to simple on-chain transactions with a single signature.
Without Taproot, in fact, any complex script on the Bitcoin blockchain, or complex transaction, has to be recorded as is, resulting in higher fees and loss of privacy. Instead, with Taproot it is possible to create single, seemingly simple, and therefore inexpensive, transactions that actually represent multiple scripts.
This increases the scalability of Bitcoin’s blockchain, improves the efficiency of the blockchain itself and the scripts, offers greater privacy, and significantly reduces the fees for these kinds of simplified complex transactions. In addition, by reducing the amount of data that must be written to the blockchain for complex transactions, it also effectively increases the number of transactions that can be recorded on it.
It is assumed that the update that introduced Taproot will also end up generating more interest in Lightning Network, and encourage multi-signature (multi-sig) solutions.
As is easy to guess, the mere introduction of these new features has not produced immediate and direct changes, as the real changes for users will only be seen when the new features are integrated into the various wallets, and then used.
It has still been too short a time since their final introduction for them to have already been taken full advantage of by those offering Bitcoin services to users and the market, and there is still much to develop before these changes can become apparent to all.
It cannot be ruled out that we will have to wait until the next halving, in early 2024, before we can see significant new initiatives that leverage Taproot to increase the possibilities of Bitcoin usage.
You might also be interested in:
Lightning Network: what it is and how Bitcoin layer 2 works Lightning Network is an excellent Layer 2 that solves the slow and wasteful problems of the bitcoin...
(BTC) is a digital currency, used and distributed in a totally electronic manner. It is a decentralized peer-to-peer network, free from the control of individuals or...
Imagine buying a digital artwork on the Internet for a reasonable price and getting a unique digital token that proves your authority over the artwork you purchased....
Metaverse is an esoteric term first used in 1992 in Neal Stephenson's novel Snow Crash, described by the author as a kind of virtual reality shared via...