We all know Blockchain technology is making its name for its trustless and decentralised features, but what makes it so secure? Before a transaction can be completed successfully, it must first be confirmed by the blockchain. This process is based on a set of rules that define how devices, such as nodes, should communicate and transmit data with one another, otherwise called a protocol. The second part is ensuring that all nodes agree on the same state of the blockchain, which prevent any one individual from controlling or changing the blockchain. This is what we call consensus.
Consensus protocols are one of the most important aspects of Blockchain technology. They are integral to the trustless and decentralised nature of each blockchain, ensuring that all nodes in a network are synchronized with one another to keep the blockchain functioning, even if some members of the network fail.
Below we will discuss the main consensus protocols currently used by many companies.
Proof of Work
Proof of Work (PoW) was the first consensus protocol to be implemented by Bitcoin creator(s) Satoshi Nakamoto. It’s the secure and decentralised foundation on which Bitcoin runs and gained hype for its benefits over traditional payment services reliant on 3rd parties.
Most of us will remember having to take maths tests at school. Not only did we have to solve the question but we had to show our working to justify how we had arrived at the answer. Proof of Work in mining is the same concept, only that it’s working on a much more complicated algorithm that requires substantial processing power.
In proof of work, miners compete to solve a complex mathematical puzzle to verify the integrity of the transactions within a block. The work is intended to be difficult for the miner to solve, but easy for the network to confirm. The first person to solve this puzzle announces it to the network and in turn for their hard work receives new minted coins, also known as a block reward, in the given cryptocurrency.
To delve a little deeper into this process, the puzzle that the miner must solve requires substantial processing power to solve an algorithm that will calculate a specific output (hash) of a block. Each input processed will return a unique output, or hash. The specific hash the miner is searching for has a predefined prefix which, when solved, is how they can verify the integrity of the block. This prefix gets more difficult to calculate the more transactions go into a blockchain, which in turn requires an increasing amount of processing power and consequently energy consumption. PoW is considered secure in the event of a fork or split in the chain, as due to the amount of resources required to calculate the algorithm, a miner can only pull their resources to work on the chain they believes will be considered the true chain by the network.
While PoW has been great in ensuring a trustless ledger for blockchains such as bitcoin, it is now facing a number of issues which puts into question its longevity and sustainability. First, due to the amount of transactions moving through the blockchain and the increased difficulty in calculating hashes, it now takes anywhere between 10-60 minutes for a transaction to be verified which is becoming a far less attractive method of payment. Bitcoin’s energy consumption is now as high as many other developing nations, including Israel , Bangladesh, and Romania, and growing. As more blocks are created on a blockchain using PoW, the algorithm for solving each block gets harder, requiring more processing power to calculate all the variations before arriving at the answer. Over time this has led to a more centralised system of mining as those with money to employ large processing units in storage facilities such as warehouses have taken the monopoly on mining.
Proof of Stake
Proof of Stake (PoS) is another popular method for verifying blocks, and is the consensus protocol used by projects such as Nxt, Lisk, and Peercoin.
In this protocol, validators (known as miners in PoW) are selected to verify blocks based on the amount of stake (coins) they have in the network rather than computer equipment they own. To counter another protocol where the richest have the advantage to dominate the block validation process, there are a few different methods that can be applied to select block validators. These include randomised block selection, and coin aged based selection. In the latter, the amount of coins staked is multiplied by the number of days the coin has been stored in the same wallet/address. The minimum age of the coins must be 30 days, and this resets once a validator has signed a block. Once selected, validators must “stake” their coins, similar to moving their coins into an escrow account. This acts as a security deposit for the network that they will behave honestly. Validators don’t receive coins for mining as in PoW, but receive part or all of the transaction fee for their work.
PoS resolves a number of issues presented by PoW, namely:
- No requirement for expensive hardware – a laptop running the validator client online is all you need
- Cost and energy efficient with little environmental impact
- Faster transaction speeds
However PoS doesn’t come without its own need for improvement, one design flaw being the Nothing at Stake problem. Unlike PoW, where resources are exhausted so much that miners can only work on one chain, validators don’t have anything to lose by validating blocks on multiple chains, should a fork occur. Users of PoS are working on implementing rules and penalties for such behaviour to try and counter this problem.
Delegated Proof of Stake
Delegated Proof of Stake (or DPoS) differs from PoS in that delegates are voted to sign blocks by participants (or stakeholders) of the network. It is a more democratic system whereby variables such as transaction fees, sizes, and pay rates, are set by the stakeholders. Additionally, stakeholders determine who the delegates are to sign each block in a process called approval voting. Voting can take place whenever, and once each maintenance period votes will be tallied and applied before the next period begins. The voting power of stakeholders is proportional to the amount of stake or coins they hold in that network. The delegates that receive enough votes are selected to start signing blocks. Each delegate chosen takes turns signing blocks in a pseudo-randomised order, that is reshuffled each maintenance period. If at any time a delegate fails to produce a block, acts maliciously or against the good of the network then stakeholders can simply withdraw or shift their vote to a new delegate and that person will be removed from validating blocks.
One of the features of DPoS is the significantly faster transaction speeds compared to that of PoW or PoS. This is because each block signed in DPoS must include a verification that the preceding block was validated by a trusted node. This simple verification method removes the requirement used in other methods like PoW to receive a certain number of confirmations before the block can be confirmed.
Just like the other consensus models, DPoS does not exist without its own drawbacks. A democratic system is only as strong the people behind it. By having active stakeholders in the network giving or removing votes to delegates then the system works in a secure and beneficial way. However, if there is “voter apathy” or a decline in stakeholder participation, then delegates not performing favourably to the network may not be removed fast enough.
The consensus protocols above are the most commonly used consensus algorithms currently in use, however these are not the only ones being developed. Proof of Activity, Proof of Capacity, Proof of Burn and Proof of Elapsed Time are just some of the other protocols being developed that will come with their own features, benefits, and disadvantages over other protocols.
The limitations in the sustainability and expansion of Proof of Work will see Ethereum move from a PoW system to PoS later this year that is being developed called Casper. And as we see blockchain and its technology continue to evolve we should expect to see these protocols grow too, to become a fairer, more secure and more decentralised system.
Passionate speaker, digital technology blogger, and founder of the community Tech Talk Berlin. Coffee lover and sucker for cat videos on YouTube. Lauren has been working in business development for a number of Blockchain companies, most notably Kora where she works as Chief Administrative Officer. She creates, edits, and advises on white paper content and business strategy across a number of startups, and writes about technologies leading innovation and their applications in our future.