To add a block, a miner must find a header whose SHA-256 hash is below a target number. Since hashes are unpredictable, the only method is trial: change the nonce (and other fields), hash again, billions of times a second. The first miner to find one broadcasts the block; everyone checks it in microseconds and moves on to the next.
Why "work"
The hash itself is worthless. What matters is that producing it required real electricity and hardware, and that the amount is visible: the lower the target, the more expected tries. A valid hash is proof that, on average, that much work happened. Hence proof of work.
What it buys
- Ordering without a clock-keeper. The chain with the most accumulated work is the one everyone follows.
- Costly rewriting. To replace the last N blocks, an attacker must redo their work faster than the honest network extends the chain.
- Fair issuance. New coins go to whoever did the work, with no allocation committee.
The reward
The winner claims the block subsidy (3.125 BTC, halving every 210,000 blocks) plus all fees in the block. Because revenue is random, most miners join pools that split rewards by contributed hash rate.
The hardware
CPUs in 2009, GPUs by 2010, ASICs since 2013. An ASIC does one thing, SHA-256, which means an attacker cannot rent general computers to attack Bitcoin; they would need to buy the chips, and the chips are worthless for anything else.
If a valid hash must start with 4 zero hex digits, roughly how many tries does it take on average? (Each hex digit has 16 values.)