Cairn threat model

What this project defends, against whom, and what it knowingly leaves open, row by row against the code it ships.

How to read this

The first model was written on 30 August 2026, in French and outside the repository, against a commit three hundred and twenty eight commits older than this revision. On 25 September it was read again row by row against the code, and nineteen of its thirty seven rows turned out to be contradicted or qualified by what had been found since. A model a reader cannot reach and nobody keeps in step is the same kind of claim as a figure nothing holds, so this one lives beside the code and moves with it.

Each row names a threat, what stands in its way and where, the test that holds that, and what is left. What is left is written as the identifiers of the findings that show it, from the audit wave of 25 and 26 September 2026: NN-Fk is a defect, NN-Ik an improvement and NN-Qk a question. An empty residue means the mitigation holds as far as anybody has looked, which is not the same as holding. Every file this document names is checked to exist by crates/cairn-explorer/tests/site.rs, and every item named beside a file is checked to appear in it, so a row that points at code which has moved fails a test rather than standing.

1

What is defended

In order of how bad a failure would be.

AssetWhat stands in the wayHeld byLeft open
Money: no pebble created or destroyed outside the rulesthe coinbase cap and the running supply in the state root, crates/cairn-ledger/src/validation.rs, CoinbaseOverpay; crates/cairn-ledger/src/state.rs, supply_after; the ceiling, crates/cairn-primitives/src/amount.rs, MAX_MONEYcrates/cairn-ledger/tests/audit_emission.rs, crates/cairn-ledger/tests/audit_supply_and_overflow.rs
Funds: nothing spent without its key, nothing spent twicestrict verification, crates/cairn-crypto/src/lib.rs, verify_strict; keys outside the prime order subgroup refused, is_torsion_free; a cold note emptied in placecrates/cairn-crypto/tests/audit_the_verification_rule.rs, crates/cairn-crypto/tests/audit_a_key_nobody_holds.rs
Agreement: two honest nodes reach the same statecommit and revert through one replay, crates/cairn-ledger/src/state.rs, fn revert; the handover held field by field, crates/cairn-ledger/src/handover.rs, pub fn acceptcrates/cairn-ledger/tests/invariants.rs, crates/cairn-ledger/tests/handover.rs09-F1, 05-F1, 05-F2, 07-F1
Availability: no message anyone can send stops a nodea frame ceiling before any allocation, crates/cairn-net/src/wire.rs, MAX_FRAME_BYTES; a per-peer allowance, crates/cairn-net/src/sync.rs, ALLOWANCE; a connection ceiling, crates/cairn-net/src/node.rs, MAX_PEERScrates/cairn-net/tests/hostile_peer.rs, crates/cairn-net/tests/fuzz_wire.rs13-F1, 16-F1, 16-F2, 16-F3, 14-F1, 15-F1, 04-F1
A newcomer's start: nobody below the honest majority puts one on a false chainthe sampled weighing, crates/cairn-ledger/src/sampling.rs, pub const SAMPLES, the count taken from the age the tip claims against the reader's clock; a fresh draw priced by holding the tip to its run, crates/cairn-ledger/src/sampling.rs, pub const MOST_FALLcrates/cairn-ledger/tests/audit_the_bound.rs, crates/cairn-ledger/tests/the_price_of_a_seed.rs12-F1
Privacy: the software adds nothing to what the chain showsby decision the chain is public, amounts and owners included; what the software must not do is tell anyone more than that38-F1, 38-F2, 38-F3, 38-F4, 38-F5, 44-I7
The rules and their schedule: they change only as the source says, and visiblya rule changes at a height written into the build, crates/cairn-ledger/src/validation.rs, version_at; a node past its schedule says so and stops, crates/cairn-node/src/main.rs, rules_running_out; nobody votescrates/cairn-ledger/tests/audit_rule_change.rs, crates/cairn-chain/tests/audit_rule_change.rs05-F1, 05-F2, 44-I1

