DEV Community

CoinMonks
CoinMonks

Posted on • Originally published at Medium on

Ethereum 2.0 For Dummies — Part 1: Why Upgrade?

Ethereum 2.0 For Dummies — Part 1: Why Upgrade?

Introduction

If you are involved or have been keeping tabs on the ETH space at all, you’ve probably been hearing plenty of buzz about Ethereum 2.0 , dubbed Serenity (that’s ok if you haven’t — that’s what this post is for). You’ve likely heard snippets about “staking” and “sharding” and a whole litany of buzzwords where like myself, you might understand the gist but have a hard time reconciling it all. Even in a space as (relatively) new as crypto– there is so much information to compress and so much noise to filter. And if you’re like me you want something comprehensive and easily digestible to get you to that mental click! without reading bits and pieces scattered all over the internet while you pull out your hair or drink all your roommate’s beers lest you go mad. Fortunately for you, I’ve since pulled out a ton of hair and finished the 18-pack in the fridge (to my roommate’s dismay) in order to piece together the many aspects of the Ethereum Serenity upgrade into a cohesive summary so that you won’t have to.

Me writing this article at 2am

In this post, we explore the Ethereum 2.0 transition from a high-level view, diving into the weeds when necessary to help fully understand or internalize important concepts. Some of the material can get pretty dry, even for crypto-lovers like myself so I will do my best not to bog you down with terminology and lazy delivery. (I have split this article into a 2-part series). I will provide links for certain sections that require its own inspection altogether, or simply for you to no-look-leap into your own rabbit holes should you choose (Be careful!).

In Part 1 we start with a glossary of relevant terms and then dive into the rationale behind the Serenity upgrade. We will talk about why we need scalability and what that really means, as well as how the upgrade affects network security and the underlying the economics behind it. For each of these we will discuss the solutions that the Ethereum 2.0 upgrade plans to introduce.

In Part 2 we delve deeper into the mechanics of staking and validating. We’ll unravel the threads of the Beacon Chain, sharding, validators, and the Proof of Stake incentive structure and then weave them all back into a comprehensible picture.

Hopefully, you will feel that this is written from a similar level of proficiency and capacity as you. To clarify, that means you are NOT a human AI like Vitalik Buterin or Satoshi Nakamoto himself (or herself), but just a normal person with a love and interest for the space (Read: If I can do it, you can too).

Glossary

PoW/PoS  — Proof of Work / Proof of Stake

Staker  — Someone who stakes/deposits/risks their ETH in order to run one or more validators

Validator  — A node that validates transactions and blocks in return for staking rewards. A validator is to PoS what a miner is to PoW. A staker can run multiple validators, assuming they have enough ETH at stake.

Node  — Part of the distributed network of computers running the Ethereum software. A node is one of those computers. There are different types of nodes (full, light, archive — for example).

Client  — An implementation of the Ethereum software. A node runs a piece of client software. Clients are written in different languages, but ultimately do the same thing — interact with the blockchain.

Serenity  — the name given to Ethereum 2.0

Casper  — Casper the Friendly Finality Gadget (or Casper FFG for short) is basically a consensus mechanism. We’ll get into this later.

RANDAO  — A (pseudo) random number generator, in a verrrrry simplified sense. We will explore how this comes into play when we talk about the validator process.

Attestation  — A 2-part vote from a validator on which blocks are valid.

Proposer  — A validator that has been pseudo-randomly ( RANDAO ) selected to build a block that other validators vote on ( attestation ).

Sharding  — Basically breaking up the blockchain into pieces and processing/validating them at the same time i.e. “parallel execution”.

Beacon Chain  — Think of this as the main chain that everybody and all the validators come back to. We’ll have a whole thing on it below.

Slashing  — Punishing malicious validators i.e. attackers by taking away some or all of their ETH stake. You have to be a real dick to slashed.

EVM  — Ethereum Virtual Machine. When people say “Ethereum is a world computer” — this is basically the computer. There is a copy of it on every full node. It allows smart contracts to be run by serving as a middleman between the smart contract (code) and your computer’s operating system — if you’re running a node. Each client (see above) is an implementation of the EVM.

eWASM  — Ethereum Web Assembly. A goal for Ethereum 2.0 and an improvement on the EVM. I won’t get too technical here, but think “faster Ethereum computer” by speaking a (machine) language that your computer’s operating system can understand faster and easier i.e. WebAssembly, thereby speeding up the process.

