Risk Warning: Beware of illegal fundraising in the name of 'virtual currency' and 'blockchain'. — Five departments including the Banking and Insurance Regulatory Commission
Information
Discover
Search
Login
简中
繁中
English
日本語
한국어
ภาษาไทย
Tiếng Việt
BTC
ETH
HTX
SOL
BNB
View Market
Detailed explanation of Ethereum PoS consensus Gasper: How does Ethereum work now?
区块律动BlockBeats
特邀专栏作者
2022-10-13 13:40
This article is about 1880 words, reading the full article takes about 3 minutes
Introduction to the underlying mechanism of Ethereum PoS consensus

Original author: @LuozhuZhang

Original compilation: 0x711, BlockBeats

As we all know,The consensus protocol of PoS Ethereum is "Gasper", which is built applying Casper FFG (Finality Tool) on top of LMD-GHOST (Fork Choice Rules). So if you want to understand the complete Ethereum consensus protocol, you must understand these two parts (Casper + Ghost). Plus, the designs are really fun. I intend to sort out the background and evolution of these two protocols, as well as their simple workflow.

The three schools of PoS consensus algorithms are as follows:

1.Nakamoto-inspired(Peercoin)

2.PBFT-inspired(Tendermint、Casper FFG)

3.CBC Casper

Nakamoto-inspired PoS is a chain-based algorithm that simulates mining in PoW. It creates new blocks by pseudo-randomly selecting validators. its in 2012"Peercoin" PaperFirst proposed in , peercoin is the first cryptocurrency based on the proof-of-stake consensus.

PBFT-inspired (that is, BFT-style) PoS is based on years of research on Byzantine fault tolerance (especially pBFT). in 2014"Tendermint" paperfirst proposed in . Generally, these algorithms select a unique chain that represents canonical transactions on the ledger.

Casper directly inherits the BFT algorithm (more precisely, pBFT) with some modifications. CBC Casper was proposed by @VladZamfir and there is some good material that explains it more fully.

V god's CBC Casper tutorial

History of CBC Casper by VladZamfir

CBC Casper Introduction Video

Although Ethereum finally chose Casper FFG instead of CBC Casper, the research on CBC Casper is also valuable, such as the fork selection rule "LMD-GHOST" that meets Ethereum's needs. Casper FFG by V God and Virgil Griffithpresented in 2017, introduces the concepts of justification and finalization, and introduces slashing conditions and dynamic verifier mechanism, which are very important features.

Casper FFG is used to guarantee "finality" (that is, security), which does not exist in PoW. In simple terms, each validator votes on the checkpoint, and after two rounds of voting, the checkpoint is "finalized" (the first round is validating, the second round is finalizing).

All finalized checkpoints become the canonical chain (part of the blockchain history), and all loyal nodes agree that they will never reverse this chain. Blocks after the "final checkpoint" can be forked at will, but previous blocks are not allowed to fork.

In addition to ensuring blockchain security through "finality", Casper FFG also introduces slashing conditions to punish all verifiers who violate the rules (this cannot be done in traditional BFT algorithms), and all verifiers who violate the rules are will be tracked and punished.

In addition, Casper FFG is license-free (traditional BFT algorithms require license authentication), pBFT maintains consensus through a list, and only those in the list can become participants. Casper FFG has built a dynamic validator mechanism, and all validators can enter and exit freely. Casper FFG is used to ensure "finality" and "safety". It is responsible for confirming the final state of blocks, but not responsible for creating new blocks, so it requires the underlying blockchain and fork selection rules.

The fork selection rule used by Ethereum is based on GHOST, which was first published inA paper from 2013proposed in. In 2017, when @VladZamfir was working on CBC Casper, he tried to combine GHOST with Casper, resulting in a variant "LMD-GHOST".

The blockchain allows forks. When different branches appear, which chain should be selected to continue adding subsequent new blocks requires fork selection rules. PoW uses the longest chain rule. The idea is that forging the longest chain requires the most computing power, so this chain is the most reliable. So when all miners add a new block, they will add it on the longest chain by default.

The idea of ​​GHOST is similar to this. It chooses the chain with the most votes instead of the chain with the longest height. LMD-GHOST has made some modifications and only considers the most recent vote (the so-called "Least Message Driven", LMD).

Rules for LMD-GHOSTIt's simple:

- from the genesis block;

- Every time there is a fork, choose the branch with the most votes;

- Repeat until a block leaf is found;

- returns the head of the chain;

This is the evolution of Casper FFG and LMD-GHOST and how they work, they work together to ensure "safety" + "liveness". LMD-GHOST allows the proposer to create a new block at any time, and the new block will be added to the chain with the largest weight according to the fork selection rule (ie, activity). While Casper FFG will finalize a canonical chain based on the votes of all validators (two rounds, more than 2/3, by deposit). All loyal nodes accept the canonical chain by default, thus gaining security.

Consensus is really interesting,Ethereum’s research on PoS began in 2014Original link

Original link

ETH
PoS
Welcome to Join Odaily Official Community