The 30 August model put privacy outside the model, as a property a public chain does not have. That was the wrong row. The chain is public by decision, and the open questions paper says what it shows; but a wallet that tells a peer which notes are its own, or a node that advertises the address of the phone it runs on, spends privacy the protocol never asked for. That is a failure of the software, and the model counts it as one.

It also said governance was none. There is no key, no vote and no authority, and that part holds. But whoever writes the build decides the rules and the height they change at, and the release is published by a workflow; that is a party, and it is in the table of actors below.

2

Who acts

ActorWhat it can doWhat stands in the wayLeft open
A usersign transfers of its own notes; pay any address, which is the hash of a key and shows that key only once a note paid to it is first spent, after which every note the address still holds, change included, sits behind it too; pay one nobody holds a key for, as on every chain that pays to the hash of a keyevery input signed over the network, the version, the identifier, the index and the note spent, crates/cairn-ledger/src/transaction.rs, fn message; an input's key hashed and compared with the note's owner before its signature is collected, crates/cairn-ledger/src/validation.rs, KeyNotOwner; an address written in Bech32m under its network's prefix, so a typo of up to four characters is refused, crates/cairn-primitives/src/bech32m.rs
A minerorder a block, date it within bounds, claim the reward and the fees less their burns, fill its own block space with its own transfers, which pay the place price like anyone's, and give its own coinbase up to fifteen extra outputs beyond the reward's own, each a place taken for nothingthe retarget, the median of past times and the drift a reader allows, crates/cairn-ledger/src/validation.rs, max_timestamp_drift; the coinbase cap, which bounds the free outputs at fifteen but does not burn for them; the eviction cap, max_evictions_per_block04-F1, 04-F2
A miner who hires hash rate and leavesmine a burst at many times the honest rate, keep its rewards and leave the honest miners to work off the difficulty it raised; past thirty two times the honest difficulty, keep newcomers from weighing the chain for a whilethe retarget's schedule, crates/cairn-ledger/src/pow.rs, next_difficulty: reaching X times the honest difficulty costs about X times the honest rate for tau / ln 2, and the honest chain gives back what the burst ran ahead of its schedule, log2(X) half lives, so the stall grows with the logarithm of what the burst paid. Measured on one basis for both rules, the next hundred honest blocks come 5.6 hours late after five minutes of 1 260 times the honest rate and 11.3 after an hour of it, where the moving average left 71 and 298 hours: for the same effort, thirteen to twenty six times less. A burst as small as 2 October's, which nearly stopped testnet-7 for 33 hours, now asks the next block 2.45 times and costs the honest chain about an hour, half of what it paid, crates/cairn-ledger/tests/the_difficulty_follows_the_clock.rs. Past a few hundred times the bound of four a block lengthens the stall by about a third of the first honest block's wait, and past a few thousand times the chain ends further behind its schedule than the floor's edge and the honest chain mines hundreds to thousands of blocks at difficulty 1, with almost no work behind them, while it catches up: 3 455 after a departure from 4 096 times, under five hours of the 2 October intruder's rate, and 9 191 after 8 192 when every block takes the mean time its difficulty asks, and a median of 2 244 and 7 793 over sixty four seeds of random block times, measured in the same file. This row said a median of 874 after 4 096 times until the testnet-9 study measured it again: a median over sixteen seeds, and a low one. A payment in that run has no work protecting it until the chain climbs back, since a branch of floor blocks costs nothing to mine, and the open questions keep what to do about it. The tie a newcomer applies, crates/cairn-ledger/src/sampling.rs, pub const MOST_FALL, refuses to weigh the chain after a burst past it: after bursts to 128 times for up to fifteen hours on a thirty year chain and thirty five on a young one, and after a burst to 1 024 times, seventy minutes of the 2 October intruder's rate, for 100 to 124 hours on a chain of 300 to 2 000 blocks, testnet-8's first days, measured in crates/cairn-ledger/tests/the_price_of_a_seed.rs. Meanwhile a newcomer holds the refusal against no peer, says the chain cannot be weighed once several peers have shown it the same, and half a minute later reads the chain block by block from the heaviest peer that kept it, checking every block, crates/cairn-net/tests/unweighable_chain.rs; every node keeps a gigabyte of blocks unless told otherwise, which on a quiet young chain is all of it
Whoever pays to drive the eviction cappush about a thousand notes a block out of the hot set, a miner or anybody, and so empty it in about 130 blocksevery new place burns the price, which no coinbase may claim, crates/cairn-ledger/src/validation.rs, place_price: a whole tier costs 131 072 places at 6 000 pebbles, about 7.9 CAIRN destroyed, and the cap bounds the rate whatever is paid; a miner's own coinbase is exempt for up to fifteen extra outputs a block, free. While it lasts the grace window spans 8 blocks rather than 64, and a spend waiting in a pool with a proof is let go of when its tree changes unless its wallet offers it again21-Q2, 44-Q2
A majority minerrewrite recent history, censor, spend twice deepnothing: it is the assumption. A node will not undo past crates/cairn-chain/src/lib.rs, MAX_REORG_DEPTH, which is a local policy tied to the burial and the maturity
A miner who rents a majority while the chain is youngmine in private a heavier branch that forks deeper than a node will undo, and publish it: the nodes that were following stay where they are and every newcomer, and every node that was away, takes the branch, so the network splits for good with nobody at faultnothing in the protocol, and nothing could be, since it is the assumption above bought cheaply. A node already following refuses a branch forking below what it will undo, crates/cairn-chain/src/lib.rs, ForkTooDeep, and says the branch is out of reach rather than hiding it, crates/cairn-net/src/sync.rs, unreachable; a newcomer weighs the branch and takes it for the heavier. The 1 024 blocks were about seventeen hours of testnet-7's honest work and under a minute at the rate the 2 October intruder ran at. The schedule the difficulty follows does not change this, since it prices a block and not who mines most of them: only more honest hash rate answers it. The attack catalogue of the testnet-8 wave rates it exposed, A01 to A03
A miner with a fifth to a half of the workearn more than its share by withholding blocks, as on every Nakamoto chain: from a third of the work if it hears the honest miners and reaches them late, from just under three tenths if as quickly as they reach each other, from under a fifth if it reaches them first; try to mislead a newcomer's startselfish mining is untreated, and the one lever taken is the tie rule, crates/cairn-chain/src/lib.rs, ChainStore::outweighed_by: a node keeps the branch it follows at equal work, and against a rival tip of its own height unless that carries more than half the tip's difficulty more. Without the band the branch dated earlier was the heavier in every race of equal length two or more blocks deep and was taken wherever it arrived, so a withholder matching with blocks it had found first won nine in ten of them and profited from 0.30, 0.27 and 0.18 of the work by placement; with it those races go to the block heard first, and withholding pays from 0.33, 0.29 and 0.19, the papers' threshold at the share of races each placement wins, within noise, crates/cairn-chain/tests/withheld_blocks.rs. A withholder that dates its blocks as early as the median allows takes matches seven or more blocks deep, and loses more to the difficulty than it gains. The start is bounded at the share the papers publish, measured and not proved06-F2, 44-I4
A hostile peersend malformed or costly messages, poison an address book, try to eclipse a nodethe frame ceiling and allowance above; a ceiling on connections from any one address, crates/cairn-net/src/node.rs, MAX_PER_HOST; a bounded share of the book per address group, crates/cairn-net/src/book.rs, MAX_PER_GROUP14-F1, 14-F2, 13-F1, 08-F1
An adversary on the pathread every message, delay or withhold blocks, eclipse a node without any Sybilnothing on the wire is private or bound to a peer; what it cannot do is forge, since every block needs work and every transfer a signature. Transport privacy is a decision not yet taken44-I3, 38-F3
An operatorcontrol a node's disk, its clock and its settingsa node replays its block log at start and validates it again rather than trusting its own disk; the clock is read for the drift a block may run ahead and nothing else05-F2, 11-F2, 21-F1, 25-F1
The maintainer and the releasedecide the rules and their heights; publish the binaries people runevery action pinned by hash; a provenance attestation, .github/workflows/release.yml, attestations; reproducible bytes; a schedule visible in the source months before its height. Nothing bounds what a schedule may change28-F1, 28-F2, 28-F3, 27-F2, 44-I1
An archivistserve paths for fallen notes; stay silent; watch who asks; vanishevery answer is folded against roots the asker's own node worked out, so it cannot lie; crates/cairn-net/src/message.rs, GetProofs. A wallet offline past its node's retention depends on one, which is the design's stated cost, and the archive's durability is not yet the software's37-F1, 38-F1, 38-F4, 20-F1, 44-I2
The seed operatorsee every first contact and every wallet session; hand a newcomer only addresses it choosesone name, crates/cairn-net/src/seeds.rs, seed.cairnchain.org; the sampling makes any chain it shows checkable, so the harm is eclipse and observation rather than a false chain38-F5, 14-Q3, 44-I6
Absent by designno validator set, no admin key, no checkpoint, no oracle, no bridgenone of them exists in the source, so none of them is a surface
3