TPS  — transactions per second

Problems/Rationale — What are we solving for?

Why Ethereum 2.0 and why does it matter? In order to understand some of the rationale behind this long-planned upgrade to the network, we have to have to understand the current scope of problems and obstacles that we face today. To me there are two main areas of focus for the Ethereum 2.0 upgrade — simplistically speaking “using the network vs. securing & running the network”. As humans, we tend to think in dualistic terms — so I think this is a good framework to kick off our journey with. (This is how I framed it for myself anyway).

Number one is derived from the user experience. Technically miners and stakers are users but when I say “user experience” — I’m talking end users (not mutually exclusive) — people and even smart contracts that interact with Dapps, DAOs, other smart contracts, and the accounts you use to hold your ETH. Basically anyone or any entity interacting with the Ethereum global computer in the way that you, me, businesses, systems, etc. use the internet to do whatever it is that we do. Think finance, or running your city’s power grid, window shopping on Amazon, playing Fortnite with your friends. This is where we get into scalability.

I’m sure you’ve heard this term. But what does scaling really mean in this context?

When we talk about scaling, we are talking about increasing the amount of computation or execution that the Ethereum network can handle within a given period of time. This is measured in transactions per second, as transactions are the way the world interacts with the Ethereum network. The speed at which transactions are processed is called transaction throughput.

If we wish to modify or update the state (i.e. who has what assets at any point in time) of the network, we send a “transaction”. There are different types of transactions but the takeaway here is that a transaction is a signal or request to the network to change the overall state, much like you press some buttons on your mobile banking app to change the state of your bank balance, or you click your mouse to move your League of Legends champion from here to there (changing the state of the game).

One of the most commonly used benchmarks is Visa. “Visa processes 1700 TPS on average while Ethereum only processes 15 TPS!” — you’ll read that over and over again. What this means is that IF Ethereum is to become a network that secures more than crypto-flavored Pringle NFTs (look it up, I swear it’s a real thing) with any hopes of servicing a global financial system, let alone a global computing system — the transaction throughput is going to have to drastically increase while maintaining security and decentralization — both core tenets of Ethereum’s mission.

So what is the real bottleneck here?

One part of the bottleneck comes from supporting complex transactions. Basically smart contracts. This is being addressed by Eth 2.0’s move from EVM to eWASM¹. This is still in development and a bit beyond the scope of this article, but ultimately it should allow for smart contract transactions to be processed faster and at a lower cost. The article linked here provides a good introduction.

A larger part of the bottleneck comes fromthe way the Ethereum state is accessed, and how it grows over time². As more things happen on the Ethereum network, its state (again — a record of all the accounts, who has what, who did what) grows in size. As that state grows it needs to be to be stored (on nodes across the network) — and accessing/processing that stored data is limited by how fast the node computer can physically process and store data.

This means that without some sort of limit on the amount of processing that can be done within a certain period, some nodes might not be able to verify blocks and stay in sync with the blockchain (which is not great for the network). For this reason, Ethereum places a limit on the amount of processing power that can be involved in each block, which indirectly limits the number of transactions that can be included within each block. This “ processing power ” is measured in “ gas” (more complex transactions use more gas), and this gas is paid to miners in ETH. Whenever you send a transaction, you are basically bidding for this gas/processing power against other people sending transactions , which is why you can specify a higher fee limit to have yours go through faster [this is slightly different now with EIP 1559]. The per-block limit on processing power I mention above is referred to as the gas limit. Currently the limit is 15m gas which averages out to about 15 transactions per day.

All said and done, there is both a technical AND artificially placed limit on throughput —both a node’s processing capability and the gas limit (which are related to each other). These limits are there to level the playing field for Ethereum users and make it relatively affordable for nodes to exist (helping to maintain decentralization), but they also limit the amount of transactions the network can safely validate. Sharding is a way around these limitations.

Sharding is not a new paradigm. It’s a method of splitting the blockchain into smaller pieces with the goal of processing the pieces concurrently — this is called parallel processing. The concept of breaking up of the blockchain itself is derived from horizontal database partitioning where, you guessed it — a database is partitioned or separated for more efficient handling and organization. As part of the Eth 2.0 upgrade, the chain will initially be partitioned into 64 shard-chains, which spreads the network’s load across the new chains. They are meant to eventually be paired with rollups³, which is a Layer 2 technology that is beyond the scope of this article. We will get into the specifics of the sharding implementation in Part 2, but the key takeaway is that sharding breaks up the blockchain into smaller, more manageable pieces.

