P2Pool scientific basics

Real difficulty

Target, hash and achieved difficulty

Updated November 2026. The definitions of target, “real target” and the ratio target/hash in the first version of this page contradicted each other in places, and the layout of the “bits” field was wrong. Those paragraphs are rewritten below. The charts are unchanged.

A block is valid when its proof-of-work hash, read as a 256-bit number, is not above the target the chain requires. Target, difficulty and hash are three views of that one comparison.

Target

The target is a 256-bit number. The header does not store it in full: the 4-byte nBits field (“bits”) encodes it compactly. The first byte is an exponent e and the remaining three bytes are a mantissa m:

target = m × 2^(8 × (e − 3))

For example, Bitcoin’s genesis block has nBits = 0x1d00ffff: e = 0x1d, m = 0x00ffff, so target = 0xffff × 2208. That is the largest target Bitcoin allows, the “difficulty 1” target.

Difficulty

Difficulty is the difficulty-1 target divided by the current target: difficulty = targetmax / target. A smaller target means a higher difficulty and more work per block. On Bitcoin-style chains a block at difficulty D takes about D × 232 hashes on average.

The target is adjusted periodically (every 2016 blocks on Bitcoin) so that blocks keep arriving at about the intended spacing; see Difficulty adjustment.

The proof-of-work hash

Miners change the nonce (and other header fields) and hash the header again until the result is at or below the target. Each attempt succeeds with probability about target / 2256, independently of the attempts before it.

On Bitcoin the proof-of-work hash is the double SHA-256 of the 80-byte header, which is also the block’s id. The chains c2pool mines use different proof-of-work functions. On Litecoin and Dogecoin the block is still named by its SHA-256d hash while its proof of work is checked with Scrypt; on Dash both are X11:

ChainProof-of-work function
Bitcoin (BTC), Bitcoin Cash (BCH)SHA-256d
Litecoin (LTC), Dogecoin (DOGE, merged), DigiByte (DGB, as c2pool mines it)Scrypt
Dash (DASH)X11
BIP-110 forkSHA-256d below height 961,640, BLAKE2b from that height
Monero (XMR, experimental in c2pool)RandomX

Achieved difficulty and the overshoot

The first version of this page used the term “real target” for the value a miner’s actual hash would still have satisfied. Two ratios are useful, and they should not be mixed:

The overshoot measures luck, not effort. Every valid block at a given difficulty took the same expected work, whatever its R. Given that a hash meets the target, R follows Pr[R ≥ r] = 1/r: half of all blocks have R below 2, one in a thousand has R above 1,000, and the mean does not exist.

original factor chart
Original chart (as published): target/real_target per block for epoch_0 (0–2015) and epoch_1 (2016–4031) of the Bitcoin blockchain. Preserved here for reference.
achieved difficulty per block, real BTC data
The same data, recomputed over all 4,032 blocks (R = target/hash; difficulty = 1 throughout both epochs, so R is the block’s own overshoot). The chain only requires R ≥ 1; the rare spikes are pure luck. Median R ≈ 2.

In the second chart the difficulty is 1 throughout both epochs, so R is each block’s achieved difficulty. The median near 2 is what Pr[R ≥ r] = 1/r predicts.

V37What achieved (“real”) difficulty is — and is not — used for.

The achieved difficulty of a hash (the “real target” of the first version of this page) says how far below its target the hash happened to fall. It is tempting to pay miners in proportion to it: “you found a rarer hash, you earn more.” This is wrong, and provably so.

Achieved difficulty is pure luck. Conditioned on meeting the target, the overshoot R = target/hash follows a power law, Pr[R ≥ r] = 1/r, whose mean does not converge: a single fortunate hash can exceed the sum of all the others. Paying by achieved difficulty would let one lucky share take an entire payout window — re-importing into the pool exactly the variance that pooling exists to remove.

Work is therefore credited by the target a share was required to meet, never by the value its hash happened to reach. Two shares meeting the same target are credited equally — the accounting stays luck-neutral.

Work below the share target is counted by the same rule. A hash that met an easier (numerically larger) target is itself a unit of work at that easier target, so a worker too weak to find shares often can still be credited for the work it did, by counting its hashes at that easier target. The overshoot is not needed for this. Measurement, not payment. This is how the Work Receipts paper credits work; see the Purple Paper summary, §5 (Proof-of-Work as Measurement) and §8 (Recovering Work Below the Order).