> Documentation index: https://docs.squeekchain.com/llms.txt. Use it to find every page.

# A hamster-powered proof-of-work toychain on Ethereum

> How Squeekchain turns a hamster's wheel into Squeek blocks and SQK on Ethereum, from measurement and settlement to issuance, Squeeks and governance.

Web version: https://docs.squeekchain.com/whitepaper/

Squeektoshi, a hamster, runs on the WHEELY9000. Each time the wheel's magnet passes its sensor counts as one unit of work. Ethereum settles that work into Squeek blocks, and every completed block issues SQK to the Squeeks that share it.
{ .wp-lede }

<p class="wp-notice">In active development Squeekchain is still being built. Parts of this paper, staking in particular, describe designs that can change before they ship.</p>

## Introduction

Squeekchain turns a hamster's wheel into a public record on Ethereum. The WHEELY9000 counts each accepted passage of the wheel's magnet, groups the counts into ten-minute rounds, and signs them. The rounds are checked, settled on Ethereum and turned into progress toward Squeek blocks. Every completed block issues SQK, which Squeek owners can claim.

The system has one source of work, the WHEELY9000; one unit, an accepted magnet passage; one ledger, SqueekCore on Ethereum; and one token, SQK. Figure 1 follows one round of work from the wheel to a wallet.

--8<-- "f01-journey.md"

<p class="wp-invariant">Only the WHEELY9000 records work, and only SqueekCore settles it. The website, the livestream and this paper show copies.</p>

## The parts and how they relate

Each part of Squeekchain has a narrow job. Work moves along one path, from the device to SqueekCore, and every other surface reads copies of that path's records. A copy can be shown, cached or rebuilt, but it can't change the record it came from.

--8<-- "f02-system-map.md"

| Part | Function |
|---|---|
| WHEELY9000 | Accepts magnet passages, closes ten-minute rounds and signs uploads with its Trust M chip |
| Oracle | Checks each signed upload and keeps accepted rounds ready for settlement |
| Reporter | Signs one exact batch of accepted rounds for SqueekCore |
| Relayer | Pays the gas to submit a signed batch |
| SqueekCore | Records settled work on Ethereum and turns it into Squeek blocks |
| SqueekMining | Issues SQK for completed blocks and holds it for Squeeks |
| SqueekToken | The SQK token, with a fixed lifetime cap |
| SqueekNFT | Records who owns each Squeek |
| Staking | Holds staked SQK and adds its power to the Squeek it backs |
| Keeper | Calls the public checkpoint that turns settled blocks into SQK |
| Indexer, API, website and livestream | Show confirmed copies of the records |

## Measuring work

The WHEELY9000 has a magnet on the wheel and a Hall sensor beside it. A small controller, the Pico, reports each time the sensor turns active or inactive. The Pi decides which of those changes count, and saves every accepted passage before doing anything else with it. One accepted passage is one work unit.

The rules are strict on purpose. The sensor has to read inactive for at least 10 ms before it can count again, accepted passages are at least 60 ms apart, and a magnet that stays in front of the sensor counts once. If the clock, storage or sensor stream becomes uncertain, the device stops counting rather than guess.

--8<-- "f03-signal.md"

Work is grouped into rounds of exactly 600 seconds, counted from a fixed starting point. When a round ends, the device saves its total, including rounds with no work, and it never moves work from one round to another. A round can hold at most 10,000 work units, which is exactly as many as the 60 ms spacing allows in ten minutes. The cap is a safety limit: a passage beyond it would be rejected, and the device would stop counting until an operator steps in.

--8<-- "f04-rounds.md"

Counting doesn't depend on the internet. If the connection drops, the device keeps counting and closing rounds, and holds its signed upload until the Oracle answers.

<p class="wp-invariant">One accepted passage is one work unit. Nothing downstream can add, remove or move it.</p>

## From the wheel to Ethereum

Each upload is signed over its exact bytes by the device's Trust M chip. The Oracle checks the signature before it reads anything else, then accepts, rejects or quarantines the upload. Only accepted rounds can be settled: a rejected upload leaves evidence behind, but no work.

