PYMNTS Crypto Basics Series: What’s a Consensus Mechanism and Why Is It Destroying the Planet?

Bitcoin, blockchain and cryptocurrency are words that most people have at least heard of in 2022, as the industry exploded into the mainstream public consciousness.

Over the course of this series of articles, we’ll be delving into the basics of the industry, providing an introduction to crypto that will give you a solid grounding in the technology and a lexicon for its terminology — cryptographers should never be allowed to name anything the public will eventually need to know — in short, enough to understand what people are talking about and decide if you want to learn more.

What we are not going to do is talk about regulation, finance or investing — you’ll find that elsewhere on PYMNTS.com.

See also: PYMNTS Crypto Basics Series: What’s a Blockchain and How Does It Work?

So, what’s a blockchain consensus mechanism and why do you care?

We’ll get to that whole “destroying the planet” thing later. Let’s also pause here for a note: If you don’t know what a blockchain is, consider reading the first article in this series, “What’s a Blockchain,” linked above — it’ll make this a lot clearer.

First off, as you might guess, it has to do with agreement.

Any blockchain, including Bitcoin, is decentralized. The way this works is that anyone can set up a “node,” which really just a computer with the appropriate app for that blockchain and a full copy of the blockchain — Bitcoin Core in this case — which has a record of every transaction ever made. It is a ledger in which old entries cannot be changed, only new ones added.

We’ve already explained that a blockchain transaction is immutable — unchangeable — because each block of a transaction is cryptographically linked, in the correct order, to the blocks that came before and after it. But how about the blockchain itself?

The blockchain node one person is running is cryptographically linked to all the blockchain nodes stored running on other computers around the world. And they all update simultaneously, in real time. This is why blockchains are uncensorable if you’ve got enough nodes in enough countries around the world.

Consensus: Agreement Matters

This is where we get to “consensus” — for your node to stay on the blockchain, its information must agree with the others. If it does not, that node is essentially booted off the blockchain. It doesn’t shut down, however. That node forms a “side chain” that is a completely new blockchain.

A good way to visualize it is a metal chain. Let’s say it has 100 links (i.e. blocks), with new ones added constantly. Now, at link No. 95, a second link was added, branching off in a new direction. Both can keep growing, and both share the same transaction record up to that point. But they are completely separate blockchains.

This can happen to prevent a bad actor from slipping fake transactions into the ledger, but it can also happen deliberately. This is a fork, and it can be done because a group of node-runners want to change the way the blockchain works.

Terminology alert: Hard fork

Take Bitcoin (BCT) and Bitcoin Cash (BCH). They both share the same blocks up to a certain point — No. 478,558 in this case — but the Bitcoin Cash supporters then split off in what’s called a “hard fork,” changing the information on that block because they wanted to make changes that would let Bitcoin process more transactions, making it more usable as a day-to-day currency.

Still, if you’re still visualizing that metal chain, there’s a time when new two links are connected to the last link. How do you know which one stays Bitcoin and which one becomes Bitcoin Cash?

It’s actually pretty simple: The Bitcoin blockchain’s software always considers the longest chain the “real” one. And because there were a lot more nodes and validators who did not make the change, their chain quickly became longer and stayed Bitcoin.

Consensus: Reaching an Agreement

Now let’s get back to that new block of information being added to the end of the chain.

Someone has to gather up the transactions that have taken place, make sure they are valid, and organize them into a block that can be added to the blockchain. Unlike a traditional computer database, a blockchain has no trusted central authority making sure the transaction record is accurate — Visa or your bank, for example.

In a decentralized, peer-to-peer blockchain system, there is no middle-man authority to be trusted. So, how do you trust the person on the other side of the transaction? You don’t. Instead, you put your trust in the blockchain protocol itself.

Remember in the intro we said cryptographers should never be allowed to name things other people will use? Get ready.

Terminology alert: Trustless

