# Gasper Consensus: Ethereum's Beating Heart
Table of Contents
Introduced in 2020 and implemented during the “Merge” in 2022, Gasper is the consensus protocol that defines how Ethereum nodes agree on the state of the blockchain. It isn’t a single algorithm but a hybrid construction combining two distinct components: LMD-GHOST and Casper FFG.
While LMD-GHOST handles the short-term task of deciding which “fork” is the head of the chain, Casper FFG provides the long-term “finality” that ensures transactions cannot be reversed without significant economic cost.
LMD-GHOST: The Fork-Choice Rule
LMD-GHOST stands for Latest Message Driven Greedy Heaviest Observed Sub-Tree. Its primary role is to provide probabilistic finality, similar to Nakamoto Consensus, but with a different approach.
Latest Message Driven (LMD): When evaluating the weight of a fork, the protocol only considers the most recent vote (attestation) from each validator. This prevents old votes from influencing the current state.
Greedy Heaviest Observed Sub-Tree (GHOST): Instead of simply counting blocks, the algorithm starts at the “root” (the last finalized block) and moves down the tree by choosing the branch with the most accumulated attestations.
In Fig 1, we see a split, GHOST chooses the fork with the most attestations, which is fork A2. Even if some attestations might not be included in the longest chain as B2 and B3 votes are counted as well even though only one of them will be the longest chain.
Casper FFG: The Finality Gadget
While GHOST keeps the chain moving, Casper the Friendly Finality Gadget (FFG) is what makes Ethereum’s security “hard”. It upgrades the probabilistic finality provided by LMG-GHOST into deterministic finality.
Ethereum works in Epochs (~6.4 minutes) time and subdivides into 32 Slots (12 seconds each). Casper works specifically on the boundaries of these epochs, the block is also known as Checkpoints.
The Two-Step Finalization Process
To achieve finality, a checkpoint block must undergo a two-step voting process involving a supermajority (more than 2/3) of the total staked ETH.
After 1 epoch of voting, the checkpoint block will be considered justified if it achieved supermajority votes from the validators.
Only after the second epoch and another round of voting, that the checkpoint block will be finalized after receiving supermajority votes from the validators.
Once a block is finalized, it is effectively permanent. Reverting a finalized block would require at least 2/3 of all validators to act maliciously.
This is a crucial step to ensure the security of the network, so every validator must vote. Double voting or inactive validators will be slashed. This is where the economic incentives come in.
Why This Hybrid Approach?
This separation of concerns allows Ethereum to remain “lively”. If the network suffers a massive partition and 2/3 of validators cannot communicate, Casper FFG will stop finalizing blocks. However, LMD-GHOST will keep the chain growing.
The chain continues to produce blocks (probabilistic), and once the network partition heals, Casper FFG “catches up” and finalizes the accumulated history.
The Future: Single Slot Finality (SSF)
Currently, it takes 2 epochs (~12.8 minutes) to finalize a block. This is a long time for high-stakes applications. The Ethereum roadmap includes Single Slot Finality, which aims to collapse these two rounds of voting into a single 12-second slot.
This requires significant optimizations in how signatures are aggregated, as every validator (currently over 1 million) would need to vote and have their vote processed within seconds.
Deep Dive Resources
There’s a lot more to Gasper that I did not include here (i.e. BLS signature aggregation, etc.).
Here are some resources to learn more:
- For visual explanation, this Youtube video goes into more depth.
- Original Gasper proposal
- Gasper explanation by ethereum foundation