An in Depth Look at the GHOST Protocol: Part 1- Where the Longest Chain Rule Breaks Down

CS
Coinmonks
5 min readApr 7, 2020

--

Photo by Jackson Simmer

TL;DR- the longest chain rule will not work on blockchains with high throughputs because it leads to too many forks, ultimately resulting in network wastage and security risks.

This is the first of a two part series examining the GHOST protocol. If you haven’t had a chance to read through my last two posts and are not familiar with what uncle and orphan blocks are, I highly recommend you check them out first. They are “An in Depth Look at Orphan Blocks” and “Why you Should Love your Uncle (Blocks)”.

With that said, let’s get into it.

At the time of writing, Ethereum currently boasts an average of just 13 seconds (compared to Bitcoin’s 10 minutes). To achieve this massive improvement, the Ethereum network had to abandon the “longest chain” rule in favor of what is known as the “Greediest Heavy Observed Subtree” or GHOST protocol. This begs the question:

Good question.

In Yonatan Sompolinsky and Aviv Zohar’s (the creators of the GHOST protocol) paper, “Secure High-Rate Transaction Processing in Bitcoin”, they discuss two main issues associated with a high throughput blockchain using the “longest chain” rule to achieve consensus; More wastage and less security.

The first issue is pretty intuitive. If the block time is reduced (or block size is increased), forks will occur more often because of latency issues, which in turn leads to more wastage in the network.

It is the second issue that is a bit more complex, and thus makes up the bulk of my post. So to explain it, I’m going to bust out one of my handy dandy examples (yes that’s a reference to Blue’s Clues).

Okay, let’s say Winfred is an honest mining node in the Bitcoin network. He has a little ASIC mining rig set up and he’s cranking out a pretty decent hash rate in his mom’s basement.

Nice.

I mentioned them briefly above, but to be more explicit, there are three ways a network can increase the throughput of its blockchain.

  1. Decrease the block time.
  2. Increase the block size.
  3. Do both.

Now let’s assume one day the Bitcoin network has a vote, and they decide it is in Bitcoin’s best interest to go with number 3 and do both, because SCALE.

Well, that’s great! Bitcoin’s biggest criticism has just been completely erased. Looks like this baby’s going to the moon!

To top it off, that very week, Winfred’s little rig just so happens to win the next block! And even though there was a fork, the next block ends up on top of his and thus is accepted to be the main chain. He’s rich! Now his mom gets to live in his basement.

But in the meantime, Mr. Notsohonest node has been praying each and every night for this moment. He runs a pretty sizable mining rig, but not nearly large enough to out mine the network as a whole. However with these new bigger, faster blocks, that is about to change.

Just as our friend Winfred adds the next block to the blockchain, Mr. Notsohonest has also mined a couple blocks himself, but here’s the catch, he did not announce this to the rest of the nodes. By doing so, he is trying to outpace/outwork the public network with his private network (keep in mind Bitcoin’s longest chain rule).

Working on a local private network gives him a huge advantage over the public network that you are a part of. In his local network he has the benefit of not dealing with the same latency issues that the public network is faced with. He also has the added benefit of being much more efficient at lengthening his chain without conflict because he will not produce forks.

And as we mentioned above, because the network naively voted to increase the block size and reduce the block time to speed up the overall chain, the public network will become extremely inefficient as it solves the PoW algorithm very quickly but propagates very slowly, ultimately resulting in many, many forks, blooming his advantage astronomically.

A visual representation of tradeoffs in Bitcoin taken from Secure High-Rate Transaction Processing in Bitcoin. As block size and block rate are increased, fork rate increases and security decreases

He now needs only a fraction of the hash rate he previously did to overtake the network. So when he finally sees a fork trying to be resolved(causing a brief slow down in the lengthening of the main chain), he will use that time to “outrun” the network and create the longest chain. Once he has done so successfully, he will finally announce it to the rest of the nodes.

So even if the fork in our example was resolved in Winfred’s favor, the time it took to resolve that fork, along with the slower propagation inherent of larger blocks gave Mr. Notsohonest enough time to outpace the network.

A simplified visual from Secure High-Rate Transaction Processing in Bitcoin that represents how an attacker can take advantage of a fork in the network by mining on a private network.

The network will now path onto Mr. Notsohonest’s chain (the longest chain), Winfred will lose his mining reward, the last of his life savings will be exhausted on the monthly payment for his new money green Lambo, and it will be his 40th birthday tomorrow and mom can’t bake.

This is the first of a two-part series. In part two we will look at how the GHOST Protocol solves the “longest chain” problem as well as examine Ethereum’s implementation of it.

Get Best Software Deals Directly In Your Inbox

--

--