Because you can transact without needing to trust the other person, this is called a “trustless” system. Yes, every dictionary on earth will give you a different meaning for that word, but this is crypto. Just accept it and move on.

Consensus mechanisms – Proof of work

To make a trustless system work, the people adding the blocks to the blockchain have to be honest. The way blockchains ensure this is with a consensus mechanism. While there are a fair number of these, the vast majority of blockchains use either “proof-of-work” or “proof-of-stake.”

Proof-of-work, or PoW, is the one created for the first blockchain, Bitcoin. The way it operates is by creating a race to solve a special kind of math puzzle: The complexity can vary according to need, as we’ll see, but essentially it is a guessing game — the math problem can only be solved by randomly guessing the right answer.

The person who does it first wins the right to create the next block on the blockchain. This is called mining, and it is used to secure the blockchain against attacks and make sure the miners build each block of transactions accurately and honestly.

Because the winner of the race is random, it’s nearly impossible to ensure you’re going to be adding a specific transaction to the next block.

Miners participate in this race for the reward: For creating a block that is successfully added to the blockchain — that all the nodes agree upon — the miner gets transaction fees but also, and far more importantly, a “block reward.” This is currently 6.25 newly minted bitcoins.

The honesty part comes because if your block is rejected by the nodes, you forfeit that reward. Even in the middle of a bear market that has cut the price of bitcoin almost in half, to about $35,000, that’s a $218,000 reward. Which is a mighty good reason to be honest and accurate.

It’s also a problem: It’s such a big reward that an arms race for faster and more powerful computers has grown up. Investors build mining server farms with thousands of expensive, custom-designed, high-powered computers. That makes it virtually impossible for the little guy to participate, and far worse, it sucks down enormous amounts of power.

According to Cambridge University, at this writing, Bitcoin miners use 128 TWh (terawatt-hours) per year: More than Ukraine but less than Egypt. The No. 2 blockchain, Ethereum, uses 110 TWh.

Producing that power comes at an enormous environmental cost. So much that it’s upsetting politicians and driving off environmental, social, governance, or ESG, investors.

Read more: Bitcoin’s New Headwind: ESG Investors Double Down on Its ‘Staggering’ Pollution

Another problem is that it has a security hole: The 51% attack. Basically, if more than half the mining power on a blockchain is controlled by bad actors they can double spend new transactions. It’s virtually impossible on big blockchains like Bitcoin and Ethereum, but has happened to Ethereum Classic.

Read more: The 51% Attack: Crypto’s Double-Spending Achilles Heel

Consensus Mechanisms – Proof of Stake

An increasingly popular alternative is proof-of-stake, delightfully referred to as “PoS” — again with the cryptographers’ naming deficiencies.

See more: PYMNTS DeFi Series: What is Staking?

Proof-of-stake replaces the race to solve a math problem with a system in which the miners — called validators in PoS blockchains — put up what amounts to a bond for good behavior. Any misdeeds will cause the stake to be automatically forfeited — “slashed” — as a penalty.

The idea is to make it too expensive to fiddle with the transactions being validated, organized and added to the next block. The rewards aren’t as big but they’re more consistent. While each block’s validator is randomly chosen, you will win in proportion to the size of your stake. So, if you have 5% of the total amount of crypto staked, you’ll win 5% of the time.

This uses very little power — so is environmentally friendly.

See also: Can Proof-of-Stake Solve Crypto’s ESG Problem?

It also makes it possible for the small investor to participate. While actual validators generally have to put up a sizable minimum, they can allow investors to stake smaller amounts of crypto in their pool of funds — sharing the profits from the increased number of wins.

PoS also makes it possible for blockchains to process far more transactions per second them PoW — orders of magnitude more. Therefore PoS blockchains are far more scalable, able to compete with and even surpass the credit card firms’ TPS rates.

Read more: PYMNTS DeFi Series: What Are the Top DeFi Blockchains?

The combination is such a big deal that Ethereum is in the midst of a massive, multi-year project to switch to proof-of-stake.