Proof of Work Consensus Mechanism
What is a consensus mechanism?
Until 2008, when Satoshi Nakamoto published the Bitcoin white paper which described a digital currency based on proof of work protocols that would allow secure, peer-to-peer transactions, one of the issues that prevented the development of digital currencies was the double-spend problem. You can't spend the same dollar bill twice, but with cryptocurrency, there needs to be a way to prevent users from spending the same unit twice (or more) in different places before the system can record the transactions. This system, or way of preventing malicious uses, is called a consensus mechanism.
Every cryptocurrency blockchain uses a consensus mechanism, also called consensus algorithm, which allows users of the blockchain to agree on the legitimacy of transactions, with no centralization or central authority needed. The consensus mechanism used by a blockchain influences the way transactions are verified, how much energy is used, transaction speed, and fees.
Although the idea of the Proof of Work consensus mechanism existed before the creation of the Bitcoin blockchain, it was implemented for the very first time for blockchain technology. A majority of cryptocurrency networks use the Proof of Work (PoW) mechanism, including Bitcoin, Litecoin, DogeCoin, Bitcoin Cash and more. Let's take a closer look at the first, and still dominant, consensus algorithm.
What is Proof of Work and how does it work?
Proof of Work is a consensus mechanism that allows anonymous entities in decentralized networks to trust one another. There is no financial institution or central authority to ensure trust, instead, miners are the guardians and facilitators that make the system run smoothly and accurately.
When users buy and sell cryptocurrencies or digital assets, the data from these new transactions is pooled into a block of transactions. With the Proof of Work system, miners are tasked with verifying new data. They compete with each other to solve a mathematical puzzle and find the nonce for a block. Showing proof that they've undertaken the computational work gives the miners the right to process the block. The winner of the next block is rewarded with cryptocurrency and adds the block to the blockchain.
Miners are required to use computing resources for the privilege, investing significant resources in computer power, equipment and energy consumption and costs. By financially incentivizing miners to verify the integrity of new crypto transactions before adding them to the blockchain network, proof of work helps prevent double spending and guarantees security.
Bitcoin, the first cryptocurrency, uses Proof of Work. Bitcoins are mined using the Hashcash proof-of-work function by individual miners and, verified by the decentralized nodes in the peer-to-peer bitcoin network. The difficulty of the math puzzle is regularly adjusted, to keep the block times around a target time of 10 minutes. Miners receive Bitcoin rewards in the form of newly minted BTC coins and transaction fees. Although Bitcoin has a fixed maximum supply of 21 million coins, after that, miners will continue receiving transaction fees for their service.
Proof of Work vs Proof of Stake
Proof of Work and Proof of Stake share the same end goal, but there are a few differences in the way they work.
In order to run the very complicated algorithms, miners in the PoW mechanism need highly specialized hardware which incurs large costs, making mining only accessible to special mining pools and threatening the decentralization of the system. Because of its lottery-like system, the mining process can also be very energy intensive, which has led to critiques of the consensus and its environmental impact, with Bitcoin mining using more electricity annually than Finland and Belgium. The Bitcoin blockchain was designed for cryptocurrency mining, leaving out smart contract functionality. Therefore, it mostly just has to process incoming and outgoing bitcoin transactions.
But the Ethereum blockchain, however, also has to process DeFi transactions, NFT sales and minting, and many other smart contracts. To maintain security and decentralization, Ethereum on proof-of-work consumed large amounts of energy. This led to Ethereum moving to the Proof of Stake consensus mechanism in 2022. Following the Merge, many have criticized Ethereum for becoming more centralized since Lido Finance and Coinbase own over 40% of the staking power. However, it must be noted that before the Merge, three mining pools owned over 50% of the overall network hashrate in Ethereum.
Proof of Stake (PoS), also employed by other blockchains such as Cardano, switches out the importance of computational power for staked ETH, and replaces miners with validators. Validators stake their crypto (ETH) to activated the ability to create new blocks. They don't compete to create blocks, they are chosen at random by an algorithm. If two out of three validators agree on the state of a block, it is considered final.
Because validators are selected at random instead of miners competing to solve a puzzle, Proof of Stake consumes a lot less energy than PoW. Validators also don't need any special tools and equipment that require huge computational power.
With Proof of Stake, validators can only validate blocks if they have a security deposit or "stake", meaning if they attack the blockchain, try to double-spend or steal coins, they can't do so without losing their investment. With PoW, if one group of miners gains more than 50% control, they can prevent transactions from being confirmed and can also spend coins twice. This is called a 51% attack. PoW is the most secure consensus algorithm, while Proof of Stake security remains untested in comparison.