Every five minutes the Reporter looks for accepted rounds that are ready. It builds a batch that moves the frontier, the last round settled so far, forward. Rounds with work are listed, at most 16 of them, and every round in between that has no work is certified as zero. The Reporter signs the batch with a one-use number, the nonce, and a deadline, and a separate relayer pays the gas to send it.

SqueekCore checks the signature, the nonce, the order and the limits. If any round breaks a rule, the whole transaction fails and nothing changes. A successful batch uses up its nonce, so it can't be replayed. Public views wait for 12 Ethereum confirmations before they show the result.

--8<-- "f05-batch.md"

<p class="wp-invariant">A batch settles in full or not at all. SqueekCore never trims, caps or repairs work.</p>

## Difficulty and Squeek blocks

A Squeek block isn't a fixed amount of running. SqueekCore keeps a running total of block units, and every billion block units completes one Squeek block. Squeek blocks are SqueekCore's own count; they have nothing to do with Ethereum's blocks.

Difficulty is the work that 1,000 Squeek blocks cost. Each round with work is first priced at the difficulty that earlier rounds set. Then, if it had at least 40 work, it moves difficulty one-thirtieth of the way toward the level at which its own work would have earned exactly 40 blocks. Rounds with less than 40 work earn progress but leave difficulty alone, and rounds with no work change nothing.

--8<-- "f06-block-maker.md"

### Exact rule

```text
blockUnits += floor(w × 10^12 / D)
D_next      = floor((29 × D + floor(w × 1,000 / 40)) / 30)   when w ≥ 40
D_next      = D                                              when w < 40
height      = floor(blockUnits / 10^9)
```

`w` is a round's work and `D` is the difficulty, in work per 1,000 blocks. Difficulty never falls below 1,000, one work unit per block. These integer expressions are the definition: any other implementation must use them exactly.

--8<-- "f07-difficulty-sim.md"

<p class="wp-invariant">Earned block units are never repriced. A change in difficulty only prices later work.</p>

## SQK

<dl class="wp-keynums">
<div><dt>Lifetime cap, 18 decimals</dt><dd>2.1B2.1 billion SQK</dd></div>
<div><dt>Premined for protocol liquidity, 10%</dt><dd>210M210 million SQK</dd></div>
<div><dt>Issued by Squeek blocks</dt><dd>1.89B1.89 billion SQK</dd></div>
<div><dt>SQK per completed Squeek block, no halvings</dt><dd>6,9006,900 SQK</dd></div>
</dl>

SQK, the Squeek token, has a lifetime cap of 2.1 billion. 10% of it, 210 million SQK, is premined for protocol liquidity; it's the only SQK that doesn't come from a Squeek block. The other 1.89 billion is issued by completed Squeek blocks: 6,900 SQK for every block, with no halvings, multipliers or bonus schedules. After 273,913 blocks only 300 SQK remain under the cap; the next block issues them, and issuance stops.

Apart from the premine, only SqueekMining can mint SQK, and only to itself; SqueekToken enforces that rule and the cap. SqueekMining holds newly issued SQK for Squeeks until their owners claim it.

Two cases issue less than 6,900 SQK for a block. Blocks completed while no Squeek has active power issue nothing, and can't be claimed later. And the last block issues only the 300 SQK left under the cap.

--8<-- "f08-supply.md"

<p class="wp-invariant">After the 210 million premine, SQK is only ever issued at checkpoints, at most 6,900 for each completed block, and never past 2.1 billion.</p>

## Squeeks and staking

Squeeks are NFTs that earn SQK, and staking SQK to a Squeek raises how much it earns. Every completed block's SQK is shared between Squeeks in proportion to their power. A Squeek with 1,000 power, while all the others together have 99,000, receives 1% of each block: 69 SQK.

--8<-- "f09-share.md"

A Squeek's level, from 1 to 10, sets its rated power. Each level is rated about 10% higher than the two Squeeks a merge combines, so merging always adds power. Power from a mint or a merge starts earning in the next ten-minute round.

After each merge a Squeek waits out a cooldown before it can merge again. Cooldowns grow with each level, from 1,000 completed Squeek blocks at level 1 to 49,000 at level 9. They count completed Squeek blocks rather than time, so they pass faster while the wheel is busy.

