§ 09 · Difficulty
Chain work
Adding up the expected effort behind a chain
On this page 6 sections
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 workChain work: The total expected work behind a chain, added up from each block's target. On Pearl it is roughly a count of multiply-accumulates.: 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.
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:
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 ticketTicket: A 256-bit BLAKE3 hash of a tile's transcript. It wins a block if, read as a number, it is at most the target times the work that tile cost..
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-accumulateMultiply-accumulate: One multiplication added onto a running total. A big matrix multiplication is billions of them, and Pearl's hashrate counts them. 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.
Which chain wins?
The valid one with the most total work, the most-work chainMost-work chain: The rule nodes use to choose between competing branches: follow the valid one with the most total work. Pearl only switches if the new branch leads by at least a quarter of a block’s work.. 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:
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:
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:
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)).