For many of us while watching introductory videos to blockchain. We keep hearing that blockchains are lists of transactions that are stored in databases in a network that are connected through nodes.
Sometimes these nodes are referred to as computers, but what really is a node in a blockchain, this article will talk about nodes and the “mining” of blocks in the Ethereum network.
In my previous article, I mentioned that anyone can participate in the consensus mechanism, well not really anyone, only people that are capable of running a node can participate in the network consensus, for your computer to be part of the nodes running the Ethereum blockchain you ought to have Ethereum clients software installed, this is connected to other computers that are also running this software, forming a network. This application software has 2 parts the execution client and the consensus client.
“A client is an implementation of Ethereum that verifies data against the protocol rules and keeps the network secure.”
What we know as mining of blocks isn't really mining in Ethereum, it is called validation of blocks, now how does this happen……
First, it is important to note that the consensus mechanism in Ethereum is called proof of stake, where the nodes willing to participate in the consensus process stake 32 eth to be part of the validation nodes.
When a transaction is initiated, the transaction gets broadcasted to the network of nodes, it then gets submitted to the execution client of the node, the execution client confirms if the sender has enough eth if there is, the transaction gets executed and it gets added to a pool of pending transactions (the mempool), waiting to get validated, when the list of these transactions reach its target size (between 15 million gas to 30 million gas), the process of the block validation then begins, this is where the consensus client comes in. One of the nodes in the network is pseudo-randomly selected with RANDAO, to be the block proposer, what the block proposer does is build and broadcast the block that is to be added to the blockchain, and then the rest of the validation nodes that were not selected to be the block proposer become the block attester, receive the new block on the consensus layer gossip network, they pass it to their execution client and the transactions are re-executed locally to ensure the proposed change is valid, they vote on the block proposal, after this, the block gets added to the blockchain. This is when the transaction gets finalized.
The nodes that participated in this consensus process get rewarded in eth.