跳至主要内容
Change page

Sidechains

最後編輯: @wackerow(opens in a new tab), 2024年3月29日

A sidechain is a separate blockchain that runs independent of Ethereum and is connected to Ethereum Mainnet by a two-way bridge. Sidechains can have separate block parameters and consensus algorithms, which are often designed for efficient processing of transactions. Using a sidechain involves trade-offs, though, as they do not inherit Ethereum's security properties. Unlike layer 2 scaling solutions, sidechains do not post state changes and transaction data back to Ethereum Mainnet.

Sidechains also sacrifice some measure of decentralization or security to achieve high throughput (scalability trilemma(opens in a new tab)). Ethereum is, however, committed to scaling without compromising on decentralization and security as outlined in its vision statement for upgrades.

How do sidechains work?

Sidechains are independent blockchains, with different histories, development roadmaps, and design considerations. While a sidechain may share some surface-level similarities with Ethereum, it has several distinctive features.

Consensus algorithms

One of the qualities that make sidechains unique (i.e., different from Ethereum) is the consensus algorithm used. Sidechains don't rely on Ethereum for consensus and can choose alternative consensus protocols that suit their needs. Some examples of consensus algorithms used on sidechains include:

Like Ethereum, sidechains have validating nodes that verify and process transactions, produce blocks, and store the blockchain state. Validators are also responsible for maintaining consensus across the network and securing it against malicious attacks.

Block parameters

Ethereum places limits on block times (i.e., the time it takes to produce new blocks) and block sizes (i.e., the amount of data contained per block denominated in gas). Conversely, sidechains often adopt different parameters, such as faster block times and higher gas limits, to achieve high throughput, fast transactions, and low fees.

While this has some benefits, it has critical implications for network decentralization and security. Block parameters, like fast block times and big block sizes, increase the difficulty of running a full node—leaving a few "supernodes" responsible for securing the chain. In such a scenario, the possibility of validator collusion or a malicious takeover of the chain increases.

For blockchains to scale without harming decentralization, running a node must be open to everyone—not necessarily parties with specialized hardware. This is why efforts are underway to ensure everyone can run a full node on the Ethereum network.

EVM compatibility

Some sidechains are EVM-compatible and are able to execute contracts developed for the Ethereum Virtual Machine (EVM). EVM-compatible sidechains support smart contracts written in Solidity, as well as other EVM smart contract languages, which means smart contracts written for Ethereum Mainnet will also work on EVM-compatible sidechains.

This means if you want to use your dapp on a sidechain, it's just a matter of deploying your smart contract to this sidechain. It looks, feels, and acts just like Mainnet—you write contracts in Solidity, and interact with the chain via the sidechains RPC.

Because sidechains are EVM-compatible, they are considered a useful scaling solution for Ethereum-native dapps. With your dapp on a sidechain, users can enjoy lower gas fees and faster transactions, especially if Mainnet is congested.

However, as explained previously, using a sidechain involves significant trade-offs. Each sidechain is responsible for its security and doesn't inherit Ethereum's security properties. This increases the possibility of malicious behavior which can affect your users or put their funds at risk.

Asset movement

In order for a separate blockchain to become a sidechain to Ethereum Mainnet it needs the ability to facilitate the transfer of assets from and to Ethereum Mainnet. This interoperability with Ethereum is achieved using a blockchain bridge. Bridges use smart contracts deployed on Ethereum Mainnet and a sidechain to control the bridging of funds between them.

While bridges help users move funds between Ethereum and the sidechain, the assets are not physically moved across the two chains. Instead, mechanisms that typically involve minting and burning are used for transferring value across chains. More on how bridges work.

Pros and cons of sidechains

ProsCons
The technology underpinning sidechains is well-established and benefits from extensive research and improvements in design.Sidechains trade off some measure of decentralization and trustlessness for scalability.
Sidechains support general computation and offer EVM compatibility (they can run Ethereum-native dapps).A sidechain uses a separate consensus mechanism and doesn't benefit from Ethereum's security guarantees.
Sidechains use different consensus models to efficiently process transactions and lower transaction fees for users.Sidechains require higher trust assumptions (e.g., a quorum of malicious sidechain validators can commit fraud).
EVM-compatible sidechains allow dapps to expand their ecosystem.

Use Sidechains

Multiple projects provide implementations of sidechains that you can integrate into your dapps:

Further reading

Know of a community resource that helped you? Edit this page and add it!

這篇文章對你有幫助嗎?

網站上次更新: 2024年7月10日

學習

  • 學習中心
  • 什麼是以太坊?
  • 什麼是以太幣 (ETH)?
  • 以太坊錢包
  • 什麼是 Web3?
  • 智慧型合約
  • Gas fees
  • 執行節點
  • 以太坊安全及詐騙預防
  • 測驗中心
  • 以太坊詞彙表
(opens in a new tab)(opens in a new tab)(opens in a new tab)
  • 關於我們
  • 以太坊品牌資產
  • 行為守則
  • 工作機會
  • 隱私條款
  • 使用條款
  • Cookie 政策
  • 媒體聯絡方式(opens in a new tab)