Sharding and nodes are vital parts of the success of the Ethereum Blockchain
This guide will help you guys better understand Sharding and Ethereum Nodes
They kind of deal with scalability, which are issues that both Ethereum and bitcoin suffer from.
The bitcoin network was supposed to go through a fork, known as Segwit in order to fix its scalability issued. Ethereum decided to do something else, which is sharding. But, we’ll go over that a little bit later. We need to get a grasp on nodes and networks first.
Bitcoin has somewhat addressed this issue by activating Segwit and by hard forking into
What in the world are Nodes and Sharding on the Ethereum network?
In order to make this easier, I’m gonna need you to imagine a small can. Which takes in some inputs, maybe beans? And then does something to them in order for something new to come out, outputs!
Well, imagine that this is a really basic network. And that the can is a node. Then imagine that the whole network is packed with these cans, but they are all connected to each other. But these cans or nodes are bound by specific rules.
So, the cans are nodes, which are components that accept inputs, perform an action, and provide an output. All nodes on a network are connected with each other.
Parameters are the rules that the nodes are bound by. But, before we dive deeper, it will be helpful if we figure out what a peer-to-peer network is.
What are peer-to-peer networks (P2P)?
Imagine a central server for a sec. Users who would like to connect with it send a request. Then they get a response. But the issue is that everything depends on this central server. Imagine if the server gets clogged or overloaded? Literally, every user will suffer. That’s not the only problem with a central server.
The other issue is that it’s most likely centralized. Therefore, it’s susceptible to hacking attempts. Additionally, the central authority can pretty much do whatever it wants.
Blockchains were pretty much developed to combat these centralized, abusive, networks. In a Blockchain, everyone has equal privileges, and nobody needs to request the server to participate in it. This is what is known as a P2P network. Everything is decentralized in a Blockchain.
But do we really need them?
Well, P2P networks are great for information and file sharing. Additionally, no centralized power exists. So, if something goes haywire, the network will function like normal. Now, imagine combining a decentralized network like this with different payment systems? All of a sudden you have some serious business brewing.
It’s time to jump back into Ethereum’s structure.
What is the Ethereum network?
It’s quite simple, the Ethereum network is a simple P2P decentralized network. The participants of a network, or the peers, are known as nodes. However, they are not entitled to any unique privileges or advantages. The Ethereum network functions on a fully topological system. Meaning, no hierarchy exists.
Every single cryptocurrency is practically built on the same concepts, staying true to decentralization. The main goal of the recent technological developments is to create a unique system in which there is no controlling party. But how would people know whats going on in the system if there isn’t anyone controlling it?
That’s where nodes come in, they record information on the network and relay it to other nodes. Eventually spreading it out until the entire network knows. We talked about cans and beans before. But what is an actual node on the Ethereum network? It cant be a can and beans, right?
Of course not, a node on the Ethereum network is a computer. Which either verifies transactions by means of mining, keeps a light copy of the entire Blockchain, or keeps a full copy of it.
Any PC that’s on the Ethereum network and stores a full copy of the Blockchain can be called a full node. Essentially, full nodes are the spleen of the whole ETH system. They are responsible for keeping the entire network authentic. Nodes have a lot of responsibilities, like giving out rewards to miners, ensures that double spending isn’t an issue, make sure that transactions are properly signed, and that correct data formats are maintained.
It’s important to note here that every miner is a node. However, full nodes are not always miners.
Let’s go back to the scalability issue?
So, how do agreements or consensuses occur on the network? Nodes solve mathematical algorithms in order to verify a transaction. When all nodes agree on the result, the transaction is verified. However, the number of transactions on the network has been gradually increasing. So, it’s starting to experience heavy transaction volumes. As a matter of fact, ETH has the most nodes out of any other cryptocurrency. ICO’s don’t really help the load intensity.
More nodes being added to the network doesn’t do much in terms of speed. Because transactions are verified in a linear way. So, the devs proposed 3 solutions which were to increase the block size, sharding, and force users to use different altcoins.
Increasing the block size would simply increase the total amount of transactions on the network. Though, this will not do much in terms of increasing node speeds. Additionally, a block increase can only happen during the event of a hard fork.
Forcing users to use different altcoins would essentially require the Ethereum Blockchain to be split up. This could increase the likelihood of hacks and create a power struggle for miners.
So, what is sharding?
Imagine that you have a database that experiencing a heavy load. Which obviously impedes scalability and makes data run at a slower rate. Well, you can partition your data so that it can be placed into smaller tables, and store it on separate servers. But the partition would have to be horizontal, this is due to how the network’s database tables were initially designed. Less data equals less load intensity.
But how would sharding help the Ethereum network?
Well, the best way to explain it would be to refer to how Mr. Vitalik Buterin covered the topic himself.
“Imagine that Ethereum has been split into thousands of islands. Each island can do its own thing. Each of the islands has its own unique features and everyone belonging on that island i.e. the accounts, can interact with each other AND they can freely indulge in all its features. If they want to contact with other islands, they will have to use some sort of protocol.”
So, the proposal is too pretty much have all of the blocks on the Ethereum Blockchain be split into different levels of interaction. Two levels to be exact.
So how do shards communicate with one another?
Going back to Vitalik’s island explanation. Each shard would work with parallel transactions at the same time. Effectively increasing performance and speed. However, every shard would generate its own receipt pertaining to a given transaction. And every transaction would change the state of the shard. Pretty much what happens on a shard, or in its memory, so to say, can be seen by every single other shard on the network. But, it can’t be modified.
Obviously, sharding is quite difficult to understand, even for some programmers. But essentially what it means is this. Suppose you want to send a transaction from account 1 on Shard X over to account 2 on Shard Y. It’s impossible to do this directly. So, what you do instead is generate a transaction on Shard X which, by means of cryptography, proves that you are indeed the owner of the 1st account and are the one who made the initial transaction. The transaction that you generated locks or destroys the pertinent funds. All of this is recorded and stored on a receipt within Shard X. The receipt is then collected by Shard Y at some later point in time. Shard Y will verify the validity of the receipt and integrate the results within itself. The transaction finally makes its way to account 2.
Sharding will become vital for the growth of Ethereum. At the moment, it is the only sensible solution. Unfortunately, it is quite a complicated one. Let’s wait and see how everything works out in the long run.