Decisive battle at the top of fragmentation? Comprehensive comparison of the design of Polkadot and Ethereum 2.0
巴比特
2020-05-27 06:10
本文约3525字,阅读全文需要约14分钟
According to the description, Polkadot has switched from the previous cross-chain positioning to a sharding protocol, so it will fight head-on with Ethereum 2.0. What is the difference between Polkadot's sharding design and Ethereum 2.0's shardin

Editor's Note: This article comes fromBabbitt Information (ID: bitcoin8btc)Editor's Note: This article comes from

Babbitt Information (ID: bitcoin8btc)

, author: joe petrowski, compiler: free and easy, released with authorization.

What is the difference between Napolka’s sharding design and Ethereum 2.0’s sharding design? This article will make a comprehensive comparison from 8 aspects of model, architecture, consensus, staking, sharding, messaging, governance and upgrade. (Note: Both are currently in the planning stages)

image description

(picture from: tuchong.com)

Model articles

The shards in Ethereum 2.0 all have the same state transition function (STF), which provides an interface for the execution of smart contracts. Contracts exist on a single shard (and can send asynchronous messages between shards), and thus scale by executing shards in parallel.

Similarly, in Polkadot, each shard carries the core logic, the shards are executed in parallel, and Polkadot can send cross-shard asynchronous messages. However, each shard in the protocol has a unique state transition function (STF). Applications can exist within a single shard or across shards through compositional logic. In addition, Polkadot uses WebAssembly (Wasm) as a "meta-protocol". As long as the verifier on Polkadot can execute in the Wasm environment, the state transition function (STF) of the fragmentation can be abstract .

secondary title[1]

Architecture

Ethereum 2.0 The main chain of Ethereum 2.0 is called the Beacon Chain. The main load on the beacon chain is attestations, which are votes on the availability of shard data and the validity of the beacon chain. Each shard in Ethereum 2.0 is a blockchain with an Ethereum Wasm (eWasm) interface.

Ethereum 2.0 only needs one beacon chain to start Phase 0 (Phase 0), and in Phase 1 (Phase 1), Ethereum will have 64 simple shard chains to test the finality of the beacon chain. Each shard submits a "crosslink" to the beacon chain, which contains information identifying the shard's data. After that, in Phase 2, the shards will implement the eWasm interface, finally making the system usable.

Polkadot is the same as Ethereum 2.0, Polkadot also has a main chain, its name is the relay chain (Relay Chain), and then it has some fragments called parachains (parachain). Parachains are not limited to a single interface like eWasm, instead, they can define their own logic and interface, as long as their state transition function (STF) is provided to the relay chain validator to execute.

According to the plan, Polkadot plans to verify up to 100 shards per block. In addition to the parallel chains scheduled to be executed in each block, Polkadot also has dynamically scheduled parallel threads (parathread). This allows chains to share shard slots, much like multiple small airlines share a single gate at an airport.

In addition, in order to interact with other chains (such as Bitcoin), Polkadot will also have a bridge parachain that provides two-way compatibility.

secondary title


  • Consensus[2]Both Ethereum 2.0 and Polkadot use a hybrid consensus model where block production and finality have their own protocols. For the finality protocol, the Casper FFG adopted by Ethereum 2.0 and Polkadot's GRANDPA are both based on GHOST, and both of them can complete a batch of blocks in one round. For block production, both protocols use slot-based protocols that randomly assign validators to a slot and provide fork selection rules for unfinished blocks, where Ethereum 2.0 uses RandDAO/LMD, while Polkadot uses BABE.

  • Ethereum 2.0 completes a batch of blocks based on time periods called "epochs". The current plan is to have 64 blocks per "epoch" and complete all blocks in one round. The estimated block time is about 12 seconds, which means the expected finality time is 6 minutes (up to 12 minutes)


Polkadot's finality protocol GRANDPA completes the batching of blocks based on availability and validity checks that occur as the proposed chain grows. In other words, Polkadot's finality time varies with the number of checks that need to be performed (invalidity reports cause the protocol to require additional checks), and the estimated time is about 12-60 seconds.

