How Mining Works
Proof of Work: Converting electricity into unforgeable security
Live Hash Attempts (Simulated)
Looking for a hash starting with many zeros...
What is Mining?
Mining is the process of adding new blocks to the Bitcoin blockchain. It serves three critical functions:
Transaction Processing
Miners include transactions in blocks, confirming them on the blockchain.
New Bitcoin Issuance
The block reward creates new bitcoin and distributes it to miners.
Network Security
The energy spent mining makes it prohibitively expensive to attack the network.
The Mining Process
Collect Transactions
Miners gather unconfirmed transactions from the mempool into a candidate block.
Build the Block Header
Combine the previous block hash, merkle root of transactions, timestamp, difficulty target, and a random nonce.
Hash the Header
Apply SHA-256 twice to the block header. This produces a 256-bit hash.
Check the Result
If the hash is below the difficulty target (starts with enough zeros), the block is valid. If not, change the nonce and try again.
Broadcast the Block
The winning miner broadcasts the new block. Other nodes verify and add it to their chain. The miner receives the block reward.
Difficulty Adjustment
Every 2,016 blocks (~2 weeks), Bitcoin automatically adjusts the difficulty target to maintain a 10-minute average block time.
Target Block Time
10 min
Adjustment Period
2,016 blocks
If blocks are found too quickly, difficulty increases. If too slowly, difficulty decreases. This ensures consistent block production regardless of how much hashpower joins or leaves.
Why Proof of Work?
Proof of Work is the only known mechanism that provides:
Unforgeable Costliness
Real energy expenditure that cannot be faked or recycled
Easy Verification
Anyone can verify a proof instantly without trusting the miner
Decentralization
No permission needed to start mining and earning rewards