Ethereum 2.0

Ethereum 2.0 has been a highly anticipated release, with over five years of research and development by many different teams from around to world that came together in mutual understanding to help the Ethereum blockchain scale. There is no one component driving Ethereum 2.0, but many small innovations that come together to make things work. Eth 2.0 will come about in phases, starting with phase 0, the beacon chain is the middle layer between the Ethereum 1 main-chain and the Ethereum 2 shards. There are many issues that the Ethereum community had to overcome; let us move on to the problems and solutions.

The Scalability Trilemma

Vitalik Buterin coined the term “Scalability Trilemma,” which says that it is not possible to simultaneously have security, decentralization, and scalability unless “assumptions” are being made about the system.

The scalability trilemma is the most famous unsolved problem in the blockchain space. Ethereum 2.0 is a fast, secure, and decentralized system without any of the drawbacks of being a decentralized system. Let us look at the solutions in-depth.

Proof of Stake

The proof of stake algorithm uses validators instead of miners; those miners achieve consensus by “staking” tokens into the network to receive rewards or receive punishments based on performance. Proof of Stake also allows many more nodes to work on the network as the incentives are validation based and not just hardware based like Proof of Work.

In the proof of work system, miners compete to find and attach a newly created block to the blockchain. Miners propose different block headers through the PoW hash function to generate a random string value. Miners then have to change the nonce value until one of the generated hash value matches the target. Allowing the Ethereum blockchain to scale higher as this consensus algorithm consumes significantly fewer resources than Proof of Work does, making Proof of Stake more scalable while being eco-friendly and convenient to a larger pool of dormant validators.

The economics of Proof of Stake incentivization

Profitability with the Proof of Work relies on the expectation that “tokens” received would be worth more than the cost of being a node/miner in the system. This profitability is a risk as it becomes “harder” to mine if there is a large pool of miners in the system. The number of total participants in the system reduces as only individuals who benefit from the cost reduction of economies of scale. Those who can buy large amounts of hardware and places where electricity and internet access are stable and cheap) can participate and remain profitable. Significant security vulnerabilities arise as the blockchain network relies on honest and diverse nodes with no/limited incentive to collude and attack the network.

Proof of Stake allows us to include more validator nodes in the system to increase security. It is significantly more energy-efficient, and miners do not require costly equipment to become nodes in the network.

Beacon chains

The Beacon Chain is Ethereums new Proof-of-Stake blockchain. It is the spine that underpins the new Ethereum 2.0 system and the administrator coordinating all the network players. The Beacon Chain’s critical purpose is to manage the proof-of-stake protocol for all of the shard chains and provide excellent quality randomness that the uppermost layers will use to validate blocks.

The main functions of the beacon chain:

  • Managing validators: Validators are people that stake their Ether in the system to assure that transactions are correct by proposing blocks, those who are wrong are punished by losing some of their Ether, and those who are right will gain Ether as payment. Beacon chains also designate validators their duties as a validator in the system.
  • Providing randomness: Providing real random number generation is difficult to achieve in blockchain systems, but with a beacon chain, this can be achieved at a faster rate. Good quality randomness allows the system to be more distributed, verifiable, and unpredictable.
  • Crosslinks: A part of Phase 1 Crosslinks tie together different shards towards the main beacon chain, the “states” of each shard, which is a snapshot of each shard, gets stored on the beacon chain.
  • Managing the committee:The main form of security in Eth 2.0 is the committee, which decides what block will be added to the main blockchain. Once this process is done, it cannot be changed, and this is all handled on the beacon chain.
  • Finalize checkpoints.
  • Progress the beacon chain.

Randomness

Good quality randomness is critical in Proof of Stake as it stops miners from manipulating blockchain data in order for their node to be picked with a higher probability then this locks out many other people from profiting off of the system and reduces the number of participants as the network incentive system seems “unfair.” Ethereum 2.0 achieves good quality randomness through two components RanDAO and VDF.

RanDAO

The RanDAO is a system where users choose a random number when depositing their 32 Ether to become a validator when it is time to reveal the numbers for a block; all these random numbers are combined to form a new random number in the system. This solves the randomness issue plaguing Proof of Work blockchains but creates a new problem as the last individuals in the system have an advantage. The last person can just follow along with everyone’s number reveals and will know the number without their input. If the number generated is not to their liking, they have an incentive to pass in a number that would benefit them. This issue is solved with verifiable delay functions.

VDF ( Verifiable Delay Function)

The verifiable delay function allows for a delay in calculating the final number with the given numbers of the validators above. This creates a time gap between the numbers proposed and the numerical result that is returned.

