# Matrix math

> The math behind Pearl's proof of useful work: matrices, multiplication, small integers, low-rank noise, GPU tiles and why checking is cheap.

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

Bitcoin miners prove their work by hashing. Pearl miners prove theirs by multiplying matrices: the same arithmetic that runs AI models. That’s Pearl’s central idea, [proof of useful work](https://pearlcodex.com/glossary/#proof-of-useful-work), and this group is the math underneath it.

You don’t need more than school arithmetic to follow it. Every page starts with small numbers you can check by hand, then shows the real sizes from Pearl’s mainnet.

_The whole picture in one diagram. Noise is added to A and B, the noisy matrices are multiplied, and the output is cut into tiles. Each tile’s running sums become one lottery ticket._

## What’s in this group?

Read in order. Each page links forward to the [mining](https://pearlcodex.com/technical/mining/) pages that use it.

| Page                                                                                          | What you’ll learn                                                                                   |
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| [Matrices](https://pearlcodex.com/technical/math/matrices/)                                   | What A and B are, the size rules, and how a matrix becomes bytes and a BLAKE3 fingerprint.          |
| [Matrix multiplication](https://pearlcodex.com/technical/math/matrix-multiplication/)         | Rows times columns, why it costs m·n·k, and the slab-by-slab view that tickets are built on.        |
| [Integers and quantization](https://pearlcodex.com/technical/math/integers-and-quantization/) | Why entries run from −64 to 64, why sums fit in 32 bits, and how AI numbers become 7-bit integers.  |
| [Rank and noise](https://pearlcodex.com/technical/math/rank-and-noise/)                       | How rank-128 noise is built from a thin matrix and a ±1 selector, removed exactly, and kept honest. |
| [GPUs and tiles](https://pearlcodex.com/technical/math/gpus-and-tiles/)                       | How a GPU tiles the work, and why the reference miner’s 2 × 64 hash tile is one thread’s registers. |
| [Cheap verification](https://pearlcodex.com/technical/math/cheap-verification/)               | Freivalds’ trick, and why Pearl uses a zero-knowledge certificate instead.                          |

## Why matrix multiplication?

Three reasons make it a good fit for mining:

- **It’s what the world already computes.** Most of the cost of running a large AI model is matrix multiplication, so mining can share hardware, and even computations, with AI serving.
- **It’s easy to measure.** Multiplying m × k by k × n is exactly m·n·k multiply-accumulates, so work can be priced per operation.
- **It’s cheap to check, with the right proof.** Verification can cost a tiny fraction of the work.

> **Warning: Useful is possible, not guaranteed**
>
> Pearl’s rules check the arithmetic, never the meaning. Random matrices pass verification exactly like a real AI layer, and a 2026 study reported that the most widely used third-party miner contains no AI inference code. How much of Pearl’s mining does useful work is an open question. See [useful output](https://pearlcodex.com/technical/mining/useful-output/).

> **Note: Only the integer scheme is live**
>
> Everything in this group describes the integer scheme that mainnet runs (certificate version 3). Pearl Research Labs have also published a floating-point (FP8) design that would need a new certificate version. It is not live at v1.5.5.

## In this group

1. [Matrices](https://pearlcodex.com/technical/math/matrices/): Grids of numbers, and the two that every Pearl miner multiplies
2. [Matrix multiplication](https://pearlcodex.com/technical/math/matrix-multiplication/): Rows times columns, one multiply-accumulate at a time
3. [Integers and quantization](https://pearlcodex.com/technical/math/integers-and-quantization/): Small whole numbers in, exact 32-bit sums out
4. [Rank and noise](https://pearlcodex.com/technical/math/rank-and-noise/): Random enough to stop shortcuts, cheap enough to peel off
5. [GPUs and tiles](https://pearlcodex.com/technical/math/gpus-and-tiles/): Thousands of cores, each one holding a lottery ticket
6. [Cheap verification](https://pearlcodex.com/technical/math/cheap-verification/): Checking a multiplication is far easier than doing it

## In short

- Pearl’s mining is a matrix multiplication: A (m × k) times B (k × n), with whole-number entries from −64 to 64.
- Each output cell is a dot product, so the work is m·n·k multiply-accumulates, and Pearl’s hashrate counts exactly those.
- Unpredictable low-rank noise stops miners reusing old answers, yet can be peeled off afterwards for a few percent extra work.
- The output is cut into tiles; each tile’s running sums, recorded every 128 steps, become one lottery ticket.
- Checking is far cheaper than doing: a \~60 KB certificate verifies in milliseconds. Usefulness itself is not enforced.

## Read the code

- [Pearl's reference CPU miner, end to end](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/zk-pow/src/ffi/mine.rs#L19-L128) `zk-pow/src/ffi/mine.rs:19-128`
- [The low-rank noise](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/zk-pow/src/circuit/pearl_noise.rs#L46-L153) `zk-pow/src/circuit/pearl_noise.rs:46-153`
- [A tile's running sums and its diary](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/zk-pow/src/circuit/chip/jackpot/helper.rs#L9-L35) `zk-pow/src/circuit/chip/jackpot/helper.rs:9-35`

## Sources

### Pearl docs

- [Pearl INT whitepaper](https://pearlresearch.ai/research/int-whitepaper)
- [Proof of Useful Work from the Ground Up (Pearl Research Labs blog)](https://pearlresearch.ai/research/blog/proof-of-useful-work)

### Papers

- [Komargodski and Weinstein, proofs of useful work from matrix multiplication (arXiv 2504.09971)](https://arxiv.org/abs/2504.09971)
- [Basu, Usefulness Gap (arXiv 2606.04819)](https://arxiv.org/abs/2606.04819)
