Tool · Mining

Toy miner

Pearl's real mining steps, on matrices small enough to read

Toy miner

Pearl’s real mining steps, one at a time, on tiny matrices

Toy sizes Real jobs are thousands of rows wide, with rank-128 noise and odds near 1 in 10¹⁶ per ticket. The steps, hash functions and byte layouts here are mainnet’s.

time1,760,000,000 job key55e6f354 hash_A94afc3a4 hash_Bf146e798 seed_B05899146 seed_Ac40e9a24 tickets 94f9a7 cc31a8 325a4b d5cd77

Step 1 of 11

Start from a block template

A miner starts from a block template: the first 76 bytes of the header. Version, the previous block’s hash, the Merkle root of the transactions, the time and the difficulty bits. There’s no nonce. The last 32 bytes, the proof commitment, can only be filled in once a ticket wins.

Change the time and watch every fingerprint above change.

Real Pearl The template comes from pearld (getblocktemplate) with real hashes; the toy uses aa…aa and bb…bb. Same 76-byte layout, with both hashes byte-reversed.

Runs in your browser · toy parameters m × k × n = 4 × 16 × 4, r = 4 src/lib/miner.ts · runToyJob

What it does

The toy miner runs one Pearl mining job from start to finish, with the same steps, hash functions and byte layouts as mainnet, on a 4 × 16 matrix A and a 16 × 4 matrix B. It starts on the research worked example, so its numbers match the ones written out on The puzzle.

  • Guided walks through eleven steps with Back and Next: template, job key, fingerprints of A and B, the salted noise seeds, low-rank noise, the noisy matrices, one tile’s diary, the tickets, the comparison with the target, the public data and block hash, and denoising.
  • Auto bumps the time and reruns the job until a ticket wins, then builds the next block on the winner’s hash.

How to read it

  • The dashed strip at the top of Guided mode holds every fingerprint of the job. Change the time on step 1 and all of them flash: the job key, both fingerprints, both seeds and every ticket. Change one entry of A on step 3 and only hash_A, seed_A and the tickets move; change one entry of B and hash_B and both seeds move, because seed_A is built on seed_B. The job key never moves when a matrix changes.
  • In One tile keeps a diary, step through the four slabs: the running sums grow, their 32 bits are XOR-folded into one word, and that word lands in the 16-word diary after a 13-bit rotation.
  • In Auto mode each dot is one ticket on a log scale; left of the dashed bound wins. What changed in the last job? compares the last two jobs. Bump the time and everything after the template changes, even hash_A, because the fingerprints are keyed with the job key. Change one entry of A and the job key, hash_B, seed_B and B’s noise stay put.

Pearl specifics

  • Mainnet uses entries in [−64, 64], noise rank 128, a checkpoint every 128 steps and 2 × 64 tiles in the reference miner. A ticket wins with odds near 1 in 10¹⁶.
  • The block hash is SHA256d of the 108-byte header. It is computed after a ticket wins and is never compared with the target.
  • The winner is proven with a ~60 KB zero-knowledge certificate; nodes never see A or B. The toy simply reveals them.

What’s simplified

Sizes (4 × 16 × 4, rank 4, 2 × 2 tiles, 4 checkpoints, so diary words 4 to 15 stay zero), value ranges (−4 to 4, noise factors −4 to 3), and the difficulty (one ticket in 4, 64 or 1,024 instead of 1 in 10¹⁶). No pools, no rank penalty (the toy’s rank is below 128), and no proof. Auto mode bumps the time to get a new job, as a real miner might; new matrices work too.

Under the hood

Runs entirely in your browser. Every value comes from runToyJob in src/lib/miner.ts, a port of the research reference that matches Pearl’s Rust code byte for byte at mainnet sizes. Its unit tests reproduce every number of the worked example (job key, fingerprints, seeds, noise, all four diaries and tickets, the public data, proof commitment, block hash and denoised product).

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.