What is assumed

AssumptionIf it is falseHeld byLeft open
Most of the work is honesthistory is rewritten, and a newcomer can be misledthe root assumption of proof of work; nothing holds it12-F1
Clocks are roughly righta node refuses valid blocks or takes future ones, a drift local to it while the median holdscrates/cairn-ledger/tests/retarget_timewarp.rs, crates/cairn-chain/tests/clock_skew.rs04-F1, 06-F1, 07-Q1
Each network's first block is written into the builda newcomer believes whichever first block a peer hands itcrates/cairn-ledger/src/validation.rs, for_network; crates/cairn-ledger/tests/network_rules.rs
A published network's first block is dated at its announced opening and published before itthe difficulty's schedule starts at that block's timestamp, so a network that opens late stands behind its schedule from its first block, and every target time it opened late is a block asked less than the honest rate, down to the floor, nearly free to whoever mines firstthe rule, docs/cairn-specification.md, first block MUST therefore be dated at its announced; one command that dates the test network's first block at the opening it is given and mints the devnet's with it, and rewrites every place that pins them, crates/cairn-ledger/examples/remint.rs; a late opening measured, crates/cairn-ledger/tests/the_difficulty_follows_the_clock.rs. The devnet's is dated early on purpose, crates/cairn-ledger/src/genesis.rs, DEVNET_DATED_EARLY, and a devnet opened long after its build stands behind by the difference
The sampling bound holdsa forger below half the work puts a newcomer on its chaincrates/cairn-ledger/tests/audit_the_bound.rs06-F2, 12-F1
Undoing a block is the exact inverse of applying itafter a reorganisation a node's state root parts from the network's, with no attacker neededcrates/cairn-ledger/tests/invariants.rs, crates/cairn-chain/tests/audit_a_reorganisation_is_the_inverse.rs09-F1, 11-F1, 11-F2, 11-F3, 17-F1
A handed ledger is the ledger a node would have builta node started from one follows another chaincrates/cairn-ledger/tests/handover.rs, crates/cairn-ledger/tests/audit_forged_join.rs07-F1, 16-F3
The hot set never passes its capacitythe one bound the whole design rests on is not a boundcrates/cairn-ledger/src/state.rs, plan_evictions; crates/cairn-ledger/tests/tiers.rs
The operating system's randomness is there and goodkeys are guessable; there is no weaker fallback for a key, so a failure is an errorcrates/cairn-crypto/src/lib.rs, random_bytes
Arithmetic does not wrap in a release buildan unchecked sum wraps where a checked one refusesCargo.toml, overflow-checks = true, with unchecked arithmetic denied in every crate31-F3

