The blockchain scalability problem
As a result, we find ourselves at something of a bottleneck. A blockchain can be viewed as a train service that departs at set intervals. There are only limited seats in each carriage, and to obtain a ticket, travelers must bid to guarantee a place. If everyone is trying to get on the train at the same time, the price will be high. Similarly, a network clogged with pending transactions will require users to pay higher fees to see their transaction included in a timely manner.
Ethereum creator Vitalik Buterin coined the Scalability Trilemma to describe the challenge faced by blockchains. He theorizes that protocols must make trade-offs between scalability, security, and decentralization. These are somewhat at odds with each other – by focusing too much on two of the properties, the third will be poor.
What are off-chain scaling solutions?
Off-chain scaling refers to approaches that allow for transactions to be executed without bloating the blockchain. Protocols that plug into the chain allow users to send and receive funds, without the transactions appearing on the main chain. We’ll dive into two of the most notable advances on this front: sidechains and payment channels.
An introduction to sidechains
What is a sidechain?
A sidechain is a separate blockchain. However, it’s not a standalone platform, as it’s pegged in some way to the main chain. The main chain and the sidechain are interoperable, meaning that assets can flow freely from one to the other.
How does a sidechain work?
Suppose that our friend Alice has five bitcoins. She wants to exchange them for five equivalent units on a Bitcoin sidechain – let’s call them sidecoins. The sidechain in question uses a two-way peg, meaning that users can transfer their assets from the main chain to the sidechain and vice-versa.
Alice has now converted her coins into sidecoins, but she can always reverse the process to reclaim her bitcoins. Now that she has entered the sidechain, she is free to transact on this separate blockchain. She can send sidecoins or receive them from others, just as she would on the main chain.
She could, for instance, pay Bob one sidecoin for a Binance hoodie. When she wants to return to Bitcoin, she could send her remaining four sidecoins to a special address. After the transaction is confirmed, four bitcoins would be unlocked and delivered to an address she controls on the main chain.
Why are sidechains used?
You might wonder what the point of this is. Why doesn’t Alice just use the Bitcoin blockchain?
Admittedly, there probably isn’t a need for this level of security for small day-to-day payments. If Alice is paying for a coffee, she’s not going to stand waiting for the transaction to confirm. She’d be holding up the queue, and her drink would be cold by the time it was handed over.
Interestingly, sidechains could even have critical bugs without affecting the underlying chain. This allows them to be used as platforms for experimentation and to roll out features that would otherwise require consensus from the majority of the network.
Provided that users are happy with the trade-offs, sidechains could be an integral step towards effective scaling. There is no requirement for main chain nodes to store every transaction from the sidechain. Alice could enter the sidechain with a single Bitcoin transaction, perform hundreds of sidecoin transactions, and then exit the sidechain. As far as the Bitcoin blockchain is concerned, she has only performed two – one to enter and one to exit.
An introduction to payment channels
What is a payment channel?
Payment channels serve the same purpose as sidechains on the scalability front, but they’re fundamentally very different. Like sidechains, they push transactions off of the main chain to prevent the blockchain from being bloated. Unlike sidechains, however, they don’t require a separate blockchain to function.
How does a payment channel work?
Let’s say they each deposit 10 BTC to an address that now holds 20 BTC. It would be easy for them to keep a balance sheet that starts off saying Alice and Bob both have 10 BTC each. If Alice wanted to give Bob a coin, they could update it to read Alice has 9 BTC, Bob has 11 BTC. They wouldn’t have to publish to the blockchain as they continue to update these balances.
When the time comes, though, let’s say that Alice has 5 BTC, and Bob has 15 BTC. They could then create a transaction that sends these balances to addresses owned by the parties, sign it, and broadcast it.
Alice and Bob could have recorded ten, a hundred, or a thousand transactions on their balance sheet. But as far as the blockchain is concerned, they’ve only performed two on-chain operations: one for the initial funding transaction, and one to reallocate balances when they are done. Apart from these two, all other transactions are free and near-instant because they occur off-chain. There’s no miner fee to pay and no block confirmations to wait for.
Evidently, payment channels are convenient for two parties that anticipate a high volume of transactions. But it gets better. A network of these channels can be fleshed out, meaning that Alice could pay a party she isn’t directly connected to. If Bob has a channel open with Carol, Alice can pay her provided there is enough capacity. She will push funds to Bob’s side of the channel, who will, in turn, push them to Carol’s. If Carol is connected to another participant, Dan, the same thing can be done.
Such a network evolves into a distributed topology where everyone connects to multiple peers. There will often be multiple routes to a destination, and users will be able to choose the most effective one.
We have discussed two scalability approaches that allow for transactions to be made without burdening the underlying blockchain. Both sidechains and payment channel technology have yet to mature, but they’re being leveraged increasingly by users that wish to circumvent the shortcomings of base layer transactions.
As time goes on and more users join the network, it’s important that decentralization is upheld. This is achievable only by enforcing limits on the growth of the blockchain so that new nodes can easily join. Proponents of off-chain scalability solutions believe that, in time, the main chain will only be used to settle high-value transactions, or for pegging in/out of sidechains and opening/closing channels.