📢 Gate Square #MBG Posting Challenge# is Live— Post for MBG Rewards!
Want a share of 1,000 MBG? Get involved now—show your insights and real participation to become an MBG promoter!
💰 20 top posts will each win 50 MBG!
How to Participate:
1️⃣ Research the MBG project
Share your in-depth views on MBG’s fundamentals, community governance, development goals, and tokenomics, etc.
2️⃣ Join and share your real experience
Take part in MBG activities (CandyDrop, Launchpool, or spot trading), and post your screenshots, earnings, or step-by-step tutorials. Content can include profits, beginner-friendl
Off-chain scaling technology depth comparison: State Channels, Sidechains and their applications
Off-chain Scaling Depth Analysis
Author: Cobo Ventures
1. The Necessity of Scaling
The future vision of blockchain is decentralization, security, and scalability. However, blockchain can usually only achieve two of these, and meeting all three requirements is known as the blockchain's impossible triangle problem. For years, people have been exploring how to solve this dilemma, how to improve the throughput and transaction speed of blockchain while ensuring decentralization and security, namely solving the scalability problem, which is one of the hot topics discussed in the current development process of blockchain.
Let us first define the decentralization, security, and scalability of blockchain in general:
Decentralization: Anyone can become a node to participate in the production and verification of the blockchain system. The more nodes there are, the higher the degree of decentralization, ensuring that the network is not controlled by a small group of large centralized participants.
Security: The higher the cost of gaining control over the blockchain system, the higher the security, and thus the chain can resist a larger proportion of participants attacking it.
Scalability: The ability of a blockchain to handle a large number of transactions.
The first major hard fork of the Bitcoin network originated from scalability issues. As the number of Bitcoin users and transaction volumes increased, the Bitcoin network, with a block size limit of 1MB, began to face congestion problems. Since 2015, there have been disagreements within the Bitcoin community regarding scalability; one side, represented by Bitcoin ABC, supports expanding the block size, while the other side, represented by Bitcoin Core, advocates for small blocks and believes that the Segregated Witness (Segwit) solution should be used to optimize the main chain structure. On August 1, 2017, Bitcoin ABC launched its client system developed to 8MB, leading to the first major hard fork in Bitcoin's history and giving rise to the new cryptocurrency BCH.
Similarly, the Ethereum network also chooses to sacrifice a portion of scalability to ensure the network's security and decentralization; although the Ethereum network does not limit transaction volume by restricting block size like the Bitcoin network, it instead sets a cap on the gas fees that can be accommodated in a single block. However, the goal is to achieve Trustless Consensus and ensure a wide distribution of nodes.
Since the rise of on-chain applications such as CryptoKitties in 2017, DeFi summer, and later GameFi and NFTs, the market's demand for throughput has been continuously increasing. However, even the Turing-complete Ethereum can only process 15 to 45 transactions per second, resulting in rising transaction costs, longer settlement times, and making it difficult for most Dapps to bear operating costs. The entire network has become slow and expensive for users, and the blockchain scalability issue urgently needs to be addressed. The ideal scalability solution is to improve the transaction speed and throughput of the blockchain network as much as possible without sacrificing decentralization and security.
2. Types of Expansion Solutions
We categorize the scalability solutions into two main types: on-chain scalability and off-chain scalability, based on the criterion of "whether to change the layer of the mainnet."
2.1 On-chain Scalability
Core concept: A solution to achieve scalability by altering a layer of the main network protocol, with the current main solution being sharding.
There are various solutions for on-chain scalability, and this article will not elaborate on them. Below are two solutions listed briefly:
Solution 1 is to expand the block space, which means increasing the number of transactions packed into each block. However, this will raise the requirements for high-performance node equipment, increase the threshold for node participation, and reduce the degree of "decentralization".
Option two is sharding, which divides the blockchain ledger into several parts. Instead of each node participating in all the accounting, different shards, that is, different nodes, are responsible for different accounting. Parallel processing can handle multiple transactions simultaneously; this reduces the computational pressure on nodes and lowers the entry barrier, improving transaction processing speed and the degree of decentralization. However, this means that the overall network computing power is dispersed, which may reduce the "security" of the entire network.
Changing the code of a layer 1 mainnet protocol can have unpredictable negative consequences, as any slight security vulnerability in the underlying system poses a serious threat to the overall security of the network. The network may be forced to undergo a fork or interrupt repairs for upgrades. For example, the inflation bug incident of Zcash in 2018: Zcash's code was modified based on Bitcoin version 0.11.2, and in 2018, an engineer discovered a critical vulnerability in its underlying code, which allowed for the unlimited issuance of tokens. The team subsequently spent 8 months secretly patching it and only disclosed the incident after the vulnerability was fixed.
2.2 off-chain scaling
Core concept: a scaling solution that does not change the existing layer one mainnet protocol.
The off-chain scalability solutions can be further divided into Layer 2 and other solutions:
3. Off-chain Expansion Solutions
3.1 State Channels
3.1.1 Overview
State channels stipulate that users only need to interact with the mainnet when opening, closing, or resolving disputes in the channel, and that interactions between users are conducted off-chain, thereby reducing the time and monetary costs of transactions for users, and allowing for unlimited transaction frequencies.
State channels are simple P2P protocols suitable for "turn-based applications," such as a two-player chess game. Each channel is managed by a multi-signature smart contract running on the mainnet, which controls the assets deposited into the channel, verifies state updates, and arbitrates disputes between participants. After participants deploy the contract on the blockchain network, they deposit a sum of money and lock it. Once both parties sign to confirm, the channel is officially opened. The channel allows participants to conduct unlimited off-chain transactions for free. Participants take turns sending state updates to each other, waiting for the other party's signature confirmation. Once the other party signs to confirm, the state update is considered complete. Normally, state updates agreed upon by both parties are not uploaded to the mainnet; they only rely on the mainnet for confirmation in the event of a dispute or when closing the channel. When it is necessary to close the channel, any participant can propose a transaction request on the mainnet. If the exit request receives unanimous signature approval, it is executed on-chain immediately, with the smart contract distributing the remaining locked funds according to each participant's balance at the final state of the channel; if other participants do not sign to approve, everyone must wait for the "challenge period" to end before receiving the remaining funds.
In summary, the state channel solution can greatly reduce the computational load on the main network, increase transaction speed, and lower transaction costs.
3.1.2 Timeline
3.1.3 Technical Principles
The core principle of state channels is:
Participants lock assets in the mainnet smart contract to open a state channel.
Participants perform status update interactions off-chain, and each interaction requires signatures from both parties for confirmation.
Submit the final state to the mainnet contract for verification and asset allocation when it is necessary to close the channel or when a dispute arises.
If a dispute arises, evidence can be submitted for challenge during the challenge period.
The advantages of state channels are that they enable fast and low-cost off-chain transactions, while the disadvantages are that participants need to be continuously online and there is a liquidity lock-up issue.
3.1.4 Advantages and Disadvantages
Advantages:
Disadvantages:
3.1.5 Application
Main applications include:
3.1.6 Application Comparison
The Bitcoin Lightning Network, Ethereum Lightning Network, and Celer Network have some differences in terms of technical implementation, application scenarios, and development status. The Lightning Network is relatively mature, the Lightning Network is used less frequently, and Celer Network has expanded its application scenarios by adding an incentive layer.
3.2 Sidechains
3.2.1 Overview
Sidechains are a form of blockchain that emerged to accelerate transactions on the main chain. They can use more complex contracts or meet specific functions by improving consensus mechanisms or block parameters. The transaction results of the sidechain are ultimately recorded on the validators' side when transmitted back to the main chain. This blockchain model is not a new form of blockchain but rather an infrastructure that attaches to the main chain and assists it in solving problems.
3.2.2 Timeline
3.2.3 Technical Principles
The core principle of sidechains is:
The main chain locks the assets, and the side chain generates the corresponding assets.
Sidechains operate independently, with their own consensus mechanisms.
The sidechain periodically submits state changes back to the main chain.
4