图解ETHPoS共识机制Gasper:合并后的以太坊是如何工作的?

区块律动Published on 2022-10-14Last updated on 2022-10-14

Abstract

众所周知, PoS 以太坊的共识协议是「Gasper」,它是在 LMD-GHOST( 分叉 选择规则)之上应用 Casper FFG(最终性确定工具)构建的。

众所周知, PoS 以太坊的共识协议是「Gasper」,它是在 LMD-GHOST( 分叉 选择规则)之上应用 Casper FFG(最终性确定工具)构建的。所以要想搞清楚完整的以太坊共识协议,就必须了解这两个部分(Casper + Ghost)。此外,这些设计真的很有趣。我打算梳理一下这两个协议的背景和演进,以及它们简单的工作流程。

PoS 共识算法的三大流派如下:

1.Nakamoto-inspired(Peercoin)

2.PBFT-inspired(Tendermint、Casper FFG)

3.CBC Casper

Nakamoto-inspired PoS 是一种基于链的算法,模拟在 PoW 中挖矿。它通过伪随机选择验证者来创建新区块。其在 2012 年的「Peercoin」论文中首次提出,peercoin 是基于权益证明共识的第一个加密货币。

PBFT-inspired(即 BFT-style)PoS 基于多年对拜占庭容错(尤其是 pBFT)的研究。在 2014 年的「Tendermint」论文中首次提出。一般来说,这些算法会选择一个代表账本规范交易的唯一链。

Casper 直接继承了 BFT 算法(更精确的是 pBFT),做了一些修改。CBC Casper 是由 @VladZamfir 提出的,有一些很好的资料可以更充分地解释它。

V 神的 CBC Casper 教程

VladZamfir 写的 CBC Casper 历史

CBC Casper 介绍视频

虽然以太坊最终选择了 Casper FFG 而不是 CBC Casper,但对 CBC Casper 的研究也很有价值,比如满足以太坊需求的分叉选择规则「LMD-GHOST」。Casper FFG 由 V 神和 Virgil Griffith在 2017 年提出,引入了 justification 和 finalization 的概念,并引入了 slashing conditions 和动态验证者机制,这些都是非常重要的特性。

Casper FFG 用于保证「最终性」(也就是安全性),这在 PoW 中是不存在的。简单来说,每个验证者都会对检查点进行投票,经过两轮投票后,检查点将被「最终确定」(第一轮为验证,第二轮为最终确定)。

所有最终确定的检查点都成为规范链(区块链历史的一部分),所有忠诚节点都同意他们永远不会逆转这条链。「最终检查点」之后的区块可以随意分叉,但之前的区块不允许分叉。

Casper FFG 除了通过「最终性」来保证区块链安全外,还引入了 slashing 条件来惩罚所有违反规则的验证者(这在传统 BFT 算法中是做不到的),所有违反规则的验证者都将被跟踪和惩罚。

除此之外,Casper FFG 是无需许可的(传统的 BFT 算法是需要许可认证的),pBFT 通过一个列表来维护共识,只有列表中的人才能成为参与者。Casper FFG 构建了动态验证者机制,所有验证者可以自由进出。Casper FFG 用于保证「最终性」和「安全性」,负责确认区块的最终状态,但不负责创建新区块,所以它需要底层区块链和分叉选择规则。

以太坊使用的分叉选择规则是基于 GHOST,该规则最早在2013 年的一篇论文中提出。2017 年,@VladZamfir 在 CBC Casper 工作时,他尝试将 GHOST 与 Casper 结合,产生了一个变种「LMD-GHOST」。

区块链允许分叉,当出现不同的分支时,应该选择哪条链继续添加后续新区块,需要分叉选择规则。PoW 使用的是最长链规则。思路是锻造最长的链需要最多的算力,所以这条链是最可信的。所以当所有矿工添加新区块时,他们会默认在最长的链上添加。

GHOST 的思路与此类似,其选择票数最多的链而不是高度最长的链,LMD-GHOST 做了一些修改,只考虑最近的投票(即所谓的「Least Message Driven」,LMD)。

LMD-GHOST 的规则很简单:

- 从创世区块开始;

- 每次有分叉,选择票数多的分支;