Not to be confused with “sharting” — image by Consensys Media

The second part of the Ethereum 2.0 focus is the network and infrastructure — this is where we get into security and the economics behind security. The economics covers everything from Ethereum’s incentive structure, centralization of miners/validators, user participation, attack mitigation, and systemic risk etc. These risks in security and economics are being addressed by Ethereum 2.0’s transition from Proof of Work to Proof of Stake , and it is arguably the largest part of the upgrade. Much like our previous discussion about scalability, we will explore what security means in this context.

Discussions about security often pertain to securing against malicious attackers who seek to modify, revert, or coerce the Ethereum network state in a way that does not follow the agreed upon protocol, — either to profit from it or simply bring the network down (think The Joker from Batman).

The most widely known and discussed attack vector is a “51% attack” or some variant of it. There are also more conventional attack vectors like scams, and contract code vulnerabilities but we won’t get into those here — as those pertain more to user error than a flaw in the overall system design. In layman’s terms a “51% attack” implies an attacker somehow gaining control of a majority of the network processing power, be that mining or validating, thus gaining the ability to process transactions in his or her favor, usually at the cost of other network participants. A well-designed system makes the cost of an attack higher than the payoff from a successful attack — something that Ethereum’s blockchain actually does fairly well already.

Related to said attacks is the risk of centralization. This is when a large group (or majority) of miners or validators are controlled by a single or small number of entities. It is essentially a monopoly or an oligopoly on network infrastructure and security, and this has a few ramifications. One, this creates a single point of failure while simultaneously creating a single point of leverage should these dominant parties decide to act against the interest of the other network participants (i.e. users like you and me). Having a fully decentralized network is valuable because it gives users the confidence that the network will function as expected regardless of a single party’s agenda, giving them the peace of mind to use and to build on it. I think an appropriate analogy is some of the public tech and media platform censorship we see today — I don’t think it’s a stretch on the imagination to see how that dynamic can quickly devolve into something we don’t like.

Another aspect to the Ethereum security model is not the security itself, but the cost of security. Currently, with the PoW paradigm there are essentially two main costs that are incurred to secure the network: capital and electricity (we will ignore elbow grease and technical expertise here for the sake of discussion, though they are clearly costs as well). Securing the network with the PoW i.e. mining, entails purchasing an ASIC — a “mining rig” in simplified terms — which is an upfront capital cost (some machines go up to $20k) and then keeping this thing running continuously, which implies an ongoing cost of electricity.

Annualized, Ethereum mining consumes about as much electricity as Singapore does. Each transaction consumes the equivalent of an average U.S. household over 3–4 days⁴. At this level, pollution and carbon dioxide emissions become equivalent factors as well — but you get the picture. Mining uses (many would say “wastes”) a lot of physical resources, namely electricity and atmosphere health — something I think we can all agree we’d like to avoid.

Ethereum 2.0’s transition from Proof of Work to Proof of Stake is meant to address all the issues that have been raised so far — maintaining security and decentralization while lowering or keeping the costs for that maintenance in check. I’m assuming that as a reader who’s gotten this far, you have at least a basic understanding of PoW and blockchains, but I’ll try to distill it down to the applicable portions here.

The Ethereum blockchain is simply a chain of snapshots of the network’s state (its history basically). Each snapshot (block) depends on the one before it and the one before that, and so on. Each block/snapshot must be computed and agreed upon by a majority of the network.

In Proof of Work (what Ethereum currently uses), you mine a block by essentially being the first one to solve a tediously hard puzzle. This is done through ASIC machines (mentioned above) which themselves run a hashing algorithm over and over, each time with a different nonce (a random number). This results in a different number result each time. Once a number is found with a value below a certain Target number (known as the difficulty level) the “puzzle” is solved. Whoever solves it first gets to mine the block and is rewarded with a fee. Everyone else vying for this fee concedes to the winner, but before that they check the winner’s answer to make sure it is valid, and if it is, they add that block to their own blockchain and begin trying to solve the next block’s puzzle.

