Everything You Need to Know About Ethereum 2.0
By: Pujeet Manot
Tags: Ether, Ethereum, Cryptocurrency, London, Blockchain

What will you learn in this blog?

The conditions for the deposit contract have been met. More than 800,000 ETH have been staked on the network so far. The launch of Beacon Chain takes place on December 1, 2020, and many people still do not know what Ethereum 2.0 is or its technicalities.

This blog covers the various reasons behind the upgrade from Ethereum 1.0 to Ethereum 2.0, the different concepts of sharding and proof of stake, and how they will be relevant in Eth2.

Eth 2 has been divided into different phases. This blog describes all the phases and their relative purposes, with more focus given to Phase 0 — the Beacon Chain. Finally, we will understand the economics behind the new upgrade and finally the problem that many people might face when it comes to staking.

We hope you enjoy this blog.

Introduction

For all these years we have known Ethereum to be the best public, open-source platform that allows developers to build and deploy decentralized applications (Dapps) using smart contracts. The decentralized virtual machine of Ethereum — the Ethereum Virtual Machine — executes contracts that could be used to pay your rent, play games, and do all sorts of activities that are completed via centralized applications. This guide on Ethereum covers everything you need to know about it.

This blog has been written to explain to you what Ethereum 2.0 or Eth2 is and how it could completely change the way we see Ethereum or Ethereum 1.0, starting from its shift to a more environment-friendly consensus mechanism — Proof of Stake (PoS) to the much needed and awaited scalability issues. This upgrade would therefore ensure that the network becomes more sustainable.

The Proof of Work (PoW) consensus mechanism is highly supported in the Bitcoin community, but being a miner/node means that you need to have resources to buy high-end mining hardware and provide excessive processing power to validate each block. People who cannot afford it, will naturally not be able to be a part of the validation process in the network, making it inaccessible and not-so “decentralized”. Moving to PoS means that the network will become more environmentally friendly, and hopefully more decentralized.

The Ethereum network has been unable to take the weight of the new applications that get developed on its network — be it CryptoKitties or DeFi. It has faced scalability issues that led to the delay in transactions and a rise in high gas fees. The most recent Uniswap Token airdrop could confirm it. Sharding, which will be discussed later in the blog, could help in solving the scalability issues in the Ethereum network that could lead to more transactions and lower gas fees.

Why Eth2?

The launch of Ethereum in 2015 captured the imagination of the blockchain community by providing them with a platform that could redistribute power away from centralized organizations. Despite the success, many members of the community believed that the protocol needed a few key upgrades to unleash its full potential. The several smaller upgrades that have been implemented to improve the network’s performance over the years, has not been able to address the issue of scalability. With the rising number of Dapps and smart contracts on Ethereum, it is difficult to maintain a network to validate and add transactions to the blockchain quickly.

At the time of writing, there are 3,895 Dapps on all the smart contract development platforms like Ethereum, TRON, EOS, etc. out of which 1,805 are on Ethereum. This clearly shows the popularity of Ethereum as compared to all the other platforms used to develop smart contracts. Blockchain platforms like Solana and Polkadot have been announced over the past few years but none have been able to compete with Ethereum in terms of the number of Dapps on the platforms.

While Ethereum has given us new hope of having a decentralized internet, its 15 Transactions Per Second (TPS) highlights the network’s inability to scale and act as an alternative to the centralized services we use today. Keeping complex Dapps aside, Ethereum cannot even be used as an alternative to Visa which handles upwards of 10,000 TPS.

As clearly visible, the TPS has been rising over the years. As seen above, in 2017, when the market had realized the potential of Ethereum and Dapps were created on the network, many protocols got introduced which ultimately led to the rise in the number of transactions per day. A very common example of this is the high congestion in the Ethereum network due to the rise in demand for CryptoKitties in 2017. To avoid such issues in the future, it is essential that the network is upgraded and ready to take the load.

Thus, Ethereum 2.0 will help in maintaining Ethereum’s dominance as the leading smart contract development platform. This upgrade will be done keeping in mind that your ETH does not change in any way. All changes will take place in the backend. Ethereum 2.0 will ensure that the developers who have continued to support Ethereum all this while do not have to switch to other platforms and learn new languages to build smart contracts on those platforms.

Ethereum 2.0 or Serenity will be launched in phases in the coming years, with Phase 0 expected to roll out in December 2020. Before we discuss the different phases of Ethereum 2.0 and their respective purposes, let us understand what sharding is and why moving to Proof of Stake is relevant in the case of Ethereum.

Sharding

There are two major ways in which scaling takes place -

Vertical Scaling — where nodes are made more powerful

Horizontal Scaling — where more nodes are added.

In order to keep the network decentralized, we scale horizontally and in the case of Eth2, this is done through sharding. It is a method of the horizontal splitting of databases across multiple servers to help manage the smaller databases in a faster and more efficient manner. These smaller databases are termed as data shards.

In Ethereum 2.0 sharding involves the splitting of the blockchain mainnet into data shards that will run alongside each other to validate transactions simultaneously instead of validating them consecutively. Since more transactions are going to get validated every second, sharding will help in scaling the Ethereum network.

How transactions are recorded on Ethereum’s PoW blockchain

For those of you that are wondering why this was not implemented earlier, the answer is security. Splitting the network into smaller databases and making fewer validators responsible to validate transactions could compromise the security of the network in the situation where even one of the shards is overtaken by a group of malicious nodes (as in the case of Proof of Work).

The Proof of Stake consensus mechanism has been adopted to prevent such attacks from happening. The validators in the network get randomly chosen to ensure that it is mathematically impossible for an attacker controlling less than a third of all validators to attack a single shard.

Proof of Stake (PoS)