- 重复,直至找到 block leaf;

- 返回链的头部;

这是 Casper FFG 和 LMD-GHOST 的演变以及它们如何工作,它们共同保证「安全」+「活性」。LMD-GHOST 允许提议者随时创建新区块,新区块将按照分叉选择规则(即活跃度)添加到权重最大的链上。虽然 Casper FFG 将根据所有验证者的投票(两轮,超过 2/3,按存款)最终确定一个规范链。所有忠诚节点默认接受规范链,从而获得安全。

共识真的很有意思,以太坊对 PoS 的研究始于 2014 年,2022 年完成了合并。这是一条漫长而曲折的道路,过程中诞生了许多奇妙的想法、设计和工程。

Trending Cryptos

Related Reads

Chip Stocks Lead U.S. Market Decline: Is AI Trading Being Hit by Both Interest Rates and Returns?

Chip stocks led a broad decline in US markets, with the Nasdaq dropping 2.2% and the S&P 500 falling 1.4%. This selloff reflects a dual challenge for the once-high-flying AI hardware trade: rising interest rate expectations and growing investor impatience for clear returns from massive AI capital expenditures. The pressure was most acute on hardware leaders. Nvidia fell about 4%, dipping below a $5 trillion market cap, while Micron plunged 13.2% ahead of its earnings report. Declines across memory, storage, AI, and mobile chips indicated a sector-wide retreat. The selloff spread globally, with South Korea's KOSPI index dropping nearly 10% as key suppliers SK Hynix and Samsung recorded double-digit losses. Investors appeared to be taking profits from the most crowded trades first. Macro headwinds intensified as market expectations shifted toward a more aggressive Federal Reserve. Forecasts for multiple rate hikes in 2026 pressured high-valuation tech stocks, which rely on long-term growth projections that become less attractive as discount rates rise. Concurrently, investors are scrutinizing the profit potential of the immense AI spending by cloud giants like Alphabet, Amazon, and Meta. While these expenditures drive demand for chips and hardware, the market is now questioning whether AI services will generate sufficient returns to justify the ongoing costs. This adjustment is not necessarily a bubble burst but a recalibration. AI demand fundamentals remain, but the narrative of endless growth can no longer fully offset concerns over higher interest rates and a longer path to profitability. Near-term direction may hinge on Micron's upcoming earnings guidance and incoming inflation data, which will influence both the AI demand outlook and the Fed's policy path. The market is transitioning from blindly buying growth to demanding clearer visibility on returns.

marsbit48m ago

Chip Stocks Lead U.S. Market Decline: Is AI Trading Being Hit by Both Interest Rates and Returns?

marsbit48m ago

OpenAI's New Paper: How to Train an AI that "Doesn't Deteriorate Under Pressure"?

OpenAI's new paper "Reinforcement Learning Towards Broadly and Persistently Beneficial Models" explores training AI to maintain safe, helpful, and honest behavior even under pressure, in unseen scenarios, or after being fine-tuned for harmful purposes. Moving beyond simple rule-based "don'ts," the research focuses on cultivating "beneficial traits" like honesty, risk-awareness, corrigibility, and transparency. It investigates if reinforcement learning (RL), often prone to "reward hacking" where models exploit loopholes, can instead be used to instill robust, generalized positive behaviors. Researchers created a multi-domain synthetic dialogue dataset covering areas like healthcare and law. They trained a model by replacing 5% of standard RL data with "beneficial trait" data. This model outperformed the baseline in 83% of 53 evaluations, showing average gains of 9.1% in alignment, safety, and helpfulness. Crucially, improvements generalized: a model trained only on healthcare "good behavior" data also performed better in 17 out of 19 non-healthcare alignment tests. The paper also tests "alignment persistence." When subjected to adversarial prompts or harmful fine-tuning, the beneficial trait model showed greater resilience, with smaller performance drops and less "spillover" of bad behavior to unrelated tasks. While not a complete solution, this work suggests a shift from post-hoc correction to proactively shaping robust, principled AI behavior, a critical step for deploying models in high-stakes, complex decision-making scenarios.

marsbit51m ago

OpenAI's New Paper: How to Train an AI that "Doesn't Deteriorate Under Pressure"?

