Off-chain scaling solution analysis: A comparison of the technical principles and applications of State Channels and Sidechains.

Off-chain Scalability Depth Analysis

1. The Necessity of Scalability

The future vision of blockchain is to achieve decentralization, security, and scalability, but it often can only satisfy two of these at the same time, which is known as the impossible triangle problem of blockchain. For many years, people have been exploring how to improve the throughput and transaction speed of blockchain while ensuring decentralization and security, that is, to solve the scalability issue, which is one of the hot topics in the current development process of blockchain.

The decentralization, security, and scalability of blockchain can be roughly defined as:

  • 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.
  • Security: The higher the cost required to gain control of the blockchain system, the higher the security, and the chain can resist attacks from a larger proportion of participants.
  • Scalability: The ability of a blockchain to handle a large number of transactions.

The first major hard fork of the Bitcoin network originated from the scalability issue. As the number of users and transaction volume increased, the Bitcoin network faced congestion due to the 1MB block limit. Starting in 2015, the Bitcoin community experienced disagreements over the scalability issue, ultimately leading to the first major hard fork in Bitcoin's history on August 1, 2017, which resulted in the creation of the new currency BCH.

Similarly, the Ethereum network also chooses to sacrifice a portion of scalability to ensure security and decentralization. Although Ethereum does not directly limit the block size, it sets a cap on the gas fees for individual blocks, but the aim is to achieve trustless consensus and ensure broad distribution of nodes.

From the emergence of CryptoKitties in 2017 to the rise of applications such as DeFi, GameFi, and NFTs, the market's demand for throughput has been continuously increasing. However, even Ethereum, which is Turing-complete, can only process 15-45 transactions per second, leading to increased transaction costs and longer settlement times, making it difficult for most DApps to bear the operating costs, resulting in the entire network becoming slow and expensive. Therefore, the problem of blockchain scalability urgently needs to be addressed. The ideal scalability solution is to maximize transaction speed and throughput without sacrificing decentralization and security.

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

2. Types of Scaling Solutions

We can categorize the scaling solutions into two main types: on-chain scaling and off-chain scaling, based on the criterion of "whether to change a layer of the mainnet."

2.1 on-chain scaling

Core concept: A solution to achieve scalability by changing a layer of the mainnet protocol, with the current main solution being sharding.

There are various solutions for on-chain scalability; this article will not elaborate on them but will briefly list two:

  • Plan One is to expand the block space, which means increasing the number of transactions packed into each block, but this will raise the requirements for high-performance node devices, increase the threshold for nodes to join, and reduce the degree of decentralization.

  • Option two is sharding, which divides the blockchain ledger into several parts, with different shards responsible for different bookkeeping. Parallel computation can handle multiple transactions simultaneously; this can reduce the computational pressure on nodes and lower the entry barriers, improving transaction processing speed and the degree of decentralization. However, it means that the overall network's computing power is distributed, which can reduce the security of the entire network.

Changing a layer of the mainnet protocol may have unpredictable negative effects, as any underlying security vulnerabilities could seriously threaten the overall network security.

2.2 off-chain scaling

Core concept: A scalability solution that does not change the existing layer one mainnet protocol.

Off-chain expansion solutions can be subdivided into Layer 2 and other solutions:

  • Layer2: State Channels, Sidechains, Plasma, Rollups ( Optimistic Rollups, ZK Rollups )
  • Other solutions: Validium, Volition

Ten Thousand Characters Depth Report: Comprehensive Analysis of off-chain Scaling

3. off-chain scaling solutions

3.1 State Channels

3.1.1 Overview

State channels stipulate that users only need to interact with the mainnet when the channel is opened, closed, or disputes are resolved, and interactions between users are conducted off-chain, thereby reducing transaction time and costs, allowing for unlimited transaction counts.

