There aren’t tiny little blockchain fairies overseeing every transaction, but for major blockchain networks like Bitcoin and Ethereum, there are these things called “miners”! When these miners “agree” (aka have reached a consensus) that a transaction is what it’s supposed to be, that’s when it is deemed legitimate! While most things in blockchain technology work similarly regardless of how they are used, consensus mechanisms can vary. The two biggest are proof of work (PoW) and proof of stake (PoS). Within those two mechanisms are even more systems, but let’s not get carried away.
First Things First: What Is a Consensus Mechanism?
Well, the broad definition of a consensus mechanism is that it is a process used to agree on a block of transactions that should be added to a blockchain.
Essentially, consensus mechanisms make sure everyone uses the same blockchain. Since anyone can submit something to a blockchain, it’s key that transactions are continually checked and audited. If consensus mechanisms are not used well or properly, blockchains are at major risk of being attacked, hacked or more.
Think of consensus mechanisms to blockchains as wheels to cars. You need the wheels for the car to actually do its job (transport) and you also need all of the wheels to work together! In order for a blockchain to do its job (which, for many, is to eliminate the need for a trusted middleman), you need consensus mechanisms to take place. You see? While you can technically have a car or a blockchain without the wheels or the consensus mechanisms, it’ll be pretty defective.
The first blockchain consensus mechanism (introduced through Bitcoin) is PoW. Like many innovations that came from Bitcoin, PoW is probably the most favored cryptocurrency consensus mechanism.
Since PoW is most often used with blockchains that power cryptocurrencies, we will use the Bitcoin transaction process as an example to describe it. Let’s say it’s your friend’s birthday and she is studying abroad in Paris, so you decide to send her some $$$ via Bitcoin for a drink. For those who don’t know, here’s how Bitcoin mining works:
1) A group of transactions are bundled into a memory pool (mempool).
- This is where your transaction of sending money to a friend in Paris comes into play.
2) Miners verify that each transaction in the mempool is legitimate by solving a mathematical puzzle.
- Aka a miner has to prove that you actually have the $$$ to send your friend and that your friend has the capabilities to receive it (blah, blah). You can’t be sending money you don’t have! The miner uses some intense mathematical stuff to prove it. It’s so intense it would make Calc 1 look like a cakewalk.
3) The first miner to solve the puzzle gets rewarded with newly minted bitcoin (the block reward) and network transaction fees.
- Woo! It’s almost like a competition. FUN! Anyway, whoever the first miner is who can prove you do in fact have the funds to supply your friend with drink money gets a prize! That prize is pretty much bitcoin of their own.
4) The verified mempool, now called a “block,” is attached to the blockchain.
- Once everything is properly verified, it turns into a block, and that block is tacked on to the blockchain.
So basically, Bitcoin uses PoW to prove a transaction is legitimate, and steps one through four above are followed each time a transaction is added. PoW works only when miners put in the work.
In Satoshi Nakamoto’s (the person who “invented” Bitcoin”) Bitcoin white paper, it is theorized that the only way to overpower blockchain networks is through a “51 percent attack.” So, the PoW system is designed to make sure no one person or entity can gain majority (51 percent plus) control over the network. That’s why PoW makes things like Bitcoin secure!
Keep in mind that PoW requires a lot of computer power and energy …
While PoS systems serve the same purpose when it comes to validating transactions and achieving consensus, it’s an entirely different process than PoW. For starters, there are no mathematical puzzles! This process is based pretty much solely on … stake. So, let’s go back to our sending-money-to-Paris example.
Let’s say that your other friend heard you were sending money to your friend in Paris for a birthday drink and decided it was a good idea, but they wanted to one-up you and send money for a drink AND dinner. You sent 5 coins and they decided to send 50 coins. Show-off.
So, you stake 5 coins and they stake 50 coins (keep in mind: these are fictional amounts for the sake of an easy example and you can assume these are all of the coins you and your friend own). That means they are ten times more likely to be chosen as the next block validator because they have more of a “stake” in the network (by virtue of owning more of its coins).
PoS does not require miners and does not validate transactions by having anyone solve mathematical puzzles. In a PoS system, validators actually hold the coins of the blockchain they are validating. This means they have a much bigger incentive to maintain the network, rather than a miner who is strictly validating for a prize (maximizing their profits). PoS validators do get a reward as well, but it is typically the transaction fees of all of the transactions in the block they created or a fixed amount of coins.
Consensus mechanisms are among the most clever and complicated aspects of blockchain technology. So, things tend to get a little messy. Here’s a recap to keep it straight.
Overall definition of a consensus mechanism — a process used to agree on a block of transactions that should be added to a blockchain.
- Uses miners
- Miners solve mathematical puzzles
- First miner to solve each puzzle receives a prize of their own bitcoin/network fees
- Once the puzzles are solved (verified), those transactions turn into a block and the block is added to the blockchain
- Uses validators
- Validators have coins of their own
- Probability of validating a new block is determined by how big of a stake a validator holds (how many coins they own)
- Validators don’t receive block rewards like miners do; they just collect network fees
- Much more cost- and energy-efficient than PoW, but less proven in actual blockchain networks