What is Distributed Consensus?
Distributed consensus is a computer science term that you will often see here in relation to cryptocurrency. It is often said that solving the problem of distributed consensus was the primary innovation which made Bitcoin work, and enabled the subsequent explosion in the number of ‘alt coins’ (alternative cryptocurrencies).
The term ‘consensus’ simply refers to a collective decision-making process, or an agreement between different people over what is true or false. It is used here in exactly the same way that you might use the term in day-to-day language – a group can come to a consensus decision about something without unanimous support from every individual.
Usually, when a group of computers or electronic devices must all be in agreement over something in order to operate there will be a central control unit whose job it is to make that call and then broadcast it to the rest of the network. Distributed consensus, however, means that the various different computers making up the network (called ‘nodes’) come to an agreement in a way that is much more similar to the way a group of humans might reach consensus – which each member contributing their own perspective, and the group as a whole coming to a collective decision.
Working out how to form a distributed consensus between the nodes of a network is a difficult computer science problem. When any individual node may be deliberately lying or trying to manipulate other members of the network (as will inevitably happen if there is any financial gain to be had by doing so) it becomes even harder.
Bitcoin’s Distributed Consensus
Bitcoin was born of the dream that a digital currency network may be able to operate in a truly peer-to-peer manner, without the need for any kind of central bank or other authority. This has the potential to reduce our reliance on ‘too big to fail’ banks who currently control the creation of new money in their own commercial interests, and put it back into the hands of the people instead. I don’t want to get sidetracked into a diatribe on the benefits of bitcoin over bank issued digital money as I could write a whole essay just on that, but I mention it to drive home the idea that distributed consensus is not just a dry technical innovation, but is at the heart of what makes Bitcoin so useful and so loved by many people.
In order for peer-to-peer digital money to work, each member of the network must be in agreement about how many coins each other member of the network owns at all times. This is vital to prevent dishonest network participants from double spending (spending the same coins more than once) or otherwise defrauding and stealing from other members of the network.
The process used by Bitcoin to solve the problem of distributed consensus is called ‘mining’. Any member of the network may choose to get involved in mining, but you do not need to participate in mining in order to use the Bitcoin network.
Miners, who take part in this processes of forming the distributed consensus, are rewarded for their effort with newly generated coins and with recycled coins spent in transaction fees by other members of the network.
Bitcoin mining uses something called ‘Proof of Work’ to ensure that the network consensus is true and correct. It also relies on the mechanics of game theory, in that it is designed in such a way that cheating is against the best interests of even the most selfish participant. To summarize this as succinctly as possible: Miners perform large numbers of calculations, each one of which gives them a chance to ‘mine’ a block of transactions (all the transactions within a given period of time), and therefore keep the reward associated with that block. But in order for their block to be accepted by the network it must be confirmed by other miners – meaning that other miners must agree with their version of the network’s transaction history. The distributed consensus is formed by the majority of the network – measured by the number of ‘Proof of Work’ calculations rather than the number of individuals – gradually confirming a block. If somebody tries to lie to the network, it is in the self-interest of other miners, who must each keep their own version of the network’s transaction history anyway, to call them out on it. Because of this the only way for a malicious user to manipulate the distributed consensus to have their own faked version of the transaction history accepted as the truth would be if they could perform more Proof of Work calculations than the whole of the rest of the network combined.
If any member of the network doesn’t agree with the consensus formed by other members they will ‘fork the network’, which means that they create their own branch of the transaction history which is different from everyone elses and which will no longer be accepted by other users as the true Bitcoin blockchain.
Bitcoin’s distributed consensus is therefore dependent on its ‘hash rate’ – the number of calculation (called hashes because they the mathematical named for them is a ‘secure hash algorithm) performed by the network. If only a small amount of these Proof of Work calculation are being performed then the network is insecure, because an attacker would not need to spend very much in order to gain over half the ‘hashing power’ and therefore perform a ‘51% attack’. If a large number of calculations are being performed then it becomes very expensive to buy enough computing power to perform a 51% attack. In fact, as the network stands today, it would be so expensive to do this that we can say for all practical intents and purposes, it is not possible (and certainly not profitable).
Alternative Cryptocurrency Consensus Algorithms
Since Bitcoin began finding a certain degree of success, may other alternative cryptocurrencies have been created. Many of these ‘alt coins’ have their own method for forming a distributed consensus. Sometimes this just means a different Proof of Work algorithm (a different type of calculation) such as Scrypt or X11, but sometimes it involves a entirely different mechanism such as Proof of Stake.
Whitepapers on Distributed Consensus in Cryptocurrency
- Bitcoin: A Peer to Peer Electronics Cash System by Satoshi Nakamoto – The famous paper by Bitcoin’s enigmatic creator.
- On Stake and Consensus by Andrew Poelstra “Proof of Stake cannot be used to form a distributed consensus”.
- Tendermint: Consensus Without Mining by Jae Kwon – Does what it says in the title.
- The Ripple Protocol Consensus Algorithm by Multiple Authors – Uses a distributed ledger but requires validators and is therefore semi-centralized.