Mining and Proof of Work
The Concept
Mining is the process by which nodes compete to add the next block to the chain. A miner assembles a candidate block from transactions waiting in the mempool, then searches for a number called a nonce such that, when the nonce is combined with the block's contents and run through a hash function, the result falls below a target value (in practice, a hash with enough leading zero bits). There is no formula that computes the right nonce directly — the only approach is brute force: try a nonce, hash it, check if it qualifies, and if not, try the next one, potentially trillions of times per second across the whole network. That brute-force requirement is exactly what makes a found solution "proof" that real computational work — and therefore real electricity and hardware cost — was spent to produce it.
function mine(block_header, target):
nonce = 0
while true:
candidate_hash = sha256(block_header + nonce)
if candidate_hash < target:
return nonce, candidate_hash // found it — broadcast the block
nonce = nonce + 1
Whoever finds a valid nonce first broadcasts the completed block; every other node checks the hash (a trivial, instant calculation once the nonce is known — the asymmetry between "hard to find, easy to verify" is the whole point) and, if valid, accepts the block and starts mining on top of it. The winning miner collects two things: the block subsidy (newly issued BTC, covered in "supply-and-issuance") and every transaction fee from the transactions included in that block.
Modern mining is dominated by specialized hardware called ASICs (application-specific integrated circuits), built to do nothing but compute SHA-256 hashes as fast as physically possible — far faster, per unit of electricity, than a general-purpose computer could manage. Because an individual miner's chance of finding the next block on their own is tiny relative to the whole network's combined hashrate, most miners join mining pools: a group of participants who combine their hardware's hashing power, split the resulting block rewards proportionally to each participant's contribution, and smooth out the otherwise highly unpredictable timing of when any single participant would find a block alone.
Worked Example
Try a toy version by hand. Suppose the target rule is simplified to: "find a nonce such that hashing the text 'BLOCK' plus the nonce produces an output starting with three zeros," using a simple illustrative hash where we just sum the character codes of the combined string and take the result modulo 1000 (not a real cryptographic hash, but enough to feel the brute-force process):
- Nonce 0: "BLOCK0" → sums to, say, 437 → doesn't start with triple-zero pattern (437 ≠ 000–009 range we're targeting)
- Nonce 1: "BLOCK1" → sums to 438 → no
- Nonce 2: "BLOCK2" → sums to 439 → no
- ...continue incrementing...
- Nonce 563: "BLOCK563" → sums to a value that happens to land in the 000–009 range → qualifies
There was no way to jump straight to nonce 563 — you had to try every candidate in order (or in parallel, which is what real mining hardware does across many chips simultaneously) until one worked. Real Bitcoin mining uses SHA-256 and a target so difficult that the global network performs on the order of hundreds of exahashes (10^18 hashes) per second collectively, and still takes about ten minutes on average to find each valid block — which tells you how astronomically larger the real search space is than this toy example.
Now extend the example to a mining pool. Suppose ten miners each contribute roughly equal hashing power to a pool, and the pool as a whole finds a valid block after a combined effort. Rather than only the one miner whose individual hardware happened to compute the winning nonce keeping the entire reward, the pool operator distributes the block reward across all ten participants in proportion to the share of total hashing work each contributed during that period — commonly measured by how many "near-miss" solutions (valid under a much easier, pool-internal target) each participant submitted. This is why an individual miner with modest hardware can still earn a small, steady, predictable share of rewards through a pool, rather than waiting, potentially for years, to find a full block alone.
Exercise
Explain, in your own words, why a hash function with the property "you cannot predict or shortcut the output without actually trying the input" is exactly what makes proof of work impossible to fake. Your answer should address why a miner can't simply claim to have found a valid nonce without having actually performed the search — tie this to the fact that every other node can verify a claimed solution instantly, which is what makes bluffing pointless. Then explain in one or two sentences why joining a mining pool changes the frequency and size of an individual miner's rewards without changing the total amount of work the network as a whole must perform to find each block.
Recap
- Mining means brute-force searching for a nonce that produces a qualifying hash; there is no shortcut, which is what makes a found block "proof" of real work spent.
- Verification is cheap and instant even though finding the solution is expensive — this asymmetry lets every node check a block without redoing the search itself.
- The winning miner collects the block subsidy plus all transaction fees in that block; mining pools let individual participants combine hashing power and split rewards proportionally, trading reward size for predictability.
Resources
- Satoshi Nakamoto, "Bitcoin: A Peer-to-Peer Electronic Cash System" (bitcoin.org/bitcoin.pdf), Section 4, "Proof-of-Work."
- Bitcoin Developer Guide, "Mining" (developer.bitcoin.org/devguide/mining.html).
- Bitcoin Optech, mining and pool-reward explainers (bitcoinops.org).