Ethereum’s Merge: PoW vs. PoS

Diving into what the Merge looks like on the backend

Abhay Ratti
Geek Culture
11 min readSep 10, 2022

--

Image from ethereum.org

If you follow crypto, you’ve definitely heard of the term “Merge” being thrown around lately.

It sounds like an incredibly ambiguous Marvel and DC crossover but it’s far more impactful than that (arguably at least).

Simply put, the Merge is the Ethereum blockchain’s transition from proof of work (PoW) to proof of stake (PoS). This change will fundamentally change the consensus protocol that brings decentralization to Ethereum in the first place — likely for good.

The Merge has been rumoured for quite a while now, often referred to with different names such as “Ethereum 2.0”. People have expected this transition from proof of work to proof of stake for a while now, mainly because it aligns with the Ethereum roadmap of becoming a scalable, secure, and sustainable network.

The sustainability of the blockchains behind cryptocurrencies has been a major concern for many throughout their period of adoption. Proof of work (the protocol used for Ethereum pre-merge) requires very high computational power. For the Ethereum blockchain alone, 112 terawatt-hours of electricity were used in the past year — more than what the entire Netherlands consumed.

Unfortunately, most of this electricity that’s being consumed isn’t coming from renewable sources either, leading to a lot of media criticism on the ethics of using cryptocurrencies.

The intention of the switch to proof of stake is to lower Ethereum’s energy consumption by 99.9%, removing the blocker for the environmentally conscious populous to adopt crypto on the Ethereum chain; therefore, giving the whole industry a better name.

To understand how this energy consumption is lowered so drastically by what appears to be a simple change in consensus mechanism (haha — simple…), it’s first important to understand the status quo with PoW and the changes being brought by PoS.

Understanding Proof of Work

A basic understanding of the functionality of a blockchain will be a prerequiste to understanding the following material.

We’re all aware that what makes blockchains unique is the fact that they’re able to create what is essentially a decentralized and secure database. These two features working in conjunction are enabled by a consensus mechanism, where numerous individuals are able to confirm the validity of something as opposed to just one person.

PoW is the first and most widely-used consensus mechanism in blockchains. It works by using a specific amount of computational power to validate each block by “unwrapping ” it from the layer of security it has. Once a block is verified, it can then be added to the blockchain and everyone’s copy of the blockchain can be updated with that block.

First, though, we need to look at how each block is secured to grasp how this works.

Some Background on Cryptography

Each transaction made on the blockchain is added to a block. Once the block has reached the max number of transactions it can hold (which varies depending on the contract being executed), it is wrapped in an SHA-256 function — a mathematical algorithm that takes an input and creates a random output of a set number of characters.

Here’s an example:
Input: “This is a transaction input”
Output: 7e22973b7926055f73f8416e9cc9f50e3c1f4f34fcffed7972fdeaac83c1caaa

Anytime you make a transaction on the Ethereum network, you can directly view its hash on Etherscan by looking up your wallet address.

The variance of even a single character in the input data will drastically change the output you get; thus, trying to figure out what precisely the input was from the output becomes extremely challenging. However, vice-versa it is much easier — meaning once someone has figured out the input, it’s elementary to verify their answer (simply run it back through the SHA-256 algorithm to see if the output matches up).

The input data itself contains a variety of strings — including the hash of the previous block. This is how blocks are chained together in a blockchain. By incorporating the hash of a previous block into the input data of the next, the blocks are connected.

Image by Simply Explained

Anyone with the intent to change or alter the data of one block (remembering that changing even one character would drastically change the entire hash), would then, consequently, have to manipulate the hash of the previous block…and then the one previous to that, and the one before that…

And this would all have to be done before the next block is added; so unless somebody completely lucks out and is able to guess the hash of the block first try, for 10 million blocks in a row (the current size of the Ethereum chain), there is essentially no chance that they would be able to do anything fraudulent.

The other most important component of the input data though is the nonce (number used once). All the other information used for info data like block hashes, timestamp of a block, etc, are publicly available. However, the nonce is a randomly generated string which is the only input data that is not publicly available. Therefore, anyone who wants to decode the SHA-256 function (and thus validate the block) really just needs to solve for the nonce.

Miners and validators

