# Chain work

> How Pearl measures the work behind a block (2²⁵⁶ ÷ (target + 1)) and a chain, what that number means in multiply-accumulates, and how it becomes hashrate.

Source: https://pearlcodex.com/technical/difficulty/chain-work/ · Last updated: 2026-10-20 · Checked against Pearl's source code at v1.5.5

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](https://pearlcodex.com/glossary/#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.

_Interactive: Bits, target and difficulty. Try it on the page: <https://pearlcodex.com/technical/difficulty/chain-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:

$$
\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](https://pearlcodex.com/glossary/#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](https://pearlcodex.com/glossary/#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.

> **Note: An inference, with a caveat**
>
> “One unit of work ≈ one multiply-accumulate” follows from how the ticket bar is scaled. Pearl doesn’t publish it as an official figure. Since block 96,251 the rank penalty also makes a block cost _more_ than its work suggests when a miner uses noise rank above 128. The work number itself never changes: it comes from the bits alone.

## 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.

_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](https://pearlcodex.com/glossary/#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](https://pearlcodex.com/technical/blockchain/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:

$$
\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](https://pearlcodex.com/technical/mining/hashrate/).

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

**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.

> **Pearl vs Bitcoin**
>
> The formula, 2²⁵⁶ ÷ (target + 1), and the idea of summing it are exactly Bitcoin’s. Two things differ. On Bitcoin one unit of work is one hash attempt; on Pearl it is roughly one multiply-accumulate of matrix work. And Bitcoin switches to any branch with strictly more work, while Pearl also demands a lead of a quarter of a block’s work.

**Code: CalcWork in pearld and in JavaScript**

From [`workmath/difficulty.go`](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/node/blockchain/internal/workmath/difficulty.go#L141-L153), 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:

```js
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`](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/zk-pow/src/api/sanity_checks.rs#L189-L194)).

## In short

- A block’s work is 2²⁵⁶ ÷ (target + 1): the expected number of attempts needed to win at that target. Pearl uses Bitcoin’s formula unchanged.
- A chain’s work is the sum over all its blocks. Nodes follow the valid chain with the most work, not the most blocks.
- Block 130,827’s work is 11,303,469,090,474,696,447,598, about 40 million times block 1’s.
- Because Pearl scales each ticket’s bar by its tile’s work, one unit of work is roughly one multiply-accumulate. That’s an inference from the design, not a published figure.
- Work per block divided by seconds per block gives the network rate: about 6.5 × 10¹⁹ per second on 20 October 2026.

## Read the code

- [CalcWork: 2²⁵⁶ ÷ (target + 1)](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/node/blockchain/internal/workmath/difficulty.go#L141-L153) `node/blockchain/internal/workmath/difficulty.go:141-153`
- [ShouldChangeTip: more work, plus a quarter-block margin](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/node/blockchain/chain.go#L1166-L1188) `node/blockchain/chain.go:1166-1188`
- [The ticket's bar is scaled by the work one attempt costs](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/zk-pow/src/api/sanity_checks.rs#L189-L194) `zk-pow/src/api/sanity_checks.rs:189-194`

## Sources

### Pearl source

- [Pearl source code at v1.5.5](https://github.com/pearl-research-labs/pearl/tree/v1.5.5)

### Papers

- [Komargodski and Weinstein, Proofs of Useful Work from Arbitrary Matrix Multiplication (arXiv 2504.09971)](https://arxiv.org/abs/2504.09971)

### Chain data

- [PRLScan network statistics](https://prlscan.com)

### Other

- [Bitcoin Wiki: Difficulty and work](https://en.bitcoin.it/wiki/Difficulty)
