TECHNICAL_DOC // BLOCK / HASH
BLOCK
HASH
HASH
A block-hash/">block hash is the SHA256d (double-SHA256) of the 80-byte block header.
It serves as the block's unique identifier and is the value miners are racing to
push below the difficulty target. A single bit change anywhere in the header produces
a completely different hash, making the blockchain tamper-evident and linking every
block to its parent.
HASH_COMPUTATION
COMPUTING THE BLOCK HASH
Input: 80-byte block header (only the header, not transactions)
[4 bytes] version
[32 bytes] previous block hash
[32 bytes] merkle root
[4 bytes] time
[4 bytes] bits (target)
[4 bytes] nonce
hash = SHA256(SHA256(header_bytes))
Output: 32 bytes (256 bits) = 64 hex characters
Genesis block hash:
000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
↑ 10 leading zero bytes — difficulty was minimal in 2009
Modern block hash example (shown in display/big-endian order):
00000000000000000002... ← ~19 leading zero bytes (2024)
Mining — Finding a Valid Hash
PROOF OF WORK
Mining is the process of finding a nonce (and occasionally other header fields) such that the resulting hash is below the current target.
Loop until hash < target:
1. Increment nonce (4 bytes → ~4 billion attempts)
2. hash = SHA256(SHA256(header))
3. Compare hash to target (as 256-bit integer)
If nonce space exhausted (~4B tries):
- Increment extraNonce in coinbase transaction
- Recompute Merkle root
- Continue with nonce = 0
Valid hash properties:
- Starts with sufficient leading zero bits
- Is deterministic: same header → same hash every time
- Is unpredictable: changing 1 bit changes everything
The hash proves work was done — no shortcut exists.
TERMINOLOGY_INDEX
Block Hash
SHA256d of the 80-byte block header. The block's unique ID and proof-of-work output.
SHA256d
Double-SHA256: SHA256(SHA256(data)). Used for block hashes and transaction IDs in Bitcoin.
Leading Zeros
A valid block hash must have enough leading zero bits to be below the target. More zeros = more difficult.
Target
A 256-bit threshold decoded from nBits. The block hash must be numerically less than or equal to the target.
INTERACTIVE — TRY IT YOURSELF
MINING / CONSENSUS
Block Hash & Mining
Bitcoin mining is a brute-force search for a 4-byte nonce that makes
SHA256d(block_header) < target. The target encodes the difficulty: more leading zero bytes required = harder. Every miner on Earth is running this loop right now, each hashing roughly 2³² combinations per second before moving to the next extra-nonce. This page lets you run that loop — slowly — in your browser.
BLOCK HEADER STRUCTURE
The block header is exactly 80 bytes. All the difficulty comes from hashing these 80 bytes over and over, incrementing only the nonce field (bytes 76–79).
80-BYTE HEADER ANATOMY
PREV BLOCK HASH
32 B
0000000000000000000000000000000000000000000000000000000000000000
TIMESTAMP
4 B
29ab5f49
BITS (TARGET)
4 B
ffff001d
NONCE ← MINED
4 B
00000000
LIVE MINING SIMULATOR
Set the leading zeros required (difficulty), then start the miner. The browser will hash headers with incrementing nonces until it finds one meeting the target. Watch the nonce counter and hash output in real time.
PROOF OF WORK SIMULATORset difficulty then mine
4
nibbles = 16 leading zero bits
NONCES TRIED
0
HASHES / SEC
—
browser SHA256d
STATUS
IDLE
CURRENT NONCE
—
CURRENT HASH
—
TARGET
—
MINING LOG (most recent attempts near threshold)
GENESIS BLOCK — REAL DATA
Bitcoin's genesis block was mined on January 3, 2009. Its nonce is 2,083,236,893 — meaning Satoshi hashed the header roughly two billion times to find it. The difficulty was the minimum possible: the target required only the first 8 nibbles to be zero.
GENESIS BLOCK HEADER VERIFICATION
Why SHA256d (double SHA-256)? Single SHA-256 is vulnerable to length-extension attacks. While a length-extension attack on block headers is theoretical, Bitcoin's protocol uses SHA256d consistently for headers, TXIDs, and Merkle roots as a defensive measure. The double hash also makes the preimage space uniform — any 256-bit string is equally hard to invert.
DIFFICULTY ADJUSTMENT
Every 2,016 blocks (~2 weeks), nodes compare the actual time taken against the 20,160-minute target and scale the difficulty by at most a factor of 4 in either direction. The target encoding is stored in the bits field of the header as a compact floating-point representation: the first byte is the exponent (number of bytes in the target) and the next 3 bytes are the coefficient.
BITS FIELD DECODER