Ethereum 2.0 requires a large number of validators per shard to provide strong validity guarantees. Polkadot's sharding requires fewer verifiers and can also provide strong validity guarantees. Polkadot achieves this by having validators distribute erasure codes to all validators in the system, so that anyone (not just validators of a shard) can reconstruct a parachain's blocks and test their validity.[3]secondary title[4]

Ethereum 2.0 will be a proof-of-stake (PoS) network, and each verifier needs to pledge 32 ETH to participate in the block verification process. Validators will run a main "beacon chain" node and multiple validator clients (each requiring 32 ETH). These validators are assigned to "committees", which are randomly selected groups that validate shards in the network. Ethereum 2.0 relies on having a large validator program to provide availability and validity guarantees: they require at least 111 validators per shard to run the network, and at least 256 validators per shard to run the network in an epoch. Finalize all shards

. This requires 64 shards, or 16,384 validators (each shard provides 256 validators)

While Polkadot can use fewer validators, it also provides strong finality and availability guarantees. It uses the Nominated Proof of Stake (NPoS) mechanism to select validators from a smaller set, allowing smaller holders to specify verification to run the infrastructure while still claiming rewards from the system without running their own nodes. Polkadot plans to have 1,000 verifiers in the first year, and each parachain in the network needs about 10 verifiers.[5],secondary title

Every shard in Ethereum 2.0 has the same state transition function (STF), in phase 1 (expected 2021)

Shards will be simple data containers that provide crosslinks pointing to the beacon chain, while in Phase 2 (expected 2023), shards will implement the eWasm execution environment. EWasm is a restricted subset of the Wasm virtual machine whose interface provides a set of methods available to contracts. For eWasm, there will be a set of development tools similar to Truffle and Ganache. {{6]}

Each shard in Polkadot has an abstract state transition function (STF) based on Wasm. Each shard can expose a custom interface as long as the logic is compiled into Wasm and each shard provides a "execute block" function for Polkadot validators. Polkadot has a Substrate development framework, which can configure, combine and expand modules to develop the state transition function (STF) of the chain.[7]secondary title

MessagingShards in Ethereum 2.0 will access each other's state through their crosslinks and states. In the Ethereum 2.0 model, there will be 64 shards, and each shard publishes a crosslink for each block in the beacon chain, which means that a shard can contain information based on a transaction on another shard. The light client proof executes the logic.As of now, the Ethereum 2.0 R&D team has not yet released the specification for message transmission between shards.

Polkadot uses parachainsSPREEprotocol to send arbitrary messages to each other. Parachains open connections with each other and can send messages over their established channels. If two parachains have any common full nodes, they can gossip messages through the full nodes. Otherwise, the validator handles message delivery. Messages do not pass through the relay chain, only proofs of post and channel operations (open, close, etc.) enter the relay chain. This enhances the scalability of the system by keeping data at the edge of the system.

In addition, Polkadot has a named

An add-on protocol that provides shared logic for cross-chain messaging. Messages sent via the SPREE protocol provide additional guarantees about origin and interpretation to the receiving chain.[8]

Governance

Ethereum currently uses off-chain governance methods such as Github discussions, all core developer discussions, and Ethereum Magicians to make decisions about the protocol.

On the other hand, Polkadot adopts an on-chain governance method (using a system called multicameral), which has several ways to pass proposals, such as on-chain councils, technical committees or the public. All proposals will eventually be decided through a referendum, in which the participation of a majority of tokens can control the outcome. For possible low turnout cases, Polkadot uses an adaptive quorum bias to set the pass threshold.

The Ethereum 2.0 upgrade will follow the normal hard fork process, which requires validators to upgrade their nodes to implement the protocol change.

Summarize

Polkadot, which uses the Wasm meta-protocol, can perform chain upgrades without hard forks. Anything like STF, transaction queue or off-chain can be upgraded without needing to fork the chain.

巴比特
作者文库