An in Depth Look at the GHOST Protocol: Part 2- How GHOST Works

CS
Coinmonks
Published in
4 min readApr 7, 2020

--

Photo by Toa Heftiba

In part 1 of this series we looked at why the longest chain rule fails in high-throughput blockchain (low security/high wastage). In part 2, we will take a look at how the GHOST protocol aimed to resolve this issue, as well as how Ethereum chooses to implement it.

In their paper, Yonatan Sompolinsky and Aviv Zohar proposed that instead of nodes following the “longest” chain, they should follow the “heaviest” chain.

Taken from Secure High-Rate Transaction Processing in Bitcoin. The attacker in this image would overtake a blockchain using the longest chain rule but not one using the GHOST rule.

By using this method, an attacker can no longer simply outpace the network. As the figure above shows, in GHOST, all blocks are taken into account when determining the overall PoW.

This ensures security risks are kept constant even as throughput is increased.

Taken from Secure High-Rate Transaction Processing in Bitcoin. In Fig. 4 and 5 we see even as block creation rate increases, security remains constant for blockchains using GHOST rule.

Great! Now let’s look at how Ethereum chooses to implement this protocol. In his white paper, Vitalik Buterin mentions the three issues that the GHOST protocol solves for Ethereum:

  1. Security breaches
  2. Wastage
  3. Centralization

The first two we should already have a pretty strong understanding of. It is the third topic I want to take a second to discuss. Why would a high throughput blockchain lead to more centralization in a network? The white paper describes it as such:

“if miner A is a mining pool with 30% hash power and B has 10% hash power, A will have a risk of producing a stale block 70% of the time (since the other 30% of the time A produced the last block and so will get mining data immediately) whereas B will have a risk of producing a stale block 90% of the time. Thus, if the block interval is short enough for the stale rate to be high, A will be substantially more efficient simply by virtue of its size.”

In other words, in the “longest chain” model, as throughput increases, large mining pools will have a proportionately growing head start to resolve forks in their favor, therefore giving them more control of the network.

Centralization in Ethereum is combatted by taking Sompolinsky and Zohar’s protocol a “step further” (as the white paper puts it) by rewarding miners for producing Uncle blocks, negating network propagation issues. Rewards are based on the calculation:

( [ uncleHeightNumber + 8 - BlockHeightNumber] * reward / 8 )

This calculation allows for 7 levels of Uncle blocks. There is also a diminishing return for each additional Uncle in a chain. The reason for this is to simplify reward calculation and remove the incentive for continual mining on Uncle chains, which poses security risks.

Let’s take a look at a real-life implementation of this formula. Block height 9825137 included 2 Uncles at heights 9825135 and 9825136. If we plug these three heights and the current block reward of 2 into the formula (try it!), we will end up with respective rewards of 1.5 and 1.75 ether for the two Uncles. The miner of block 9825137 will also receive 3.125% of the block reward as incentive to include the 2 Uncles.

Block #9825137 taken from etherscan. Notice that it includes both rewards for Uncle heights 9825135 and 9825136.

It should be noted an Uncle chain will rarely extend past 1 or 2 blocks as miners will find more reward in mining on the main chain (remember Uncle rewards diminish rapidly). As a matter of fact, I had to go 75 pages deep on etherscan just to find the example above!

The GHOST protocol has allowed Ethereum to garner a throughput of roughly 20 transactions-per-second (accounting for a proper number of confirmations). While this is a major improvement on Bitcoin’s measly 7 transactions-per-second, it is nowhere near the throughput needed to rival centralized systems.

That being said, Ethereum is set to switch to the Casper protocol in the near future, an improvement upon GHOST (hence the name) that utilizes Proof-of-Stake and sharding in hopes to speed up its network without sacrificing security or decentralization, and though the exact date has not been announced, it is estimated to be released in 2021.

This is part 2 of 2 in my series explaining how the GHOST protocol works.

Get Best Software Deals Directly In Your Inbox

--

--