BR Academy
0%
Consensus and Security·Lesson 18 of 25·12 min

Proof of Work Explained

The Concept

Proof of Work (PoW) — used by Bitcoin and, historically, by Ethereum before 2022 — is the original solution to the consensus problem from the previous lesson. The core idea: before you're allowed to propose the next block and collect a reward, you must solve a puzzle that is computationally expensive to produce but trivially cheap for everyone else to check.

The puzzle itself is simple to describe, even though solving it takes enormous effort. Every candidate block includes a special field called a nonce (a number used once). The miner takes the block's contents plus the nonce and runs it through a cryptographic hash function (covered in Module 2). The network sets a target: the resulting hash must start with a certain number of leading zeros. There's no shortcut to finding a nonce that produces such a hash — the only strategy is to guess a nonce, hash it, check the result, and if it doesn't meet the target, try a different nonce. Miners run specialized hardware (ASICs) doing this trillions of times per second, racing each other to find a valid nonce first.

This "hard to solve, easy to verify" asymmetry is the entire security model. Any node, even a phone, can instantly check whether a submitted hash meets the target — one hash computation. But producing that valid hash in the first place required, on average, trillions of failed attempts. The miner who finds it first broadcasts the block; every other node verifies the proof in milliseconds and, if valid, accepts the block and moves on to mining the next one.

Why does this secure the network? Because rewriting history — say, reversing a transaction you already spent — means re-mining that block and every block after it, faster than the rest of the network is mining new blocks. Since each block requires a genuinely enormous amount of real computation and electricity to produce, an attacker would need to control more raw computing power than the rest of the honest network combined (the so-called "51% attack," covered two lessons from now) and sustain it long enough to outpace everyone else. The cost of attempting fraud is tied directly to the cost of real-world electricity and hardware — which is exactly the kind of non-fakeable cost the consensus lesson said was necessary.

The network also adjusts the target difficulty roughly every two weeks (in Bitcoin's case) so that, regardless of how much total computing power joins or leaves the network, a new block is found on average every 10 minutes. More miners doesn't mean faster blocks — it means a harder puzzle, keeping the pace constant.

It's worth being precise about what "mining" actually produces, since the word evokes digging something up rather than computing something. A miner isn't discovering coins hidden somewhere — the reward for finding a valid nonce is newly issued currency created by the protocol's own rules (a fixed amount per block, cut in half roughly every four years on Bitcoin, an event called "the halving") plus the transaction fees from everything bundled into that block. The "mining" metaphor refers only to the resource-intensive search process being analogous to the effort of mining a physical commodity — there's no actual digging, no physical coin, and no warehouse where finished coins sit waiting to be found.

Proof of Work's biggest practical criticism is energy consumption: Bitcoin's network alone is estimated to use more electricity annually than many mid-sized countries, according to figures regularly published by the Cambridge Centre for Alternative Finance's Bitcoin Electricity Consumption Index. Supporters counter that this energy spend is precisely the point — it's what makes rewriting history prohibitively expensive — and that a growing share of mining uses stranded, renewable, or otherwise wasted energy sources that wouldn't otherwise be monetized. This trade-off (real security bought with real energy) is exactly the kind of cost/benefit judgment the capstone project later in this course will ask you to weigh for whichever protocol you choose to evaluate.

Worked Example

Walk through a drastically simplified mining loop:

block_data = "Alice pays Bob 2 BTC"
target = "0000..."  # hash must start with 4 zeros

nonce = 0
loop:
    candidate = hash(block_data + nonce)
    if candidate starts with target:
        found! broadcast nonce = winning value
        break
    nonce += 1

In this toy example, the miner might need to try nonce values 0, 1, 2, 3... up to some large number before stumbling on one whose hash happens to start with four zeros — pure trial and error, since hash outputs are unpredictable until computed. Real Bitcoin mining targets require around 19 leading zero bits, and the network collectively tries roughly 600 million trillion hashes per second to find one every 10 minutes. Any node receiving the finished block does exactly one hash computation to confirm "yes, this nonce really does produce a hash meeting the target" — verification that takes microseconds versus the minutes of brute-force work that produced it.

Exercise

Explain, in two or three sentences, why it would take an enormous amount of electricity for an attacker to "out-mine" the honest network and rewrite several already-confirmed blocks of history. Be specific about what the attacker would need to outpace (the combined hash rate of every other honest miner, sustained over time) and why that cost scales with how many blocks deep they're trying to reverse.

Recap

  • Proof of Work requires miners to find a nonce whose hash meets a difficulty target — hard to find, trivial to verify.
  • This asymmetry converts electricity into security: rewriting history requires re-doing all that costly work faster than the honest network can do it once.
  • Difficulty adjusts over time so blocks arrive at a steady pace no matter how much total mining power joins the network.

Resources