marsbit51m ago

Semiconductor Stock Rebound: Is the Technical Correction Over or a Trend Reversal?

The core of recent semiconductor stock volatility is not about daily price swings, but rather the market questioning whether AI-driven semiconductor pricing has entered a new phase. Following a sharp sell-off in Korean stocks on June 23rd, led by Samsung and SK Hynix, a subsequent rebound is seen more as a technical positioning adjustment rather than a confirmed trend reversal. The key variable is HBM (High Bandwidth Memory), essential for AI chips. Its supply-demand imbalance granted memory makers significant pricing power. The current market focus is on whether this dynamic remains strong enough to justify elevated valuations. All eyes are on Micron's upcoming earnings report. The critical factor is not whether results meet already high expectations, but whether the company's guidance confirms that AI memory pricing power, order visibility, and future margins are still expanding. Micron's outlook will serve as a crucial test for the broader AI semiconductor chain, including Samsung, SK Hynix, and other infrastructure players. The recent bounce appears to be a pre-earnings positioning repair. For it to evolve into a sustained uptrend, concrete evidence is needed that the AI infrastructure expansion cycle's fundamentals—particularly for high-end memory—remain robust and can continue to surpass elevated market expectations. The risk is that strong demand alone may not be sufficient if future guidance hints at peaking momentum or increasing supply-side pressures.

marsbit1h ago

Semiconductor Stock Rebound: Is the Technical Correction Over or a Trend Reversal?

marsbit1h ago

Trading

Spot
Futures

Hot Articles

How to Buy CSPR

Welcome to HTX.com! We've made purchasing Casper (CSPR) simple and convenient. Follow our step-by-step guide to embark on your crypto journey.Step 1: Create Your HTX AccountUse your email or phone number to sign up for a free account on HTX. Experience a hassle-free registration journey and unlock all features.Get My AccountStep 2: Go to Buy Crypto and Choose Your Payment MethodCredit/Debit Card: Use your Visa or Mastercard to buy Casper (CSPR) instantly.Balance: Use funds from your HTX account balance to trade seamlessly.Third Parties: We've added popular payment methods such as Google Pay and Apple Pay to enhance convenience.P2P: Trade directly with other users on HTX.Over-the-Counter (OTC): We offer tailor-made services and competitive exchange rates for traders.Step 3: Store Your Casper (CSPR)After purchasing your Casper (CSPR), store it in your HTX account. Alternatively, you can send it elsewhere via blockchain transfer or use it to trade other cryptocurrencies.Step 4: Trade Casper (CSPR)Easily trade Casper (CSPR) on HTX's spot market. Simply access your account, select your trading pair, execute your trades, and monitor in real-time. We offer a user-friendly experience for both beginners and seasoned traders.

1.9k Total ViewsPublished 2024.03.29Updated 2026.06.02

How to Buy CSPR

What is CASPER

