— —
Follow on X
LESSONS

What a miner actually does

A miner assembles a candidate block, hashes its header trillions of times per second with different nonces, and broadcasts when one hash is below the target.

5 MIN READ
A miner builds a template, hashes repeatedly, and broadcasts a block when the hash is under target.
LEVEL · Intermediate
IN THIS LESSON · 1 OF 7
BY THE END YOU WILL BE ABLE TO ANSWER
  • Which part of the block do miners hash?
  • Why do miners vary the coinbase as well as the nonce?

Then prove it: a 2-question quiz. The lesson marks itself complete at 100%.

Strip away the warehouses and a miner does one thing: tries to find a block header whose hash is below the current target.

Step by step

  1. Build a template. Select transactions from the mempool, usually by highest fee rate, up to the block weight limit. Add the coinbase transaction paying the subsidy and fees to the miner's address. Compute the Merkle root.
  2. Hash. Take the 80-byte header and run SHA-256 twice. Compare with the target. If not below it, change the nonce and hash again. The nonce is only 4 bytes, so miners also vary the coinbase (the "extra nonce") and the timestamp to get fresh headers.
  3. Repeat at hundreds of trillions of hashes per second per machine, across millions of machines.
  4. Found one. Broadcast the block. Every node checks it in milliseconds. Other miners drop their templates and start on the next block.
  5. Get paid. The coinbase output becomes spendable after 100 blocks.

The odds

The target today requires a hash with roughly 19 leading hexadecimal zeros. The network as a whole makes hundreds of exahashes (10¹⁸) per second to find one block every ten minutes. A single machine would wait years. That is why pools exist (lesson 3).

What the work is for

The hash is worthless. The proof that work happened is what makes rewriting history cost real resources. See Mining and proof of work for the security argument.

CHECK YOURSELF
1/2 Which part of the block do miners hash?
2/2 Why do miners vary the coinbase as well as the nonce?
pick an answer for each question
Progress is saved in this browser only.