The art of Ethereum 2.0, Serenity of ETH

Rui S.
7 min readFeb 14, 2023

Author Rui, blockchain gal, web3 founder.
Twitter: @popolandRuii

Proof of Work is a brutal waste of computing power-like democracy. R.I.P.

Takeaways 🍦:

  • The Ethereum launch process
  • Why do we need to replace PoW with PoS?
  • What is the mechanism of PoS?
  • What are the rewards and penalties for PoS?
  • PoS rewards, penalties, and slashing
  • Emergency status: Inactivity Leak

The Ethereum Launch Process:

There’re four main steps of the Ethereum launch process: Frontier, Homestead, Metropolis, and Serenity. From the very barest form, to develop a more functional, secure, user-friendly, scalable, and sustainable network.

  • Step One “Frontier”, the barest form acts as the first step towards creating a functional decentralized platform in Jul.2015
    It was a command line interface(CLI) and the main use is getting mining operations and Ether exchanges running. The biggest rewards also have a substantial risk to the ecosystem. When people run Ether, the Frontier block reward is 5 Ether per block. The Frontier network will be shut down once ready for the homestead, and Ether values in wallets will be transferred.
  • Step two “Homestead” marked the transition from a test network to a stable production-ready platform, in Mar. 2016.
    Key features include a new virtual machine(EVM) that made the network more secure and allowed for the deployment of more complex smart contracts. More user-friendly graphical user interface(GUI) that made it easier for users and developers to interact with
  • Step three “Metropolis” is a relatively full-featured user interface for non-tech users introduced the secure, scalable, and user-friendly improvement in Sep. 2017
    -
    The Metropolis phase consisted of two major upgrades: Byzantium and Constantinople.
    -
    Byzantium introduced security and performance enhancements to the Ethereum network, including several new opcodes(instructions used in smart contracts), smart contract privacy, and security improvements, and zk-SNARKs, a zero-knowledge proof system that allows for more private transactions on Eth.
    - Constantinople(Feb. 2019) changed the way transactions were processed, the introduction of a new pricing model for smart contract execution, and improvements to the network’s scalability.
  • Step four “Serenity”, Ethereum 2.0 addresses scalability, security, and sustainability issues faced by the infamous Proof of stake.
    Introduce the PoS consensus algorithm that replaces the current PoW algorithm.

As we could see, Ethereum now is entering the Serenity phase: to replace the PoW with the PoS network. But why do we need to introduce a new consensus to the chain?

Why do we need to replace PoW with PoS?

Proof of Work(PoW) is a consensus algorithm used in blockchain networks to secure the network and validate transactions.

To be short about how PoW works:

  1. Transactions sent by users are broadcast to the network.
  2. Miners compete to validate the block by solving a cryptographic puzzle
  3. The first miner to solve the puzzle is able to validate the block and add it to the blockchain
  4. Other nodes verify the block, add the block to the blockchain and the transactions contained within the block are considered validated.
  5. The miner is rewarded with a block reward(2E a block) and also the transaction fee( gas fee).

The intention of PoW was to create a way to address the problem of double-spending in digital currencies. The competition and broadcast system in PoW makes it difficult for any single node to manipulate the network, but it requires a large amount of computational power and implies the inefficient conversion of electricity into heat just to validate multiple blocks in a row.

While Proof-of-Stake(PoS) used a different approach, instead of having high-performance computing power, people just need to “stake” their ETH to become a validator and staked ETH then acts as collateral that can be destroyed if the validator behaves dishonestly or lazilyAnd several advantages of PoS we could tell from the comparison with PoW.

  1. Energy consumption:
    The energy consumption of Ethereum under the PoS proof of rights mechanism is 99.5% lower than that of the PoW workload proof mechanism (pos is 112TWh/year).
  2. Scalability problem:
    PoS can theoretically reach 100,000 TPS combined with Layer 2 Rollup after the fragmentation chain starts, and the TPS under the PoW workload proof mechanism is 15–17, and the gas war caused by network congestion occurs.
  3. Security issues:
    The existence of the PoW mining pool makes the Ethereum computing power tend to be centralized, and the attack cost is reflected in the accumulation of equipment and computing power. Once more than 51% of the computing power is mastered, a “51% attack” can occur and the agreement cannot be suppressed by itself; the attack cost of PoS is converted to purchase a large amount of ETH pledge, and the protocol can also confiscate assets for malicious attack nodes when investing assets. The introduction of shard chains by pos makes it almost impossible for verifiers to attack the network by attacking a specific shard. Sharding allows people to use laptops and mobile phones to run shards, encouraging more people to become verifiers, increasing centralization, and reducing the attack surface.
  4. Entry barriers:
    PoS reduced hardware requirements, there’s no need for elite hardware to stand a chance of creating new blocks, and people can simply use their laptops to conduct validation.
  5. Public chain competition:
    The TVL market share of Ethereum is declining, and expansion is necessary to maintain its dominance.

