Introduction
Blockchain scalability issues
What is an off-chain scaling solution?
Introduction to side chains
What is side chain?
How side chains work
Why use side chains?
Introduction to payment channels
What is a payment channel?
How payment channels work
Payment paths
Summary
In a broad sense In general, scalability refers to the ability of a system to continuously expand in response to growing demands. In computing, you can improve your computer's performance and perform some tasks faster through hardware upgrades. When it comes to blockchain scalability, it generally refers to improving performance so that more transactions can be processed.
Protocols such as Bitcoin have many advantages, but they lack scalability. If Bitcoin ran on a centralized database, it would be much easier for administrators to increase processing speed and throughput. However, Bitcoin’s value proposition (such as censorship resistance) requires that many participants work together to synchronize copies of the blockchain.
Bitcoin nodes are relatively cheap to run, even Even low-end devices can do the job. However, thousands of nodes need to be kept up to date, resulting in limited capacity.
The upper limit of a block is generally set to the number of transactions that can be processed on the chain to prevent data growth from getting out of control. If the data increment is too large and the growth rate is too fast, the nodes may not be able to keep up. Additionally, if a block is too large, it will be difficult to relay quickly across the network.
Therefore, when encountering this situation, we will hit a bottleneck. We can think of blockchain as a train service with fixed departure intervals. Seats are limited in each carriage, and passengers must bid to secure a ticket. If everyone wants to board the train, the fare will naturally increase. Likewise, a network clogged with unconfirmed transactions would require users to pay exorbitant fees in order to have their transactions prioritized.
One solution is to expand the carriage capacity. As the number of seats increases, passenger flow increases, and ticket prices decrease. However, the carriages are still likely to be as full as before. Carriages cannot be continuously widened, just as block and fuel fee limits cannot be increased indefinitely. Gas fees add to the cost of keeping nodes in the network because nodes can only stay synchronized through hardware upgrades.
Vitalik Buterin, the creator of Ethereum, proposed the "Triple Paradox" of scalability to discuss the challenges facing the blockchain. He believes that protocols must balance scalability, security and decentralization. The three are contradictory to each other. If any two are over-strengthened, the third will be greatly reduced.
Therefore, many people believe that scalability is expected to be achieved off-chain, while security and decentralization should be maximized on the blockchain itself.
Off-chain expansion refers to a method that supports transaction execution but does not allow the blockchain to expand. The on-chain protocol allows users to send and receive funds, but transactions will not appear immediately on the main chain. In this regard, we’ll dive into two of the most notable developments: sidechains and payment channels.
The side chain is an independent blockchain, but it is not an independent platform and is linked to the main chain to some extent. The main chain and the side chain can interoperate, that is, assets can flow freely between the main chain and the side chain.
There are many ways to ensure smooth transfer of funds. In some cases, funds can be deposited into a special address and assets in the main chain can be transferred to the side chain. At this time, the funds are not actually transferred out, but are locked in the address, and the side chain will receive the corresponding amount. A more direct approach (which may favor centralization) is to send the funds to a custodian, who uses the margin to exchange funds for the side chain.
Suppose our friend Alice owns five Bitcoin. She hopes to exchange this for five equivalent currencies in the Bitcoin side chain (we call them "side chain coins"). The sidechain we discussed is a two-way peg, where users can transfer their assets from the main chain to the sidechain and vice versa.
Don’t forget, sidechains are independent blockchains with different blocks, nodes and verification mechanisms. In order to get sidechain coins, Alice will send her five Bitcoins to another address. The address may be owned by someone. After receiving the Bitcoins, the address owner credits these 5 sidechain coins to Alice's sidechain address. Additionally, the address may have some sort of maximum trustless setup, with the software automatically crediting the sidechain coins when it detects the payment.
Alice has converted her Bitcoin holdings into sidechain coins. She can also work in reverse, converting sidechain coins into Bitcoin. After owning the asset on the side chain, she can now trade freely on this independent blockchain. Just like the main chain, she can send or receive sidechain coins from others.
For example, she can pay Bob a sidechain coin to buy a Binance hoodie. When she wants to exchange her bitcoins back, she can send the remaining four sidechain coins to a special address. After the transaction is confirmed, the four Bitcoins will be unlocked and transferred to the address she controls on the main chain.
You may be wondering why sidechains are used. Isn’t it okay for Alice to just use the Bitcoin blockchain?
The answer is that sidechains may have features that Bitcoin does not. Blockchain is a carefully designed off-chain transaction system. While Bitcoin is the most secure decentralized cryptocurrency, it is not yet the leader when it comes to throughput. While Bitcoin transactions are faster than traditional methods, the speed is slightly inferior compared to other blockchain systems. Blocks can only be mined every ten minutes, and when the network is congested, fees can increase significantly.
But we have to admit that daily small payments may not require such a high level of security at all. If Alice goes to buy coffee, she certainly won't wait for the transaction to be confirmed. If so, her transaction will always be in the queue, and by the time the transaction is confirmed, her coffee will have gone cold.
Sidechains are not subject to this rule. It even works without using proof of work. You are free to choose the consensus mechanism, trust a single validator or adjust any number of parameters. Sidechains can implement upgrades not available on the main chain, generate larger blocks and perform fast settlements.
Interestingly, even if the side chain goes seriously wrong, it will not affect the base chain. In this way, they can serve as experimental platforms to launch features that should dominate the majority of the network's consensus.
If users are satisfied with off-chain transactions, sidechains may be an indispensable step for efficient scaling. The main chain node does not need to store all transactions of the side chain. Alice can enter the sidechain with a single Bitcoin transaction, perform hundreds of sidechain currency transactions, and then exit. As far as the Bitcoin blockchain is concerned, she only completed two operations: one in and one out.
Ethereum Plasma is similar, but there are obvious differences. Please read "What is Ethereum Plasma (Plasma)?" 》, learn more:
Payment channels play the same role as sidechains in terms of scalability, but they are fundamentally different. Similar to sidechains, payment channels separate transactions from the main chain, preventing the blockchain from unlimited expansion. However, unlike sidechains, they do not need to rely on an independent blockchain.
Payment channels support user transactions through smart contracts without publishing transactions to the blockchain. It works by using software to enforce the agreement between the two participants.
In the popular Lightning Network model, both parties first Deposit tokens to a jointly owned address. This is a multi-signature address and requires two signatures to spend funds. Therefore, if Alice and Bob create such an address, funds can only be transferred by mutual consent.
Assume that both people deposit 10 Bitcoins to the same address, and the balance of the address is 20 Bitcoins. They are able to easily determine the initial balance, which is that Alice and Bob each have 10 Bitcoins. If Alice needs to transfer a token to Bob, the ledger can be updated to: Alice owns 9 Bitcoins and Bob owns 11 Bitcoins. They do not need to post transactions to the blockchain in order to update their balances.
After all transactions are finally completed, assume that Alice owns 5 Bitcoins, and Bob owns 15. They can create transactions, send these balances to their respective addresses, sign them and broadcast them on the chain.
Alice and Bob could have recorded dozens, hundreds or even thousands of transactions in the ledger. But at the blockchain level, they only performed two on-chain operations: one was the initial funding transaction, and the other redistributed the balance after completing the transaction. Except for the above two points, all other transactions are conducted off-chain, with no handling fees and almost instant completion. Both parties do not have to pay miner fees or wait for block confirmations.
Of course, the examples discussed above are based on mutual understanding and close cooperation between the parties to the transaction, and are not suitable for strangers. However, special mechanisms can also be used to punish fraud and allow unfamiliar parties to transact safely.
For both parties with frequent transactions, payment channels are obviously more convenient and faster. This approach is also improving day by day. The network of these channels can be continuously enriched and optimized, allowing Alice to pay payees with whom she has no direct contact. If Bob and Carol open a payment channel, Alice can pay Carol through the channel as long as the capacity is sufficient. She can first pay through Bob's payment channel, and Bob transfers the funds to Carol's channel. The same operation can be done if Carol is connected to another participant, Dan.
Such a network structure eventually evolved into a distributed topology, where everyone can connect to multiple peer nodes. There are many payment channels, and users can choose the most effective channel independently.
In the above, we discussed two scalability solutions. Both enable transactions to be completed without increasing the burden on the underlying blockchain. Sidechains and payment channels are still immature, but are being embraced by a growing number of users who want to circumvent the pitfalls of base-layer transactions.
Over time, users continue to join the network, and maintaining decentralization is crucial. To achieve the goal, the growth of the blockchain capacity can be limited so that new nodes can be added at any time. Supporters of off-chain scalability solutions believe that with the development of technology, the main chain will only serve high-value transactions in the future, or will only be used to access/disconnect side chains and open/close payment channels.