# The mining lottery

> Mining is a lottery for the right to add the next block, where every ticket costs real work. Bitcoin guesses hashes; Pearl multiplies matrices.

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

Someone has to decide which transactions go into the next block, and in what order.

If anyone could just announce a new block, the network would drown in competing versions, and a cheater could keep rewriting history to undo their own payments. So Pearl, like Bitcoin, makes adding a block expensive. That expense is [mining](https://pearlcodex.com/glossary/#mining).

## Why do we need miners?

The previous pages left one problem open: if two payments spend the same coins, which one counts?

Blocks answer that by putting transactions in a fixed order. Whatever is in the chain first wins, and the later attempt is rejected as a [double spend](https://pearlcodex.com/glossary/#double-spend). But that only works if blocks are hard to make and hard to remake.

So the right to add the next block goes to whoever wins a lottery, and every lottery ticket costs real computing work. Anyone who does that work is a [miner](https://pearlcodex.com/glossary/#miner).

## How does the lottery work?

Think of scratch cards that each cost a little electricity to scratch. Most are blanks. Very rarely, one is a winner.

Nobody can tell in advance which card will win, and nobody can fake a scratched card. The only way to win more often is to scratch more cards, which means doing more work.

This idea is called [proof of work](https://pearlcodex.com/glossary/#proof-of-work). A winning ticket is proof that, on average, a huge amount of work was done to find it.

## How does Bitcoin do it?

In Bitcoin, the tickets are guesses. A miner takes the header of the block it wants to add, changes a number in it called the [nonce](https://pearlcodex.com/glossary/#nonce), and hashes it. If the hash comes out below a target number, the block wins. If not, it changes the nonce and tries again.

Bitcoin miners make an astonishing number of guesses every second. The guessing protects the network well, but the hashes themselves are useless for anything else.

## What does Pearl do differently?

Pearl keeps the lottery but changes the tickets. A Pearl header has no nonce at all.

Instead, a miner multiplies two big grids of numbers, called matrices, the same math that runs AI models. The answer is cut into small patches, and each patch is turned into a ticket by hashing a record of how it was computed. A ticket that comes in under the target wins the block.

So on Pearl, the block’s own hash plays no part in the lottery. It’s just the block’s ID.

| Topic                     | Bitcoin                                   | Pearl                                                          |
| ------------------------- | ----------------------------------------- | -------------------------------------------------------------- |
| What a ticket is          | A guess: hash the header with a new nonce | A hash of how one small patch of a matrix product was computed |
| What must beat the target | The block hash                            | The winning ticket, inside the certificate                     |
| How others check it       | Hash the 80-byte header once              | Verify a \~60 KB zero-knowledge certificate, in milliseconds   |
| Typical hardware          | Chips built only for SHA-256              | GPUs, the chips that run AI                                    |
| New block about every     | 10 minutes                                | 194 seconds                                                    |

The next two pages open this up: first the matrix math itself, then how a miner proves it did the work.

## What does the winner get?

The winner’s block starts with the coinbase transaction, which pays the [block reward](https://pearlcodex.com/glossary/#block-reward) to the miner. The reward has two parts:

- **New coins**, created by the block itself. In block 1 that was about 3,229.64 PRL, and it shrinks a little with every block. Right now it is about 2,238.33 PRL.
- **The fees** of every transaction in the block.

There’s a catch: newly mined coins can’t be spent until 100 more blocks have been added on top. If the block gets dropped in a race with a competing block, its reward disappears with it.

## Why would anyone play fair?

Because cheating doesn’t pay. A block that breaks any rule, such as paying itself too much or including an invalid transaction, is rejected by every node. The miner’s work is wasted, and so is the reward.

Following the rules, on the other hand, earns the reward. The system works by making honesty the profitable choice.

**Make a guess:** You double your mining power. On average, how much more often will you win a block?

**Answer:** Twice as often.

Every unit of work has the same tiny chance of producing a winning ticket, so twice the work means twice the expected wins. Luck still decides any single block: you might win twice in a row, or wait much longer than average.

## Do miners work alone?

Some do. Many join a [mining pool](https://pearlcodex.com/glossary/#mining-pool), which combines many miners’ work and shares out the rewards. That turns rare, large wins into smaller, steadier payments.

Pools measure each member’s effort with shares: tickets that beat an easier target set by the pool. A share that also beats the network’s real target wins a block for the whole pool. On Pearl, the pool’s software also builds the block’s certificate from that winning share.

## How much work is going on?

The network’s total mining speed is its [hashrate](https://pearlcodex.com/glossary/#hashrate). On Pearl, it doesn’t count hashes. It counts [multiply-accumulates](https://pearlcodex.com/glossary/#multiply-accumulate): one multiplication added onto a running total, the basic step of matrix math.

On 2026-10-20, the network’s estimated rate was about 65 quintillion multiply-accumulates per second. A quintillion is a 1 followed by 18 zeros. Explorers still label this “H/s”, for historical reasons.

> **Pearl vs Bitcoin**
>
> The lottery idea, the coinbase reward, the 100-block wait and the pools all come straight from Bitcoin. What’s new: no nonce, a block hash that never has to beat anything, tickets made from matrix work, a certificate that proves it, and a hashrate that counts multiply-accumulates instead of hashes.

So miners buy lottery tickets with work, and the winner writes the next page. Next: what that work actually is, and why AI runs on the same math.

## In short

- Mining decides who adds the next block. It works like a lottery where each ticket costs real computing work.
- Because winning takes work, rewriting history would mean redoing that work faster than everyone else.
- Bitcoin miners guess numbers until a block hash comes out small enough. Pearl miners multiply matrices, and patches of the result are the tickets.
- The winner collects the block reward, new PRL plus the fees, but cheating gets the block rejected and wastes the work.
- Pearl’s hashrate counts multiply-accumulates per second, not hashes.

## Read the code

- [checkProofOfWork, where a block's certificate is verified](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/node/blockchain/validate.go#L309-L339) `node/blockchain/validate.go:309-339`
- [The winning ticket compared with the bound](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/zk-pow/src/api/sanity_checks.rs#L150-L159) `zk-pow/src/api/sanity_checks.rs:150-159`
- [The block subsidy formula](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/node/blockchain/validate.go#L160-L190) `node/blockchain/validate.go:160-190`

## Sources

### Pearl source

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

### Pearl docs

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

### Chain data

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