How does bitcoin mining work?
Bitcoin miners race to solve a puzzle with specialized computers. The winner adds a block of transactions and earns new bitcoin plus fees.
Bitcoin mining is the process that adds new transactions to bitcoin's ledger and releases new coins. Miners run machines that race to solve a mathematical puzzle. About every 10 minutes one of them wins, adds a block of transactions and is paid in bitcoin.
What puzzle are miners solving?
Miners collect pending transactions into a candidate block. They then run a summary of the block through SHA-256, a hash function, which is a formula that turns any input into a fixed-length string of characters. The output looks random, and changing the input even slightly produces a completely different result.
The network sets a target. A block is valid only if its hash, read as a number, falls below that target. There is no shortcut to finding one, so miners change a small field in the block called the nonce and try again. A single modern machine makes trillions of guesses a second. The first miner to find a valid hash broadcasts the block, and other nodes can check the answer almost instantly.
This system is called proof of work. It is one of the two main designs covered in proof of work vs proof of stake.
What is the difficulty adjustment?
Bitcoin aims for one block roughly every 10 minutes. If more machines join and blocks start arriving faster, the software makes the puzzle harder. If miners leave, it gets easier. The adjustment happens automatically every 2,016 blocks, which is about two weeks.
This is why adding more computing power does not produce bitcoin any faster. It only raises the bar for everyone.
How do miners get paid?
The miner of each block receives two things:
- The block reward. A set amount of newly created bitcoin. It began at 50 bitcoin in 2009 and is cut in half every 210,000 blocks, an event called the halving. Since April 2024 it has been 3.125 bitcoin.
- Transaction fees. Users attach fees to their transactions, and miners tend to include the highest-paying ones first.
Who mines bitcoin today?
In the first years, people mined on home computers. Today the work is done by ASICs (application-specific integrated circuits), which are chips built to do nothing but SHA-256 hashing. They usually run in warehouses sited near cheap electricity.
Because any single machine has a tiny chance of winning a block, most miners join a mining pool. A pool combines the computing power of many participants and shares the rewards according to the work each one contributed.
Mining draws criticism on two fronts. It consumes large amounts of electricity, with an environmental cost that depends on the energy source. And a handful of large pools have long produced most blocks, which raises concerns about concentration. A group controlling most of the computing power could, in theory, carry out a 51% attack and interfere with recent transactions.
This guide explains how things work. It is not financial, legal or tax advice. Last updated .