Ethereum is one of the most well-known blockchains, and it is about to receive a significant upgrade. The crypto community is now keeping an eye out for ETH 2.0, and for a good reason. The 2.0 upgrade will bring a host of changes to the network that will make Ethereum faster and more secure than ever before. The changes that this upgrade is going to bring in a host of changes like – proof-of-stake, Sharding, eWASM, Plasma, and the Raiden Network.
Timeframe for ETH 2.0
Ethereum 2.0 has been an open secret for quite some time now. When Ethereum was initially released, it was done so in five stages. This was done to give each step the proper development time it required:
- Frontier: This stage came around July 2015, when Ethereum was first launched. This is often known as stage 0.
- Homestead: Ethereum entered this phase around March 2016.
- Metropolis: This stage has two forks – Byzantium and Constantinople.
- Serenity: The final phase of Ethereum 1.0 will have at least three forks – Istanbul, Berlin, and London. It may have more forks if needed. This is expected to take place over 2020 and 2021.
ETH 2.0 – Main Changes
#1 Proof-of-Work (POW) to Proof-of-Stake (POS)
The most significant change that will happen during this upgrade is the transition from POW to POS. Now, we will be covering ETH 2.0 staking in a future article. This time around, let’s give you a little overview.
So, what is POW?
In a POW system, specialized nodes called “miners” who use specialized equipment like ASICs to solve cryptographically hard puzzles. If they are successful, then they get to add a block to the blockchain and earn rewards.
POW, while secure, has the following problems:
- Firstly, it is not a scalable method. The validation of blocks takes a long time, and this time only increases as the network gets bigger in size. Ethereum currently solely manages to do 15-20 transactions per second.
- POW requires you to waste a lot of energy via computational resources. As you can imagine, this isn’t a very environmentally-friendly option.
This is the reason why Ethereum is opting for a POS strategy.
- POS makes the whole mining process completely virtual.
- Nodes that want to become validators in the network need first to lock up a stake. In eth 2.0, validations will need to commit at least 32 ETH in the system.
- Following that, validators will be able to sign off on a block, the more their stake, the more their chances of signing off on a block.
- They will receive a reward that’s proportional to their stake.
Ethereum will be adopting solutions like Beacon and Casper to transition over to POS successfully. As mentioned before, we will be going into the bare bones of this topic in a future article.
#2 Sharding
Most of the technical advances that Ethereum will make in its Casper upgrade are scalability-related. Sharding is a layer-one scalability technique that will scale Ethereum up to thousands of transactions per second. So, how exactly does this work, and why is it beneficial?
For this, let’s understand the difference between sequential and parallelized tasks. If you need to move from position A to position B, you have to do three tasks T1, T2, T3. Now, if you have to do the tasks one after another, then its called sequential. However, if you can somehow manage to do these three tasks at once, then it’s a parallelized task. As you can imagine, the latter is a considerably faster method.
Cryptocurrency transactions are sequential:
- You first verify the signature of the sender.
- You then check if the person has enough balance to send over the money.
- The money goes over to the receiver’s public address.
- The receiver unlocks the money with its private key.
As you can see, the processes here can’t be parallelized, and for a good reason. Every single thing here needs to be processed before it can go on to the next one. However, what if we parallelize the state itself? Ethereum is hoping to achieve that with Sharding.
What is Sharding?
Sharding is a very popular concept in database systems. Databases sometimes need to deal with a large amount of big data, which makes traversal and data location extremely difficult and inefficient. What Sharding does, is that it horizontally partitions your database and becomes much easier to handle sub-databases. Let’s look at a simple example of what we are talking about:
Here, we have a table that declares two variables – A and B. Along with that, we have multiplication and a division function. Now, if we implement Sharding, it horizontally partitions the table into these:
Basically, smaller sub-tables of the same table.
It’s crucial to note that Sharding is a horizontal partition. The reason being, when you do a vertical separation, this is what it looks like:
See that?
Upon vertical partitioning, the subtables are entirely different tables from the original ones.
The smaller subtables that you get following horizontal partitioning are called “shards.”
How does ETH 2.0 use Sharding?
As we have mentioned before, Ethereum’s architecture makes it inherently non-scalable. As more nodes enter the system, the more time the whole verification and consensus process takes. What Sharding does is that it breaks down the entire state of the blockchain into more manageable shards. Every single Ethereum account will belong in a shard.
To understand how this works, imagine a hypothetical network with three nodes – Alice, Bob, and Charlie. This network has to verify data D. Now, instead of these three checking the data at once, the data gets broken down into three shards – D1, D2, and D3. Alice, Bob, and Charlie get a shard and work on it at the same time. When you scale this model up, you can see why this can save an exponential amount of time and resources.
#3 Layer-2 Scalability
In blockchain terminology, layer-2 is a framework that lies on top of the existing blockchain. This framework will enable users to conduct interactions, which would typically occur on the blockchain, off the blockchain. In the process, it will help reduce clogging in the main blockchain and increase overall speed and scalability. ETH 2.0 uses two techniques to capitalize on layer-2 scalability – Raiden and Plasma.
Raiden
The Ethereum community has long debated and talked about the scalability issues prevalent in the underlying protocol. One of the factors that make Ethereum’s transaction slow is its verification process. The miners must verify the validity of each transaction before inserting them into their blocks. While this sounds good on paper, the reality is quite different. The process creates a bottleneck and increases the waiting time for the rest of the transactions in the mempool.
Raiden uses state-channels and hashed timelock contracts (HTLC) to allow users to rapidly and directly transact with each other. A state-channel is an off-chain, cryptographically-secured communication channel between participants.
Raiden is especially helpful in the case of microtransactions. Usually, it makes no sense to send $1 to someone through ETH, since you will have to pay a transaction fee and wait for verification. Raiden allows Ethereum to organically handle a large volume of microtransactions.
Image Credit: Raiden.Network
So, how does it work? Let’s do a brief overview:
- Suppose Alice wants to interact with Charlie and both of them have a common connection with Bob.
- These three enter into a state-channel by sealing off a portion of the blockchain with smart contracts.
- Inside this channel, Alice and Charlie can interact as many times as they want.
- The channel closes down after a certain amount of time has expired. This time is predetermined by the participants.
- The miners receive the final state of the transaction and commit it to the blockchain.
- Raiden is a two-way state-channel, wherein both the sender and the receiver must validate the transactions.
The advantages of using Raiden are as follows:
- Allows Ethereum to scale up its throughput.
- Its API is very easy-to-use.
- Users can interact with Raiden through its native RDN token.
- Allows you to transfer money fast with ease.
- Decreases bloat on the Ethereum blockchain.
Plasma
Plasma is like layer-2 on steroids. The whole idea is to break down the blockchain into an entire network of child blockchains or plasma chains built on top of the main blockchain. OmiseGo is an Ethereum-based open-source payment platform. They are presently working on plasma implementation.
Image Credit: Plasma Whitepaper
Let’s break down the functionalities:
- The root chain sets all the ground rules, which all the plasma chains will need to follow.
- Each level of the plasma chain is answerable to the preceding level. So, in the diagram above, the plasma chains in the 2nd tree depth are the children of the chains in the 1st tree depth and so forth.
- Plasma leverages the MapReduce function to distribute and collect work from the relevant child chains.
- If an operation (like a transaction) needs to be executed via plasma, it will be parallelly distributed among all the concerned child chains, via the MAP function.
- Once completed, the parent chain will use the REDUCE function to accumulate all the data from the child chains. The child chain submits the data in the form of Merkilized proofs.
- The root chain will not participate in any of the operations. It will only jump in if there is some dispute among the child chains that need resolution. This makes sure that the root chain experiences minimal bloating.
If properly implemented, the Plasma protocol will allow Ethereum to speedily and efficiently execute vast amounts of data, without clogging up the main blockchain.
#4 eWASM
The next significant update to consider here is eWASM. Before we get into it, let’s understand what the Ethereum Virtual Machine (EVM) is. You can think of EVM as the core computational component of Ethereum or its CPU, so to speak. The EVM takes care of all of Ethereum’s internal state and computations. The EVM makes sure that the following components of the are correct:
- Block Information
- Storage State
- Account State
- Runtime Environment Information
The EVM is also responsible for executing smart contracts by converting it from solidity/Vyper to machine-readable EVM bytecode. The EVM executes bytecode in every single node on the network. Since it is responsible for so many functions, the speed and efficiency with which the EVM operates are directly proportional to the speed and efficiency of the entire network.
The eWASM solution
The solution that eth 2.0 will use to contour this issue is WASM or WebAssembly – an open standard instruction-set developed by a W3C community group. The W3C group is an open standard instruction-set currently being worked on by Google, Mozilla, Microsoft, and Apple.
Features of WASM are as follows:
- WASM is fast, efficient, and portable. It takes on hardware capabilities and runs at “near-native speed.”
- It is easily debuggable and readable via its use of a human-readable text format. It allows code to be viewed, written, and debugged by hand.
- It enforces the host browser’s permissions policies and remains highly compatible by maintaining backward compatibility. As such, it is highly secure..
So, at this point, you must be wondering, what’s the difference between WASM and eWASM. To understand the difference, just keep in mind the following formula:
eWASM = WASM — nondeterminism (floating point) + metering + EEI (methods that are used to interact with Ethereum).
The team that’s creating eWASM has listed down the following as their goals:
- Create an EVM transcompiler and a metering injector. They prefer this to be an eWASM subcontract.
- Create a precise specification of the Ethereum interface and eWASM contract semantics.
- Build an eWASM backend for the solidity compiler that will provide instruction and a library for creating C and Rust-enabled smart contracts
With the eWASM implementation, Ethereum will join projects like Polkadot, Cardano, EOS, Tron, Spacemesh, and NEAR protocol, who have either adopted or are in the process of choosing WASM.
#5 Other ETH 2.0 updates
Ethereum has already implemented a bunch of system-wide upgrades that are part of its current Metropolis version implementation. Ethereum may also incorporate privacy in the form of zk-SNARKS or “Zero-Knowledge Succinct Non-Interactive Argument of Knowledge.” A privacy protocol made famous by Zcash and refers to a construction that allows a prover to prove to a verifier that they own a particular piece of knowledge without directly telling them what that knowledge is.
ETH 2.0 fork: The different phases
As you can imagine, ETH 2.0 needs to be implemented in various forks or phases to ensure each piece of the update is integrated correctly. These phases are as follows:
Phase 0
The Phase 0 of ETH 2.0’s implementation begins in 2020. It will launch the beacon chain, which will signal the beginning of the proof-of-stake implementation. The beacon chain manages the registration of validators, who will attest the blocks and integrate them on ETH 2.0.
For the beacon chain to launch its first block, aka genesis block, the following conditions must be met:
- At least 524,288 ETH must be staked on the network.
- The network should already have at least 16,384 validators to ensure security and decentralization.
NOTE: Ethereum will not distribute the rewards until it reaches these numbers. This is why the network will depend on its early participants’ charitable nature in phase 0.
Another thing to keep in mind is that the original Ethereum POW chain will continue to exist along with the beacon chain in the early phases. In fact the beacon chain is not going to be particularly useful in the early stages since it will be able to do the three most important things that an Ethereum chain should be able to do – process transactions, execute smart contracts, or host dApps.
However, Ethereum has purposefully done this. It ensures that the operations in the main chain are not disrupted during the transition. The original blockchain will continue to run during Phase 0 and Phase 1. In Phase 1.5, the two chains will eventually become one.
Phase 1
Phase 1 should take place in 2021 and it’s all about Sharding implementation. For ETH 2.0, the Sharding will result in the blockchain partitioning into 64 shard chains that will run parallelly and should be able to communicate with each other easily. This will enable Ethereum to theoretically process multiple transactions, in 64 blocks simultaneously. With these chains communicating with each other, the burden is spread across blocks, reducing bloat in the main chain.
Phase 1.5
Phase 1.5 is all about the merging between the original POW chains and the beacon chain to create the new POS chain. The POW chains will exist as one of the 64 shard chains along with the beacon chain.
Adopting this approach makes sure that:
- There’s no break in continuity or data history.
- ETH holders will not have to undergo any sort of token transfer or swap between Ethereum 1.0 and 2.0.
- ETH holders will be able to use their tokens on ETH 2.0 easily without any extra work. They don’t have to worry about their tokens getting obsolete.
- While the original POW chain’s history will still exist, it’ll no longer run using the POW consensus mechanism. It just runs like any other shard.
Phase 2
Unlike Phase 0, 1, and 1.5, the details of what will happen in Phase 2 is still not very clear. Post POS and Sharding implementation, ether accounts, transactions, transfers and withdrawals, and smart contract execution will be implemented in this phase.
ETH 2.0 – Conclusion
ETH 2.0 is going to be one of the most seismic events in cryptocurrency space. With the implementation of POS and Sharding, it will be exciting to see how Ethereum’s throughput improves. Beyond Phase 2, there should be more opportunities to increase the overall reach and functionality of the Ethereum network.
Meanwhile, why don’t you check out some of the blockchain courses already available on Ivan on Tech Academy? We have several high-value accredited classes on blockchain technology and cryptocurrency that have been created by our in-house trainers and industry experts. If you want to know more about Ethereum, why don’t you check out our course on smart contract programming? We hope to see you enrolled soon!