State channels are simple P2P protocols suitable for "turn-based applications" such as two-player chess games. Each channel is managed by a multi-signature smart contract running on the mainnet, which controls the assets deposited in the channel, verifies state updates, and arbitrates disputes between participants. After deploying the contract, participants deposit and lock funds, and once both parties sign to confirm, the channel is officially opened. The channel allows participants to conduct an unlimited number of off-chain free transactions ( as long as the net transfer value does not exceed the total amount of tokens deposited ). Participants take turns sending state updates to each other, waiting for the other party's signature confirmation. Once the other party confirms with a signature, the state update is considered complete. Normally, state updates agreed upon by both parties are not uploaded to the mainnet; it only relies on the mainnet for confirmation in the event of a dispute or when closing the channel. When closing the channel, any participant can make a transaction request on the mainnet, which will be executed immediately if approved by all signatures; otherwise, they must wait for the "challenge period" to end before receiving the remaining funds.

In summary, the state channel solution can greatly reduce the computation load on the mainnet, enhance transaction speed, and lower transaction costs.

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

3.1.2 Timeline

  • 2015/02: Joseph Poon and Thaddeus Dryja released the draft of the Lightning Network white paper.
  • 2015/11: Jeff Coleman first systematically summarized the concept of State Channel and proposed that the Payment Channel of Bitcoin is a sub-case of the State Channel concept.
  • 2016/01: Joseph Poon and Thaddeus Dryja officially published the white paper "The Bitcoin Lightning Network: Scalable Off-Chain Instant Payments" proposing the Payment Channel scalability solution for the Bitcoin Lightning Network.
  • 2017/11: Proposed the first design specification for State Channel under the Payment Channel framework, Sprites.
  • 2018/06: Counterfactual proposed a detailed design of Generalized State Channels, which is the first fully state channel-related design.
  • 2018/10: The article Generalised State Channel Networks proposed the concepts of State Channel Networks and Virtual Channels.
  • 2019/02: The concept of state channels was expanded to N-Party Channels, with Nitro being the first protocol built on this idea.
  • 2019/10: Pisa expanded the concept of Watchtowers to address the issue of all participants needing to remain online.
  • 2020/03: Hydra proposed Fast Isomorphic Channels.

3.1.3 Technical Principles

The general workflow of state channels is as follows:

  1. Alice and Bob deposit funds from their personal EOA to the on-chain contract address, where these funds are locked in the contract until they are returned to the user when the channel closes; after both parties sign to confirm, the channel officially opens.

  2. Alice and Bob can conduct unlimited off-chain transactions, with participants communicating through encrypted signed messages. Both parties need to sign each transaction to prevent double spending. Through these messages, they propose updates to their account status and accept updates proposed by the other party.

  3. If Alice wants to close the channel, she needs to submit the final state of her account to the contract. If Bob signs to approve, the contract will release the locked funds back to the corresponding user according to the final state. If Bob does not respond with a signature, the contract will release the funds back to the corresponding user after the challenge period ends.

In a pessimistic scenario, if Bob does not respond to the state update signature sent by Alice at a certain point in time, Alice can initiate a challenge by submitting her last valid state to the contract. Then, the contract allows Bob to respond within a period of time by submitting the next state to the contract; if Bob responds, the two can continue trading within the state channel; if Bob does not respond within that time period, the contract automatically closes the state channel and returns the funds to Alice.

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

3.1.4 Advantages and Disadvantages

Advantages:

  • Instant trading: no need to wait for block confirmation
  • High throughput: off-chain transaction counts are unlimited
  • Low cost: only on-chain fees are required when opening and closing the channel.
  • Privacy: off-chain transaction details will not be disclosed

Disadvantages:

  • Fund Locking: Funds are locked during the channel opening period.
  • Online Requirement: Participants need to stay online to sign status updates
  • Poor composability: not suitable for complex multi-party interactions
  • Security Dependency: Relies on external monitoring services ( such as Watchtowers ) to prevent malfeasance.

3.1.5 Application