<table class="wp-levels__table">
<thead><tr><th scope="col">Level</th><th scope="col">Rated power</th><th scope="col">Merge cooldown in completed Squeek blocks</th></tr></thead>
<tbody>
<tr><th scope="row">1</th><td>1,000</td><td>1,000</td></tr>
<tr><th scope="row">2</th><td>2,200</td><td>3,000</td></tr>
<tr><th scope="row">3</th><td>4,840</td><td>7,000</td></tr>
<tr><th scope="row">4</th><td>10,648</td><td>14,000</td></tr>
<tr><th scope="row">5</th><td>23,426</td><td>21,000</td></tr>
<tr><th scope="row">6</th><td>51,536</td><td>28,000</td></tr>
<tr><th scope="row">7</th><td>113,380</td><td>35,000</td></tr>
<tr><th scope="row">8</th><td>249,436</td><td>42,000</td></tr>
<tr><th scope="row">9</th><td>548,759</td><td>49,000</td></tr>
<tr><th scope="row">10</th><td>1,207,269</td><td class="wp-levels__none">Can't merge</td></tr>
</tbody>
</table>

Staking SQK is how a Squeek earns at its full rating. On its own, a Squeek earns with bootstrap power, a fixed fraction of its rated power. SQK you stake to a Squeek you own raises its power in a straight line: enough stake brings it to its rated power, and more takes it into Overdrive, up to a ceiling below the next level's rating. A level 10 Squeek's ceiling is above its own rating.

The SQK a Squeek earns is split by where its power comes from. The share earned by bootstrap power belongs to the Squeek and goes with it if it's sold. The share earned by your stake belongs to you, and so does the stake itself, whoever owns the Squeek later.

Stake changes take effect at the next round. When you unstake, the power your stake added ends at the next round and an exit fee is taken, which rises when a lot of stake has left recently. Half of the fee is burned and half goes to the stakers who remain. The rest can be withdrawn from that round on.

--8<-- "f10-staking.md"

<p class="wp-invariant">New power starts earning in the next round, never in the round it was added.</p>

## Checkpoints and claims

Settled blocks become SQK when someone calls the checkpoint. It takes no inputs, anyone can call it, and the Keeper service calls it routinely. A checkpoint works through settled rounds in order. Each stretch of blocks is paid to the power that was active while it was earned, and only then are scheduled power changes applied. One call applies at most 32 power changes; the next call carries on where it stopped.

--8<-- "f11-checkpoint.md"

Claiming moves SQK that a checkpoint already issued from SqueekMining to your wallet. One claim covers 1 to 32 Squeeks, never mints anything, and keeps working while settlement is paused. Unclaimed rewards belong to the Squeek, so they go with it if it's sold.

--8<-- "f12-claims.md"

<p class="wp-invariant">Claims only move SQK that a checkpoint already issued. They never mint.</p>

## Merging Squeeks

You can merge two Squeeks of the same level that you own into one Squeek a level higher. You choose which one survives. The survivor keeps its ID and image and takes the other Squeek's unclaimed rewards; the donor is burned.

Both Squeeks must be past their merge cooldown and have no pending power. Until the next round, the survivor earns with both Squeeks' old power. Then it switches to its new level's power, and a new cooldown starts, counted in completed Squeek blocks. Level 10 Squeeks can't merge.

SQK you staked to the donor follows the survivor without an exit fee. A Squeek backed by someone else's stake can't be merged.

--8<-- "f13-merge.md"

<p class="wp-invariant">A merge can't be undone: the donor is burned.</p>

## Distributing the Squeeks

<dl class="wp-keynums">
<div><dt>Squeeks</dt><dd>9,9999,999 Squeeks</dd></div>
<div><dt>For sale to the community</dt><dd>8,8888,888 Squeeks</dd></div>
<div><dt>For the protocol</dt><dd>1,0001,000 Squeeks</dd></div>
<div><dt>For the team</dt><dd>111111 Squeeks</dd></div>
</dl>

There are 9,999 Squeeks. 8,888 of them will be sold to the community, 1,000 are for the protocol and 111 for the team. No more can ever be minted: a Squeek burned in a merge doesn't free its ID.

All 9,999 Squeeks start earning together. Governance can start SqueekMining only once every Squeek is minted. Earning begins with the next full round, and no SQK is paid for blocks completed before then.

