In essence, the Ethereum blockchain is a single-element general state transaction system. Computer science describes a concept of a “state system” or a “state machine” as a system which processes input data and, based on it, is transformed into a new state.
On the Ethereum state machine, all processes start with an “initial state.” Such a state is an equivalent to the zero state in which the machine remains until the very moment when any actions related to transactions start taking place in its network. When such actions start occurring, the initial state is replaced with the final state. In addition, the final state shows the current Ethereum state at any specific time.
The Ethereum state has millions of transactions. These transactions are grouped into “blocks.” The block includes a number of transactions, and each subsequent block connects to the previous one, and thus, a unique chain of blocks is created.
The transaction must be correct to trigger its transition from one state to another. The transaction is considered to be correct exclusively when it has passed the verification process – the so-called “mining.” Mining is the process when a group of nodes (computers) utilizes their computing resources to create a block of correct transactions.
Any node in the network which claims to be a miner can try creating and verifying a transaction block. Many miners commonly attempt to simultaneously create and verify a block of transactions. Every miner provides their mathematical “proof,” connecting a block to a blockchain, and this proof is a kind of guarantee: in case the proof exists, the transactions in the block are considered to be correct.
To add their block to the main blockchain, a miner has to provide their mathematical proof sooner than any other competitor does. Each block verification process, which involves the miner’s mathematical proof provision, is called “proof of work.”
A miner, who creates a new block, earns a certain reward for doing this work. What kind of reward is it? In the Ethereum blockchain, a built-in digital token called “Ether” is utilized. Every time a miner creates their block of transactions, new token or new Ether is created, and the miner receives a reward for creating it.
Now, you may have quite a logical question: is it guaranteed that each miner will stick to a single chain of blocks? How can I be sure that some other team of miners will not take a decision to create their own chain of blocks?
We have already mentioned the following definition – “a single-element general state transaction system.” Based on this definition, we can come to a conclusion there are no two or more correct current states – a current state is unique. So, everyone who takes part in the new block verification process has to accept this statement as true. If there were several states (or chains), it would disrupt the entire system because it would be impossible to agree which of the states is correct. For instance, let us imagine there are several chains of blocks. In this case, you theoretically could collect 10 coins in one chain, 20 coins in another one, 40 coins in the next, and so on. Therefore, it would be impossible to determine which chain is the “most correct.”
Every time when a branch is generated, a new “fork” takes place. Forks are very undesirable as they disrupt the system integrity, and users have to choose one of the possible chains.
To determine which of the possible forks is correct and to prevent the multiple chains creation, a technique called the “GHOST protocol” is enacted in the Ethereum system.
GHOST – “Greedy Heaviest Observed Subtree”
I will try to put it in simple words: the GHOST protocol declares we have to choose exclusively the chain with the largest number of calculations performed. To find such a chain, the block number considered to be the last (“leaf block”) can be used. Using this approach, it is possible to calculate the total number of blocks in the current chain (excluding the initial state block). The higher the block is, the longer the chain is, and the more verifications miners have to provide. Based on such conclusions, the only correct version for the current state is accepted.
Read more on Ethereum: