— —
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?
  • Roughly how many leading hexadecimal zeros does today's target require?
  • Open mempool.space and find the current network hashrate (EH/s) and the days until the next difficulty adjustment. Enter the hashrate in EH/s.

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

After this lesson you can: describe what a miner does, block by block.

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.

Animation of a miner trying nonces until a hash falls below the target.
Steps 2 and 3, animated: hash, compare, change the nonce, repeat.

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 network hash rate shown as a cycling number in the hundreds of exahashes per second.
Hundreds of exahashes a second, network-wide, to find one block every ten minutes.

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.

MINI CHALLENGEDo this now: hashrate and difficulty

Open mempool.space and find the current network hashrate (EH/s) and the days until the next difficulty adjustment. Enter the hashrate in EH/s.

EH/s
CHECK YOURSELF
1/3 Which part of the block do miners hash?
2/3 Why do miners vary the coinbase as well as the nonce?
3/3 Roughly how many leading hexadecimal zeros does today's target require?
pick an answer for each question

SOURCES

  1. Hash rate (River Glossary)
  2. Difficulty (River Glossary)
Progress is saved in this browser only.