These “someones” who I’ve been referencing throughout this article are miners — a term you’re probably familiar with if you know a bit about blockchain. Miners are just computers that have been specifically built to solve these PoW problems and validate blocks onto the blockchain. These computing rigs are built with very powerful hardware, to ensure they can solve as many blocks as possible in as short of a time as possible.

As a result of tens of thousands of these computers around the world constantly running, a lot of electricity is used in validating and maintaining the blockchain.

The incentive for one to go out of their way, purchase all the parts to assemble a machine like this, and then pay the operating cost all stems from the very currency they’re validating — Ether (ETH). For every block that a minor validates, they are awarded 2 Ether as well as any gas fees associated.

Gas fees are a cost that comes with committing any transaction on the Ethereum blockchain. Depending on how quickly you want your transaction to go through, you pay a gas fee as an added incentive for the miner to prioritize validating your transaction over all others.

TL;DR on PoW

With this brief deep dive into PoW, it becomes evident why this has been the go-to protocol for such a while. The chain can make itself insusceptible to fraud by creating a barrier through computational power. Until or unless someone is able to develop hardware that is more powerful than the current computing rigs that miners use (which also have their hardware constantly updated), the blockchain remains immune to fraud.

Even in the event that for whatever reason, one group has access to hardware that is vastly superior to what everyone else has, the blockchain can just be programmed to include more characters in the nonce (leading 0s in the hash), which increases the block difficulty.

Understanding Proof of Stake

A moderate level of technical depth on proof of work is a prerequisite to understanding proof of stake — but look, now you have that!

One of the issues outlined with PoW was the high levels of computational power needed to maintain the blockchain. It’s not necessarily the actual solving of a hash that requires high levels of computing power (almost any modern device could do that in a fairly short period of time), but rather the competition that is driven by the incentive offered for every block validated.

There are no participation points on the Ethereum blockchain. You either validate a block and get the Ether reward or you don’t. Resultantly, people optimize to have the most powerful machines in order to outcompete the other miners on the network and solve blocks first. This competition is what drives the need for expensive and energy-demanding computers to be miners.

Removing the Need for Powerful Hardware & Large Energy Consumption

The intention with PoS is to completely eliminate the need for high energy consumption machines by targeting the root cause — hardware-driven competition. PoS shifts the driver of competition from energy expenditure to ETH expenditure.

Essentially, in a PoS consensus protocol, the miners/validators are only those who stake their own ETH as collateral on a smart contract. In the event that any miner is identified to be committing fraudulent transactions, their staked ETH is destroyed.

The way a block is validated still, fundamentally, remains the same. A miner must try and find the nonce value. However, it’s no longer a race to solve the block before another miner. Although this eliminates the need to have top-of-the-line hardware to enter the space, it poses another barrier to entry — money.

As per the Ethereum documentation on 06/09/2022, at the very minimum, a miner must stake at least 32 ETH (roughly $60,000 at the time of writing) in order to be part of the validating group. On top of this, in PoS, a miner is chosen based on how much ETH they have staked. The more ETH that a party stakes, the higher their chances are of being given a block to validate. Thus, it still isn’t making crypto mining something that’s easily accessible for the average person, which is in ways good and bad (a debate for a separate article).

TL;DR on PoS

Overall, the elimination of competition based on just CPU power means that far less computational power is used — as mentioned in the intro, 99.95% less energy will be needed to maintain the Ethereum blockchain post-Merge.

PoS as a whole seems to be the golden balance of all consensus protocols, due to its ability to continue to push out transactions at as high a speed as PoW while also remaining environmentally conscious and increasing the equitability of any participant in the blockchain to join as a validator.

The Stages of the PoS Transition

Vocabulary and topics mentioned in this section will be foreign to what was just covered. The intention is to provide a high level overview on what the implementation plan of the Merge will look like, to gain a sense of the complexities in a transition from PoW to PoS.

For many years, numerous blockchains like Cardano, Polkadot, and Polygon have used PoS. This consensus protocol isn’t anything new that we’re seeing for the first time.

What makes the Merge such a big deal is that it’s the first time any major blockchain is transitioning its consensus protocol from one to another. As described by a Forbes article, it’s the equivalent of changing the engine of a spaceship mid-flight — very risky & very complex.