Bitcoin Lightning Network:

  • A micropayment channel based on the Bitcoin network, using a 2/2 multi-signature to build a one-way payment channel, then constructing a two-way payment channel after adding RSMC, and finally expanding the payment channel to multi-party payments by adding HTLC, ultimately building a payment network.
  • The draft of the white paper was proposed in February 2015, and the official version of the white paper was released in January 2016.
  • The first mainnet version was released in March 2018.
  • In 2021, El Salvador adopted Bitcoin as legal tender and launched the Chivo wallet based on the Lightning Network.
  • In 2022, there were 76,236 payment channels with a total fund of 5049 BTC.
  • Ecological development: from the underlying BTC network to core infrastructure solutions (, nodes, and liquidity services ), to various payment and financial services as well as applications.

Ethereum Lightning Network:

  • Small payment channels based on Ethereum, similar to the Lightning Network.
  • Established in 2017, conducted ICO in October of the same year.
  • The first Raiden Light Client was launched on the Ethereum mainnet in May 2020.
  • Currently not widely adopted, reasons include high usage thresholds and the emergence of more advanced scaling technologies.
  • Being transformed to run on the Ethereum Layer2 Rollup network, reducing the Gas fees for creating State Channels.

Celer Network:

  • Essentially, it has added an incentive layer with the ( token $CELR)'s Lightning Network, building high-frequency interactive blockchain DApps through off-chain scaling technology and an incentive economic model.
  • Suitable for high-frequency interaction scenarios such as esports platforms.
  • Founded in 2018, the token $CELR was launched on Binance Launchpad in March 2019.
  • Currently launched products include the DeFi protocol Layer2.finance, the information cross-chain protocol Celer IM, and the asset cross-chain bridge cBridge.

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

3.1.6 Application Comparison

The Bitcoin Lightning Network, Ethereum Lightning Network, and Celer Network are similar in design philosophy, all being off-chain scaling solutions based on state channels. The main difference is:

  1. Underlying blockchain: The Bitcoin Lightning Network is based on Bitcoin, while the Lightning Network and Celer Network are based on Ethereum.

  2. Application Scenarios:

    • The Lightning Network is primarily used for small Bitcoin payments.
    • The Lightning Network aims to support ERC20 token payments on Ethereum.
    • Celer Network aims broader, supporting high-frequency interactive DApps
  3. Technical Features:

    • The Lightning Network uses HTLC to achieve multi-hop payments
    • The Lightning Network uses a similar mechanism
    • Celer Network has added an incentive layer and a state routing layer.
  4. Development Stage:

    • The Lightning Network has matured and the ecosystem is developing well.
    • The Lightning Network is developing slowly, with low usage.
    • Celer Network is transforming into a multi-chain scaling aggregation platform.
  5. Token Economy:

    • The Lightning Network has no native tokens
    • The Lightning Network and Celer Network have both issued their own tokens.

3.2 Sidechains

3.2.1 Summary

The concept of sidechains was first proposed in 2012 in the Bitcoin developer chatroom, and the first related article was written by a Blockstream researcher in 2014.

Sidechains are a form of blockchain that emerged to accelerate Bitcoin transactions, allowing for the use of more complex contracts or by improving consensus mechanisms like PoS(, or adjusting block parameters to make the sidechain suitable for specific purposes. The transaction results of the sidechain are ultimately recorded in the validation when sent back to the main chain.

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
  • 5
  • Share
Comment
0/400
LiquidationAlertvip
· 07-01 16:29
Don't panic, you lost money early on but are still alive now?
View OriginalReply0
not_your_keysvip
· 07-01 16:24
Is a fast-running chain necessarily reliable?
View OriginalReply0
RuntimeErrorvip
· 07-01 16:21
It's just a few lines of text, have you learned it?
View OriginalReply0
ForkItAllvip
· 07-01 16:19
The triangle problem is revealed...
View OriginalReply0
NotFinancialAdvicevip
· 07-01 16:08
Goodness, after talking for so long, it's still the Unholy Trinity.
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)