Proof of Work (PoW)


What is it?
Proof of Work is a consensus mechanism used in blockchain networks like Bitcoin to ensure security and validate transactions. It involves solving complex cryptographic puzzles that require significant computational resources, making it costly for any single entity to manipulate the network. This mechanism ensures the integrity of the blockchain without relying on a central authority. It's a core component of many cryptocurrencies like Bitcoin, where miners compete to solve these puzzles, and the winner adds a new block of transactions to the chain, receiving a reward.
This idea was first published by Cynthia Dwork and Moni Naor in 1993and later was applied by Satoshi Nakamoto in 2008 in the bitcoin whitepaper.
N/B
On September 15 2022, Ethereum moved from being a Proof of Work (PoW) blockchain to being a Proof of Stake (PoS) blockchain.
How does it work?
- Consensus Mechanism
consensus means a general agreement about something: an idea or opinion that is shared by all the pple.
Proof of Work (PoW) is a decentralized consensus mechanism that allows nodes in a blockchain network agree on the state of the ledger without central authority. i.e. the transactions, account balances etc.
The consensus protocol help us achieve that agreement. Theoretically, it is possible to compromise the consensus of a blockchain by controlling a majority of the network. The goal of a sound consensus protocol is to make that sort of attack economically unfeasible, at least for blockchains that people use and care about - like Bitcoin and Ethereum. Different protocols like Proof of Work and Proof of Stake take upon this problem differently.
b. Mining and Hashing
- Miners perform PoW by solving cryptographic puzzles using the SHA-256 hashing algorithm. Miners compete to find a hash below a target value set by the network, which requires trials and error due to its randomness.The first miner to solve the puzzle gets to add a new block to the blockchain and gets a reward in Bitcoin/ Ethereum or any other crypto currency that they are mining.
c. Security and Double spending prevention
- PoW secures the network by making it economically unfeasible for malicious actors to alter transaction history. To change a transaction, an attacker would need to redo the PoW for all subsequent blocks, requiring more than 50% of the network's total computational power, known as a 51% attack. This makes double spending attacks impractical.
d. Economic incentives
- The costliness of PoW creates economic incentives for miners to act honestly. If a miner includes fraudulent transactions, other nodes will reject their block, resulting in wasted resource.This incentivizes miners to follow the network's rules to recoup their investment in hardware and electricity
e. comparison with other consensus mechanisms
- While PoW is effective, it is energy-intensive. Alternatives like Proof of Stake (PoS) have been developed, which rely on validators holding a stake in the network rather than performing computational work. Each mechanism has its trade-offs in terms of decentralization, security, and efficiency.
How Ethereum's Proof of Work (PoW) protocol (Ethash algorithm), worked before Ethereum transitioned to Proof of Stake (PoS) with its "Merge" upgrade
Transaction Selection:
The miner selects transactions based on transaction fees. This makes sense because miners have an incentive to maximize the reward they get for mining a block, and transactions with higher fees generally yield higher rewards.
State Selection:
The "slice of data" (about 1GB) is pulled from the current state of the Ethereum network. The specifics of how this is chosen are abstracted here but are tied to the protocol rules.
While the exact rules aren't the focus here, it’s important to understand that Ethereum's state includes all account balances, smart contract data, and other blockchain information that miners need to process.
Hash Function and Target Value:
This part describes the mining process where a miner hashes the dataset using a hash function and compares it to a "target value." The target is inversely proportional to the mining difficulty so as difficulty increases, the target gets smaller, meaning it becomes harder to find a valid hash.
Nonce and Brute Force:
The nonce is the random number miners try to find to generate a valid hash. The brute-force method mentioned here refers to the process of miners continually adjusting the nonce and re-hashing the dataset until they find a valid hash (i.e., a hash that is smaller than the target value).
This is where computational effort and power come in: miners are essentially racing to find this valid nonce first.
Sybil Resistance:
Sybil resistance is a measure of how well a protocol would do against a Sybil Attack.
Sybil attack on the other hand is a type of cyberattack where a single entity creates multiple fake identities to gain disproportionate influence in a network. This attack is particularly relevant in blockchain and peer-to-peer networks where identity verification is weak or absent . In such environments, these fake identities can be used to manipulate consensus mechanisms, disrupt communication, or conduct fraudulent activities.
Proof of Work helps protect against Sybil Attacks because the miners need to put up computational power as collateral for the reward. They have to have fast computers which can solve the mathematical puzzle and cover electricity costs - and the better your setup, the higher chance of earning rewards you have.
Chain Selection Rules:
Sometimes two miners can create valid blocks at almost the same time, causing a "fork" in the blockchain. Because of network delays, different nodes might see different blocks as the next one in the chain. This creates temporary confusion about which block is the right one.
However, this isn't a big problem. The blockchain rules say that the longest chain (the one with the most proof of work) is considered the correct one. Eventually, miners will build on the longer chain, and the shorter fork will be abandoned. So, the network naturally resolves the fork over time.
The combination of Proof of Work and the Longest Chain Rule together is known as Nakamoto Consensus - named after Satoshi Nakamoto
Occasionally, forking means that certain transactions might get mined by one miner which were not included in a block by the other miner when the fork happened, and as one of the split chains gets discarded, the transaction would need to be rolled back as if it never happened in the first place.
N/B
The blocks which form the forked chain and end up getting deleted are called Uncle Blocks. The miner clearly put in the work to solve the puzzle and produce the Uncle Block, and just lost out on the mining reward due to network latencies. As such, uncle block miners still get a mining reward - however it is less than the usual mining reward.
Additional Resources:
The following are optional, but recommended, readings to understand more about Proof of Work:
Subscribe to my newsletter
Read articles from x1x directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

x1x
x1x
Everyday learner