How a Bitcoin Miner Works
A Bitcoin miner is a specialized computer that validates transactions and adds them to the blockchain by solving a cryptographic puzzle. The first machine to solve the puzzle earns the right to create the next block and receives a reward in newly minted bitcoin plus transaction fees.
More from this site
Keep reading the latest coverage
The Puzzle: Proof of Work
Miners repeatedly run a hash function called SHA-256 on the block header, changing a small piece of data known as a nonce. The goal is to produce a hash that starts with a certain number of zeros, a target set by the network. Because the hash function is unpredictable, finding a valid result requires trillions of guesses, which demands significant electrical and computational effort.
From Hardware to Network
Early mining used CPUs and GPUs, but modern miners use application-specific integrated circuits, or ASICs, designed solely for this hash calculation. A mining rig connects to a mining pool or the network directly, submits shares that prove partial work, and broadcasts a full block when a solution is found.
Why Mining Matters
Mining serves two purposes: it issues new bitcoin in a predictable, decentralized way and secures the ledger against tampering. Altering a past block would require redoing the work for that block and every block after it, making attacks economically impractical.
The Mining Cycle
- Collect pending transactions into a candidate block.
- Build the block header with the previous block hash, a merkle root, a timestamp, and the target bits.
- Iterate the nonce and extra-nonce fields, hashing repeatedly.
- If a hash meets the target, broadcast the block to the network.
- Other nodes verify the block and accept it if valid.
- The miner receives the block reward and fees.
What Miners Need to Run
Beyond the ASIC, a miner requires a power supply, cooling, a stable internet connection, and mining software that links the hardware to the network or pool. Electricity cost is the dominant operating expense, which is why miners often locate in regions with cheap, reliable power.