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.

Ten Thousand Words Depth Research Report: Comprehensive Analysis of off-chain Scalability

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:

  • Layer 2: State Channels, Plasma, Rollups
  • Other solutions: Sidechains, Validium

Ten Thousand Words Depth Research Report: Comprehensive Analysis of off-chain Expansion

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.

Ten Thousand Words Depth Research Report: Comprehensive Analysis of off-chain Scalability

3.1.2 Timeline

  • In February 2015, Joseph Poon and Thaddeus Dryja released the draft of the Lightning Network white paper.
  • In November 2015, Jeff Coleman systematically summarized the concept of State Channels for the first time, proposing that Bitcoin's Payment Channel is a sub-case of the State Channel concept.
  • In January 2016, Joseph Poon and Thaddeus Dryja officially published the white paper "The Bitcoin Lightning Network: Scalable Off-Chain Instant Payments" proposing the scaling solution for the Bitcoin Lightning Network called Payment Channel.
  • In November 2017, the first design specification for State Channels based on the Payment Channel framework, Sprites, was proposed.
  • In June 2018, Counterfactual proposed a very detailed Generalized State Channels design, which is the first design fully related to state channels.
  • In October 2018, the article Generalised State Channel Networks introduced the concepts of State Channel Networks and Virtual Channels.
  • In February 2019, the concept of state channels was extended to N-Party Channels, and Nitro is the first protocol built on this idea.
  • 2019/10, Pisa expanded the concept of Watchtowers to address the issue of all participants needing to be continuously online.
  • 2020/03, Hydra proposed Fast Isomorphic Channels.

3.1.3 Technical Principles

The core principle of state channels is:

  1. Participants lock assets in the mainnet smart contract to open a state channel.

  2. Participants perform status update interactions off-chain, and each interaction requires signatures from both parties for confirmation.

  3. 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.

  4. 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.

Ten Thousand Words Depth Research Report: Comprehensive Analysis of Off-Chain Expansion

3.1.4 Advantages and Disadvantages

Advantages:

  • High throughput and low latency
  • Low transaction costs
  • Protect Privacy

Disadvantages:

  • Participants must remain online continuously.
  • Fund Locking
  • Not applicable for multi-party applications
  • Funds need to be deposited in advance.

3.1.5 Application

Main applications include:

  1. Bitcoin Lightning Network
  • Used for small Bitcoin payments
  • The first mainnet version was released in March 2018.
  • Currently, there are about 80,000 payment channels, with 5,000 BTC locked funds.
  1. Ethereum Lightning Network
  • Used for payments of Ethereum ERC20 tokens
  • Established in 2017, launched mainnet in May 2020.
  • Currently used less
  1. Celer Network
  • Added a general state channel network for the incentive layer
  • Established in 2018, launched mainnet in 2019
  • Supports various application scenarios such as gaming, payment, etc.

Ten Thousand Words Depth Research Report: Comprehensive Analysis of off-chain Scalability

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.

Ten Thousand Words Depth Research Report: Comprehensive Analysis of off-chain Scalability

3.2.2 Timeline

  • In January 2012, the concept of Bitcoin sidechains was proposed in chat rooms.
  • In October 2014, the paper on Bitcoin sidechains was first published.
  • In April 2017, the POA Network launched a testnet for a sidechain based on the Ethereum Proof of Authentication consensus.
  • 2017/10, Matic Network launched
  • December 2017, POA Network mainnet launched
  • January 2018, Skales testnet launched
  • 2018/10, xDai Chain testnet launched
  • June 2020, Skale mainnet launched
  • June 2020, Ethereum sidechain Matic PoS Chain mainnet launched
  • In February 2021, Matic Network was rebranded as Polygon Network.
  • In February 2021, the Ronin mainnet of the Axie Infinity game sidechain began operation.
  • In December 2021, xDai Chain merged with Gnosis Dao to form Gnosis Chain
  • March 2022, POA Network merged into Gnosis Chain

3.2.3 Technical Principles

The core principle of sidechains is:

  1. The main chain locks the assets, and the side chain generates the corresponding assets.

  2. Sidechains operate independently, with their own consensus mechanisms.

  3. The sidechain periodically submits state changes back to the main chain.

4

BTC1.24%
View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • 3
  • Share
Comment
0/400
LightningLadyvip
· 07-24 20:33
Newbie investors shouldn't use high leverage~ babe, make sure to read more technical articles.
View OriginalReply0
MentalWealthHarvestervip
· 07-24 20:25
Triangle impossible reliable
View OriginalReply0
GateUser-5854de8bvip
· 07-24 20:25
Blockchain is still talking about these nonsensical things.
View OriginalReply0
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate app
Community
English
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)