Accordingly, a precise roadmap has been developed since at least December 1st, 2020, to ensure this transition remains as smooth as possible. Below is a visual representation of what the roadmap for the Merge looks like.

Image from trent.eth on Twitter

Let’s break this down.

One of the main concepts to understand with this Merge is the existence of the Beacon Chain (green line, referred to as the “consensus layer”) and the Ethereum Mainnet (black line, referred to as the “execution layer”). The Beacon Chain uses the PoS consensus mechanism but it currently does not host any of the transactions made on the Ethereum network. Those all still remain on the Mainnet, which as we know uses PoW.

There is still activity happening on the Beacon Chain, it’s just that none of the blocks created at the moment deal with real Ethereum. It’s primarily focused on just building a ledger for all the wallets of validators that are going to be on the chain.

Back to the roadmap— a few days ago on September 6th, the Bellatrix hard fork took place which updated the codebase on the Beacon Chain and prompted nodes on the Ethereum chain to update their clients in preparation to begin creating blocks on the Beacon. At a high level, it was the final update that the Ethereum blockchain needed before the Merge.

What’s left now is the Paris update, which is when the Beacon Chain and Mainnet will merge to be one, and all future transactions will be validated on a PoS consensus mechanism. There’s still a little bit of uncertainty on when exactly this update will come out but it’s expected to be around the 15th of September.

This update will be executed once the execution layer reaches a Total Terminal Difficulty (TTD) of 58750000000000000000000. The TTD is a way to measure the mining difficulty on the network as a whole, and it will be used as a way to specify what the final block on the PoW consensus mechanism will be. Once a block reaches this level of difficulty, all the subsequent blocks that are added to the chain will be done through PoS (after an epoch of 12 minutes).

In short — it gives the green light for the Merge to go ahead and take place.

“How does this impact my crypto?”

You’d expect that because of this massive change happening on the backend, you, someone who holds ETH, will have to make note of some changes this makes to your crypto trading lifestyle.

Well, it actually changes nothing.

  • Gas fees — those stay the same.
  • Time to process a transaction — that stays the same (roughly).
  • The way of making a transaction — also remains the same.

Although the transition to PoS will yield massive benefits for the Ethereum blockchain and the industry as a whole, the design and rollout have been done intentionally to ensure the experience for the end-user remains the same.

Those who are against the Merge (which are very far and few) seem to be anybody with a stake in the current ways of crypto mining (own expensive rigs, invested in companies that do crypto mining, etc.). Resistance to change is always expected, as it’s impossible to accommodate every group. Yet, it seems as though nearly everyone, except this small group, will benefit from the Merge.

Final Thoughts

What Ethereum is doing here with its transition from PoW to PoS is nothing short of incredible. As one of the largest blockchains by both activity and market cap (currently sitting at over $200 billion), they’re leading what is quite possible a revolution in the crypto industry.

The scrutiny that blockchain and crypto have fallen under from the media is immense. Concerns about the environmental implications of the vast amounts of energy usage coming from non-renewable sources have always linked the words crypto or blockchain with a negative connotation in the minds of many.

This is a turning point.

Not only has there been overwhelming levels of support for the switch to the Merge, but the fact that Ethereum is showing that is possible will inevitably prompt other blockchains, and more importantly, future ones, to follow.

Many often forget that crypto and blockchain technology as a whole is ridiculously early in its lifespan. Ethereum still has so much of its broader roadmap to go in becoming the most sustainable, scalable, and secure blockchain out there.

Cool — let’s think even bigger.

Any nonfiscal blockchain projects that have been held back from this barrier of environmental concerns no longer have that blocker. Future solutions and ideations that previously ruled out blockchain will now have one more reason to adopt the technology. This includes large corporations, hospitals, sectors of the government, the financial industry — you name it.

Companies like Meta, Facebook, and Microsoft have been known to mingle with blockchain technologies experimentally, but are years away from releasing any type of decentralized service to their consumers as a result of barriers around sustainability and scalability. The Merge is taking a step in the right direction for enabling this tech to reach more widespread adoption.

The direct impact of the Merge is evident — lower environmental impact. But its potential to be one of the most fundamental changes that lead to wider adoption of decentralization technology is a ripple effect that I think we’ll witness over the next coming years.

Image from Fortune

--

--

Abhay Ratti
Geek Culture

sharing my thoughts and things that i find are cool