cryptocurrency consensus handshake image

Overview of "Consensus" - Crypto Whiteboard 101


By now, most people know that cryptocurrencies aren't physical objects and rather exist as entries on a distributed, public ledger known as the blockchain. Although the blockchain itself is decentralized and distributed across many locations, we still need a mechanism for ensuring that all of the dispersed records are kept in agreement. In this article, I will briefly describe consensus, which is the process by which cryptocurrency networks determine what the “correct” version of the blockchain is and maintain accurate records. 

Why Consensus Matters

Because cryptocurrencies are simply entries stored on an electronic database we must have an accurate database that shows the correct amount of crypto assigned to each address. So, how can we have a publicly viewable database that anyone in the world can look at to verify the amount of crypto in an address? An oversimplified example would be to think of uploading a huge read-only Excel file to an online server and allowing anyone permission to view, but not write to the file.

4af13da6563d4ae6ecdbd7aa524e273ae00ff7ae3f954a800af2d3a86c1d6350.jpeg

In some ways, the blockchain works as a read-only file hosted on a web server. Anyone, anywhere in the world, can view this blockchain to verify information and transactions. However, that only solves part of the problem, and although we want people to view the current state of the network, blockchains also need a way of updating and adding new information in addition to simply displaying past transactions.

Given that the blockchain is distributed across countless different computers and nodes the question then becomes, who should be allowed to update this blockchain? Allowing each node to create its own updated blockchain would be pure chaos as people could add and subtract balances from other people's accounts at will. At the same time, simply electing one person to be in charge of updating every transaction would lead to a centralized system with one all-powerful node that could write the blockchain and create transactions in a way that benefits them at the expense of everyone else. 

Methods of Achieving Consensus

The problem of determining who gets to write new blocks and transactions to the blockchain is solved through an algorithm known as a consensus mechanism. Although it sounds fancy, a consensus mechanism is nothing more than the process by which all of the nodes on the network agree on the current state of the blockchain. Two of the most popular methods of determining consensus are known as proof of work and proof of stake. 

6f11267878627701929838b4989418e160b1e6b9c0db8ee0f01051bcfca06a79.png

Proof of work, as implemented in Bitcoin and most other cryptos, was the original cryptocurrency consensus mechanism. Under the proof-of-work system, computers bundle new transactions into “blocks”. They then attempt to solve a mathematical puzzle that has been generated by the network. The first computer to solve this puzzle “wins” a mining reward, and writes its block to the chain. The difficulty of the mathematical puzzle ensures that the ability to write the next block is both 1) random but also 2) a function of computing power. This means that a more computing power a user, or pull of users, has the more likely they are to generate the next block. 

The second method of consensus is known as proof of stake. In this system, users do not have to solve any intense computational procedures. Rather users “stake” cryptocurrency in the network by locking it into a staking portal for a certain length of time. Under the proof of stake system, the probability of winning the reward and writing the next block isn't a function of computing power, but rather the percentage of crypto that a certain computer has staked. Under the PoS system, the network will award the block distribution based on the proportion of cryptocurrency that a user has staked. In other words, someone who has staked 5% of the cryptocurrency has a higher chance of writing the next block than someone who has staked 1%. 

Although both proof of work and proof of stake have some differences, the end goal of both systems is the same. The idea is that for the blockchain to remain secure, whoever writes new blocks should have a vested interest in a secure network. Both PoS and PoW systems achieve this by making it costly to write new blocks. Whereas PoW Requires that a user purchase expensive computer hardware, the PoS system requires that the user purchase a significant amount of the cryptocurrency and stake it if they want to have a chance of winning the next block.

 

Incentivizing "Good" Blockchain Behavior

Requiring that users make a significant investment to win blocks decreases the incentive for a user to simply buy enough hardware or stake enough crypto that they can write bad blocks. First, amassing enough computing power or staking enough cryptocurrency to consistently write bad blocks would be cost-prohibitive (at least on larger networks). Second, and assuming that someone was able to gain enough computing power to consistently win and write bad blocks, they would essentially be sabotaging themselves. As other users found that the network was now controlled by a malicious actor, they would rush to sell their cryptocurrency. This would make any mining rewards or coins held by the malicious actor less valuable. And they would likely be unable to recoup the investment that they made in mining equipment/crypto to stake. 

Of course, no system is ever entirely 100% foolproof, and there have been instances where a bad actor was able to amass enough computing power to temporarily gain control of the network. That being said, both the PoS and PoW systems create a strong incentive system that discourages such behavior, especially on the larger networks where amassing enough computing power to take over the network is cost-prohibitive. 

Summary

Because cryptocurrencies rely on a distributed public ledger, they need a way of ensuring that new transactions can be written to the blockchain without trusting one, single authority to write the transactions. The two most common methods of reaching consensus and determining which transactions will be written to the blockchain are proof of work and proof of stake methods. Although both PoS and PoW have different ways of determining who gets to write the next block, both ensure the security of the network by ensuring that whoever writes the next block has a financial incentive to write “good” transactions. 

Thanks for reading!

 

NOTE: There is much more to consensus than what has been covered here, but I tried to cover the most important parts for beginners without getting in too deep. For a much more detailed, "advanced" level treatment of consensus mechanisms, check out this post by LiquidAttic.  

References

https://www.coindesk.com/ethereum-classic-blockchain-subject-to-yet-another-51-attack


Image Credits:

https://unsplash.com/
https://imgflip.com/

 

How do you rate this article?


68

1

The Part Time Economist
The Part Time Economist

Hi everyone. I'm just a simple man trying to make my way in the universe. I am passionate about cryptocurrency and hope that I can make at least some small contribution towards promoting wider crypto adoption and understanding.


The Part Time Economist
The Part Time Economist

Hi everyone. This is just a place for me to post some of my thoughts and analysis. I hope that someone finds them useful.

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.