Decentralization and Consensus are the most often used terms in blockchain and the crypto-space, but do you really know what they mean? Becoming an expert in blockchain begins with knowing the fundamentals. So lets begin!
Consensus in Crypto
Consensus does not simply mean “majority decision” or “popular opinion”! Consensus in computer science or the field of distributed systems is a technical term which can be formalized.
What is a distributed System?
A distributed system involves a set of something we call distinct “processes” (e.g. computers) passing messages to one another and coordinating to accomplish a common and objective goal (i.e. solving a computational problem).
>>A distributed computer-system is a group of computers working together to achieve a unified goal.<<
Although the processes are distinct, the system appears as a single computer to the end-user.
Distributed and Decentralized
We all know these kinds of graphics explaining a decentralized system vs. a fully distributed system. You probably get the point that an equally distributed system, where every participant is equal, would also be a fully decentralized system. This is trivial.
In politics we call a fully decentralized voting scheme “democracy” and a fully decentralized socio-economic system “communism”. We call a decentralized state “federalism” and the centralization aspect “union”. A fully centralized government we call “dictatorship” and the complete lack of a leader we call “anarchy” or “agorism”. In network-communication we call a fully distributed architecture “peer-to-peer” and a more or less centralized one “master node system” or “server consortium”. The economy talks about “person-to-person” or “user-to-user”, which is not the same as peer-to-peer. In a peer-to-peer network architecture a person can talk to another person without a central service provider. However, peer-to-peer is not a direct person-to-person message passing. Peer-to-peer is the very opposite of a direct (Alice to Bob) person-to-person connection! Every peer, and the peer of the peer, and the peer of the peer of this peer and so on, is an intermediary.
You can quantify decentralization but…
Srinivasan 2017 has a nice article on quantifying decentralization
Which decentralization do you mean? Be more precise!
However, it should be clear that there is decentralization or a certain distribution on different levels with different effects on the consensus. Delegated Proof-of-Stake based Systems like Eos or Steem/Hive are centralized in the consensus layer (there are only 21 Block-producers), but by using different delegation- and voting schemes, those systems try to outsource the decentralization.
Example – delegated Proof-of-Stake
This is why a dPOS fully relies on the collusion-resistance of the voting mechanism. Vitalik Buterin has a great article on Collusion and how you can achieve collusion resistance.
So, when you talk about “decentralization” you should be really precise what you mean, otherwise it is only a meaningless buzzword.
Distributed vs. decentralized
Now “distributed” in distributed-consensus (or more generally in distributed-computing) is not the same as just a degree of statistical distribution. The purpose of distributed systems is often not political decentralization! Distributed computer systems come traditionally from spaceship- and airplane design. You distribute a task over many computers to have redundancy – fault tolerance.
Redundancy
It is the same principle evolution is using. Your body has not only one big cell but billions and billions of cells which are (per compartment) genetically all the same. When you lose a skin- or brain cell you probably do not care.
Why distribution at all? There are different motives!
Eliminating single points of failure is so important in spaceships and airplanes (of course also in nuclear powerplants), because in high altitude we spontaneous bit-flips occur. Radiation hits electrons and messes up your computation. When you have three or four computers doing exact the same, then the risk of failure is mitigated.
Motives for distribution
- fault-resistance
- censorship resistance (byzantine-fault resistance)
There are different degrees of censorship resistance (Sukernik 2018 on the different forms)
- sovereign grade censorship resistance
- platform grade censorship resistance
The whole “Bitcoin is distributed and decentralized” story
Bitcoin is based on a distributed computer – the P2P-Communication layer but also has a decentralized governance mechanism – the Mining Layer.
The P2P-Communication layer consists of equal nodes/processes which are distributed over the globe. This distributed computer system of full-nodes does not output the distributed-consensus! Each node validates the consensus and holds a copy of it (it is the same technique used in spaceships like the Falcon9. It is called state machine replication), but they do not generate consensus!
You, running a node is nice, but it does not help
Further, in Nakamoto-Consensus you do not necessarily contribute to more decentralization of the P2P-Layer by running a node. The bottleneck is that every node has to process every transaction. Decentralization for the purpose of resistance against government attacks can already be archives if you have a hand full of professional nodes distributed over the globe and maybe one or two satellite nodes. It would not be beneficial when we all connect our laptops and Raspberry-Pi to the Bitcoin network.
It is about the quality of distribution not the quantity
Distribution does not mean that more nodes mean more decentralization/is better. The really important aspect is jurisdictional agility. In the case that one government says No, then we can rely on nodes in other jurisdictions. The best would be nodes outside of any human jurisdiction. Stan Larimer has great Articles about nodes on international waters and nodes in the orbit.
Jurisdictional agility
>>Bitcoin, Ethereum, BitShares, Steem, EOS, and most blockchains are designed to be inter-jurisdictional, spread out over many jurisdictions, under the theory that if some rogue government shuts down nodes in one jurisdiction, the network will simply heal itself with nodes in the remaining jurisdictions. This is much like the Internet itself which was designed to survive nuclear war by routing around smoking craters.<< (Stan Larimer 2018)
P2P-Communication Layer vs. Consensus Layer
The consensus layer is the mining-layer. Miners are also a distributed system, they economically don’t work together but are used to achieve a common goal. However, there is also a parallel computing aspect to mining. Mining itself (solving the hash-puzzle) is based on parallel computing. Parallel computing is when computer add up their computational-power.
Distributed computing vs. parallel computing
Such a parallel architecture is not used for decentralization, but for raw computing power. A mining pool is a parallel computer (lots of CPUs/GPUs/FGPAs/ASICs joined to one processor). However, the whole mining layer (lots of competing parallel computers) in itself is a distributed computer.
The distributed mining-layer generates consensus – miners verify single blocks against a set of rules (consensus rules). The consensus is not what a miner adds to the chain, the consensus is the valid chain.
The Consensus Problem
The purpose of a consensus algorithm like Bitcoin is … to reach consensus in a political decentralized fashion. The purpose of an algorithm is called correctness. An algorith is correct when it does what it is supposed to do. Algorithms achieve consensus if they satisfy the following conditions:
- Agreement: All non-faulty nodes decide on the same output value.
- Termination: All non-faulty nodes eventually decide on some output value.
>>Different algorithms have different variations of the conditions above. For example, some divide the Agreement property into Consistency and Totality. Some have a concept of Validity or Integrity or Efficiency.<< (Kasireddy on consensus)
The best way to design your consensus-algorithm is to make it correct by design. Correct by design is a mathematical proof, that your algorithm holds under all thinkable circumstances.
Validation, Verification, Block-production, Consensus
You probably have wondered what the role of a full node is and if a miner is also a full node? Well, the mining-layer in Nakamoto-Consensus consists of nodes (each computer can be seen as a node) but the algorithm has no concept of nodes. The only thing which matters for reaching consensus is hash-power. This means that it does not matter if you have 2000 nodes or 2 million nodes as long as they output the same hashpower.
A consensus algorithm can have three types of agents
- Proposers, often called leaders or coordinators.
- Acceptors, processes that listen to requests from proposers and respond with values.
- Learners, other processes in the system which learn the final values that are decided upon.
Your full-node is part of the P2P-communication layer and is not a proposer. A miner is a potential proposer, it proposes a block, other miners accept or deny this block. The full-nodes are learners, they validate all the transaction and they verify them against a set of rules, but they don´t decide on the consensus.
The Consensus Process
Finally we decided on consensus by adding our block (as a block-producer) to the right chain. The right chain is determined by a set of consensus rules. The consensus rule in bitcoin is the longest-and-heaviest-chain-rule. The “heaviest chain” in terms of computational weight –> the chain, which has the most hash-power applied to it (at least 51%). In delegated proof-of-work you add your block to the chain which has the last block which was confirmed by at least 2/3 (~66%) of block-producers. Dan Larimer has termed this concept the “Last-irreversible-Block” (LIP). So, do not confuse the delegation in dPOS with the consensus voting!
Proof-of-Work is not a consensus mechanism!
Proof-of-Work which is a actually a Proof-of-Stake is an oracle for leader-election and sibyl-resistance but it does not output consensus! Proof-of-Stake schemes asses social-economic capacities of the participants and ideally they asses skin-in-the-game but they are not consensus mechanisms!
Consensus is the right chain. For consensus we rely on oracles, but proof-of-stake/proof-of-work alone does not yield the right chain. You need a set of consensus rules (fork choice rules).
>>A fork choice rule is a function, evaluated by the client, that takes as input the set of blocks and other messages that have been produced, and outputs to the client what the “canonical chain” is.<<
Conclusion on Consensus and Decentralization
Now you should know that in crypto “consensus” and “decentralization” are not trivial terms. Yes, in Bitcoin consensus can mean a simple majority decision of >50% (but it does not have to). In other consensus schemes like delegated Proof-of-Stake you need a at-least 2/3 majority decision. If you want to cover all possible fork-scenarios you need 2/3 + 1 node (>66%).
These numbers are no random, there are mathematical and even physical reasons for these thresholds.
We will learn about it in a later post and make you a blockchain expert.