THAMER
Sovereign Bitcoin Wallet

WALLET AI BITCOIN

Your Bitcoin Wallet. Your Keys. Your Engine.

Self-hosted Bitcoin software built for developers, applications, and AI agents.

CREATE WALLET

Bitcoin Mining Explained: Proof of Work, Hashes, and Block Validation

permalink THAMER
#bitcoin-mining#block-header#consensus#proof-of-work#sha256

Bitcoin mining is the process of proposing a Bitcoin block and performing computational work to make its header hash meet the network's current target. Miners compete to find valid proof of work; independently validating full nodes decide whether a proposed block obeys consensus rules.

What exactly does a miner hash?

A Bitcoin block header is 80 bytes. It includes a version, the previous block hash, a Merkle root committing to the block's transactions, a timestamp, compact target (nBits), and a nonce. The proof-of-work check applies double SHA-256 to the serialized header and interprets the result as a 256-bit integer. A valid hash must be no greater than the target represented by nBits.

Because a nonce is only 32 bits, miners can change other candidate-block data, often through an extra nonce in the coinbase transaction. That changes the Merkle root and creates additional search space. Finding a hash is probabilistic; no miner can guarantee a block at a particular moment.

What do full nodes verify?

A full node checks proof of work and the applicable difficulty target, but also validates transactions, signatures, spending conditions, coinbase limits, block weight, and other consensus requirements. A miner cannot make an invalid transaction valid simply by expending more hashing power.

The cumulative-work chain-selection rule is often summarized as the 'longest chain,' but the relevant measure is accumulated proof of work, not raw block count. A node must also regard the chain as valid.

Why does mining matter for settlement?

Proof of work makes rewriting confirmed history increasingly expensive in expected computation. It does not make a newly broadcast transaction final, nor does it prevent all reorganizations. Applications should choose confirmation policies appropriate to their risk and recognize that confirmation count is a measure of depth, not a mathematical guarantee.

Primary references

Bitcoin whitepaper, Section 4 — Proof-of-Work: https://bitcoin.org/bitcoin.pdf

Bitcoin Developer Reference — Block Headers: https://developer.bitcoin.org/reference/block_chain.html

Bitcoin Core source — consensus and validation: https://github.com/bitcoin/bitcoin

Questions & Answers

Explore all questions →

Latest from the Lab

THAMER illustrated developer portrait and signature

ABOUT THE DEVELOPER

Independent Software Developer specializing in Bitcoin Script, Golang, and AI Agents.

Software engineering · Independent research · Open-source projects