Scalability is one of Bitcoin‘s most significant and longest-standing problems concerning its growth and adoption as a fully-fledged alternative to traditional payment protocols.
As it stands, the Bitcoin network can only process up to 7 transactions per second, which is way below the required throughput for a network aspiring to become a truly global, mainstream value transfer system. For reference, Visa and MasterCard have the capacity to settle more than 5000 transactions per second.
To solve this issue and increase Bitcoin’s throughput capacity, Bitcoin’s passionate development community has proposed several scaling solutions that mainly fall within two broad categories: first layer or protocol-layer solutions and second layer or off-chain solutions.
What is the distinction between a first layer and a second layer scaling solution?
A first layer (a.k.a. an on-chain) scaling solution is a method that involves a fundamental change to the codebase of the actual cryptocurrency protocol. First layer or protocol-layer scaling solutions usually entail an increase in the blocks’ size, as in the case of the Bitcoin Cash hard fork. Another alternative is reducing the block time or the average time it takes the entire network to find a new block and add it to the blockchain.
Second layer (or off-chain) solutions, on the other hand, are built on top of the main blockchain and interact with the blockchain without requiring changes to the actual codebase of the underlying protocol. These usually involve offloading certain transactions to secondary off-chain channels in order to reduce network congestion and speed up transaction processing times.
One of the most well known second layer scalability solutions for Bitcoin is the Lightning Network, first implemented on January 10th, 2018.
What is The Lightning Network?
The Lightning Network is a second layer off-chain payment protocol that operates on top of the BTC blockchain. It was developed by Joseph Poon and Thaddeus Dryja and published in the Lightning whitepaper back in 2015.
The idea behind the Lightning Network is to solve Bitcoin’s scalability issues by routing transactions away from the main chain. Instead, it uses user-generated bi-directional payment channels that allow the network participants to make almost instantaneous peer-to-peer cryptocurrency transactions.
The Lightning Network is separate from the Bitcoin network operating on top of it. By “on top of it,” we mean that users making payments using the Lightning Network can transact with other peers in the network without broadcasting or recording every single transaction on the main blockchain.
An important thing to remember here is that the Lightning Network does not have its own currency or its own blockchain. Instead, it’s merely a network for exchanging Bitcoin transactions cheaply, privately, and almost instantaneously. For reference, a typical transaction on the Bitcoin network takes at least 10 minutes to settle and can cost up to several dollars in transaction fees. In contrast, Bitcoin transactions routed through Lightning take milliseconds to settle and cost less than one satoshi or a fraction of a penny.
How Does The Lightning Network Work?
As we already mentioned, the Lightning Network enables Bitcoin users to create bidirectional, peer-to-peer, off-chain channels and conduct as many transactions as they’d like without broadcasting every one of those on the Bitcoin blockchain.
In order to set up a payment channel on the Lightning Network, two transacting parties need to create a joint multi-signature wallet, which is a special type of cryptocurrency wallet that requires more than one private key or signature to authorize a transaction. In certain respects, the multi-signature wallet is like a joint bank account where all signatories need to sign off on the transaction before it’s confirmed.
The payment channel or the multi-sig wallet is created with a so-called anchor or opening transaction. This is a regular on-chain transaction recorded on the Bitcoin blockchain. With the opening transaction, the parties deposit a certain amount of bitcoin in the multi-sig wallet. Later on, they can use these funds to make as many feeless and instantaneous transactions on the network.
The amounts deposited by both parties does not have to be equal. For example, if Alice and Bob want to open a Lightning payment channel, Alice could deposit one BTC to the multi-sig wallet, while Bob could deposit two. The Lightning Network then uses Bitcoin’s native smart contract protocol to keep track of what belongs to who, such that either party can only access up to as much as they deposited to the multi-sig wallet.
From this point forward, all transactions between the two parties within the payment channel are conducted off-chain. In fact, if we get down to it, the Lightning Network doesn’t actually send bitcoins back and forth between the parties but instead merely updates each party’s respective balances within the multi-sig wallet.
Since all transactions essentially occur off-chain or within the multi-sig wallet, there’s no need for mining to confirm the transactions, which saves significant time and costs.
When the parties decide they’re through transacting with each other, they, or either party individually, can close the Lightning payment channel by sending and signing a so-called closing transaction. Again, this is a regular on-chain transaction broadcasted on the main Bitcoin ledger. The closing transaction allows the parties to broadcast the final sums of their entire off-chain activity in a single Bitcoin transaction, effectively lowering the number of on-chain transactions enabling Bitcoin to scale.
Routing payments
The Lightning Network’s key feature is that it allows routing payments across connected peers within the network. This is actually what makes the Lightning Network a network. Otherwise, this entire off-chain infrastructure wouldn’t be nearly as useful.
What does this mean? It means that every peer in the Lightning Network can transact with every other peer in the network as long as they’re connected through some other peer(s) in the network. For example, if Alice wants to send Jane some bitcoin, she doesn’t have to open a direct Lightning payment channel with Jane; instead, she can route her transaction through the payment channel previously established between Bob and Jane. To do this, Bob will transfer the bitcoin to Jane, and, in turn, Alice will reimburse Bob the full amount through their own direct payment channel.
In this manner, peers within the Lightning Network can connect and transact at lightning speeds and pay nominal fees. When one peer sends some bitcoin to another peer in the network, the protocol automatically calculates and routes the transaction through the shortest possible path. If somewhere along the path the connection breaks, or some of the peers in the chain have insufficient funds to carry on the transaction, the transaction will simply get canceled without any recourse to either party.
This second layer network, made up of thousands of interconnected payment channels, allows for millions of instant transactions to take place without clogging or causing any trouble for the main Bitcoin network.
The Advantages and Limitations of The Lightning Network
Some of the Lightning Network’s advantages, like the super-fast transaction speeds, amazingly low transaction fees, and the enabling of sub-satoshi micropayments, should be somewhat obvious by now.
However, there are two significant advantages that we haven’t yet mentioned. One is privacy, and the other is cross-chain atomic swaps.
Privacy — The beautiful thing about off-chain payments is that they’re largely anonymous. For example, if Alice and Bob opened a Lightning payment channel, outsiders would only see the opening and the closing transactions broadcasted on the main chain — but nothing else. Essentially, other participants in the Bitcoin network can only know that Alice and Bob have opened a channel but can’t see any of the intra-channel transactions. Moreover, Alice could use Bob to route payments to Jane, and nobody can know where the money went once the Alice-Bob payment channel is closed.
Atomic or cross-chain swaps — An atomic swap is a technology that leverages smart contracts to facilitate the exchange between two different cryptocurrencies running on two distinct blockchains sharing the same hashing algorithm, without using a centralized intermediary such as an exchange. Atomic swaps can occur either directly between blockchains or through off-chain channels such as the Lightning Network. Essentially, once fully operational, the Lightning Network will allow for instant, inexpensive, and private peer-to-peer transactions across different blockchains.
That being said, the Lightning Network isn’t the one-stop solution to all of Bitcoin’s problems, and the protocol has its own issues and limitations.
Centralized hubs — One of the primary concerns regarding Lightning Network’s implementation is centralization. Namely, the way in which the network is formed and interconnected could lead to the rise of massive centralized “hubs” or large, heavily-connected nodes with a lot of liquidity. This would essentially lead to a situation where network participants wishing to transact with as many nodes in the network as possible would practically be forced to connect to these hubs, further worsening the situation. Aside from censorship concerns, if, hypothetically, one of these hubs were to go offline — they’d take a significant chunk of the network down with them.
Usability — The second big concern with the Lightning Network is the user experience. Cryptocurrency projects don’t come with the most user-friendly apps to begin with, and adding a second layer on top of them certainly doesn’t make things any better. As things currently stand, operating a Lightning Network node is slightly more time consuming and technically challenging than operating on the main blockchain.
Not suitable for big payments — The third significant problem with the Lightning Network is that the ability to transact and route payments through the protocol is heavily constrained by the liquidity locked into the pipelines. For example, if Alice and Bob have 5 BTC each in their channel, but Jane only has 1 BTC locked in her channel with Bob, then Alice could never send more than 1 BTC to Jane through Bob. This effectively limits the number of funds that can be routed through the network, which has a further knock-on effect on usability.
The Current State of The Lightning Network
The Lightning Network is growing slowly but steadily. As of January 2021, it boasts upwards of 16,000 online nodes, 37,000+ active channels, and just over 1000 BTC in capacity.
In terms of development, the network is still in the beta phase and a work in progress. Since 2015, several teams, including Blockstream, Lightning Labs, and ACINQ, have been working on their own implementations of the technology. However, all implementations are interoperable and compatible with the Basis of Lightning Technology (BOLT) specifications drafted in late 2016.
As time progresses, running a Lightning node is becoming ever more straightforward. For the less tech-savvy users, many companies such as Casa, Hodl One, Lightning in a Box, and Lux Node offer plug-and-go full node Lightning devices that anyone can set up and start running within minutes.