Skip main navigation

New offer! Get 30% off one whole year of Unlimited learning. Subscribe for just £249.99 £174.99. New subscribers only. T&Cs apply

Find out more

How is consensus established?

How do consensus mechanisms work when rewarding the community for contributing towards a blockchain? Learn more in this article.

As we explored in the previous article, in order to ensure the hosts across the community of a blockchain are rewarded for their contribution, a consensus mechanism is used.

These ensure participation in the community to avoid changes to the blockchain, as well as provide an incentive to the hosts. The two ways that consensus can be established are through either a ‘proof-of-work’ approach or a ‘proof-of-stake’ approach.

Proof-of-work (PoW)

The PoW consensus mechanism was the first to be proven and was part of the original revolutionary design of the Bitcoin blockchain. In simple terms each time a block is ready to be given a hash, a challenge is put out to the hosts to be the first to create a particular type of hash using the SHA256 algorithm, such as one with four zeroes at the start.

This involves adding a new number to the final block (called a ‘nonce’, or a ‘number only used once’) and running the SHA256 and seeing if the first four items are zeros. Typically the nonce is generated randomly or it can simply start by adding a ‘1’, then a ’2’, etc until ‘0000’ appears at the start, something like this:

0000dedb4946c17409dc1f0c9a795c237b08c6119c898ecc4e88deecbd9a46ab

In order to level the playing field, nodes that are winning lots of challenges are given the task to find more than four preceding zeros, while it is made a little easier for nodes that are not winning very often by allowing fewer zeros. The winner not only gets the transaction fee for the block – they also get some freshly minted Bitcoins with an initial block reward of 50 Bitcoins, worth 3.4 million in November 2021. Since 2009, the amount of Bitcoin minted has been slowing down and will continue to do so until the maximum of 21 million has been issued, with 19.4 million Bitcoins minted in May 2023.

decorative image

The SHA256 algorithm is a key part of the digital magic that allows blockchains to work, and it was created in 2001 by the US National Security Agency – some 7 years later it was included in the Bitcoin White Paper. SHA stands for ‘Secure Hash Algorithm’ and the SHA256 algorithm is currently one of the most secure hash algorithms in the world. A key feature is that it is not possible to reconstruct the original data if you only have the hash, meaning that it can be publicly displayed, such as in the Bitcoin blockchain which is public. An example of a transaction stored in the Bitcoin blockchain is shown in Figure 1 and the hash for the block is:

00003hs8j4kf93js05je68113f175a6b517294546bbb22748f3adc9ddac68a3

As you can see, the persons or entities sending and receiving the payment are identified using something similar to a hash, which is a unique 26-35 alphanumeric code.

Example of a transaction stored in the Bitcoin blockchain Figure 1: An example of a transaction stored in the Bitcoin blockchain

Proof-of-stake (PoS)

Once it was clear that a consensus mechanism could be created using the ‘proof-of-work’ approach, enquiring minds set to figure out how to overcome one of its main drawbacks. As we will explore later in this week, a large amount of computational power and associated energy consumption is needed to operate the Bitcoin blockchain as thousands of hosts race for the reward.

An alternative is called ‘proof-of-stake’, invented by Scott Nadal and Sunny King in 2012, and this is now a common consensus mechanism used by blockchains. In this approach, an entity puts up a ‘stake’, such as $1,000 worth of the Blockchains native currency (called ‘tokens’), which is locked inside that blockchain in order to become a host. Often a group of entities combine their stakes in order to present a larger stake to the network which will attract a larger reward.

Now, when the blockchain needs a block validated, it will look to see how much each host, or group of hosts, has staked. The chances of being selected to verify the block are directly proportional to the value of the stake compared to the total staking pool. Imagine if 10 hosts each put in $1,000 worth of tokens, then they will each have a 10% chance of being selected.

decorative image

However, if one of the hosts really wants to increase their chances of being selected, they could put in $6,000 while everyone else keeps putting up $1,000. This means the pool is now $15,000, and the host with $6,000 at stake will have a 40% chance of being selected, but it is not guaranteed. In this model, it is possible to game the system by putting in a very high stake, but as we discussed previously it is very easy to see if a host has been compromised, or if they are a bad actor. In this case, they would lose their stake and have no way to get it back.

The beauty of a PoS system is that people who have small amounts of tokens of a particular blockchain can put some of them into a ‘staking pool’ with others which increases the chance of being selected, and then sharing the rewards. For instance, it is not uncommon for staking returns to be in the order of 4-12% compound interest, and the reward is paid in tokens that can then be re-staked, over and over.

Proof-of-authority (PoA)

A variation of the PoS is the ‘proof-of-authority’ or ‘PoA’ approach, in which rather than staking tokens the hosts literally stake their identity and reputation. This is mainly to account for very rich entities being able to stake relatively large amounts that present a low risk to them, and as such are less incentivised to do the right thing.

In a PoA, known entities put their reputation and ongoing participation on the line, rather than putting up tokens. However, a limitation is that a PoA approach can only involve a limited number of hosts, compared with a PoS approach that everyday people can be involved in, with the VeChain blockchain selecting 101 ‘Authorities’ as hosts (and are referred to as ‘Masternode Operators’).

This article is from the free online

Introduction to Blockchain for Business

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now