The Ultimate Guide to Ethereum 2.0
ETH2’s Road to Launch
Phase 2 – Post Merge Cleanup
Future Features of ETH2’s Roadmap
What’s new with ETH2?
How ETH2 Works
ETH2 At A Glance
Ethereum 2.0 (Eth2 or “Serenity”) is an upgrade to the Ethereum blockchain. The upgrade introduced a proof of stake (PoS) beacon chain. This will run alongside the main Ethereum proof-of-work chain until the two chains are merged in summer 2022.
Proof of stake (PoS) differs in that instead of miners, transaction validators stake crypto for the right to verify a transaction. These validators are selected to propose a block based on how much crypto they hold, and how long they’ve held it.
Eth2 aims to enhance the speed, efficiency, and scalability of the Ethereum network so that it can process more transactions and ease bottlenecks.
Ethereum (ETH1) was designed as the first blockchain that allows programmable smart contracts, using a Proof of Work consensus mechanism. Ever since its launch, ETH1 has experienced knock-on effects from its successful, widespread adoption. As the network grows, so too do fees and energy requirements needed to sustain the blockchain. Ethereum 2.0 (ETH2) is designed to overcome these challenges. The community has acknowledged that radical upgrades would be necessary ever since ETH1’s launch in 2015. Today, the technology is available for ETH1 to enter a new secure, sustainable and scalable era. These upgrades are meant to support the thousands of smart contracts and millions of users that the blockchain currently hosts, making it easier and more valuable for them to do business. ETH2 is a network update composed of many smaller parts required for a successful launch. These are designed to revolutionize the world’s second largest blockchain by market capitalization.
One of the major changes ETH2 ushers in is transitioning the blockchain from Proof of Work (PoW) to Proof of Stake (PoS). This is significant, as it represents a fundamental change from the existing, original consensus mechanism. Proof of Work relies on an external resource for mining, namely electricity, while PoS instead relies on an internal resource, namely users’ stake. In its current form, as ETH1 grows in use, utility and adoption, so too does its environmental impact. Current Proof of Work operations use a lot of electricity, contributing to many natural resources being consumed as a result. ETH2’s new consensus mechanism delivers a more sustainable, eco-friendly foundation on which developers and users can build.
ETH2’s Road to Launch
ETH2 has a number of milestones to reach before it is fully functional. These milestones are phases which build upon each other.
Phase 0 – Beacon Chain
The Beacon Chain is ETH2’s first step towards a PoS future. This Beacon Chain fully supports staking, manages the registry of validators and is the core pillar of the initial phase of ETH2’s roadmap. ETH1’s original Proof of Work mainnet will live in parallel to the Beacon Chain until the Merge, which is the next phase. During this time, the Beacon Chain will be adding blocks via the staking protocol, while the original ETH1 chain continues to mint blocks as usual. Eventually, ETH1 will transition fully to PoS.
The Beacon Chain does not have the same capabilities as ETH1. It does not, for example, support smart contracts. This is because the main goal of the Beacon Chain is to allow validators to get setup with staking, rather than miners. A unidirectional smart contract was setup to help secure the Beacon Chain, by allowing interested ETH holders to send funds to an address with the intention of becoming a validator on this chain. The requirement to participate on the Beacon Chain was a deposit of 32 ETH to the deposit contract. Deposited funds cannot be withdrawn for the time being. The Beacon Chain successfully shipped on 1 December 2020.
Phase 1 – The Merge
The Merge will mean the original ETH1 execution layer is no longer an independent chain. Rather, it will live inside of the Proof of Stake consensus chain (the Beacon Chain). This is an accelerated and simple shift to Proof of Stake. The current original ETH1 execution layer (Proof of Work) will be made almost obsolete in the upcoming Merge. Originally, it was proposed that the ETH1 chain would be a shard of the ETH2 chain. However, this plan was replaced by ETH2 simply absorbing the blocks of the ETH1 chain in order to process ETH1’s transactions, basically removing the need for the PoW miners completely.
Leading up to this transition are a number of hard forks (updates to the network), which lay the groundwork for the the Merge to take place:
ETH1 (Proof of Work)
- Berlin Hard Fork: The Berlin hard fork took place April 2021.
- London Hard Fork: The London hard fork changes how fees work on the ETH1 chain. The core of this update is EIP1559 (Ethereum Improvement Proposal 1559), which will be a radical change to the network. Traditionally, transactions have included a gas fee paid to miners as a charge for processing transactions. In this new Ethereum Improvement Proposal (EIP), the gas costs will be burned, with a tip to miners possible instead. This tip is expected to be predictably low outside of times of surges in demand. This is intended to make payments on the network fairer and improve the user experience.
ETH2 (Proof of Stake)
- Altair Hard Fork: The Altair hard fork is the first Beacon Chain hard fork. This is designed to alter some of the specifics around how validators are penalized and rewarded. For example, the minimum slashing penalty will increase.
These hard forks represent the final updates of the two respective chains on the ETH2 roadmap. Following these updates, the Merge will allow the Beacon Chain to process blocks from ETH1, essentially completing this phase of the roadmap.
Phase 2 – Post Merge Cleanup
The idea of a post-Merge cleanup is that following a minimalistic and simple Merge, there will still need to be updates required to ‘clean up’ the outstanding requirements. For example, validators who deposited 32 ETH to participate in the Beacon Chain will be able to now withdraw funds.
Future Features of ETH2’s Roadmap
ETH2 will look towards sharding as a future network upgrade to process larger volumes of transactions. Achieving this requires more nodes without increasing the size of those nodes in the network. To achieve this, ETH2 hopes to introduce 64 sharded chains to the network. Sharding is the process of splitting a database horizontally to spread the load, commonly seen in traditional areas of computing. For ETH2, sharding will create new chains known as “shards”, which are designed to take the pressure off of the main chain as transactions increase. Think of it as building roads parallel to a main highway in order to speed up the flow of vehicles and reduce congestion on the main road. For sharded chains, validators only need to store and run data for the shard they’re validating rather than the entire network. Sharding is currently not possible in ETH1. Theoretically, it will be possible for ETH2 with sharding to have at a minimum 64 times more throughput.
Scalability overcomes the challenge of servicing all the current dApps and users that ETH1 currently supports. ETH2’s ability to partition the chain into 64 shards will bring unprecedented levels of scalability to the blockchain. This is aimed at accelerating the use of the blockchain, making it truly mainstream.
New Smart Contract System
The current Ethereum Virtual Machine (EVM) which executes ETH1 smart contracts is planned to be upgraded to a new virtual machine called eWASM. This acronym stands for Ethereum WebAssembly, which is based off of WebAssembly code developed by W3C (World Wide Web Consortium). This will provide a new paradigm for smart contracts, as they will be able to be written in a suite of programming languages, all of which can be compiled down to WebAssembly. Each shard will manage this virtual machine, and will support accounts, contracts, state and other abstractions that Solidity (ETH1’s smart contract programming language) hosts. The eWASM builds on the solid foundations that WASM was founded on.
ETH2 hopes to introduce ‘Execution Environments (EEs)’. While the original ETH1 chain is based on an accounts model, EEs within a shard can be built to whatever specifications the developer wants. This means there could be an EE for a UTXO-style chain, a similar structure to the Bitcoin blockchain, or an EE for a Libra-style system. Each shard will have access to all execution environments and be able to transact within them and interface with smart contracts.
What’s new with ETH2?
ETH2 introduces many new and exciting features not seen in the original chain. These new updates bring unique advantages to the Ethereum ecosystem. In this section, we’ll explore the key features of ETH2 which set it apart from the original chain.
ETH’s original Proof of Work favoured miners with access to the best mining equipment and access to the cheapest power. Over time, this increasingly narrows down the potential candidates who can participate in block production. ETH2 is radically more egalitarian than ETH1, as anyone with a stake in the network can participate in consensus. While the minimum of 32 ETH to become a validator on the Beacon Chain remains a relatively high barrier to entry, it will be possible in the future to participate in consensus simply by holding the native token and collaborating with others to make up the difference required to meet this requirement. ETH2’s egalitarian nature levels the playing field for participants regardless of their access to state-of-the-art mining equipment or proximity to affordable energy sources.
In today’s ETH1 ecosystem, holding ETH tokens is holding an asset that dilutes as more are minted and added to the network. This dilutionary effect would be mitigated if holders could participate in the staking process. Entities such as institutions or exchanges could return staking rewards to holders by pooling individual holders’ resources together to act as validators on their behalf. This would allow individuals to be rewarded with a portion of block rewards, keeping up with the overall inflation as new tokens are added to circulation.
How ETH2 Works
Who’s involved, what do they do, how do they do it?
(Info Source: Ethos.dev)
Validators in ETH2 are the equivalent of miners in the original ETH1 blockchain. Rather than using expensive mining equipment, they execute validator clients that make use of a beacon node. Such a node has the ability to follow and read the Beacon Chain, which is ETH2’s backbone. This client can implement beacon node functionality or make calls into beacon nodes. Validators are actively involved in the consensus of ETH2. They are selected to carry out vital functions necessary for the health of the chain. The first important role a validator may play is that of proposer. A proposer is pseudo randomly selected to propose the next block in the chain. Validators can also be attesters, those who vote on beacon blocks and shard blocks. Such votes are recorded in the main Beacon Chain. The more votes that a block receives, the higher the security guarantees. This vote is weighted by the validator’s balance and votes are broadcast by validators in addition to blocks. The requirement for becoming a validator is 32 ETH.
Validators are divided into committees at each epoch in both the Beacon Chain and each shard. A slot is the 12 second frame of opportunity for a block to be added to the beacon chain or shards. It is the smallest unit of time in ETH2’s blockchain, with 32 slots comprising an epoch. Each epoch lasts 6.4 minutes. A validator can only be in one committee per epoch. A committee comprises a minimum of 128 validators. At every epoch, validators are evenly distributed across committees and then subdivided across slots within that committee’s remit that epoch.
The validators in a committee are tasked with creating attestations, to vote on beacon blocks and shard blocks, or to aggregate bundles of attestations. These votes are then propagated through the network and reach the other validators. Every epoch a source of randomness called RANDAO is used to shuffle validators into committees and to allocate proposer and attester duties. These proposers are selected proportionally to their stake (up to a maximum balance of 32 ETH), meaning the greater stake a validator controls, the higher their likelihood of being elected.
A beacon committee is pseudo randomly assigned an ETH2 shard to crosslink into a beacon block. As mentioned earlier, ETH2 will eventaully introduce sharding as a way of improving the network’s scalability. Crosslinking tethers each sharded chain to the Beacon Chain. It is how the Beacon Chain follows the head of a shard chain. In order for the transactions of an ETH2 shard to be recorded in the main Beacon Chain, each Beacon Block can contain 64 links – one for every sharded chain in the system. The committee responsible for crosslinking a shard block changes on a slot-by-slot basis. At every epoch, validators are evenly divided across slots and then subdivided into committees of appropriate size. All of the validators from that slot attest to the Beacon Chain head.
The two consensus mechanisms validators participate in are LMD Ghost and Casper FFG. Attesters’ LMD Ghost votes determine the head of the Beacon Chain, and the heads of shards. While casting an LMD Ghost vote, a validator also votes for the checkpoint of a current epoch, called the target. This vote is the Casper FFG vote, which achieves finality on the network. This means that the majority of validators agree on the state of the network up until this point. For this to be achieved, two-thirds of the total balance of all active validators must vote on a checkpoint. A checkpoint is a block in the first slot of an epoch. There is always one checkpoint per epoch.
Validators are rewarded for performing their duties on the ETH2 network.
Proposers (those validators selected randomly to propose the next block in the blockchain) are given a sizeable reward when their block is finalized. Consistently being online and performing well earns validators a ~⅛ boost to their total rewards for proposing blocks with new attestations. Proposers also receive a small reward for adding slashing evidence in a block.
In summary, there are three ways proposers are rewarded:
- Adding a proof to a block from a whistleblower that results in a validator being slashed.
- Adding new attestations from other validators.
- Tips: As part of EIP1559, senders of a transaction can include a tip. The tip has two functions. First, if there are far more transactions than expected, miners will include transactions with higher tips first. Second, it compensates miners for uncle risk (the increased risk their block will not be included in the main chain because adding one more transaction will slow it down).
Attestations are votes of confidence that show a validator agrees with a decision in ETH2. This means validators will receive rewards for making attestations (LMD Ghost and FFG votes) that the majority of other validators agree with. Phase 1 of ETH2 allocates rewards for crosslinks. Finalized block attestations are worth more. There are five different ways that attesters can be rewarded:
- Getting your attestation on-chain
- Agreeing with other validators about the history of the chain
- Agreeing with others about the head of the chain
- Getting your attestation on chain quickly
- Pointing to the correct block in the assigned shard
Reward Issuance Rates
Reward issuance rates are determined by the total amount of ETH staked and the average percentage of validators who are online. Rewards are transferred to validators every epoch.
ETH1’s founder Vitalik Buterin has outlined the issuance figures for ETH2 rewards given the level of validator participation in the network.
|ETH validating||Max annual issuance||Max annual return rate|
These rates of issuance will depend on a number of factors, as outlined by Vitalik Buterin.
ETH2 At A Glance
|Network type||Pure Proof of Stake|
|APR||Variable from 1.82% to 18.10% depending on level of validator participation – see diagram below.|
|Reward Distribution||Every ~6 minutes (approx 1 epoch)|
|Unbonding||The Beacon Chain deactivates (“forced exit”) all validators whose balance reaches 16 ETH; stakers will be able to withdraw any remaining validator balance but not in ETH2 Phase 0.
Validators can also “voluntary exit” after serving for 2,048 epochs, around 9 days.
In any voluntary or forced exit, there is a delay of four epochs before stakers can withdraw their stake. Within the four epochs, a validator can still be caught and slashed. An honest validator’s balance is withdrawable in around 27 hours. But a slashed validator incurs a delay of 8,192 epochs (approximately 36 days).
|Number of Validators||+140,000 active validators currently on the Beacon Chain as of May 2021|
The above graph highlights the variability of rewards issued on ETH2’s network as more validators become active.
ETH2 uses a blend of two mechanisms to decide which blocks are at the head of a chain, as well as which blocks are and are not included in the chain.
- Latest Message Driven Greedy Heaviest Observed Sub Tree (LMD-GHOST).
This is responsible for adding new blocks and deciding which blocks should be at the head of the chain. The idea behind LMD-GHOST is that when calculating the head of the chain, one only considers the latest vote made by each validator, and not any of the votes made in the past. This allows for rapid computation.
- Casper, the Friendly Finality Gadget (Casper FFG)
This is a variation to a Practical Byzantine Fault Tolerant (PBFT) consensus mechanism. It is responsible for finalizing blocks in the ETH2 network. Casper doesn’t finalize slots, but rather finalizes every epoch. Thirty two slots comprise an epoch.
Consensus within eth2 relies on both LMD-GHOST – which adds new blocks and decides what the head of the chain is – and Casper FFG which makes the final decision on which blocks are and are not a part of the chain.
Validators on the network are subject to slashing. Slashing’s goal is to make it prohibitively expensive to attack ETH2, and to penalize validators for not performing their duties well in consensus. Behaving maliciously contributes to the likelihood of slashing. Slashing takes place when validators act against the best interest of the blockchain, and as such a portion of their stake is destroyed. Being offline causes an offline penalty, which doesn’t result in slashing.
A validator has their own balance, with penalties and rewards being reflected in this balance over time. Validators are penalized for not attesting or attesting to blocks not finalized. Penalties and rewards are issued roughly every six minutes, which is an epoch of time in ETH2. Within each epoch the network judges a validator’s actions and issues rewards or penalties in line with this. The three types of offences are as follows:
This is where a proposer proposes more than one block for an assigned slot.
FFG Surround Vote
This is a vote with source and target surrounding or surrounded by a previously made vote. This means walking back on what a validator said was finalized in a previous attestation. It is not possible to walk back on something a validator has committed to.
This is where a validator casts two FFG votes for two targets during the same epoch. This is to prevent double votes, so validators vote for one chain rather than multiple forks.
Slashing penalties range from over 0.5 ETH to a validator’s entire stake. Honest validators cannot be slashed by other validators. ETH2 will increase the slashing penalty which will result in 1 ETH removed and for 36 days you must stay online and attest, but will lose money for those 36 days. Half way through the 36 days, the protocol counts up the amount of validators who have also been slashed. The more people who have been slashed, the higher the extra penalty. Network attacks which are coordinated result in large penalties across actors in the network, whereas single, uncorrelated slashing incidents are punished less harshly.