How Distributed Systems Maintain Consensus
Think back to the last time you asked your friends, “Where should we eat lunch?” While simple, this question required a decision that affected everyone in the group. Perhaps each of you voted. Perhaps the group even reached a consensus.
Imagine the question that a blockchain must ask every time a new transaction is posted: Is this transaction valid, and, if so, should it be recorded on the distributed network? This question involves a number of complex and high-stakes variables: many users, tremendous sums of money, and clients with multiple accounts that threaten to render the one-user-one-vote scheme useless.
In this article, we will look at methods employed by blockchains to allow all parties to agree upon the ledger of transactions, and how these agreements allow the distributed systems within a blockchain to reach consensus.
Consensus Systems
Two important types of consensus systems are voting-based consensus systems and Nakamoto consensus systems.
Voting-based consensus mechanisms are older and more researched. One of the most classic voting-based consensus mechanisms is the Paxos mechanism. Paxos is an island off of Greece where parliament consisted of Proposers, Acceptors, and Learners. Proposers spoke with the people and would then propose laws to the Acceptors. Acceptors were legislators who voted on laws but were often asynchronously absent from the island. Because of this, Proposers would propose a law and, whenever the Acceptors happened to be in town, the Acceptors would examine the proposition and either vote for or against the law. If the proposition ultimately received enough votes to meet quorum (the majority vote), then the law would pass and Learners would educate the public of the new law. This asynchronous voting technique was adapted by computer programs.
The problem with voting-based consensus mechanisms is that they don’t work with blockchain distributed ledgers because any user on the blockchain can make multiple accounts, thus rendering the one-user-one-vote scheme useless. This is where Nakamoto consensus systems step in to save the day. Nakamoto consensus systems tie votes to quantitative aspects other than users’ identities. The two most famous Nakamoto consensus systems are Proof of Work and Proof of Stake.
Proof of Work
Proof of Work is the current blockchain standard for consensus systems and is used in Bitcoin. This system ties votes to computing power (a.k.a. one-vote-one-CPU). This system assumes that at least 51% of a blockchain network’s voting power will vote honestly. Proof of Work randomly selects a user to vote on the next group of transactions, known more formally as a block. The only way User #1 has more voting leverage than User #2 is if User #1 has more computing power. Proof of Work statistically guarantees that votes will be distributed somewhat evenly to all blockchain users by tying each of their votes to the computing power they use. With this fair distribution of votes in place, the blockchain can reach a consensus regarding which transactions to record on the distributed ledger.
Proof of Stake
Proof of Stake is the up-and-coming blockchain standard for consensus systems and is used by Ethereum. This system ties votes to economic stake, or how much Ethereum you own. Voting power is therefore proportional to how much of a given currency you own. This system not only assumes that 51% of the network’s voting power will vote honestly, but also that someone with more of an economic stake in the cryptocurrency will be incentivized to cast votes that benefit the system. In this system, users are randomly selected to vote on a block. The only way User #1 has more voting leverage than User #2 is if User #1 holds a greater economic stake. Proof of Stake statistically guarantees that votes will be distributed somewhat evenly to all blockchain users by tying users’ voting leverage proportional to the amount of economic stake they own. With this fair distribution of votes in place, the blockchain can reach a consensus regarding which transactions to record on the distributed ledger.
Conclusion
- Blockchain users must reach a consensus to add new groups of transactions (or blocks) to the record.
- The two most common consensus systems are voting-based systems and Nakamoto consensus systems.
- Voting-based systems tie one vote to one person.
- Nakamoto consensus systems tie votes to quantitative aspects other than users’ identities.
- Proof of Work ties users’ votes to their computing power.
- Proof of Stake ties users’ votes proportional to the amount of economic stake they hold.