Proof of work
Proof of work is how Bitcoin decides who adds the next block: miners spend electricity on guessing, and a correct guess is easy for everyone to check but expensive to produce.
How it works
A miner hashes the block header with SHA-256 twice. The result must be a number below the current target. Hashes look random, so the only way to find one is to keep changing the nonce (and other fields) and try again. On average the network needs about difficulty × 2³² attempts per block.
Checking the answer takes one hash, so every node can verify the work instantly. The chain with the most accumulated work is the valid one.
Origin
The idea comes from Hashcash, Adam Back's 1997 anti-spam scheme, which the whitepaper cites. Bitcoin made the work a lottery for the right to write the next block and paid the winner in new coins.
Energy
The electricity is the security: rewriting history would need more energy than the honest network spends. Whether that use is worth it is debated; the Orange pill page lists the main arguments with sources.
See also
- Bitcoin miningBitcoin mining is finding a valid Proof of work for the next block. Miners who succeed earn the block subsidy (currently 3.125 BTC per block in this Halving era) plus transaction fees. Difficulty retargets every 2,016 blocks so blocks stay about ten minutes apart; live hashrate and difficulty are in the infobox and on [[/mining-power|mining power]].
- Bitcoin hashrateHashrate is how many guesses per second all Bitcoin miners make together. More hashrate means more energy protecting the network.
- Difficulty adjustmentEvery 2,016 blocks (about two weeks) Bitcoin makes mining harder or easier so that a block still arrives about every ten minutes on average.
- Hashcash is announced28 Mar 1997: Adam Back announces “hash cash postage” on the cypherpunks list: a sender proves work by finding a partial SHA-1 collision, which is costly to make and instant to check.
- BlockA block is a batch of Bitcoin transactions added to the chain about every ten minutes. The miner who finds it collects the new coins and the fees.