What is the mechanism of PoS?

About Validators:

  • Responsibility: There are two primary roles for a validator:
    1) checking new blocks and “attesting” to them if they are valid;
    2) proposing new blocks when selected at random from the total validator pool.
  • Standard: People need to at least stake 32 Ethereum to become a validator while setting up your own staking infrastructure can be complicated, and also 32 ETH is not a small amount of money. However, except for independent stake, you can choose Stake-as-Service(Avoid complex infra setting), co-stake(use a small amount of money to participate), or use exchanges to stake.
  • On depositing ETH, the user joins an activation queue that limits the rate of new validators joining the network.

How does PoS generate blocks?
1. Generate transaction: A user creates and signs a transaction with their private key using a wallet or library, and defines the amount of gas they prepared to encourage the validator to include the transaction in a block.

2. Transaction validation: The transaction is submitted to the Ethereum execution client to verify the sender has enough ETH and signed it with the correct key.

3. Pending and broadcast: execution client adds a valid transaction into its local mempool(list of pending transactions) and broadcasts it over the execution layer gossip network, when other nodes hear about the transaction they add it to their local mempool too.

4. Execute and validation: a node will be selected pseudo-randomly using RANDAO as the block proposer for the current slot, and the node is responsible for building and broadcasting the next block to be added to the Ethereum blockchain and updating the global state.
- The node is made up of three parts: an execution client, a consensus client, and a validator client.
- The execution client bundles transactions from the local mempool into an “execution payload” and executes them locally to generate a state change.
- This information is passed to the consensus client where the execution payload is wrapped as part of a “beacon block” that also contains information about rewards, penalties, slashings, attestations etc that enable the network to agree on the sequence of blocks at the head of the chain.

5. Broadcast: Other nodes receive the new beacon block on the consensus layer gossip network, and they pass it to their execution client where the transactions are re-executed locally to ensure the proposed state change is valid.

6. Finalization: Checkpoints occur at the start of each epoch and to have a supermajority link they must both be attested to by 66% of the total staked ETH on the network.

How PoS generate blocks

PoS rewards, penalties and slashing

Who’s qualified for the rewards:

  1. Validators make votes that are consistent with the majority of other validators
  2. Validators propose blocks
  3. Validators participate in sync committees

The reward is proportional to the validator’s effective balance and inversely proportional to the number of validators on the network. Block proposers receive 8 / 64 * base_reward for each valid attestation included in the block, so the actual value of the reward scales with the number of attesting validators.

Who will be punished:

  1. For missing target and source votes, penalities are equal to the rewards the attestor would have received.

Who will be slashed:

  • By proposing and signing two different blocks for the same slot
  • By attesting to a block that “surrounds” another one (effectively changing history)
  • By “double voting” by attesting to two candidates for the same block

If these actions are detected, the validator is slashed.

  • 1/32 of their staked ether (up to a maximum of 1 ether) is immediately burned.
  • A 36-day removal period begins
  • At the mid-point (Day 18) an additional penalty is applied whose magnitude scales with the total staked ether of all slashed validators in the 36 days prior to the slashing event.
  • The maximum slash is the full effective balance of all slashed validators

Emergency status: Inactivity Leak

Finality requires a 2/3 majority of the total staked ether to agree on source and target checkpoint, what if the block stuck and doesn’t pass through the 2/3 agreement?

If the Beacon Chain has gone more than four epochs without finalizing, an emergency protocol called the “inactivity leak” is activated. The ultimate aim of the inactivity leak is to create the conditions required for the chain to recover finality.

The inactivity leak lets the stake belonging to the inactive validators gradually bleed away until they control less than 1/3 of the total stake, let the remaining active validators control over 2/3 of the stake.

Source: @milesdeutscher

References:

https://blog.ethereum.org/2015/03/03/ethereum-launch-process
https://jason.mirror.xyz/dF3DbxW6trfvC7Mfx4N2raR3lclsm07Mfl5ACk_qkwI
https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/
https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/rewards-and-penalties/

--

--