If you’ve tried to send a Bitcoin transaction at any time in the past few years, you’ve probably noticed that you have to wait quite a while for it to be confirmed, and you might even have gotten hit with an unpleasantly-high fee. That’s because the original Bitcoin network simply doesn’t have the capacity to process all the transactions people are making at once, which means everyone has to wait before theirs goes through.
The Lightning Network, though, could potentially change all that, enabling instant, almost-free Bitcoin transactions. If it takes off, Bitcoin’s scaling issues won’t be a problem anymore, and you’ll actually be able to use it to pay for your morning shot of caffeine.
What’s wrong with the original Bitcoin?
Imagine there’s a city where everyone’s money is stored as a balance number engraved on a cube that’s stored in a magically unchangeable tower built of cubes. Every time a balance changes because you sent or received money, the new number is verified, engraved onto a cube, and stored at the top of the tower.
The problem, though, is that on a busy day lots of people want to fit their transactions onto the limited surface area of the cube, and new cubes only appear roughly every ten minutes. All the transactions will eventually be stored in the magical tower, but depending on how busy that day is, it might take quite a while.
This scaling problem is what the Lightning Network is trying to fix. Visa claims it can process 65,000 transactions per second (though on average it’s around 1,700). Bitcoin, on the other hand, can handle a maximum of about seven per second.
That’s because every Bitcoin exchange from one address to another is put into a block full of transaction records, with a maximum size of 1 megabyte and an average of 10 minutes between every block. When there are too many transactions, not all of them can make it into the next block, so they all have to wait their turn.
Bitcoin Cash tried to solve this problem by creating a new version of Bitcoin with the block size increased to 8 megabytes. Its transactions-per-second still don’t rival processors like Visa or MasterCard yet, though.
An upgrade to the main Bitcoin blockchain called SegWit (Segregated Witness) originally intended to fix a transaction vulnerability but ended up actually decreasing the size of each transaction and enabling more of them to fit in each block.
The Lightning Network
The changes introduced by SegWit paved the way for the Lightning Network: a layer on top of Bitcoin that allows people to send money to each other many times without multiple Bitcoin transactions. Here’s how it works:
- Alex and Roberta set up a Lightning channel and put some Bitcoin in it as a security deposit. (It can be lost if one of them tries to cheat!) This creates a transaction on the main Bitcoin chain.
- Alex and Roberta can send Bitcoin back and forth in the channel as often as they want.
- When they’re done, they close the channel, which then alerts the main blockchain to what has changed and creates a second and final transaction to settle the differences.
- Lightning channels can link together to form a big network. If Alex’s friend, Cleopatra, wants to send money to Roberta, it can go from the Cleopatra-Alex channel to the Alex-Roberta channel.
If the city with a magical tower of blocks was working for you, here it is in those terms:
- The citizens, recognizing the issue with their current system, tap into the tower’s magic to create links (pulsing with a strange, lightning-like energy) between themselves and people they need to pay.
- At each end of the link is a portion of their balance from the tower. They can instantly send money back and forth along this link as many times as they like.
- When they’re done, the link is absorbed into a block as a single transaction that adds to one citizen’s total account balance and subtracts from the other.
- The links can only go between two citizens at a time, but these links can connect to each other and form networks, allowing transactions to travel from Citizen A to Citizen Z without opening a direct link.
Okay, that’s not exactly what happens, but you get the idea: Lightning lets lots of small transactions happen off the main chain, then lets the chain know the end results. Ultimately, there will be enough open channels that it will form a network that allows transactions to bounce through multiple nodes and still arrive at the destination. It’s not the simplest thing ever, but it means you’ll be able to send Bitcoin fast and cheaply, so that’s pretty cool!
Tip: You can speed up the Bitcoin process by creating a Bitcoin Lightning node in Linux.
How and why to use the Lightning Network
Lightning is still a work in progress, but it’s grown a lot since it first launched in 2018, and it’s going mainstream. Several wallets and at least one major exchange (Bitfinex, as of December 2019) support it, so if you want to use it, you’ll need to get set up with one of those. Eventually, Lightning may just become the default for every exchange and wallet, but until then a few good options include Breez Wallet, Wallet of Satoshi, and Peach.
Other cryptocurrencies, like Litecoin and Stellar, have also been building their own versions of Lightning, so second layers might end up being a fairly standard way for cryptocurrencies to work in the future. Along with faster, cheaper transactions, it’s technically more private than most one-layer cryptocurrencies out there, since many transactions will happen “off the record” and won’t be recorded to the main chain. There are definitely some issues to work through, but Lightning might just be the upgrade Bitcoin needs to jumpstart more mainstream use.
Our latest tutorials delivered straight to your inbox