Vitalik's Casper: A Comprehensive Overview Introduction In the ever-evolving landscape of blockchain technology, consensus protocols play a crucial role in maintaining the integrity and security of decentralized networks. Vitalik's Casper, a pioneering proof-of-stake (PoS) consensus mechanism, is specifically designed for the Ethereum network. This innovative project represents a monumental shift from Ethereum's current proof-of-work (PoW) approach to a more energy-efficient and scalable model. As the crypto industry continues to grow, understanding the nuances and implications of Casper becomes increasingly vital for stakeholders, developers, and enthusiasts alike. What is Vitalik's Casper? Vitalik's Casper serves as a transformative variant of traditional PoS protocols. The primary objective of this project is to enhance the network's overall security and scalability while addressing inherent limitations commonly found in earlier PoS systems. At its core, Casper leverages a security deposit system that requires validators—participants responsible for confirming transactions and creating new blocks—to stake a certain amount of cryptocurrency. This deposit not only incentivizes good behavior but also establishes a penalty mechanism for validators exhibiting malicious conduct. In essence, Casper seeks to provide a reliable framework that fortifies the Ethereum ecosystem against potential threats and attacks while supporting the growing demand for network efficiency and scalability. Who is the Creator of Vitalik's Casper? Vitalik Buterin, a visionary in the world of blockchain, is credited as the creator of Vitalik's Casper. Buterin co-founded Ethereum in 2015 and has continuously driven the project’s development and evolution. His commitment to enhancing the Ethereum ecosystem and addressing its challenges culminated in the introduction of Casper, which aims to revolutionize the consensus mechanism in blockchain technology. Who Are the Investors of Vitalik's Casper? While specific information on individual investors backing Vitalik's Casper is not publicly available, the project is comprehensively supported by the Ethereum Foundation and the broader Ethereum community. The foundation plays a pivotal role in funding and advancing projects that improve Ethereum, and its backing of Casper highlights the importance of this protocol in the future of the network. Furthermore, various developers and stakeholders within the Ethereum ecosystem actively contribute to and advocate for the continued growth and implementation of Casper. How Does Vitalik's Casper Work? Vitalik's Casper operates through a sophisticated mechanism designed to facilitate smoother and more secure consensus within the Ethereum network. Key features that distinguish Casper from traditional consensus protocols include: Security Deposit System One of the hallmark features of Casper is its security deposit requirement for validators. To participate in the consensus process, validators must stake a certain amount of cryptocurrency, thereby ensuring their financial commitment to the network. This system deters malicious behavior, as any validator caught acting dishonestly risks losing their staked assets. Voting System Casper incorporates a voting mechanism where validators collaborate to finalize blocks on the blockchain. Each validator proposes and votes on blocks, contributing to the overall decision-making process. This democratic element fosters a decentralized approach to consensus, enhancing security and network stability. Penalty System The protocol's penalty system serves as a crucial deterrent against unethical validator behavior. Should a validator act maliciously or fail to participate in the consensus process adequately, they can be penalized by losing a portion—or in some cases, all—of their staked assets. This punitive measure reinforces the accountability of validators and upholds the integrity of the network. Hybrid Consensus By employing a hybrid consensus model, Casper smartly combines elements from both PoW and PoS mechanisms. This unique structure promotes a gradual transition from Ethereum's existing PoW model to a fully-fledged PoS system, allowing the network to evolve without compromising security during the changeover. Timeline of Vitalik's Casper The journey of Vitalik's Casper has been marked by significant milestones critical to its evolution. Here’s a brief timeline highlighting key events in its history: 2017: The conceptual framework of Casper was first articulated by Vitalik Buterin as a potential solution to Ethereum's scalability challenges. 2018: The first iteration of Casper was released on GitHub, marking the initial steps toward transitioning Ethereum to a PoS model. 2020: The launch of the Beacon Chain, a foundational blockchain for the Ethereum 2.0 ecosystem, occurred. This footstep marked the commencement of a multi-phased transition to the Casper protocol. Ongoing: The transition to Casper remains a continuous effort, with a series of phases developed to ensure the effective implementation of the new consensus mechanism. Key Features of Vitalik's Casper Vitalik's Casper boasts several distinguishing features that contribute to its viability and innovation within the blockchain landscape, including: Security Deposit System: Validators must stake a deposit, enhancing their commitment to network integrity. Voting System: A collaborative approach to block finalization promotes decentralized decision-making. Penalty System: Deters malicious activities through financial penalties, ensuring network stability and security. Hybrid Consensus: The blend of PoW and PoS elements facilitates a slower transition to PoS without abrupt disruptions to the network. Conclusion Vitalik's Casper represents a significant advancement in Ethereum's ongoing evolution. By introducing a secure and scalable consensus mechanism, Casper aims to address the inherent limitations of traditional PoS systems and enhance the overall functionality of the Ethereum network. The project’s emphasis on security, accountability, and innovation positions it as a critical component of Ethereum's future. Understanding Vitalik's Casper is essential not only for developers and investors within the crypto space but also for those interested in the broader implications of blockchain technology. As the Ethereum ecosystem continues its transformative journey towards scalability and efficiency, Casper stands at the forefront of this revolution, promising to reshape the landscape of decentralized consensus in the years to come.

693 Total ViewsPublished 2024.08.25Updated 2024.12.03

What is CASPER

Discussions

Welcome to the HTX Community. Here, you can stay informed about the latest platform developments and gain access to professional market insights. Users' opinions on the price of CSPR (CSPR) are presented below.

活动图片