Consensus Mechanisms: How Are Blockchains Secure?
|— The participants in a decentralized network need to come to an agreement when deciding which data should be added and what shouldn’t in order to keep the network secure. |
— This decision making process ensures transactions can be completed without relying on central intermediaries.
— The rules they use to come to this agreement are called consensus mechanisms, and there are various different types—including Proof of Work (PoW) and Proof of Stake (PoS).
If you wonder how are blockchains secure, then you’ve come to the right place, let’s explore consensus mechanisms.
If you don’t know what consensus is, make sure you check out the article on ‘what blockchain is”. But essentially, consensus is necessary for all blockchains. Blockchains store their information distributed across the whole network in nodes.
These nodes are like a network of identical filing cabinets that all work to keep a record of everything that ever happened on a blockchain and there’s an incredibly meticulous process of deciding which new files to add to each cabinet, since they all need to stay in sync to keep everything running smoothly—otherwise they’d end up with conflicting records.
Each file added to the cabinet could represent practically anything, but generally represents a transfer of value, i.e. a record of someone sending a payment to someone else—this is what you’d expect from a blockchain like Bitcoin or Litecoin.
What Is a Consensus Mechanism?
Being decentralized, there are no supervisors or admins deciding what data should or shouldn’t be added to the database. But thanks to the magic of blockchain, they don’t actually need any!
Instead, the filing cabinets (nodes) just need a set of agreements that they can use to decide if they should add a transaction to their records, or reject it. This set of agreements is known as a consensus mechanism—since the blockchain only gets updated when a majority of nodes agree to do so, i.e. they reach consensus!
This is an incredibly important process, since these records could relate to the transfer of funds from one person to another—we wouldn’t want someone successfully spending funds they don’t have, or even worse, spending other people’s funds! This type of thing is what consensus mechanisms protect against, and more.
You wouldn’t want to use a blockchain that can’t keep your funds safe, right?
What Is Blockchain Consensus For?
We’re still exploring all the ways blockchain can be used and there are now literally thousands of blockchains out there all with different purposes.
Nonetheless, they’ve all gone one thing in common—they need to maintain accurate records, or they’d be pretty much useless.
Unlike a bank, blockchains don’t have any central authority tasked with keeping the records up to date… there are no administrators, operators, or clearinghouses to refer to.
Instead, with the process of reaching an agreement about the current state of the network falls to the nodes—these are the computers that keep a complete record of the blockchain.
Practically anybody can start up a node and help with this process, you can usually start one up yourself in less than half an hour if you want.
Fortunately, if you opt to help secure the network, you don’t actually have to sit there manually reviewing each transaction. Just imagine how incredibly tedious that would be! Instead, it’s software that handles this process, using a pre-defined set of rules.
When important data and user balances are on the line, it’s super important that the blockchain remains free of errors. This way you can guarantee the network only contains genuine transactions. This is why consensus is so imporant: It prevents nodes recording conflicting information.
You can think of this as a voting process. If more than half of nodes vote to include a transaction, then it can join the blockchain network. Otherwise, the network discards the transaction.
Most of the time, users involved in maintaining consensus must put something at stake to prevent them from acting maliciously. If they misbehave, they will lose their rewards.
If you’ve ever heard the term “strength in numbers”—it applies perfectly to blockchains. As you can imagine, a system secured by just a few people could easily be corrupted. With a small system, validators or miners could collude. However, this is pretty much unfeasible when there are thousands of network participants.
Consensus Mechanisms: What Types Are There?
All consensus mechanisms look to achieve agreement in a decentralized network, but exactly how they achieve this varies significantly.
Just like how you can have a jury, a parliament, a council, and various other ways to work towards an agreement about something, blockchain protocols can use different consensus mechanisms.
Let’s take a look at some of the most popular ones.
Proof of Work (PoW) is the very first decentralized consensus mechanism used to secure the Bitcoin blockchain.
It was created in 2008 by Satoshi Nakamoto. If that sounds familiar, it’s because it’s the same person responsible for the first and most popular blockchain; the Bitcoin network.
A Proof-of-work consensus uses a decentralized network of specialized computers which put in computational work. This computational work determines which transactions joins the blockchain next. Next a miner arranges them in a block and broadcasts them to the network.
PoW is a deterrent to anybody who wanted to spam the Bitcoin network or attempt to seize the majority control over it. To explain, the amount of computational effort needed to ‘mine’ a block is feasible but incredibly costly. This deters attackers from trying to forge blocks, while also preventing a single entity from effectively monopolizing the network. Simply, cheating the network is just too expensive.
Although Proof of Work is certainly a robust consensus mechanism, it has one major problem—energy usage.
All those specialized computers that work to keep blockchains secure through Proof of Work suck up a huge amount of power. According to some estimates, the Bitcoin mining network uses a whopping 77.78 TWh of electricity…. which is similar to a small country!
Used by Bitcoin (BTC) | Litecoin (LTC)
Proof of Stake (PoS)
To combat PoW’s energy consumption, blockchain developers, Sunny King and Scott Nadal created their environmentally friendly alternative in 2012. This was later dubbed Proof of Stake (PoS) and it quickly became a very popular consensus mechanism.
Rather than requiring a large network of miners to crunch numbers, a proof of stake network uses validators instead. A validator chosen to produce the next block can then fill it with transactions they deem to be valid. In return, they earn a reward. However, to ensure they act honestly, validators must put up collateral. This is usually a significant amount of tokens and they could lose a portion if they break the rules.
Famously, the Ethereum network was once a proof-of-work blockchain. However, it transitioned to become a proof-of-stake network in order to address its energy efficiency in 2022.
Used by Cardano (ADA) | Tezos (XTZ) | Cosmos (ATOM)
Nominated Proof-of-Stake (NPoS)
Nominated Proof of Stake (NPoS) is one of the newest consensus mechanisms. Essentially, it’s an updated version of regular Proof of Stake. First implemented by Polkadot in 2020, it introduces a few changes to make it easier to participate in the consensus process.
For example, rather than simply relying on validators like in PoS, NPoS also introduces another key stakeholder known as a nominator. Nominators vote in the validators they believe will operate in the best interests of the network. To back them, they put up their stake.
Then, the network chooses Validators at random to produce the next block. If they act honestly, they receive a reward, most of which goes to the nominators.
This is a much more inclusive way to secure a blockchain. To explain, practically anybody can become a nominator just by bonding some tokens and selecting a validator they trust. While running a validator requires some technical expertise and specialized computer hardware, becoming a nominator is a ‘set it and forget it’ kinda thing.
How Consensus Mechanisms Shape A Blockchain
Consensus mechanisms are an extremely important aspect of many blockchains. Put simply, they are the only reason why cryptocurrencies are so secure. Understanding how they work and their differences will help you understand the nuances of blockchain technology.
Consensus mechanisms are the the bread and butter for many cryptocurrency miners and node operators. Earning rewards by helping secure a blockchain network is much easier if you understand how you’re helping.
Luckily, there are a few ways to take part in the consensus mechanism yourself, from crypto mining, to validating. But you can also earn rewards from helping other participate too. For example, you could fund a validator and recieve rewards that way!
Unlike in the world of centralized finance, almost anybody can participate in the role of keeping a cryptocurrency network secure. This makes for a much more inclusive financial system that you can be a part of governing.