Proof of work: how does mining work?
THE SHORT ANSWER
Proof of work asks miners to find a cryptographic result that meets a difficulty target. The network can easily check that proof and the proposed block’s transactions. Computation costs help protect the history, but consume energy and do not make attacks impossible.
Finding a hash below a target
A miner is not solving an equation useful for another task: it makes many attempts using the header of a candidate block.
- •
Build a block containing transactions and a reference to the previous block.
- •
Change header data and calculate hashes until the difficulty target is met.
- •
Broadcast the block. Nodes check its proof and transactions; an invalid block is still rejected.
What protects the history
Decentralization
Nodes enforce rules independently of miners. Bitcoin follows the valid chain with the most accumulated work, not simply the most blocks.
Computing Power
A hostile majority of hash power can facilitate censorship or reorganization of recent transactions. It does not enable forging someone else’s signature or accepting coins created against the rules.
Energy cost
- •
Mining consumes electricity and requires hardware.
- •
Its impact depends partly on the amount and source of energy.
- •
Other mechanisms, such as proof of stake, avoid this computational competition.
Difficulty, confirmations and reward
Three Bitcoin reference points
- •
Difficulty adjusts every 2,016 blocks to target roughly ten minutes per block on average.
- •
Competing blocks can occur; waiting for more confirmations reduces some risks without giving an absolute guarantee.
- •
The reward comprises a subsidy, halved every 210,000 blocks, and transaction fees.
Key takeaway
Proof of work links security to a computational cost. Its assessment also depends on available hash power, concentration and the value at risk.
Sources and further reading
Page updated on
Documentation checked on · WhyTheBlockchain · Editorial approach