Ethereum 2.0 | Proof-of-work vs Proof-of-stake | 51% Attack | Blockchain
Updated: May 14
Finally, Ethereum is upgrading to Ethereum 2.0 and this is not an overnight process. Ethereum 2.0 is not just a single launch of complete Ethereum 2.0 blockchain technology but a very long process with 3 different phases.
First, let us understand the current running Ethereum :
To understand Ethereum we need to understand the technology on which it is running
Blockchain consists of the data encapsulated in a block and these blocks are interconnected to death other cryptographically using hashing.
For example, in bitcoin, the transactions are stored in the blocks and these blocks are connected to each other in such a fashion that the current block will hold the hash of its preceding block. Blockchain is one of the most advance and most secure technology to store the data as :
Blockchain is decentralized: that is no single organization governs and handles your data. Whole data is stored in a decentralized ledger and is self secured using cryptography and proof-of-work (which we will discuss later).
Blockchain is transparent: That is the data entered in the blockchain is open to read for all the nodes participating in the network and any update is copied to all instantly.
Blockchain is immutable: Blockchain uses a methodology called proof-of-work which symbolizes that some intense work(mining) is done on a particular block to include in the chain and once the block is added it can't tamper.
Currently, the Ethereum Blockchain is using Proof-of-work methodology to validate the new block and secure the blockchain
Proof-of-work vs Proof-of-stake:
Proof of work:
Think it this way - if one can add blocks in the blockchain easily then any corrupt person can spam the blockchain or cheat by adding multiple large numbers of blocks with false transactions at a time easily. So, to ignore this kind of act proof-of-work was introduced which says you have to give proof that you have done some work(here it is called mining) before adding the block to the blockchain.
And this works like this: to perform any transaction on the blockchain, users pay some transaction fees (in Ethereum it is called Gas). These transactions are not directly added to the blockchain. There are miners who mine these transactions in order to earn some freshly generated reward (bitcoins/Eths/or other) + the sum of the transaction fees users paid. All the miners in the network participate in the race to mine the transactions and by mining it means they validate these transactions add them to a new block and perform heavy computational work using their machines to solve some cryptographic puzzle and the miner who is successful to achieve the target or solve the puzzle announces the new block to the whole network and then add it to blockchain plus in turn, earns his reward.
Here, Performing this heavy computational work to solve the puzzle is the proof that the miner has done some work on the block and this is called Proof-of-work.
By puzzle, you can understand it by example - consider a target hash value which you have to achieve. Every block contains the data, current hash, previous hash, and a nonce value which is changed continuously, and the new hash is calculated continuously in a hit-and-trial fashion to check all the possibilities and reach the target. This consumes a lot of computational power and resources like processing, memory, electricity.
This proof-of-work ensures that every new block is added after a specific amount of time and also this secures the blockchain as the hacker can't change the blocks easily.
But now Ethereum is dropping this proof-of-work and moving towards proof-of-stake.
Disadvantages of Proof-of-work:
Proof-of-work makes miners consume a lot of electrical energy and resources to mine these blocks.
Centralization: One of the major drawbacks of proof-of-work with time is that many miners are now joining together to improve their hashing power(computational power) and then distribute the reward accordingly. These are called mining-pools and they are deploying the decentralization property of blockchain.
Also, Proof-of-work is way too biased as the miner with more hash-power will always mine faster and thus earn the rewards.
Proof of stake:
In proof-of-stake methodology, the miners are replaced with validators.
Staking: To become a validator a new user has to stake some of his Eth to activate validator software. As a validator, you’ll be responsible for storing data, processing transactions, and adding new blocks to the blockchain. This will keep Ethereum secure for everyone and earn you new ETH in the process. The system itself picks any random validator to validate the transactions and add a new block to the blockchain. The selection of the validator depends on different factors including the amount he has staked.
How secure is Proof-of-stake:
penalty: the protocols are defined such that any malicious validator will lose all his stake money as the penalty.
reduces the risk of a 51% attack.
51% attack - in blockchain cryptocurrency there is a theoretical attack which is a possible but costly attack.
What is a 51% attack in Blockchain cryptocurrency?
It says that if a miner or group of miners are somehow successful in holding more than 50% of the blockchain network's computing power/hashing power then they have the monopoly over the complete chain as, only the miner holding 51% of the hashing power will mine the blocks faster than other miners and so can fraud the complete network by mining corrupt transactions, roll-back the transactions, double-spend(case in which the same cryptocurrency is used twice in the chain).
But, holding such a massive amount of hashing power is not easy and so, in proof-of-stake holding that much Eth(million $ worth) is not possible.
Also, Ethereum 2.0 runs on proof-of-stake which means it has validators, not miners and it is easy to expand the network because more and more validators will stake and participate as it is way more cost-efficient than having heavy computational power and resources. more the validators harder the 51% attack.
So, after we have understood this long let us see what changes are bought by the new Ethereum 2.0
Ethereum 2.0 is an upgrade to Ethereum making it more scalable, more secure, faster, and more sustainable.
Ethereum 2.0 is a long process and is coming in 3 different phases.
Phase 0 - Beacon Chain: The Beacon chain phase is currently in progress and is expected to be launched in December of 2020. This phase brings no major changes to the current running Ethereum. Whole Ethereum will run perfectly as it is running currently instead it introduces the proof-of-stake parallelly by allowing the Eth holders to stake and become validators. Eth holders can become validators by staking 32 Eths or less using the 3rd party stakers.
Phase 1 - Shard Chains: The Shard Chain phase is estimated to be launched in 2021 after the beacon chain. This phase will make the Ethereum more scalable and efficient by dividing the complete blockchain into small chains known as "shards", and these shards will run parallelly. Ethereum can then hold 100 to 1000 transactions per second as compared to 30 transactions at the present as the validators then have to validate the transactions for the particular small shard rather than complete blockchain.
Phase 3 - The Docking: Ethereum 2.0 then will be finally docked with the current mainnet Ethereum and the Docking phase is expected to e execute in late 2021 or early 2022.
checkout - official announcement on Ethereum 2.0