Blockchain Stories
Published in

Blockchain Stories

Ethereum 2.0: The Beacon Chain

By Sumi Maria Abraham, Research & Training Engineer, Kerala Blockchain Academy

Ethereum 2.0 journey was kickstarted by the Beacon chain launch, termed Phase 0 of the Ethereum 2.0 roadmap. This phase aimed to introduce and test the proof of stake consensus in the Ethereum context.

The consensus mechanism is the heartbeat of any blockchain system. Alterations to the consensus, if not executed in proper, can lead to collapse of the entire system . Understandingly, Ethereum 2.0 upgrade proposed a parallel blockchain which runs on proof of stake: the Beacon chain.

This article discusses how the Beacon chain contributes towards Ethereum 2.0. Let’s have a look.

Beacon chain: What is it?

The Beacon Chain is a blockchain which acts as a consensus engine of Ethereum 2.0, the part that coordinates the entire system. The Beacon chain is designed as a minimal structure which can implement a proof of stake system. It does not process transactions or host the smart contracts. It is intended as the heart of Ethereum 2.0, which replaces the miners or puzzle solvers in Proof of Work with validators who decide the blocks. It stores a registry of validator addresses, the state of each validator, attestations (validator votes), and links to shards. The Ethereum Beacon Chain is named after the randomness beacon, a cryptographic service that provides a public source of random numbers. The beacon chain randomly selects validators for a block based on a pseudorandom process called RANDAO and manages the consensus mechanism.

Role of a validator

One can become a validator by depositing 32 ETH using a specific transaction in the deposit contract in the Ethereum mainnet. Every time a valid deposit occurs, an event is triggered. The beacon chain references this event log. Once the deposit is made and detected by the beacon chain nodes, the validator is activated. The validators are responsible for creating new blocks (block proposer) and voting on a proposed block (committee).

Validators are rewarded for honest behaviour and also penalized for dishonest behaviour. The rewards and penalties are decided based on the specific scenario. Accordingly, each validator’s deposit rises and falls with rewards and penalties.

Validator Lifecycle

A validator is connected to a beacon node to get updates regarding validator assignments. Validators are executed by validator clients that can implement beacon node functionality or make calls into beacon nodes. One validator client can run one or more validators.

Working of Proof of Stake (PoS)

Let us briefly discuss the operation of Ethereum’s PoS protocol Casper FFG in the beacon chain.

Time is divided into epochs, which are further sub-divided into 32 slots of 12 seconds each. Before the start of an epoch, each slot is assigned a validator as a block proposer, and a specific group of validators(minimum 128) called a committee. A validator can only be in one committee per epoch. There can also be more than one committee per slot. All the committees must be of same size.

During each slot, its block proposer will select a block to append to the existing Beacon chain, and the committee will vote to add this to the main chain. These votes are termed attestations and are weighted by the validator’s deposit. The validators broadcast their votes, and a block which gets a two-thirds majority of validator votes is accepted.

The majority is decided based on the weight of deposits rather than the number of validators. 2/3 rd majority refers to set of validators whose total deposit size equals to 2/3 of the total deposit size of that set of validators.

For secure functioning, a minimum validator count of 16,384 is required. Even if an attacker manages to take control over one-third of all 16,384 validator nodes, there is a very low probability (1 in a trillion) that the same attacker could control more than two-thirds of a randomly selected committee of 128 validators.

Only epoch-boundary blocks (checkpoints) can be justified and finalized.Are you looking for a read about block finality, refer Gasper.

Validator Rewards and Penalties

Each validator has its balance — with the initial balance mentioned in the deposit contract. Rewards and penalties are reflected in the validator’s balance over time. Validators are rewarded for proposing or attesting to blocks included in the chain. Block rewards are calculated based on the network’s total amount of ETH staked. Validators also police each other and are rewarded for reporting other validators that make conflicting votes or propose multiple blocks. They can be penalized for being offline and behaving maliciously. In some instances, validators can also be slashed, after which they are further prevented from participating in the protocol and forcibly exited. At every epoch, the network counts the actions of each validator and issues the rewards or penalties appropriately.

How to resolve a Fork?

Forks occur when validators have different information about the system state. It may happen when they miss some messages due to network delays or dishonest validators. A fork-choice rule specifies a law for the validators to follow to decide what the right block should be. The fork-choice rule in Ethereum 2.0 is called the Latest Message Driven Greediest Heaviest Observed SubTree (LMD GHOST). In the event of a fork, the honest chain chosen will have the most attestations (considering only recent votes of validators) and stake.

Why Proof of Stake?

Though Proof of Work helps to maintain the decentralized nature of blockchain, there is a threat of centralization caused due to a small number of miners dominating the Ethereum ecosystem. The high cost of computational resources restricts the miner count, whereas the energy consumption damages the environment. Proof of Stake replaces miners with validators, who stake ether to participate in block creation and claim rewards for that. In PoW, users buy hardware to become miners, whereas, in Ethereum 2.0, users stake ETH to activate and control validators. The staked ethers will remain locked, and if the validators violate any rules, they can also be penalized. This will force them to act honestly. Instead of competing on speed and energy to generate a hash, validators in PoS systems compete on the amount of ether staked (deposit). The PoS system should ensure the validator nodes are sufficiently incentivized to maintain the network’s security. Due to the lesser energy consumption of validators, the rewards do not need to be as high as in PoW.

What’s next?

Phase 0 Beacon chain needs to take care of only its consensus layer. Once shards are in place, the beacon chain will also serve as a medium for cross-shard communication. Every shard will also be assigned block proposer and validator committees at every slot. Apart from the staking information, the beacon chain also stores the information about state changes of shards using cross-links, links on beacon chain blocks which refer to shard blocks.

References

  1. Bashir, I., Mastering Blockchain — Third Edition: “A Deep Dive Into Distributed Ledgers, Consensus Protocols, Smart Contracts, DApps, Cryptocurrencies, Ethereum, and More”.
  2. Andreas M Antonopoulos; Gavin Wood, Dr., “Mastering Ethereum: building smart contracts and DApps”.
  3. V. Buterin and V. Griffith. Casper the friendly finality gadget. CoRR, abs/1710.09437, 2017.
  4. Vitalik Buterin, Diego Hernandez, Thor Kamphefner, Khiem Pham, Zhi Qiao, Danny Ryan, Juhyeok Sin, Ying Wang, and Yan X Zhang. “Combining GHOST and Casper”. In: arXiv:2003.03052 [cs.CR] (2020). URL: https://arxiv.org/abs/2003.03052.
  5. https://launchpad.ethereum.org/
  6. https://ethos.dev/beacon-chain/
  7. https://ethereum.org/en/developers/docs/
  8. Image Courtesy: https://clipart.world, https://www.veryicon.com, https://www.flaticon.com/

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kerala Blockchain Academy

Kerala Blockchain Academy

One-stop solution for quality blockchain education and research. Offers best in class blockchain certification programs in multiple blockchain domains.