What is a Gossip Protocol, and How Does it work?

What is a Gossip Protocol, and How Does it work?

The gossip protocol linked to peer-to-peer (P2P) is relatively unknown to the general public and even to some Bitcoin enthusiasts. However, the latter is essential to the functioning of Satoshi Nakamoto’s currency.

In Search of Lost Contacts

To avoid scaring you off from the first lines of this article, I’m going to picture the gossip protocol for you. And this by using representations within everyone’s reach.

First, let’s say you just got a new phone with an assigned number, and there are no contacts inside. You are quite old-fashioned, so to get the phone number of your loved ones, you choose to use directories.

As for your loved ones, they also don’t know that you have a new number. You will, therefore, gradually leaf through the first directory to find a number, then a second, etc. You have found the perfect directory where 8 of your loved ones have their number inside.

You will then make contact and explain to them who you are. Since we have mutual friends with these relatives, we will also seek to contact them. We are going to contact a friend to serve as a relay. He will randomly choose other of his friends to inform them that you have a new number. That’s when these new friends will do the same and so on.

Now that you have all your contacts and they know you, unfortunately, you fall ill. And that’s where having contacts comes in handy since you’re going to contact them. You will then announce it to some of them to protect them and that they do not take the risk of approaching you. They will then let other contacts know, who will also relay the information so that your entire network of relatives is aware. 

I hope you understood this little story because now we are getting down to business.

What is a Gossip Protocol?

Your phone is actually a node (network player), while the directory represents a DNS server. The node will try to connect to a DNS server to get the address of the other actors. The DNS truly plays the role of a directory since it has a list of all the addresses on the network.

Then, the DNS will provide it with these then our node will be able to communicate with its new neighbouring nodes (those directly connected to it), known thanks to the DNS.

It will ask them for the addresses they know to be able to connect to other nodes. Everyone will therefore share their list of nodes with which they are connected.

Note that since your node is also in a DNS, it will, in turn, be able to accept all incoming connections.

Once you have the list, you will be able to connect. Let’s take a node B that you connect with. B will send its randomly selected neighbouring nodes the address of your node. These chosen nodes will, in turn, choose another node and so on until the entire network is aware of its existence.

Once your node is known to everyone, it will start generating/receiving information and communicating it with its neighbours. 

Then, he will simply specify to his neighbours that he has information. Its neighbours will therefore ask it for this information; if they do not already know it, our node will be able to send it to them.

Linking Gossip Protocol to Bitcoin

Now that we have grasped the principle of a gossip protocol, we will have to link it to Bitcoin. Full nodes under Bitcoin run on the original software, which is Bitcoin Core.

From there, just take it all back and apply it. Data is indeed transactions. When the node will verify a transaction in the blockchain, it will generate data and “change state”. It will then announce this change of state randomly to a few other nodes of the network with which it is close.

Its neighbours will check if they know this transaction; if they already have it, they will reject it, if the transaction is false, they will also refuse it. If it is right, they will keep it in memory and then repeat the same operation with their own neighbouring nodes and so on. This is how each transaction communicates through the nodes.

This process also applies to mining using Proof of Work (PoW). Miners fetch the hash that solves the mathematical equation such that it starts with a number of 0 defined by the Bitcoin protocol. It will announce to the other nodes that it has the answer, and the latter will then check whether they have this solution or not. If it does not correspond to what the protocol requires, they will refuse it.

Once someone gets an agreed solution, they will announce it. The other miners ask what he found and check the parameters to be in accordance with the protocol. Assuming everything is good, they will, in turn, share it with other neighbouring miners and the block is resolved once the majority agrees. If someone offers a solution right after, since the other miners already know the information, they refuse it. 

If you want to see a graphical representation of gossip protocol, I invite you to take a look here.


Today, what makes the strength of Bitcoin is certainly its security, but the latter can only be ensured by transparency and flawless communication within the network.

This article does not deal with the specificities and other possible cases of the gossip protocol either but aims to highlight the basics of this technology.

Share this :