§ 09

§ 09 · Difficulty

Chain work

Adding up the expected effort behind a chain

How much effort went into a block? Nobody can see the miners’ GPUs, but everyone can read the block’s target. And the target says how rare a winning ticket was, so how many tickets, on average, someone had to try.

That average is the block’s work. Add it up over a whole chain and you get its chain work: the expected effort it would take to redo the chain from scratch. It’s how nodes decide which of two competing chains is the real one.

Try it

Type a bits value and look at its target. The smaller the target, the bigger the work.

Bits, target and difficulty

Three ways to write how hard a block is

How bits encode the target

17 6a f3 a6

target = 0x6af3a6 × 25623 − 3 : the exponent says the target is 23 bytes long; the mantissa gives its first 3 bytes, the rest are zeros.

0000000000000000006af3a60000000000000000000000000000000000000000
Difficulty

40,157,376.49334089

The PowLimit target (difficulty 1) ÷ this target.

Target

0000000000000000006af3a60000000000000000000000000000000000000000

How small the target is, on a log scale from 1 to 2²⁵⁶

The target is about 2^182.7. A random 256-bit number lands below it about once in 1.13 × 10²² tries. Each step left on this bar is a doubling of difficulty. Expected work per block (chain work) is 2²⁵⁶ ÷ (target + 1) ≈ 2^73.3.

Pearl: nothing is compared with this target alone. A block wins when its certificate’s BLAKE3 ticket is at most target × the work in one tile, and the block hash is never checked against it.

Runs in your browser · nothing is sent src/lib/block.ts · btcd’s CompactToBig / BigToCompact

How is a block’s work computed?

A ticket is a 256-bit number, so there are 2²⁵⁶ possible values. A ticket wins if it’s at most the target, so the chance of a win is about (target + 1) ÷ 2²⁵⁶. The expected number of tries is one over that:

work(block)=⌊2256target+1⌋\text{work}(\text{block}) = \left\lfloor \frac{2^{256}}{\text{target} + 1} \right\rfloor
CalcWork, same as Bitcoin
Computed from the header's bits alone.

Real values from Pearl’s chain:

Block Bits Difficulty Work
0 and 1 0x1b00ffff 1.00 281,479,271,743,489
2 0x1b00ffea 1.00032054 281,569,497,721,243
10,000 0x1a0ab2a8 23.93 6,735,691,664,008,417
100,000 0x1800c4ef 21,808,883.28 6,138,748,583,186,453,807,890
120,000 0x180089e0 31,150,692.73 8,768,274,303,641,916,045,013
130,827 0x176af3a6 40,157,376.49 11,303,469,090,474,696,447,598

Work and difficulty are the same idea on different scales: work ≈ difficulty × 281,479,271,743,489. Block 130,827’s work is 40,157,376 times block 1’s, exactly its difficulty.

What is one unit of work on Pearl?

On Bitcoin, one unit is one SHA-256d attempt at a block hash. Pearl has no such attempts: miners multiply matrices, and each tile of the result yields one BLAKE3 ticket.

The trick is in the bar. A ticket wins if it’s at most the target times the work that tile cost, h·w·L multiply-accumulates (for block 130,827, 8 × 16 × 8,192 = 1,048,576). A tile twice as big gets a bar twice as easy. So, on average, every multiply-accumulate buys the same chance, and the expected number of multiply-accumulates per block works out to about 2²⁵⁶ ÷ target: the same number as the work.

How is chain work added up?

Block by block. Each node stores, for every block it knows, the total work of the chain ending there: its parent’s total plus its own work. Genesis counts too, at difficulty 1.

Because the sum weighs each block by its difficulty, a chain’s length means little. One block at today’s difficulty is worth over 40 million blocks at difficulty 1. An attacker who forks the chain from an early, easy point can mine thousands of blocks quickly and still be nowhere near the main chain’s work.

3 hard blockstotal work 3 × 100 = 3008 easy blockstotal work 8 × 10 = 80
Chain work grows with each block's difficulty, not with the number of blocks. Simplified, not to scale.

Which chain wins?

The valid one with the most total work, the most-work chain. On top of that, Pearl adds a margin of its own: a node only switches to a competing branch if it leads by at least a quarter of a block’s work. For a block at today’s difficulty, a quarter is 2,825,867,272,618,674,111,899.

When two branches tie exactly, a node keeps the one it saw first. The full rule, ties and reorganizations are on the most-work chain.

How does work become hashrate?

Divide the work per block by the time per block. On 20 October 2026, block 130,827’s work was about 1.13 × 10²² and blocks had averaged 174.3 seconds over the last 144:

1.1303×1022174.3 s≈6.49×1019 per second\frac{1.1303 \times 10^{22}}{174.3\ \text{s}} \approx 6.49 \times 10^{19}\ \text{per second}

That matches the estimate PRLScan published that day, 6.49 × 10¹⁹ per second, derived the same way from the difficulty. Read as multiply-accumulates, that’s about 65 quintillion per second. The live estimate is 64.9 quintillion multiply-accumulates per second. More on what this number means is on hashrate.

Make a guess

Blocks suddenly arrive twice as fast for an hour, at the same difficulty. What happens to the work per block?

Think of your answer first, then check it.

Answer Nothing. The work per block only changes when the bits change.

Work comes from the target alone, not from how long the block took. What changes is the hashrate estimate, since the same work now arrives in half the time. WTEMA then shrinks the target, a little after each fast block, and only that raises the work per block.

Code: CalcWork in pearld and in JavaScript

From workmath/difficulty.go (node/blockchain/internal/workmath/difficulty.go:141-153 at v1.5.2, on GitHub), unchanged from btcd:

node/blockchain/internal/workmath/difficulty.go Go
difficultyNum := CompactToBig(bits)
if difficultyNum.Sign() <= 0 {
	return big.NewInt(0)
}
// (1 << 256) / (difficultyNum + 1)
denominator := new(big.Int).Add(difficultyNum, bigOne)
return new(big.Int).Div(oneLsh256, denominator)

In JavaScript:

JavaScript
const target = 0x6af3a6n << 160n;          // bits 0x176af3a6
const work = (1n << 256n) / (target + 1n); // 11303469090474696447598n

The ticket side of the argument is in Pearl’s Rust verifier: the bar is “made easier … in proportion to the work one attempt costs” (sanity_checks.rs (zk-pow/src/api/sanity_checks.rs:189-194 at v1.5.2, on GitHub)).

The codex

Suggested

Up and down arrows move through the results, Enter opens one, Escape closes. Anywhere on the site, slash or Command K opens this search, and the square brackets [ and ] go to the previous and next page.