A great number of people are looking to the Lightning Network as the answer to some of Bitcoin and the Blockchain’s scaling issues – but what exactly is it? Here, we’ll take a deeper look at the Lightning Network – and what it might mean for cryptocurrency...
It’s an exciting time for Bitcoin and Blockchain technology. When the two concepts were first imagined, no one could have expected the system would one day be handling such an enormous number of transactions every day.
The trouble is, the large daily numbers see many thousand transactions stacking up, awaiting verification by miners who can only work as quickly as the Blockchain allows. The result? Large transaction fees and a long wait for your Bitcoin to arrive at its destination.
Bitcoin Cash is a direct result of the cryptocurrency community trying to overcome these scaling issues – but it’s only one option – another is the Lightning Network. Here, we’ll take an understandable look at what it is – and how it works.
In our recent blog post about Bitcoin and Bitcoin Cash, we took a quick glance at how the Blockchain works. In short; the Blockchain is a decentralised ledger system that relies on a global network of powerful ‘mining’ computers to check that every transaction checks out against the transactions that have gone before.
With hundreds of thousands of transactions taking place every day, this checking and authorising process is costly and time-consuming – which means Bitcoin transactions are also costly and time-consuming. The problem here is that ‘costly’ and ‘time-consuming’ are two phrases that currency users don’t like – so; until there’s a practical way of making Blockchain transactions fast and cost-effective, it’s unlikely you’ll be paying for your morning coffee with Bitcoin, which puts a real damper on the most popular cryptocurrency’s scalability...
If there’s one thing that we become increasingly sure of every day – it’s that the Blockchain is safe and reliable – which is exactly why so many people are averse to the idea of tweaking and adjusting the concept.
Effectively, this is what Bitcoin Cash has done; the size and complexity of problems that miners have to solve to verify transactions is changed to speed the process up – but this process doesn’t come without its concerns.
Lightning network developers have done something totally different though. Rather than make changes to the Blockchain, they’ve created an additional ‘layer’ to the system that consolidates smaller transactions away from the Blockchain; before satisfying them as a whole in one overall Blockchain transaction. The potential result is exactly what users are looking for – low cost transactions that are as quick as, well... lightning.
In essence, the Lightning Network is a layer of smart contracts that operate alongside the Blockchain. For the sake of an example, we can take a two-users process and break it down into a series of smaller steps:
Step 1: A wallet is set up. Rather than needing one private key to enact a transaction, this type of wallet needs, in this case, both parties to agree before funds are removed.
Step 2: The wallet address is saved to the Blockchain. In addition to this address, a smart contract or balance sheet is also saved, outlining how much Bitcoin is owned by each wallet user.
Step 3: Transactions between the two parties now take place instantly – the Blockchain information is untouched at this stage, instead, it’s the balance sheet that changes.
Step 4: Every time a transaction takes place, each user re-signs the balance sheet; outlining how much of the held Bitcoin is owned by each party.
Step 5: When both parties no longer require transactions to take place between them, the channel can be closed. When it is, the most recent copy of the balance sheet is uploaded to the Blockchain – and the Bitcoin is distributed accordingly, through traditional mining authorisation methods.
As with virtually every currency on the planet, the behind-the-scenes technicalities often matter very little to end-users – who, as we know, are generally just looking for a fast and low-cost way to go about their transactions.
So, what would the Lightning Network look like in real terms?
Let’s take a morning cup of coffee as an example:
Your walk-to-work-route coffee shop has started accepting Bitcoin – so the Lightning Network allows you to set up something of a virtual ‘tab’. You set up a wallet that can be accessed when both yourself and the coffee shop authorise it. Since you’re the one who wants coffee; you credit 0.005BTC to the wallet – and the shop credits nothing. The creation of this wallet is uploaded to the Blockchain.
Each day, you receive a coffee worth 0.00045BTC – and that daily transaction concludes with the balance sheet updating; which you both confirm. When your portion of the Bitcoin runs low, you can either credit more to the wallet – or, if you’ve got your sights on a different coffee shop, you can conclude the transaction – meaning each party will be credited accordingly and the channel is closed.
Oh – and coffee shop owners don’t have to worry; if your customer suddenly disappears, you can conclude the channel of transactions and the Bitcoin will be distributed according to the last version of the balance sheet.
The process is quick and simple – and also you won’t run hours (or even days!) late for work; as you might have done if you’d been waiting for a Blockchain Bitcoin transaction to be authorised before you were handed your drink.
While this example offers a simple everyday explanation of how the Lightning Network could work, paying for a latté doesn’t represent much of a network – so where does that part come in?
Well, quite simply, the Lightning Network doesn’t rely on a direct open payment channel between you and the person you want to pay. So, if a friend like the sounds of your morning coffee routine, they can create and credit an open channel to you. When they do, you become a ‘node’ – connecting your friend to the coffee shop.
When they order a coffee, the network creates smart contracts between each party. You have no control over the money you’re relaying – you’ll simply receive the 0.00045BTC your friend pays for his latté as long as the network has been able to credit the appropriate 0.00045BTC from you to the coffee shop – like an instantaneous escrow service that requires no input from you.
This approached requires there to be enough currency between each connection all the way down the line, but the network is still ‘trustless’; as it’s based on smart contracts – so funds will always reach their destination, or be refunded if there’s no available path to the destination. Of course, this is just another simple example – but a worldwide network might roll out surprisingly quickly; especially if the ‘six degrees of separation theory’ is based in truth...
There’s no denying the significant benefits that the Lightning Network could bring. It makes tiny Bitcoin payments feasible, payments are settled virtually instantly – and there are privacy benefits too, since it’s only the overall transaction that’s held on the Blockchain – not the fine detail.
That said, it’s perhaps not perfect. Payments can only be made to someone who’s online – and if a peer becomes unresponsive, it could still take time for payment channels to close and funds find a different route. It could also be very difficult to make large payments without a direct channel – since you’ll rely on peers having sufficient funds in their multi-signature wallets.
All that considered, perhaps one of the biggest concerns of the Lightning Network are the nodes who’ll be instrumental to its success. Will larger nodes somewhat ‘centralise’ a concept that currently avoids direct control through its decentralised nature? How important is this idea going forward?
While the Lightning Network is still in beta testing stages, these questions will remain somewhat unanswered – but, if found to work as intended, the Lightning Network could represent an incredible step forward for cryptocurrency as we know it.