Proof of Stake is a little more simple on the surface. In order to mine a block, you lock up 32 ETH for the right to “mine” or validate blocks. Every few minutes, you work alongside other validators to cast votes on valid blocks, and if everyone continues to vote on valid blocks in this manner, everyone is continuously rewarded with a fee. If you make a mistake or are found to be acting malicious, you are punished by losing some or all of your ETH, depending on the severity of your infraction. The computation involved with validating the blocks is not nearly as high as PoW.

Moving to PoS allows us to maintain our network security at a lower cost (less financial waste). Mining Ethereum with PoW is on average ~1/3 ongoing electricity costs and ~2/3 upfront capital costs⁵. The ASIC machine (your upfront capital cost) has a useful life of about ~2yrs before it wears out or become obsolete from newer and better hardware. Essentially your ASIC is a depreciating asset, which means mining over the years will incur a fixed cost every 2 years (adding to the total cost of mining over time).

With Eth 2.0’s transition to Proof of Stake, the dynamic becomes different. In PoS, your cost is almost entirely a capital cost (the ETH you deposit) but really, it is the just the opportunity cost of not being able to use your coins while they are locked up/staked. Electricity consumption in the PoS scheme is minimal, since staking can be done without expensive hardware (i.e. your home computer) and the computation is minimal. Unlike ASICs, your deposited coins do not depreciate (in a pure sense: 1 ETH today will still be 1 ETH tomorrow, regardless of the dollar value).

ETH gives you a year-over-year return whereas an ASIC gives you a year-over-year deprecation. This is a fundamental component of the improved tradeoff between security and cost of security. Some contend as well that as more and more coins are staked and taken out of circulating supply, the value of the circulating coins rise — meaning that the total value in circulation (the buying power and opportunity to do something productive with the coins) remains the same, even as coins are being locked up.

Essentially all of this means that we maintain the our current level of network at a drastically lower cost. This also lowers the barrier to entry for staking, as there is no longer a requirement for expensive ASICs (this is an arguable point⁶). As a wider spread of participants come into the picture, we make a step in the direction of decentralization as well.

Summary

Zooming back out — this article contends that there are two main high-level goals for the Ethereum 2.0 transition: increasing scalability and lowering the cost of security. Ethereum is currently unable to handle the transaction throughput required for conventional high-transaction applications, due to both real and artificial limitations on the way Ethereum’s transactions are processed, stored, and mined by network nodes. This is being addressed by sharding implementations in Eth 2.0, which is essentially done through parallel processing of different parts of the blockchain. Ethereum 2.0 will also replace the existing Proof of Work consensus mechanism with Proof of Stake. PoW miners are replaced with PoS validators that deposit a sum of ETH into a lock-up mechanism for the right to validate transactions and gain rewards proportional to the size of their stake. Depreciating ASIC mining machines are replaced by non-depreciating ETH coins , essentially eliminating both a wasteful consumption of electricity as well as a recurring capital cost of expensive machinery. This lowers cost of network security, barriers to entry for transaction validation, and reduces centralization in the network security providers (validators or miners).

In the next section , we will cover the nuts and bolts of the new Eth2.0 blockchain design — everything from how validating is actually done, what the beacon chain and shards looks like, rewards and penalties associated with processing transactions, and how it all comes together.

REFERENCES

[1] Ivan on Tech (June 27, 2020) Breaking Down ETH 2.0 — EVM and eWASM Explained https://academy.ivanontech.com/blog/breaking-down-eth-2-0-ewasm-and-evm-explained

[2] Crypto AM (Feb 26, 2021) The state of the State of Ethereum https://www.cityam.com/the-state-of-the-state-of-ethereum/

[3] Vitalik Buterin (Jan 05, 2021) An Incomplete Guide to Rollups https://vitalik.ca/general/2021/01/05/rollup.html

[4] Digiconomist Ethereum Electricity Consumption Index https://digiconomist.net/ethereum-energy-consumption/

[5] Ethereum Wiki Proof of Stake FAQs: What about capital lockup costs? https://eth.wiki/concepts/proof-of-stake-faqs#what-about-capital-lockup-costs

[6] Reddit r/Ethereum (Jan 21, 2021) “How is Proof of Stake supposed to combat centralization?” https://www.reddit.com/r/ethereum/comments/l2gptb/how_is_proof_of_stake_supposed_to_combat/

Join Coinmonks Telegram Channel and learn about crypto trading and investing

Also, Read


Top comments (0)