3.1The three assumptions that would stop the project

The 30 August model named three of these as the ones whose failure ends the project rather than costs it something, because each one false is a disagreement between honest nodes. Where each stands now:

  1. The sampling bound. Then: a derivation of 512 samples, unreviewed and unmeasured. Now: 4 096 samples, the adversary's best placement measured, the count taken from the age a tip claims against a clock the reader holds, a tip held to the run below it so that a fresh draw costs work, and the whole stated as a conjecture rather than a theorem. It was broken once by this project and mended. Still open: 12-F1.
  2. Undo is the exact inverse of apply. Then: held by debug assertions on the length of the hot set, and nothing in a release build. Now: held by property tests over random sequences and forks, and by a test that undoes every block of a chain and compares roots. Still open: 09-F1, and 11-F1 to 11-F3 on the node-local structures around it.
  3. A handed ledger is exact. Then: held by the state root and the chain of recent headers. Now: held field by field, with every refusal named by a test, and tied to the chain that was weighed by the run of headers between the ledger and the tip. Still open: 07-F1 and 16-F3.

None of the three has the shape it had on 30 August, and none is closed.

4

Where it can be reached

SurfaceWhat stands in the wayHeld byLeft open
The peer protocolevery message capped at decode; an allowance per peercrates/cairn-net/tests/protocol.rs, crates/cairn-net/tests/fuzz.rs13-F1, 16-F1, 16-F2, 16-F3, 14-F1, 14-F2, 15-F1
The wallet's pageserved on the loopback, behind a secret drawn for the run, refusing another host or origin; it moves money, crates/cairn-wallet/src/serve.rs, /api/send; a body read only for a POST and capped, crates/cairn-http/src/http.rs, MAX_BODY_BYTEScrates/cairn-wallet/tests/page.rs, crates/cairn-http/tests/fuzz_request.rs22-F1, 24-F1, 24-F6
The explorerpublic by design, read only, bounded per requestcrates/cairn-explorer/tests/answers.rs25-F1, 26-F1
The poolbounded in count and in bytes, conflicts refused, a floor of ten pebbles a byte and the burn of every place asked again when the state moves, crates/cairn-chain/src/lib.rs, MAX_POOL_BYTEScrates/cairn-chain/tests/pool.rs21-F3
A wallet as a nodea wallet joins the network as a node of its own, listening, crates/cairn-wallet/src/lib.rs, 0.0.0.0:0; every cost a greeted peer can impose lands on the device the design exists for38-F2, 16-F1, 13-F1, 14-F1, 44-I5
The sampled startnew, and the part of the design with no deployed precedent in this formcrates/cairn-ledger/tests/sampling.rs, crates/cairn-ledger/tests/audit_the_bound.rs06-F2, 12-F1
The two tiers and cold proofsnew; a proof is checked against the forest as it stands and nothing older, crates/cairn-accumulator/src/forest.rs, pub fn verify; a fallen note stays spendable without a proof for a window, crates/cairn-ledger/src/state.rs, GRACE_BLOCKScrates/cairn-ledger/tests/tiers.rs, crates/cairn-ledger/tests/cold_spends.rs, crates/cairn-ledger/tests/place_price.rs21-Q2
Files read back from diskevery record framed and checked; the block log validated again at startcrates/cairn-store/tests/fuzz_record_framing.rs, crates/cairn-store/tests/block_log.rs17-F1, 18-F1
The installer and the unitsone script, deploy/install.sh, writes the units deploy/cairnd.service and deploy/cairn-explorer.service27-F1, 27-F2
Dependenciesthe crates a shipped program pulls in, few on purpose, checked against the advisory database every week, .github/workflows/audit.yml, cargo audit
Contracts, a virtual machine, a bridgenone exists
5

What makes this model unusual

There is no finality. A node will not undo more than MAX_REORG_DEPTH blocks, and that is its own policy, not a rule of the chain: two nodes with different limits part company only over a reorganisation deeper than one of them accepts.

The bound on what a node holds is itself a claim this model has to carry. If the state a validator holds is not bounded after all, the thesis falls without anyone losing money: it is a failure of the promise rather than of consensus. The papers state every term of it and a test computes each one.

And two mechanisms carry the security that have no deployed precedent in this form, the sampled start and the handover. That is where review is most worth spending, and where every row above that ends in an open finding points.