<p class="wp-invariant">There will only ever be 9,999 Squeeks. A burned Squeek's ID is never minted again.</p>

## Flywheels

Three loops follow directly from the rules above: two that compound and one that balances. Every block issues the same 6,900 SQK however much power exists, so the loops change how SQK is divided, never how much is issued. They describe what the contracts do, not what prices will do.

<ol class="wp-loops">
<li><h3>Earn and stake</h3><p>A Squeek's SQK can be staked back to it. The stake raises its power, more power takes a larger share of each block, and that share can be staked again. The loop stops at the Squeek's ceiling, just below the next level's rating; merging is how it goes further.</p></li>
<li><h3>Merge</h3><p>Merging is the only way a Squeek's level rises, and the only way a Squeek leaves circulation. Each merge burns the donor and rates the survivor about 10% above the pair, with a higher ceiling for stake, so as Squeeks grow there are fewer of them. Cooldowns count completed Squeek blocks, so the wheel sets how soon the next merge can happen.</p></li>
<li><h3>Exit fees</h3><p>Unstaking costs an exit fee that rises when a lot of stake has left recently. Half is burned and half goes to the stakers who remain, so the more stake leaves at once, the more each exit pays the stakers who stay.</p></li>
</ol>

## Who can change what

Some rules are permanent, some can change only through a delayed governance process, and one role exists only to stop things safely.

- SqueekToken can't be upgraded. Its lifetime cap and its single minter, SqueekMining, are permanent.
- SqueekCore and SqueekMining can be upgraded. An upgrade is scheduled through a Timelock and can run only after its delay. Because an upgrade could change how work or rewards are handled, upgrades are a trust assumption, not a technical guarantee.
- The Guardian can pause settlement and checkpoint funding, and can replace the Reporter while paused. It can't set difficulty, mint SQK or upgrade contracts. Pausing cancels every signed batch that hasn't been settled.
- A Reporter address is never reused.

--8<-- "f14-authority.md"

<p class="wp-invariant">Difficulty has no setter. Only settled work changes it.</p>

## What the system proves

Each step adds a specific, limited guarantee.

--8<-- "f15-evidence.md"

A work record says a passage was accepted under the device's rules. It doesn't identify the animal, show the wheel's direction or establish what made it move. A round with no work means no passage was accepted, which could also mean the device was off. The livestream shows the wheel, but cameras never create, confirm or correct work.

<p class="wp-invariant">A signature proves which chip signed the bytes, not that the measurement is true.</p>

## When things fail

Squeekchain is built to stop rather than guess. Each part fails on its own, and the parts that hold records keep them.

--8<-- "f17-ladder.md"

--8<-- "f17-failures.md"

<p class="wp-invariant">Recovery never edits work, skips a round or reuses a nonce.</p>

## Building on Squeekchain

The contracts, their events and a public API are open to anyone. Prediction markets, games, dynamic NFTs and SqueekFi can all build on Squeektoshi's work. The [developer documentation](https://docs.squeekchain.com/developers.md) lists the contracts, events and API.

## Parameters

| Parameter | Value |
|---|---|
| Round length | 600 seconds |
| Work in one round, at most | 10,000 work units |
| Rounds with work in one batch, at most | 16 |
| Confirmations before public views | 12 Ethereum blocks |
| Block units in one Squeek block | 1,000,000,000 |
| Minimum difficulty | 1,000 work per 1,000 blocks |
| Work needed to steer difficulty | 40 in a round |
| Steering target | 40 Squeek blocks per round |
| Steering step | One-thirtieth of the way to the target |
| SQK per completed block | 6,900 |
| Lifetime SQK cap | 2,100,000,000 |
| Premine | 210,000,000 SQK, 10% of the cap, for protocol liquidity |
| Issued by Squeek blocks | 1,890,000,000; the last 300 in block 273,914 |
| SQK decimals | 18 |
| Squeeks | 9,999 |
| Distribution | 8,888 for sale to the community; 1,000 for the protocol; 111 for the team |
| Squeek levels | 1 to 10 |
| Rated power | 1,000 at level 1 to 1,207,269 at level 10 |
| Merge cooldown | 1,000 to 49,000 completed Squeek blocks |
| Power changes per checkpoint, at most | 32 |
| Squeeks per claim | 1 to 32 |
