Understanding the hash-puzzle mechanism that secures blockchain networks
By the end of this session, you will be able to:
Proof of Work (PoW) is a consensus mechanism where participants (miners) compete to solve computationally expensive puzzles to validate transactions and create new blocks.
Gold Mining: Just as gold miners expend energy and resources to find gold, blockchain miners expend computational power to find valid blocks. The "difficulty" of finding gold (or blocks) adjusts based on how many miners are working.
Miners must find a number (called a nonce) that, when combined with block data and hashed, produces a result with a specific number of leading zeros.
Goal: Find a nonce where SHA-256(block_data + nonce) starts with "0000"
Attempt 1: nonce = 12345
SHA-256("block_data12345") = "a7b3c2d1..." ❌ (doesn't start with 0000)
Attempt 2: nonce = 67890
SHA-256("block_data67890") = "f9e8d7c6..." ❌ (doesn't start with 0000)
Attempt 1,234,567: nonce = 1234567
SHA-256("block_data1234567") = "0000a1b2..." ✅ (starts with 0000!)
1. Collect
Transactions
2. Validate
Transactions
3. Create
Block Header
4. Compute
Hash Puzzle
5. Broadcast
Solution
6. Receive
Reward
As more miners join the network (increasing total hash power), blocks would be found too quickly. Difficulty adjustment ensures consistent block times regardless of network hash rate.
Result: More leading zeros required in hash
Result: Fewer leading zeros required in hash
If last 2,016 blocks took 10 days instead of 14 days:
New Difficulty = Old Difficulty × (14 days / 10 days) = Old Difficulty × 1.4
Difficulty increases by 40% to slow down block production
Largest operational cost, varies by location
ASIC miners, GPUs, depreciation costs
Cooling, maintenance, facility costs
Profit = (Block Reward + Transaction Fees) × Price - (Electricity + Hardware + Operations)
Miners must constantly evaluate profitability and may shut down operations when costs exceed rewards.
Changing past blocks requires redoing all subsequent work
No single entity controls the network
Attacker controls majority of hash power
Miner withholds blocks to gain advantage
| Cryptocurrency | Hash Function | Key Properties | ASIC Resistance |
|---|---|---|---|
| Bitcoin | SHA-256 | Fast, well-studied, secure | No (ASIC-friendly) |
| Ethereum | Ethash | Memory-hard, ASIC-resistant | Yes (GPU-friendly) |
| Litecoin | Scrypt | Memory-hard, slower than SHA-256 | Partial (ASIC developed later) |
| Monero | RandomX | CPU-optimized, frequently updated | Yes (CPU-friendly) |
While PoW consumes significant energy, proponents argue it:
In the next session, we'll explore Proof of Stake & Hybrid Models, examining alternative consensus mechanisms that address energy concerns while maintaining security.