Individuals now have no reason to “wait” and watch the generated numbers, and there is no last movers advantage. If validators do not participate in the system and “wait,” they will lose out on profitability.

VDF works by taking the numbers from the RanDAO and adds layers that are squaring to the number. Each “layer” is a square; this number can go as high as 80 trillion squares, as seen in a project at MIT.

If we have a number X, a six-fold quadratic VDF of that X can be: ((((((X^2)^2)^2)^2)^2)^2)^2)^2), where we square the number and that result on each of the seven layers. Each layer adds complexity to the function, and a reasonably high layered VDF will take a long time to calculate as the calculation is intense for the computer.

In Ethereum, the amount of time the VDF is expected to achieve is 102 minutes in length. VDF is “verifiable” since we know what computer operations are needed to reach that result, and we can predict with a reasonable degree of accuracy how long it will take for a machine to arrive at the result.

Two ghosts

The consensus in Ethereum 2.0 relies on both Casper FFG and LMD-Ghost. LMD-Ghost adds new blocks and decides what the head of the chain is.
Casper FFG, on the other hand, achieves finality on which blocks are and are not apart of the blockchain. GHOST (Greedy Heaviest Observed Subtree) is a fork choice rule. GHOST selects the head of the chain by choosing the fork that has the most votes. Vitalik Buterin proposed Casper FFG, but there was another Casper proposal called Casper CBC, which is a framework on which simpler, more flexible finality and block consensus can occur.

Casper FFG (Casper Friendly Finality Gadget)

Casper’s primary goal is changing Ethereum from the EthHash Proof of Work algorithm to the Proof of Stake consensus algorithm. There are two types of Casper, Casper FFG and Casper CBC. We will explain Casper CBC after Casper FFG.
FFG’s primary goal is to focus on block finality. Finality means that once a specific operation is done, it will be solidified and will not be able to be changed. According to Vitalik Buterin, no system can guarantee absolute finality. This issue is prominent in centralized institutions as nothing is stopping centralized accessors from modifying the data that is available to them.

According to many, PoW fixes this issue and is the only reliable way to achieve finality. However, we have discovered that there is no way to “rewrite history” and modify data in the decentralized blockchain over the years. Casper FFG is meant to create a more sophisticated finality system that would limit the opportunity to change or modify the system after finality was achieved.

Why does Casper FFG have better finality than PoW?

  • Total economic finality: 2/3rds of all validators make maximum odd bets to finalize the blocks.
  • Collusion resistance: There is no reason for collusions to occur since 2/3rd’s of the network are staked into the well-being of the network. This reduces the chances of collusion as an attack will bring the house down for most of the network. It would also significantly reduce their deposits in the system. This creates a lose-lose scenario.
  • Double Finality Choices: In the case of a double finality and an impending fork, people can choose which chain to switch to. The chain with the most votes will be regarded as the dominant chain moving forward.

Casper CBC (Casper Correct by Construction)

Casper CBC has many advantages; it is flexible and straightforward. With Casper CBC, the finality cycle is on a block by block basis; this allows for very low latency finality to be achieved. Let’s take a look at this more in-depth.

In the blockchain space, there are usually two types of consensus protocols, the first being block-based consensus protocols, and the second is chain- based consensus-based protocols.

Block-based protocols are when a consensus protocol is executed for each block. In block-based protocols, forking is rare as it requires nodes to get on the same page before a block is added to the chain.
Chain-based protocols allow participants of the system to extend chains to other blocks before the blocks are finalized. Transactions are processed faster, but there is an increase in the chance of the network being forked.

Systems that use chain-based consensuses like Ethereum and Bitcoin have the longest-chain rule as their fork-choice rule. The longest-chain rule means that the network follows the longest chain and tries to converge towards the longest continual chain.

Casper CBC is a chain-based consensus protocol but has deterministic finality. Casper CBC is different due to two reasons:

  • Correct by construction methodology
  • Message Justification

LMD Ghost

LMD GHOST (“Latest Message Driven Greedy Heaviest-Observed Sub-Tree”) is a fork choice rule that puts together the latest attestations from validators to calculate the total balance that attests to each block on the tree. Gasper is the union of Casper and Ghost to create the Eth 2 consensus protocol.

Conclusion

That is it for the first half of this piece on Ethereum 2.0 phase 0. I trust that this piece will help you gain clarity with how Phase 0 works, and its benefits over Proof of Work algorithms. In the next part, we have BLS signatures, the validation cycle, and other more modest but important components of Eth 2.0.