A shift to the PoS consensus mechanism would allow ETH holders to stake their tokens on the network to participate in the transaction validation process and earn rewards in return.

The contract for Eth2 must collect an initial 16,384 deposits of 32 ETH each, a total of 524,288 ETH or about $270 million (at $515/ETH) , to proceed with the Phase 0 launch of Ethereum 2.0. These funds will be locked in the contract as a security deposit of being given access to the network and its validation procedure. Any malicious activity from these validators will lead to a penalty being imposed on their stake. This is how we expect the security of the network to be maintained.

Since validation depends on the ETH staked in the network and not the computing power needed, as in the case of Proof of Work, no validator would want to act against the interest of the blockchain that would lead them to lose their funds and a possibility of a reduction in the price of each token if people start believing that the network is under attack.

Attacking the network also means that a validator would need to have a very high stake in the network. Having a high stake and performing an attack means that these attackers could even lose their whole funds, thus making such attacks expensive. This process is called slashing.

The only major drawback of PoS is that there could still be validators who stake a lot more than the others, thus having more influence in the network and getting more staking rewards. As more people stake on the network, the annual percentage rate (APR) keeps decreasing. This might not be that advantageous for those validators who stake less funds, thus making the entire process again “not-so decentralized”. Moreover, having a larger stake in the network also means that the network could be attacked.

Staking on Ethereum will work in a similar way as it works on any other PoS blockchain. You will validate only as many transactions as your stake in the network. For example, if you have staked 4 tokens in the network of 100 tokens, then you will only validate 4% of the new blocks and receive the rewards for those transactions recorded in the blocks.

Game Over for Miners?

At the time of writing, 805,728 ETH have been staked on the contract. ETH 2.0’s Beacon Chain genesis will therefore occur on December 1, 2020.

If everything goes as planned, there will be no use of miners or mining hardware in the Ethereum network in the coming future. Mining will still continue on the network until Phase 1.5 of Eth2. It is during this phase that the mainnet will become the shard and the consensus mechanism of the network will only be Proof of Stake.

Just like the DAO hack in 2016, which led to a hard fork called Ethereum Classic, this shift in consensus mechanism might not be accepted by the entirety of the network. This may lead to another hard fork.

Phase 0: The Beacon Chain

The Beacon Chain, scheduled to be launched on December 1, 2020, is an overarching chain that will ensure that the data on the shards has the most up-to-date data, reward validators for proposing new blocks and punish them for their malicious behavior. There will not be any shard chains operational as there is nothing that needs to be in sync. Its role initially will only be to bring all validators onboard.

The Beacon Chain

The Beacon chain will have Casper finality, a random number generator to shuffle validators, and simulate crosslinking in the non-existent shard chains. Eth1 will continue to receive upgrades and operate alongside the Beacon Chain.

As explained by Interdax in their Medium post, the first implementation of Casper will use Ethereum’s current PoW proposal mechanism to introduce new blocks onto the blockchain. If two blocks are proposed simultaneously, validators are only rewarded for betting on one chain, so it only makes sense to bet on the original chain, as this is the one that is most likely to succeed.

More importantly, Casper introduces a mechanism that will instantly confiscate the entire stake of any validator who tries to support an invalid chain by validating more than one block at a time. Should a validator maliciously attempt to compromise the network (i.e. validate incorrect data history), all or some of their 32 staked ETH will be slashed (more about penalties later). Users can submit evidence of voting on the wrong chain by miners to penalize incorrect votes. Casper, therefore, handles the nothing at stake problem by introducing a wrong-voting penalty to the protocol.

Slots and Epochs

The validators on the network will be responsible to validate transactions and also propose new shard blocks. If they are not chosen to propose a new block then they can make sure that everything in the proposed block looks right.

A minimum of 128 validators (called a committee) is needed to attest every shard block. Every shard block is to be proposed and validated by this committee in a time-frame known as a slot. Each slot is 12 seconds and an epoch contains 32 slots adding to 6.4 minutes. Once the validation process is complete for the epoch, the committee is broken up, and a new set of validators will be chosen using a pseudo-random process RANDAO. This is done so that malicious validators don’t have any control over the final outcome of new proposed blocks.

A new slot is added every 12 seconds. 32 slots make and epoch.

A slot is therefore a chance to add a block to the Beacon Chain. Every 12 seconds, one Beacon Chain block and 64 shard blocks (as the current Eth2 has plans for 64 PoS shards) are added when the system is running optimally. Slots are similar to block time but some slots can remain empty too.

Although real shards are not introduced until Phase 1, validators participate in the consensus of the assigned shard to vote for the shard’s head. The validator links the shard head to the beacon block for a slot and as mentioned earlier, they police each other and are rewarded for reporting other validators that make conflicting votes or propose multiple blocks.

Validators are shuffled into committees for each epoch to create attestations (or votes) for each of the 32 slots.

Phase 1: Shard Chains

Phase 1 will add a basic structure of sharding to Ethereum 2.0. This is necessary from a scalability point of view. This phase is expected to start with 64 PoS shards but they will not support accounts or smart contracts right away.

Along with shard chains, cross-references will also be introduced in Phase 1. Cross-references will allow to record and finalize the state of each shard on Beacon Chain. Ultimately, cross-references will serve as the basis for transactions between shards in later phases.

Phase 1.5: Mainnet to Shard

Everything until Phase 1.5 will be done on the Proof of Work blockchain. It is only when the mainnet becomes the shard in Phase 1.5 will the transition to PoS take place. We expect this transition to be seamless and to happen sometime in 2021.

Phase 2: Fully Formed Shards

The fully formed shard of Phase 2 is expected to be seen beyond 2021. Shards should be fully functional chains that will then be compatible with smart contracts and be able to communicate with each other more freely. Developers may even be able to design shards in their own ways.