Next up on the roadmap for ETH2.0 will be the merging event, which will launch Proof of Stake and make the Ethereum blockchain as we know it one of the shards on the Ethereum network. But why does Ethereum need shards, and what will be possible after multiple shards are ultimately launched?
We've previously touched lightly on what sharding will bring but if we dive a bit deeper into the why's and how's, we can really see the level of scalability this exciting upgrade might make possible.
The Trilemma
Today's Ethereum chain is congested, and transactions are much more costly than desired. The Ethereum network can process roughly 15-30 transactions per second, which is way too low for today's demand of new NFTs, DeFi, and all the other fun that's happening right now on chain.
There's a common trilemma that nearly every blockchain system faces, known as the DCS triangle, in which there's no possibility to simultaneously achieve decentralization, consistency, and scalability. You can only have two at once, not all three.
Decentralization
The "D" in DCS, decentralization means that no single entity has full control of the network. Anyone can join the network, and it's possible to run a client on a common device, such as a normal laptop or a small virtual server.
Consistent
In the context of Ethereum, consistency dictates that all nodes see the same data of the Ethereum chain at the same time. This prevents problems such as double-spends, wherein one transaction could be performed multiple times.
Scale
The main issue with Ethereum right now. As every node needs to know the same data that every other node knows, Ethereum is practically limited to the speed of a single node. Right now, Ethereum can be classified as being both decentralized and consistent, as anyone can choose to run a node on the network while seeing the same data as everyone else. But this has come at the cost of scalability failing to meet current demands.
The Solution
Sharding is an attempt to solve this trilemma. Sharding is already a common phenomenon in database structures, wherein a large database is split up into multiple, smaller databases that can operate faster, ultimately making the entire system more efficient and scalable.
In the context of databases, this is known as facilitating horizontal scaling or scaling out, by adding additional machines to spread out the load and facilitate more traffic and quicker processing. If you were to only have one machine hosting the database, and simply continuously upgrade this machine with additional processing power over time, it would be called vertical scaling or scaling up. However, such a system will ultimately run into limits regarding its computing resources.
With sharding in Ethereum, this means that one node might only keep an eye on a subset of the network, but not have to keep track of any transactions happening on other parts of the network.
The Merge
The Merge is when the Ethereum chain as we know it will "merge" with the beacon chain, ending Ethereum's proof-of-work mechanism that it launched with and transitioning to proof-of-stake.
Sharding was initially planned to take place before the merge, but with layer 2 scaling solutions becoming much more popular in recent times, priority has shifted to allow the merge to happen earlier.
Miners will soon be replaced by validators who stake their Ether, process transactions, and attest to new blocks. No longer will you be required to supply an immense amount of computer power, and a validator node will ultimately be something you can run on even your phone due to the low hardware requirements.
The Validators
Sharding would not work with the proof-of-work system that Ethereum currently has. In such a system, sharding would dilute the computational power required to corrupt the network altogether, ultimately making it easier for malicious actors to take over shards.
For sharding to be a success, there needs to be a large number of validators on the network, something that can be achieved with ease of entry and low hardware requirements.
The Shards
Though the launch of proof-of-stake will speed up Ethereum's transaction throughput significantly, there's no indication that layer 2 solutions will disappear any time soon, even when sharding launches at a later stage.
Sharding will likely be deployed in two iterations. "Version 1," which will be the first shard chains deploying to the network, won't actually be able to do much for gas-guzzling DeFi projects at a first glance, as they won't be able to process transactions or contract interactions. However, they will be able to store data, which might just be enough to solve the current gas crisis.
This is where L2's, and especially rollups, come into play. Currently, various dapps are already using rollups to save gas costs by performing computation off-chain (on layer 2), creating a cryptographic proof, and then "rolling up" the data of a bundle of transactions on-chain (layer 1). This method of saving gas, and thus transaction costs, is already heavily used on the Ethereum chain.
Once sharding goes live on Ethereum, it will initially launch with 64 shards, each of which will operate in parallel. By combining rollups and the fact that shards will be able to store data, various Ethereum stakeholders are confident this might just introduce the possibility of ~100k transactions per second to Ethereum, a big upgrade from today's ~30!
"Version 2" is intended to add more functionality to shards, allowing them to handle transactions, account balances, and smart contracts. This additional functionality was always on the roadmap, but since version 1 should be able to provide such an increase in transaction throughput, there have been discussions within the Ethereum community on whether launching version 2 still really needs to happen.
In one scenario, additional functionality might only get introduced to a few shards, leaving the remaining shards with only the possibility of storing data. However, with version 2 still far away, this debate will likely continue to be held for quite some time.
The Beacon
The various shards that will ultimately make up Ethereum will be able to communicate with each other through the beacon chain, which has already been launched on the Ethereum network since late 2020. For a refresher on the beacon chain, you can find our ETH2.0: Everything You Need to Know article.
To summarize, the beacon chain is there to keep an eye over all the shards on the network and facilitate the validators on the network. When a block within a shard is created, also called a shard block, the header of this block gets added to the beacon chain, containing any new information regarding the state (such as transactions) of the shard block.
Other shards will then be able to retrieve this information via the beacon chain.
Conclusion
Much is still to change about how sharding will eventually look like as part of Ethereum, and we're still some years out. Shipment of shard chains is currently expected to be sometime in 2023, a few years later than initially anticipated, but this could still be earlier or later depending on how Ethereum's switch to proof-of-stake with the merge will go, and how work progresses after that.
The process of reaching ETH2.0 has already started but isn't something that will happen overnight. The beacon chain has already been launched, providing a foundation for Ethereum's merge event which will soon™️ transition Ethereum to PoS. Launching shards will be the next focus, possibly followed by the expansion of functionality on said shards.
All in all, there's lots to look forward to (scaling!) and learn about. Ethereum.org provides great guides about the new ETH2.0 upgrades that regularly get updated, and we highly recommend checking those out to learn even more about this exciting new era for Ethereum.