Coming To Consensus

Normally we think of “coming to consensus” as a process through which a group of people, who may disagree, end up agreeing on a solution to a particular problem. For example, a group of friends determining where they should go to for lunch. Consensus is also a goal for many important distributed computer systems.

Consensus is what keeps society in order, and your Bitcoin safe.

Distributed Systems

Without consensus, one single computer could decide what happens to your Bitcoin.

In Bitcoin, every computer in the network has a copy of the same thing, the blockchain. Every time you send Bitcoin, you must connect to one of these computers. One of the most important differences between iCloud and Bitcoin is that Bitcoin servers, known as miners, are not owned by a single entity. They are owned by anyone willing to participate in the network. In Bitcoin, we can’t trust who is joining the network, since anyone can join. Thus, the Bitcoin network (and other cryptocurrency networks) are deemed “trustless” and “decentralised”.

In the case of a cryptocurrency like Bitcoin, there is a lot at stake if the network doesn’t agree. Miners can spend money they don’t have. We require a mechanism that incentivises nodes to be honest. Bitcoin’s answer is Proof of Work.

Proof of Work (PoW)

Bitcoin is a PoW blockchain

A random person asks you which whales are bigger, blue whales or sperm whales. You’re a bit of a prankster and answer “sperm whales”. This person does not know which whale is bigger. They don’t know you, so why should they trust you? To them, sperm whale could be the correct answer. They say “to give me some confidence in your answer, run five laps of that oval and I’ll reward you, but only if majority of the other people I ask – and they will also run laps – answer the same as you.” Do you run the five laps, knowing that you answered incorrectly? That’s a lot of work, and if more people come back to the question master with “blue whale” which you know is the correct answer, then you’d be running five laps for nothing.

This is a version of proof of work. You are putting “work” on the line to justify your reasoning. If majority of other people answer the same as you, then you’re safe and you get a reward.

In the case of Bitcoin miners, “work” is thousands of mathematical calculations per second as each miners races to solve a puzzle. Once the first person solves the puzzle they can pass it around to the other servers and the other servers can check that their solution does solve the puzzle – it’s far easier to verify the solution, than to solve the Bitcoin puzzle.

This is incredibly resource inefficient. Thousands of computers are all doing the same work and only one computer wins. What a waste. Surely there’s a better way to come to consensus on things.

Proof of Stake (PoS)

The most popular alternative to PoW is Proof of Stake.

Let’s again consider the scenario above. However, this time, instead of asking you to run five laps of an oval to get a reward, they say “ok, you’ve said sperm whale, now put $10,000 on the line and I’ll believe you if a majority also say the same thing, having also put $10,000 on the line..” Now you’re realising it wasn’t the best idea to lie. If the others are honest (which you’re assuming they will be since they stand to lose $10,000 if they’re not in the majority) then you will lose your $10,000.

It’s called “Proof of Stake” because you are “staking” your money in order to participate in the network. This provides a disincentive to be dishonest. You will also earn rewards for being honest, since otherwise you’ve risked your stake for no potential financial return.

“Coming to consensus” does not mean “agreeing on the correct answer”. The answer could be objectively incorrect, but if majority of the network agree on it then it is considered “true” by the network. For example, if 50% of the others said “sperm whale” as a joke too, despite putting $10,000 on the line, then the people who answered honestly would then get their funds slashed (this is the crypto term for deleting one’s funds in a misbehaviour event). This is the basic idea behind a “51% attack”.

Political Consensus

Political consensus, or more broadly, decisions made by a group people that impact that group of people, has one important difference to a computer-driven consensus model. People are not the same. A blockchain consensus model’s participants are identical. They all stand to lose the same financially, and, if honest, they all want the same thing for the network. People do not all want the same thing. Even if all actors are honest and are voting for the ideas that they feel brings about the best for themselves and society, each person is sufficiently different such that they could be diametrically opposed to each other on particular issues.

Even current political voting systems don’t account for these differences in people as well as they could. Quadratic voting can offer people a way to express their differences, something a blockchain system doesn’t require, since there are no differences.

Final notes

While the term “consensus” shares meaning across the contexts in which it’s used, it’s important to take it with the context. The nature of each consensus mechanism changes drastically with respect to its context.