If you’ve followed the biggest news stories of recent months in the cryptocurrency space, then you’ve likely heard about Bitcoin’s scalability problems.
The Bitcoin Cash hard fork and the canceled SegWit2x hard fork were both conceived as solutions to this issue of scaling the Bitcoin network. This article will be discussing one of the most promising solutions that may eventually be implemented on the Bitcoin blockchain — the Lightning Network.
For anybody who is invested in Bitcoin, the Lightning Network is one of the most important topics that you should know about. After all, it is the future of Bitcoin. If Bitcoin is to reach mass adoption and go to the moon as many of us hope, it will be in no small part because of the success of the Lightning Network.
To understand why this is so important, let’s start with the problem that Lightning Network addresses.
Understanding the Scalability Problem
Blockchains are slow. In its current state, Bitcoin’s transaction processing speed maxes out at just over 10 transactions per second. However, the historical average is even lower, at about 3 transactions per second.
Meanwhile, transaction fees have increased by over 1000% since 2015. With fees at their current levels, small transactions can often cost more than the actual value being sent, making them infeasible.
If Bitcoin is going to be useful in the future as an actual currency and not just a store of value, something has to change.
Bitcoin Cash addressed the problem by increasing the blockchain’s block size from 1 MB to 8 MB. This increased transaction throughput from 3 per second to about 24 per second. As a result, Bitcoin Cash has the same low fees that Bitcoin had from 2009 until 2016, making it more useful for small transactions. So why was Bitcoin Cash created rather than just increasing the block size on the Bitcoin blockchain?
Well, bigger blocks come with a potential drawback. In theory, having bigger blocks makes it more expensive to run a full node on the network. Increasing cost leads to decreasing participation, meaning that there are fewer full nodes. And fewer full nodes makes the network more centralized.
There’s another way to scale Bitcoin though. It’s a way to bring the fees back down and increase transaction throughput by several orders of magnitude. And that scalability solution is…
The Lightning Network
Imagine if, instead of 3 transactions per second, Bitcoin could process tens of thousands per second while maintaining the same trustless appeal. If such a thing were possible, it would allow Bitcoin to become both a long-term store of value and an efficient medium of exchange.
That is what the Lightning Network offers as a solution to the scalability problem. How? Lightning uses built-in smart contract functionality of the blockchain to enable off-chain transactions across a secure network of participants.
Let’s break that down further.
Bi-Directional Payment Channels
Say that we have two Bitcoin users, Alice and Bob, who transact with each other regularly. The idea behind Lightning Network is to record their transactions off the chain in something called a payment channel.
Here’s how it would work: Alice and Bob open a payment channel between them with a transaction that’s recorded on the blockchain. Each deposits, for example, 1 BTC into the channel. They carry out several transactions, after which Alice has 1.2 BTC and Bob has 0.8 BTC.
Alice is ready to close the channel, so she posts the most recent balance record to the blockchain. The funds from the channel are held for an additional time period – perhaps 24 hours – in which Bob can check that Alice has posted the most recent balance record. After the waiting period, the transaction is processed on the blockchain and the funds from the channel are distributed.
This process is represented in the graphic below:
There’s a problem with taking transactions off the blockchain, right? That is, how can Lightning Network be as secure and trustless as the blockchain?
The answer comes down to cryptography and simple game theory.
The waiting period mentioned in the above section is critical. You see, Bob or Alice might be tempted to post one of the earlier balance records to the blockchain so that they get a larger share of the balance. But doing so would incur massive risk.
Note that the chronological order of the balance records can be proven with cryptography, just like on the actual blockchain. In the event that a void balance record is posted to the blockchain, the other party has that waiting period to post a more recent balance record.
Upon doing so, they would receive ALL of the balance. The other party loses everything as a result of posting an expired balance record. In this way, both parties are incentivized to be honest.
On their own, these bi-directional payment channels aren’t a robust solution to the overall scalability problem. However, this is where the ‘network’ in Lightning Network comes into play.
The goal is to reduce the amount of transactions that need to be posted on the blockchain in a significant way. So to accomplish that, there must be a way to transact with people on the network without opening a new payment channel each time. Otherwise, Lightning serves no purpose for people who aren’t transacting with each other frequently.
The solution is rather simple.
Say that you have the same payment channel as before between Alice and Bob. But now let’s say that Alice wants to have a transaction with somebody else, Carol. This will just be a one-time transaction, so there’s no point in opening a new payment channel.
But there is another way.
Imagine that Bob already has a payment channel open between himself and Carol. Now, the transaction between Alice and Carol can occur through Bob, all while still being trustless and secure.
If Alice wants to send 0.1 BTC to Carol, she simply sends that amount to Bob who simultaneously sends the same amount to Carol. Bob’s overall balance remains unchanged while Alice and Carol’s transaction can be recorded off-chain.
This same process can be carried out with any number of middlemen. The more robust the Lightning Network becomes, the easier it is to find channels to connect two individuals.
As ingenious as the Lightning Network is, it still has a drawback of its own. That is that its logical evolution is something that’s not a fully decentralized, peer-to-peer network. Instead, there will likely be large hubs in the network.
The biggest reason for this is that each time transactions occur across multiple channels, the ‘middleman’ channels need to have large enough funds to cover the transactions. For example, a transaction of 5 BTC could not go through any payment channels that don’t have at least 5 BTC in them.
What you can expect to have are large hubs that all have payment channels with one another. Then, as long as the two parties in a transaction are both connected to one of those hubs, the transaction will be possible without posting to the blockchain.
For some cryptocurrency purists, this increased centralization is reason enough to be against the implementation of the Lightning Network. Most people who feel this way are in favor of larger blocks to scale the network, which has its own drawbacks as mentioned earlier.
Ultimately, these large payment hubs are not at all like central banks. They never actually possess or store your money in any way – that is still done by trustless smart contracts. Instead, they are simply a trustless medium for quick and cheap transactions.
Money is really simple. The big key is how you make it secure.
Bitcoin’s 10 transactions per second is highly inefficient. But Bitcoin remains relevant because it’s trustless. Likewise, it’s not a big deal that Alice can send money to Carol through Bob using an off-chain transaction medium. The big deal is that carrying out that transaction is trustless.
Lightning Network enables lower fees, faster transactions, as well as micro and even nano payments. This is the future of Bitcoin as a medium of exchange. And that future certainly appears very bright.
You can learn more about the cryptography behind Lightning Network and its possible applications here.