# SLNN — the network layer Reference for an engineer who has to run a node on a hostile internet, or write a second implementation that talks to this one. Everything here is read off `src/network/` as it stands. Citations are `file.ts:line`. Every number is either a constant in the code or a measurement recorded in the code or in a test; where a number would be an estimate it says **unmeasured** and stops. Read `docs/NAMING.md` for why the components are called what they are called. Read [§13](#13-contradictions-with-other-documents) before trusting any other network document in this repository — three of them describe a version of this layer that no longer exists. > **The opening claim was false by omission until 2026-09-08.** "Everything here is read off > `src/network/` as it stands" was written when this volume cited every file in that directory > except one: **`iris.ts`, 1,688 lines, cited zero times** — and it is the only write-capable > port in the directory, the only surface a program outside the chain can reach, and the door > every wallet, dapp, exchange and second implementation comes through. §9.6 to §9.9 are new and > were read off the tree on 2026-09-08; everything else in this volume carries its earlier date. > The failure mode is worth naming because it is not staleness: nothing here was *wrong*, and a > reader could still have finished the volume believing a node opens one socket. > > **It happened again, and the second time it was three files.** Until 2026-09-12 this volume > mentioned `roche.ts` (1,268 lines), `arecibo.ts` (1,055) and `sleipnir.ts` (350) **zero times** — > 2,673 of the directory's 11,547 lines, **23.1%** of the layer, including two protocols every node > with a chain registers and runs (`src/node/hestia.ts:21`, `:695`). §14 was titled *every constant* > and listed nine of the eleven `PROTOCOL_LIMITS` entries. §15 to §17 are new, were read off the > tree on 2026-09-12, and the two missing limits are now in §14. The map above had the same three > gaps and now does not. Neither omission was drift: both files were in the directory on the day > the volume was written. **Line numbers are as of `9220195`**, read on 2026-09-07, except §9.6–§9.9, read 2026-09-08. The tree was clean at `git status --short` when this pass began; by the time it finished, work on other subsystems had modified `src/core/` and other book volumes, and **nothing under `src/network/` was touched by it**, so every citation here is against the committed tree. Symbol names are stable; line numbers drift, and `ratatoskr.ts` and `starw-node.ts` both moved by hundreds of lines in the cycle that added the pre-session cost class and wired Valkyrie collection — every citation into those two files in this volume was re-read against the tree at that commit rather than carried forward. Treat every `file.ts:line` as an anchor to check. --- ## 1. The map | Name | File | What it owns | |---|---|---| | **Rune** | `src/network/protocol.ts` | `str://` addressing, frame encoding, the message-id commitment, the dedup key, per-protocol limits, TTL | | **Bifrost** | `src/network/bifrost.ts` | the three-leg mutual handshake, the ML-KEM session key, AES-256-GCM frame sealing | | **Ratatoskr** / **Gleipnir** | `src/network/ratatoskr.ts` | flood gossip, the seen-cache, and four token-bucket cost classes: traffic, handshake, pre-session, ring verification | | **Praeco** | `src/network/praeco.ts` | hostless discovery, peer records, scoring, address-group diversity, eviction | | **Verdandi** | `src/network/verdandi.ts` | continuous block sync, bounded spans, byte budgets, the backward ancestor search | | **Mnemosyne** | `src/network/mnemosyne.ts` | STARW node classes and the retention budget | | **StarwNode** | `src/network/starw-node.ts` | the assembly: session lifecycle, ingress dispatch, relay policy, gossip mempools | | **Aether** | `AetherNetwork` `src/network/starw-node.ts:4287` | in-memory transport, for tests and single-process meshes | | **TCP** | `src/network/tcp.ts` | the **peer** socket transport: reassembly, deadlines, write-queue bound | | **Iris** | `src/network/iris.ts` | the **public** JSON-RPC door: 30 methods in three cost classes, 11 of them writes, metered by Gleipnir, loopback unless the operator says otherwise. §9.6 | | **Arecibo** | `src/network/arecibo.ts` | announcing which public hostless spaces exist and who holds them: two signatures, four admission gates, a bounded index. §15 | | **Roche** | `src/network/roche.ts` | moving the sealed chunks of a hostless space between peers, verified against the chain root on the way in and again on the way out. §16 | | **Sleipnir** | `src/network/sleipnir.ts` | the Kademlia routing table and iterative lookup. **Live, opt-in**: the table in shadow under `--peer-shadow`, the lookup on the dial path under `--peer-lookup` (`sleipnir-wire.ts`). §17 | `StarwNode` is the only place that knows about all of them. Every other file is reachable on its own and is tested on its own. **Iris is the exception in a second way**: it is the only entry in this table that is not part of the peer mesh at all — it is a node's door to the world rather than to other nodes, and it is the only one that accepts a write from a caller nobody has authenticated. It was absent from this volume until 2026-09-08; see §9.6, and see the note under the header above about what that means for the rest of the citations here. The runtime that drives this layer — the dial loop, peer exchange rounds, record refresh, the sync tick — is `src/node/hestia.ts`. It is not part of this reference except where its choices bind a bound described here (it does: `hestia.ts:483` sets the TCP connection cap). --- ## 2. `str://` addressing ``` str://@/: str://STR.GENESIS0022@tcp/node.slnn:9111 ``` `parseStrAddress` (`protocol.ts:599`) is the grammar, and it is the whole grammar: ``` /^str:\/\/([A-Za-z0-9._-]+)@([a-z]+)\/([^:/]+):(\d+)$/ ``` - transport must be one of `tcp | ws | wss | mesh | memory` (`protocol.ts:202`); anything else is refused by name rather than ignored. - port must be an integer in `[1, 65535]` (`protocol.ts:217`). - the host production is `[^:/]+`, so **an IPv6 literal does not parse**. `hostGroup` (`praeco.ts:651`) contains a full IPv6 expander that is currently unreachable for exactly this reason, and says so in its own comment (`praeco.ts:668`). If you widen the grammar, the diversity rule starts applying to v6 with no further change. The identity is the address. `host:port` is only where a node currently answers, which is what lets `TcpTransport.identify` (`tcp.ts:641`) rename a connection from `ip:port` to the node id the handshake proved, so that every per-peer bound counts a node rather than a socket. --- ## 3. The wire — Rune ### 3.1 Frame layout `encodeRune` (`protocol.ts:822`), `decodeRune` (`protocol.ts:879`): ``` magic 4 bytes "SLNN" version 1 byte SLNN_WIRE_VERSION = 1 ttl 1 byte protoLen 1 byte + protocol id (utf8, protoLen bytes) messageId 16 bytes (32 hex chars, decoded) bodyLen 4 bytes big endian body bodyLen bytes, canonical JSON (utf8) ``` Header is `27 + protoLen` bytes. Protocol ids run 20–27 bytes, so headers run 47–54. `MAX_FRAME_BYTES = 512 * 1024 = 524,288` (`protocol.ts:26`) is the hard ceiling on any single frame, and `decodeRune` refuses anything over it as its first act (`decodeRune` `protocol.ts:879`). ### 3.2 The length prefix, and where it actually protects you There are **two** length gates, and only one of them is the "refuse without allocating" property. Be precise about which: 1. **The transport prefix.** `TcpTransport` puts its own 4-byte big-endian length ahead of each frame (`tcp.ts:18`, written at `tcp.ts:403`). `RuneReassembler.next` reads that prefix at an offset and throws if the declared length exceeds `MAX_FRAME_BYTES` (`tcp.ts:212-215`) — from the four header bytes alone, before any body buffer exists. The test asserts the buffer still holds exactly 4 bytes after the refusal (`tests/integration/tcp.integration.test.ts:241`). **This is the gate that keeps a Pulsar from allocating a gigabyte because a stranger lied.** 2. **The Rune prefix.** `decodeRune` compares the declared `bodyLen` against the protocol's own limit (`protocol.ts:474-475`) and then against the actual frame length (`protocol.ts:476`), both **before** `JSON.parse` (`protocol.ts:478`). By this point the bytes are already in memory — the transport delivered a complete frame — so what this saves is the parse and everything downstream of it, not the allocation. **One frame on the wire is not a Rune: the connection refusal (2026-10-26).** A listener at its per-address cap or with a full inbound table no longer accepts the socket and destroys it. It writes ONE length-prefixed frame whose body is the four ASCII bytes `SLRF` followed by a short printable reason (`per-address connection limit` or `inbound connection table full`, at most 96 characters), then `end()`s the socket and destroys it within `REFUSAL_LINGER_MS` (1 s); at most `MAX_LINGERING_REFUSALS` (64) refused sockets are held at once, and past that the old silent destroy applies. The dialler reads it ONLY on a connection it dialled and has not yet authenticated: it reports `per-address connection limit at :` through `TcpTransportOptions.onRefused`, and Hestia keeps it in `HestiaStatus.connectionRefusals`, backs the address off, frees the dial slot at once and runs a dial turn so the next seed is tried, and `strblk node` prints the reason in place of "no seed answered". `SLRF` cannot collide with a Rune (`SLNN`) or a sealed frame (`SLNS`). Tests: `tests/integration/connection-refusal.integration.test.ts`. **Two more reasons the same frame carries (2026-10-26).** `remaining slots are reserved for new addresses` — the newcomer reserve of §11.2 item 1 — and, from the node rather than the transport, `another chain: this node follows chain genesis `. The second is sent on the first handshake leg by a responder whose chain id or genesis differs from the dialler's, through `Transport.refuse`, which writes the frame and closes an inbound connection that has not authenticated; it is journalled in `handshakeRefusals` under the `handshake` counter it was always counted under. Before it, the responder dropped the challenge without a word and kept the socket, and a dialler on the wrong genesis waited out its handshake deadline and reported "no peer has advertised a height yet" — MEASURED on Asgard: a follower started without the Asgard genesis held seven TCP connections to the seven public seats with zero sessions and nothing on either side naming the cause. A following explorer now appends the refusal to that sentence, with the seed's address cut off because the sentence is rendered on public pages. Tests: `tests/integration/newcomer-admission.integration.test.ts`. A third ordering fact matters for an authenticated peer: a sealed frame's plaintext only exists after the GCM tag verifies (`bifrost.ts:530-536`), so the per-protocol limit is applied *after* an AES-256-GCM decrypt of up to `MAX_FRAME_BYTES`. The decrypt itself is not charged; it is the cheap half, about 0.45 ms for a maximal frame. The decode is the expensive half, and since 2026-11-05 it is charged first: `StarwNode.receive` reads the protocol from the opened header with `peekRuneProtocol` and charges Gleipnir's byte budget (§5.3) for that topic BEFORE `decodeRune`, then skips the later charge so the frame is billed once. Until then the first charge came after the decode, and a sealed frame that failed to decode was never charged at all. Tests: `tests/integration/starw-sealed-charge-before-decode.integration.test.ts`. ### 3.3 `messageId` is a commitment, and it is not the dedup key `messageId = sha256(protocol + "|" + canonicalStringify(payload)).slice(0, 32)` (`runeIdFor` `protocol.ts:654`) — 128 bits, carried on the wire. `decodeRune` recomputes it over the parsed payload and refuses a mismatch (`protocol.ts:481-483`). That is what stops a relay swapping a body and keeping the id. The gossip router does **not** deduplicate on it. It deduplicates on `frame.dedupKey` (`ratatoskr.ts:403`), which `decodeRune` derives locally (`protocol.ts:494`) and which is never on the wire: ``` dedupKey = sha256(protocol + "|" + canonicalStringify(dedupContentOf(protocol, payload))).slice(0, 32) ``` `runeDedupKey` is at (`runeDedupKey` `protocol.ts:671`); `dedupContentOf` at (`dedupContentOf` `protocol.ts:719`). The reason the two had to stop being one number is an amplifier, and it was measured twice: - The projection was taken over the *wire fields*, and `deserializeTx` coerces (`String(raw.id)`, `BigInt(String(raw.amountMinor))`, `Number(raw.timestampMs)`), so every spelling that coerced to the same value was a different key. **70 wire spellings of one signed transaction produced 70 distinct dedup keys, 61 relays across a three-node line, and 61 seen-cache entries** (`protocol.ts:317-321`, asserted at `tests/integration/network-amplification.integration.test.ts:460` and `:478`). - `block` had no projection at all — it fell through to `default: return payload` — so every field `deserializeBlock` ignores was free entropy on the largest payload the wire carries. **1,001 padded payloads of one sealed block produced 1,001 distinct dedup keys** (`protocol.ts:323-325`, asserted at `tests/integration/network-amplification.integration.test.ts:517`). The key is now taken over the **output of the same decoder the handler runs**, which buys a property a hand-maintained projection can only approximate: a frame is relayed only if it decodes, and two frames that decode to the same thing have the same key. The cost was measured rather than waved at: on a 519,548-byte block frame (1,050 transactions, near the protocol ceiling) the dedup key costs **1.93 ms** against **1.77 ms** for the id commitment that was already being paid, so the projection adds **0.16 ms** to a **4.44 ms** `decodeRune` (`protocol.ts:326-328`). **Honest note on width.** Both `messageId` and `dedupKey` are truncated to 128 bits. A dedup key collision would suppress a legitimate message at every node that saw the colliding one first. The work to find one is birthday-bound at 2^64. Nothing in the tree measures or exploits this; it is stated so a reimplementer does not widen one and not the other. ### 3.4 `RUNE_FIELDS` and `RUNE_KINDS` — strict, at the decoder `RUNE_FIELDS` (`protocol.ts:457`) names the top-level payload fields each protocol may carry. `RUNE_KINDS` (`protocol.ts:526`) names the `kind` values it may take. `assertRuneShape` (`assertRuneShape` `protocol.ts:793`) enforces both and throws — that is, refuses the frame — for: - a payload that is not a plain object; - a `kind` that is not a string or is not in the protocol's list; - **any** top-level field the protocol does not name. This runs in `decodeRune` (`protocol.ts:879`), before the dedup key is taken over the payload and before any handler reads a field. The failure it closes: the gossip id was a hash of the whole payload while the validators read only the fields they knew about, so `{block: X, z: "1"}` and `{block: X, z: "2"}` were two distinct message ids carrying the same valid block — new to every seen-cache, relayed to the full fanout by every node, for the cost of incrementing a counter (`protocol.ts:126-138`). `kind` was the same hole with a shorter name: nothing on the `tx`, `block`, `attest` or `ghost` path read it, so any string in it was another free message id. **Adding a field to a protocol means adding it here**, and that is a wire-breaking change — see §12. ### 3.5 TTL `MAX_RUNE_TTL = 8` (`protocol.ts:124`). `encodeRune` defaults to 4 (`encodeRune` `protocol.ts:822`) and clamps on the way out (`encodeRune` `protocol.ts:802`); `decodeRune` clamps on the way in (`protocol.ts:497`). `burnHop` (`protocol.ts:966`) decrements and returns `null` at zero. TTL is one byte the sender chooses and nothing clamped it. A hand-built frame arriving with 255 was relayed 255 times to a fanout of six by every honest node that saw it — the bound that makes a flood terminate was the sender's to set (`protocol.ts:113-123`). It is **clamped, not refused**: an over-large TTL is not evidence of anything, and refusing the frame would let a relay anywhere on the path get a message dropped by raising a byte nobody signs. Test: `tests/integration/network-amplification.integration.test.ts:157`. Note that TTL is **not** what decides whether a frame is relayed. That is decided by the protocol (§3.6), because `frame.ttl === 0` was half of a test a sender controls: a `head` payload built with a budget of four went down the flood path, where its `hashHex` is a field this node does not check and every distinct value was another trip round the fanout (`starw-node.ts:1043-1053`). ### 3.6 The protocol table Limits from `PROTOCOL_LIMITS` (`src/network/protocol.ts:203`). Routing from `DIRECT_PROTOCOLS` (`DIRECT_PROTOCOLS` `src/network/starw-node.ts:296`), `NON_RELAYED_PROTOCOLS` (`src/network/starw-node.ts:361`) and the dispatch in `handlePayload` (`src/network/starw-node.ts:3406`), which `receive` (`receive` `src/network/starw-node.ts:2874`) reaches once a frame has been admitted. | Protocol id | Payload cap (bytes) | Kinds | Routing | Validated before relay by | |---|---|---|---|---| | `/sourceless/handshake/1.0.0` | 16,384 | `challenge`, `response`, `confirm` | **cleartext only**, pre-session, never relayed, never deduplicated | Bifrost signature checks (`starw-node.ts:1463`) | | `/sourceless/praeco/1.0.0` | 131,072 | `peers` | **direct** | `isPeerRecord` + `PraecoDirectory.merge`, and `merged.admitted > 0` is required (`starw-node.ts:1604-1622`) | | `/sourceless/tx/1.0.0` | 65,536 | `tx` | **flooded** | `deserializeTx` + `validateTransactionStateless` bound to chainId and genesis (`starw-node.ts:1526-1535`) | | `/sourceless/identity/1.0.0` | 4,096 | `allocation`, `registration` | **flooded** | `parseWireAllocation` / `parseWireRegistration`, then `verifyDomainClaim` / `verifyDomainProof` (`starw-node.ts:1551-1576`) | | `/sourceless/arecibo/1.0.0` | 131,072 | `spaces` | **direct** | `isSpaceOffer` on every entry, then `AreciboDirectory.merge` — two signatures and the chain's own visibility — and `merged.admitted > 0` is required (`starw-node.ts:1787-1818`). §15 | | `/sourceless/roche/1.0.0` | 360,448 | `want-manifest`, `manifest`, `want-chunks`, `chunk`, `miss` | **direct** | `RocheTransfer.onPayload` — solicitation first, then the Merkle path against the root this node's chain holds (`starw-node.ts:1820-1833`). §16 | | `/sourceless/ghost/1.0.0` | 32,768 | `ghost-preconfirm`, `witness-request`, `witness`, `witness-decline` | **direct** | `handleGhost` — and `direct` rather than *delivered, never relayed* since the witness exchange gave the protocol a sender: two peers asking about one entry build byte-identical frames, so the flood layer's seen-cache would have eaten the second (`src/network/starw-node.ts:150`) | | `/sourceless/block/1.0.0` | 523,235 | `block` | **flooded** | `parseWireBlock`, then the host's `onBlock` — relayed only if accepted (`starw-node.ts:1645-1657`) | | `/sourceless/attest/1.0.0` | 16,384 | `attest` | **flooded** | `verifyValkyrie` (`starw-node.ts:1584-1602`) | | `/sourceless/sync/1.0.0` | 523,235 | `head`, `want`, `blocks` | **direct** | `VerdandiSync.onPayload` (`starw-node.ts:1628`) | | `/sourceless/ping/1.0.0` | 1,024 | `ping` | **direct** | shape only | 523,235 is `MAX_FRAME_BYTES - SEALING_HEADROOM_BYTES`, where `SEALING_HEADROOM_BYTES = 29 + 1024 = 1053` (`protocol.ts:44`). The headroom exists because a frame that is legal in the clear and illegal once sealed is a frame the node can build and then fail to send — and the failure lands on the relay path, where a throw is a node-wide halt rather than a dropped message (`protocol.ts:28-35`). Check the arithmetic at the top end: a maximal block Rune is `50 + 523,235 = 523,285`; sealed, `+29 = 523,314`; with the TCP prefix, `523,318` on the wire, under the 524,288 cap by 970 bytes and under `MAX_REASSEMBLY_BYTES` (524,292) by 974. **`attest` has a publisher now, and it is the largest new load on this layer.** The topic had a name, a 16 KB budget and a receive-side validator and nothing that ever sent one, so `block.attestations` was empty on every running network. `StarwNode.broadcastAttestation` (`StarwNode.broadcastAttestation` `starw-node.ts:1923`) is the send side, driven by `attestAccepted` (`starw-node.ts:1981`) from the two places a block joins this node's chain — `broadcastBlock` (`starw-node.ts:2128`) and `acceptBlockFromPeer` (`starw-node.ts:3855`) — with the chain reached through the two-function `ValkyrieHooks` (`starw-node.ts:812`), wired as a constructor option (`StarwNodeOptions.valkyrie`, `starw-node.ts:268`) and never as a setter. A node signs each block once: `attested` is a bounded FIFO of block hashes (`attested` `starw-node.ts:1112`, `MAX_ATTESTED_BLOCKS = 128` at `starw-node.ts:337`), and it has to be, because `attestedAtMs` is inside the signed payload, so asking twice yields two valid signatures with two different dedup keys that every verifier counts as one and every peer pays to relay. What collection costs the network is §10.4; what it cannot do is §11.2 item 15. Three routing categories, and what each means: - **flooded** — put through the seen-cache, hop budget honoured, relayed to `fanout` peers that have not been marked as knowing it. - **direct** — charged a Gleipnir token, **not** deduplicated, **never** relayed. Request and response cannot travel by flood, because two peers asking for the same range build byte-identical payloads and the second would be dropped by the very mechanism that makes flooding safe (`starw-node.ts:871-877`). Same for head advertisements and PEX samples: an unchanged one is byte-identical to the last, and that repeat is precisely what a peer that joined late needs to hear (`starw-node.ts:1020-1028`, `starw-node.ts:1043-1053`). - **non-relayed** — accepted, validated, delivered to local handlers, forwarded to nobody. `ghost` is the only non-relayed protocol, and the reason is stated as a limit rather than hidden: a pre-confirmation receipt carries three hashes and **no signature**, so nothing in the payload can be verified against anything. The handler could only check that the fields were strings, which made any two strings a valid receipt — 32 KB of arbitrary text, accepted, and relayed to six peers each of whom did the same (`starw-node.ts:150-162`). The fields are now required to be SHA-256 digests, which bounds a receipt at a couple of hundred bytes, and the frame stops here. Making it relayable would take a signature over it, and that is a wire change (`starw-node.ts:159-162`). ### 3.7 The wire codecs live next to the dedup key, deliberately `serializeTx` / `deserializeTx` (`protocol.ts:538`, `:556`), `parseWireBlock` (`parseWireBlock` `protocol.ts:1078`), `serializeAllocation` / `parseWireAllocation` (`protocol.ts:636`, `:652`) and their registration counterparts are all in `protocol.ts`, and `starw-node.ts` and `verdandi.ts` re-export them (`starw-node.ts:1864`, `verdandi.ts:952`). They moved there because a decoder and a hand-maintained projection *of* that decoder is the same defect wearing a different name, and it cost 70 dedup keys for one transaction and 1,001 for one block before it was believed (`protocol.ts:534-547`, `protocol.ts:611-620`). Two decoder details a reimplementer will get wrong: - **`purpose` is validated, not coerced** (`decodeWirePurpose` `protocol.ts:1010`). It is inside the signing payload, so dropping it changes what the transaction signs as. When it was dropped, a gossiped CCOS transfer (`purpose: 'financial'`, which the ledger requires) arrived signed as `'transfer'` and failed signature verification — those transactions could not propagate at all (`protocol.ts:566-574`). `String(raw)` would have accepted `purpose: ["financial"]` as another spelling; `typeof` before comparison does not. - **The identity codecs go through the store's codec** (`serializePendingRecords` / `deserializePendingRecords` from `src/storage/mimir.ts`), so the gossip path, the pending log and the block body are one encoding rather than three (`protocol.ts:604-620`). What is added here is totality: the disk decoders throw on a missing field, and this runs on a stranger's bytes inside the transport's data handler, where a throw is the node stopping. --- ## 4. Bifrost — handshake and frame sealing **What Bifrost is not.** It is the handshake between two peers **already on the same chain**, and it runs after **Snotra** (`src/core/snotra.ts`) has decided which chain that is — `snotra.ts` says so in its own header, listing itself as the question that comes before the doorkeepers (`snotra.ts:50-53`). The `chainId` and `genesisHashHex` the legs below compare are values Snotra resolved before a socket was opened; mainnet is now chain id **1313** (`ASGARD_CHAIN_ID`, `src/core/config.ts:47`) and the development chain moved to **31337** (`DEV_CHAIN_ID`, `src/core/config.ts:34`), so a stale 1313 pasted into a config now names mainnet rather than a harmless local chain. The realm register and the operator-facing consequences are `GOVERNANCE_AND_OPERATIONS.md`; nothing else in this volume depends on it. ### 4.1 The three legs ``` A ──── challenge { nonce_A(32B), issuedAtMs, identity_A, chainId, genesisHash } ──▶ B A ◀─── response { nonce_A, nonce_B(32B), respondedAtMs, identity_B, chainId, genesisHash, protocols, checkpoint, kemCipherText, sig_B } ─── B A ──── confirm { nonce_A, nonce_B, sessionProof, confirmedAtMs, identity_A, protocols, checkpoint, sig_A } ──▶ B ``` `openBifrost` `bifrost.ts:551` · `crossBifrost` `:640` · `verifyBifrostResponse` `:703` · `sealBifrost` `:282` · `verifyBifrostSeal` `:307`. Nonces are 32 bytes from `crypto.getRandomValues` (`randomHex` `bifrost.ts:1014`). `BIFROST_MAX_AGE_MS = 30_000` (`bifrost.ts:37`) bounds the replay window on both verifying legs (`bifrost.ts:202`, `bifrost.ts:310`). **What each leg proves.** - **Leg 1 (challenge) proves nothing.** It is unsigned. It announces the dialer's claimed identity, its KEM public key, and which network it is on. Treat everything in it as a claim until leg 3. - **Leg 2 (response) proves the responder's identity to the dialer.** `sig_B` is a hybrid ed25519 + ML-DSA-65 signature (`signGemini` `aegis.ts:239`) over `bifrostSigningPayload(challenge, unsigned)` (`bifrost.ts:133`), which binds the dialer's nonce, both node ids, both signing keys, **the dialer's KEM public key**, chainId, genesis hash, the sorted protocol list, the checkpoint proof, and the KEM ciphertext. - **Leg 3 (confirm) proves the dialer's identity to the responder, and proves key agreement both ways.** `sig_A` covers `sealSigningPayload` (`bifrost.ts:787`), which binds both nonces and the session proof. The first implementation had two legs. The dialer never proved anything, yet the responder had to accept its frames — an unauthenticated peer with a live channel. The responder now opens no session until `verifyBifrostSeal` passes (`starw-node.ts:1450-1478`), and the confirm identity must match the one that issued the challenge, key material included (`bifrost.ts:320-326`). **Why the dialer's KEM key is in the transcript.** Without it a relay swaps in its own key, the responder encapsulates to the attacker, the responder's signature still verifies, and the attacker holds the session key while the dialer silently derives a different one through ML-KEM's implicit rejection (`bifrost.ts:130-134`). This is the single line that makes leg 2 non-forwardable. **Why the session proof exists.** ML-KEM fails by implicit rejection — a wrong key yields a different secret with no error — so a mismatch is otherwise silent on both sides (`bifrost.ts:328-330`). `sessionProof` (`bifrost.ts:783`) is `sha256("slnn-session-proof-v1|" + sessionKey + "|" + nonceA + "|" + nonceB)`, and `verifyBifrostSeal` compares it against the value the responder computes from its own key (`bifrost.ts:331`). Other refusals in `verifyBifrostResponse`: version mismatch, nonce echo mismatch, expired challenge, wrong chainId, wrong genesis hash, a peer claiming this node's own identity, an empty protocol list, a failing signature, a failing decapsulation, and no protocols in common (`bifrost.ts:200-241`). **A footgun that fails closed.** `sealBifrost` takes `sessionKeyHex = ''` as a default (`sealBifrost` `bifrost.ts:830`). A caller that forgets to pass it produces a proof over the empty string, which the responder's comparison then rejects. The real caller passes it (`starw-node.ts:562`). Failing closed is correct; the default is still worth removing. ### 4.2 The session key, and what it rests on ``` sessionKey = sha256(canonical({ domain: 'slnn-session-key-v1', sharedSecretHex, nonceHex: challengeNonce, challenger: nodeIdA, responder: nodeIdB })) ``` `deriveSessionKey` `bifrost.ts:997`. **Since `slnn-handshake-2.0.0` (2026-09-12), `sharedSecretHex` comes from the hybrid combiner, ML-KEM-768 and X25519 together.** `crossBifrost` calls `encapsulateHybrid` and `verifyBifrostResponse` calls `decapsulateHybrid` (`bifrost.ts:684`, `bifrost.ts:772`), against the dialer's hybrid session KEM key. The combiner hashes both ciphertexts and both public keys into the shared secret, so recovering the session secret means breaking both ML-KEM-768 and X25519 (`bifrost.ts:59-69`). Until that version this section said, correctly then, that the secret came from bare ML-KEM-768 alone. The fix was the handshake version bump it asked for: `kemPublicKeyHex` grew from 1184 to 1216 bytes and `kemCipherTextHex` from 1088 to 1120, both inside the signed Bifrost transcript, and a bare 1088-byte ciphertext is now refused (`bifrost.ts:461-470`). What that means, concretely: - Signatures on this link are hybrid, and **so is confidentiality**. A flaw in ML-KEM-768, or in the unaudited `@noble/post-quantum` implementation of it, which does not claim constant time, leaves X25519 standing, and a break of X25519 leaves ML-KEM-768 standing. - What the swap did not change is the property below: there is still no forward secrecy. **Two further properties of this construction that are not stated anywhere else, and that an operator should know.** - **There is no forward secrecy.** The KEM keypair is the node's long-lived identity key, generated once and persisted to disk (`hestia.ts:1403`, `hestia.ts:1413`, loaded at `hestia.ts:1389`). Encapsulation is against that static key. Anyone who later obtains a node's KEM secret key can decrypt every recorded session that node ever *dialled* — because only the dialer's KEM key is encapsulated to. The responder's `kemPublicKeyHex` is in the signed transcript but contributes nothing to the secret. The comment at `bifrost.ts:31-32` calls this "forward-looking confidentiality against a quantum adversary recording it now", which is true against an adversary who must break ML-KEM and false against one who later takes the disk. There is no ephemeral KEM key and no rekey anywhere in the file. - **The handshake itself is in the clear.** Legs 1–3 are unsealed Runes (`starw-node.ts:541`, `:445`, `:1132`). A passive observer on the link learns both node ids, both signing public keys, both KEM public keys, the chain id, the genesis hash, the advertised protocol set and both checkpoint proof hashes before any frame is encrypted. ### 4.3 Frame sealing — AES-256-GCM Every application byte leaves through `StarwNode.deliver` (`starw-node.ts:2844`) and is sealed. The session key was derived, confirmed by both sides, and then never used: every application frame went out as canonical JSON in the clear, which made the encapsulation decorative (`bifrost.ts:376-385`, `starw-node.ts:926-931`). ``` SEALED_MAGIC 4 bytes "SLNS" version 1 byte SEALED_VERSION = 1 counter 8 bytes big endian ciphertext n bytes tag 16 bytes GCM ``` `sealFrame` `bifrost.ts:1081` · `openFrame` `bifrost.ts:1110` · `isSealedFrame` `bifrost.ts:1075`. `SEALED_HEADER_BYTES = 13` (`bifrost.ts:447`), `GCM_TAG_BYTES = 16` (`bifrost.ts:448`), total overhead 29 (`protocol.ts:36`). The 13-byte header is **authenticated as AAD but not encrypted** (`bifrost.ts:450`): the counter has to be readable to be checked, and authenticated so that reading it is worth anything. **Per-direction keys.** `frameCipherFor(sessionKey, writerNodeId)` (`bifrost.ts:464`): ``` key = sha256("slnn-frame-key-v1|" + sessionKey + "|" + writerNodeId) // 32 B noncePrefix = sha256("slnn-frame-nonce-v1|" + sessionKey + "|" + writerNodeId)[0..4] // 4 B ``` The sender passes its own node id and the receiver passes the peer's, so both compute the same two ciphers (`starw-node.ts:615-616`). Each key has exactly one writer. **The nonce.** 12 bytes: the 4-byte per-direction prefix, then this frame's counter as a 64-bit big-endian integer at offset 4 (`nonceFor`, `bifrost.ts:507`). **Why it cannot repeat.** Four things together, and all four are needed: 1. Both sides hold the same session key, so a counter-based nonce would repeat across the two directions — and a repeated nonce under one GCM key is a total break of both messages, not a weakening. The writer's node id is mixed into **both** the key and the nonce prefix, so the two directions share neither (`bifrost.ts:386-392`). 2. The counter is a counter, not a random value. 96-bit random nonces collide at birthday scale; a counter cannot collide at all while the session lives (`bifrost.ts:393-396`). 3. `writeCounter` starts at 0 and only increments (`starw-node.ts:617`, `starw-node.ts:1149`). It is never reset within a session, and there is no rekey to reset it across one. 4. At `SEALED_MAX_COUNTER` (`Number.MAX_SAFE_INTEGER`, `bifrost.ts:450`) the sender **ends the session** rather than wrapping (`starw-node.ts:1140-1146`); the peer redials and derives a fresh key. **Replay.** `openFrame` requires the counter to strictly increase past `lastCounter` (`lastCounter` `bifrost.ts:1125`), and `readCounter` starts at `-1` so that counter 0 is a legal first frame (`starw-node.ts:619`). A recorded frame replayed by anyone who saw the link is refused before the payload handlers see it. **`openFrame` returns `null`, never throws** (`bifrost.ts:502-505`, `:496-500`). It sits on the receive path, where an exception is a process-wide halt that any peer could trigger by sending 30 bytes of noise. A failed tag check is not an error to report upward; it is a frame that did not come from the peer holding the session key. ### 4.4 Ingress policy — what an unauthenticated peer may do `StarwNode.receive` `starw-node.ts:2874`. In order: | Frame | Session? | Outcome | |---|---|---| | sealed | no | refused `unauthenticated` (`:1168`) | | sealed, tag/counter fails | yes | refused `unsealed` (`:1175`) | | sealed, protocol `handshake` | yes | refused `handshake` (`:1188`) — the handshake establishes the key; one arriving already sealed under it is confused or trying to restart an established session | | **cleartext, any protocol** | **no** | **charged its raw wire bytes to `gossip.allowPresession(peerId, bytes.length)` BEFORE `decodeRune` runs, or refused `presession-budget` (`:1220-1222`)** | | cleartext, any protocol | yes | charged `gossip.allow(peerId, bytes.length)` before the decode, or refused `rate-limited` (`:1216-1218`) | | cleartext, protocol `handshake` | no | charged a second class — the traffic buckets, `gossip.allow` (`:1255-1258`) — then `handleHandshake` inside a `try` (`:1261-1265`) | | cleartext, protocol `handshake` | yes | refused `handshake` (`:1236-1239`) — the protocol has three legs and none arrives after the session opens | | cleartext, anything else | either | refused `unauthenticated` or `unsealed` (`:1268`). If it were accepted from a peer that has a session, encryption would be the sender's choice — and an attacker's choice is always plaintext | **The quality gate holds: an unauthenticated peer can send exactly one thing, a cleartext handshake frame, capped at 16,384 bytes.** What changed on 2026-09-07 is what the *refusal* of everything else costs. Before, the refusal was the last act rather than the first: the frame was decoded in full — the `JSON.parse`, the canonical re-serialisation and the two SHA-256s inside `decodeRune` — and only then counted as `unauthenticated`, with nothing charged to any bucket. The limiter was not applied late on that path; **it was never reached**. It is now charged on the raw bytes at `starw-node.ts:1220`, before the protocol is known, because knowing the protocol costs the parse the charge is meant to be paying for. See §5.5 for the class and §11.2 item 1 for what it was measured at. An honest handshake leg is therefore charged to **two** classes and no class twice: its bytes to the pre-session bucket at `:1220`, its bytes and one frame to the traffic buckets at `:1255`, and — only if it is a challenge this node decides to answer — one token to the handshake bucket inside `handleHandshake` (`starw-node.ts:3117`). The pre-session class is the tighter of the two on every dimension but the frame burst, so a flood meets it first and the traffic class never (`starw-node.ts:1247-1254`). --- ## 5. Ratatoskr and Gleipnir — gossip and rate limiting `RatatoskrRouter` `ratatoskr.ts:636`. **Gleipnir is four cost classes, not one limit.** The class is carried on the bucket record rather than inferred from its key, because the sweep and the eviction ranking both need to know what "full" means for a bucket and getting that wrong for one class silently mis-sizes the others (`BucketKind`, `ratatoskr.ts:297`). | Class | Method | Keyed by | Charged | Meters | |---|---|---|---|---| | **traffic** | `charge` (`ratatoskr.ts:1415`), via `accept` (`:815`) and `allow` (`:966`) | the peer id **and** its address envelope, scaled by live connections | one frame + its wire bytes | what an authenticated peer sends | | **handshake** | `allowHandshake` (`ratatoskr.ts:1005`) | the address alone, fixed allowance | one token | one hybrid ML-KEM-768 + X25519 encapsulation plus a hybrid ed25519 + ML-DSA-65 signature | | **pre-session** | `allowPresession` (`ratatoskr.ts:1058`) | the address alone, fixed allowance | one frame + its **raw wire bytes**, before `decodeRune` | what a stranger may make this node parse | | **ring verification** | `admitRingVerify` (`ratatoskr.ts:1102`) | the sender's address at a fixed allowance, **and** one node-wide bucket, both asked before either is spent | one token per ring member, after every cheap lookup has passed | the ZK13 ring verifications a relayed attestation can make this node run | The two address-keyed classes are prefixed with a NUL — `HANDSHAKE_BUCKET_PREFIX` (`HANDSHAKE_BUCKET_PREFIX` `ratatoskr.ts:527`), `PRESESSION_BUCKET_PREFIX` (`ratatoskr.ts:515`) — because a NUL is the one byte a remote address, a node id and a `host:port` string all cannot contain, so no sender can name its way into another sender's bucket. ### 5.1 The flood `accept(fromPeer, frame, connectedPeers, frameBytes)` (`ratatoskr.ts:399`) does, in order: 1. `charge` the frame against the rate limit — **before** deduplication, so a peer cannot use repeats to probe (`ratatoskr.ts:400`). 2. mark `fromPeer` as knowing the key. 3. expire the seen-cache by TTL, then check it. A hit is `duplicate`. 4. remember the key. 5. `burnHop`. At zero hops, deliver with an empty relay list. 6. relay to `connectedPeers` minus the sender minus everyone already known to have it, capped at `fanout` and taken from where the last slice stopped (`chooseTargets`, `ratatoskr.ts`). **Step 6 used to take a prefix, and the prefix was a defect.** `connectedPeers.slice(0, fanout)` reads as "any six", and it is not: the list comes from a `Map` of sessions in establishment order, so the prefix is the six **oldest** sessions and it was the same six on every call. Every link opened after the sixth carried nothing this node published, for as long as those six stayed up — a node's gossip reach was fixed at the moment its sixth peer connected and adding peers afterwards did nothing. **MEASURED on Asgard, 2026-10-07, across all 444 running seats of `asgard-ws`: a mean of 8.97 sessions each, so 2.97 links per seat on average were structurally unreachable by anything that seat published.** `chooseTargets` keeps a cursor instead, advanced by exactly the number of slots used, so over `ceil(n / fanout)` publishes every connected peer has had a turn. A cursor and not a random pick, because no production path here carries a randomised value and because an operator asking why a record did not arrive needs the target set to be re-derivable. The same `fanout` frames leave either way: it costs no bytes. See `docs/design/NODE_VISIBILITY.md`. Defaults: `fanout = 6` (`ratatoskr.ts:383`), `seenCacheSize = 4_096`, `seenTtlMs = 600_000`, `perPeerRatePerSecond = 64`, `perPeerBurst = 128` (`ratatoskr.ts:357-361`). `StarwNode` overrides the cache size and the bucket bounds from the class policy (`starw-node.ts:479-497`). **The seen-cache forgets on purpose.** It was content-addressed and permanent, so a transaction a producer refused once — a nonce that arrived before its predecessor — kept the same key forever and could never be re-delivered. **Measured: five re-announcements, one distinct id, one `deliver` and four `duplicate`** (`ratatoskr.ts:21-33`). Ten minutes is long enough that a message cannot loop back around a mesh this size and short enough that a legitimate retry gets through while anyone is still waiting for it. `expireSeen` (`ratatoskr.ts:1369`) is driven by lookups rather than a timer, and stops at the first entry inside the window because `seen` is in arrival order. `publish` (`ratatoskr.ts:862`) remembers the key locally so the echo comes back as a duplicate, and `StarwNode.publish` remembers the **dedup** key rather than the wire id (`starw-node.ts:1112-1114`) — remembering the wire id would make this node's own message look new when it came back round the mesh. `allow(peerId, frameBytes)` (`ratatoskr.ts:438`) charges a token for a frame delivered directly rather than gossiped. Gleipnir binds the peer, not the mechanism: sync requests, responses and PEX samples bypass the seen-cache on purpose, and without this they would bypass the rate limit with it, which would make the direct path the cheap way to flood a node. ### 5.2 Cost class 1 — traffic, and why its bucket is two-level `charge`, `ratatoskr.ts:703`. **Two buckets, both of which must pass, and both dimensions of each.** - **The peer's own bucket**, keyed by peer id, scale 1. This is what honest traffic is measured against. It is per-connection. - **The address envelope**, keyed by `rateKeyOf(peerId)` — on TCP, the remote address without the port (`tcp.rateKeyFor`, `tcp.ts:511`, wired at `starw-node.ts:484`). This is the anti-DoS property: it survives the socket, and it scales with the number of connections that address *currently* holds, capped at `maxPeersPerRateKey` (`peersOn` `ratatoskr.ts:1530`). `shortfallMs` is evaluated on both before either is spent (`ratatoskr.ts:714-716`), so a refused frame costs the sender nothing — otherwise a peer inside its own limit would be drained by an address that is not. **The measurement that forced this shape.** Keying the only bucket by remote address is right against a reconnect — a port is a number the dialer picks fresh, so a per-socket allowance resets by dropping the socket — but it made every peer behind one address share one allowance. Sixty-four frames a second and a burst of 128, divided by twelve peers, is five frames a second each, and flood gossip is synchronised by construction: every node relays the same block at the same moment, so the burst arrives all at once. > **Measured on a 13-node loopback mesh doing nothing but honest work: 3,107 of 4,992 frames > refused (62.2%), with nodes hearing as few as 42 of the 72 transactions their peers > announced. The mesh converged anyway, because gossip is redundant enough to survive losing > most of itself — which is how an anti-DoS mechanism fires on the honest case for a long time > without anyone finding out.** > > `ratatoskr.ts:680-691`. The test is > `tests/integration/tcp.integration.test.ts:626` — thirteen nodes on `127.0.0.1`, each dialing > the six that follow it round a ring, all 78 links of the full mesh, six announcements per node > in one synchronised burst. It asserts `refused === 0` and that every node heard all 72 > transactions (`tcp.integration.test.ts:709-716`). Every node behind one NAT is the same case. **The reciprocal cost, stated rather than hidden.** The envelope grows with connections held, so an attacker on one address that holds N sockets is entitled to N allowances. The bound is the number of connections this node is willing to hold at once, which is the real bound on how many peers any address can be (`ratatoskr.ts:55-64`). On a Quasar that is 128 (§11.2). ### 5.3 Cost class 1, second dimension — bytes as well as frames `GLEIPNIR_BYTES_PER_SECOND = 4 MiB` (`ratatoskr.ts:120`), `GLEIPNIR_BYTE_BURST = 8 MiB` (`ratatoskr.ts:123`). Gleipnir counted frames and nothing else, so 64 frames per second was **32 MB/s of maximal frames from a single peer** — a third of a gigabyte a minute to parse, verify and relay, entirely inside the "rate limit" (`ratatoskr.ts:103-111`). Counting frames bounds how often a peer speaks; only counting bytes bounds how much it says. 4 MiB/s is derived from what a legitimate sender needs: the largest unprompted frame is a block, the largest on request is a Verdandi response at `VERDANDI_MAX_RESPONSE_BYTES` (519,139 bytes, the sync frame's own ceiling less a 4 KiB envelope; 192 KB until 2026-11-15). What bounds a serving peer's sustained rate toward one asker is its own serve budget, `VERDANDI_SERVE_BYTES_PER_SECOND` at 2 MiB/s, which is half of this — so the limit is never what refuses an honest catch-up, and it is eight times tighter than the frame limit alone allowed (`ratatoskr.ts:112-119`). `StarwNode` charges the **wire** size including the seal, because that is what the sender actually spent of this node's link and memory (`starw-node.ts:1300-1303`, `ratatoskr.ts:399-400`). ### 5.4 Bucket lifetime, and the eviction rule The bucket used to be deleted on disconnect, which made the whole limit optional: the pre-handshake peer id is `address:port`, a fresh ephemeral port every time, so a sender spent its 128-frame burst, dropped the socket and reconnected with a full one. **Measured against the previous code: unlimited handshake responses from one address, each costing this node an ML-KEM encapsulation and a hybrid signature, and costing the sender a TCP connect** (`ratatoskr.ts:541-544`). Now `forgetPeer` (`ratatoskr.ts:1234`) detaches rather than deletes, and `detachBucket` (`detachBucket` `ratatoskr.ts:1282`) clamps the balance back to a single connection's entitlement — an address that held twelve connections refills at twelve allowances, and that credit must not become spendable by the one connection that stays. `pruneBuckets` (`ratatoskr.ts:1562`) only forgets a detached bucket once it has refilled completely, which is exactly the moment at which keeping it would have made no difference. `GLEIPNIR_MAX_BUCKETS = 4_096` (`ratatoskr.ts:142`) bounds the table, and a Pulsar cannot take that default: 4,096 buckets is 164 KB, a fifth of its whole 700 KB budget, spent on addresses that never authenticated (`ratatoskr.ts:65-74`). `StarwNode` sizes it at `maxPeers * 8` (`starw-node.ts:496`), and the multiplier is eight rather than two because one connection now costs a bucket of its own plus a share of **three** per-address buckets — the traffic envelope, the handshake budget and the pre-session budget — all of them held for the seconds a spent bucket takes to refill and become worth forgetting. Four buckets a connection at worst, so eight times the peer cap is still twice what a full peer table can hold (`starw-node.ts:490-496`). `evictFullestBucket` (`ratatoskr.ts:1585`) drops the **fullest** bucket, preferring a detached one, and ranks on the *fraction* spent rather than the raw count so that an envelope holding twelve allowances is not mistaken for a peer that has spent nothing. Evicting the emptiest would hand a throttled sender a way to clear its own penalty: arrive from enough addresses and the table discards exactly the record of what you did. ### 5.5 Cost classes 2 and 3 — the handshake budget and the pre-session budget Both are keyed by the **address alone at a fixed allowance**, and neither is released when the socket closes. Those two properties are the whole point of them. The traffic envelope of §5.2 scales with the number of connections an address currently holds, which is right for twelve honest peers behind one NAT and exactly backwards before authentication, because pre-authentication connections are free to open — an attacker buys envelope with TCP connects. `forgetPeer` detaches these buckets and the sweep forgets one only once it has refilled (`ratatoskr.ts:550`, `:800`), so hanging up costs the sender its balance rather than clearing it. **Class 2 — the handshake budget.** `GLEIPNIR_HANDSHAKE_PER_SECOND = 2` (`ratatoskr.ts:168`), `GLEIPNIR_HANDSHAKE_BURST = 32` (`ratatoskr.ts:182`). One token per expensive answer, no byte dimension, charged in `handleHandshake` after the free chain and genesis checks and before `crossBifrost` (`starw-node.ts:1412`). It exists because the traffic buckets meter the wrong quantity for this one thing. They count frames and bytes, which is right for gossip — every frame costs about the same to decode and relay. Answering Bifrost leg 1 does not: it is an ML-KEM-768 encapsulation plus a hybrid ed25519 + ML-DSA-65 signature, about **5 ms**, for a frame the sender assembled once and can replay from every socket it opens, because `crossBifrost` never verifies the challenge it is answering (`ratatoskr.ts:144-167`, `starw-node.ts:1394-1404`). One token for two hundred frames' worth of work is not a rate limit on that work. Two a second is sized against the honest floor: `hestia.ts` opens at most 4 dials per 5 s turn and stops at its target peer count, so thirteen nodes sharing one loopback address offer any one of them about 0.8 new handshakes a second at their busiest. That is 1% of one core. The burst of 32 is past the twelve such a mesh offers at once, and what happens beyond it is a wait: the bucket refills, so the 33rd peer is answered half a second later rather than blocked (`ratatoskr.ts:170-182`). **Class 3 — the pre-session budget.** `GLEIPNIR_PRESESSION_BYTES_PER_SECOND = 512 KiB` (`ratatoskr.ts:224`), `GLEIPNIR_PRESESSION_BYTE_BURST = 4 MiB` (`ratatoskr.ts:244`), `GLEIPNIR_PRESESSION_PER_SECOND = 32` (`ratatoskr.ts:256`), `GLEIPNIR_PRESESSION_BURST = 128` (`ratatoskr.ts:266`). Charged on the raw wire bytes of **any** frame from a peer that holds no session, before `decodeRune` (`starw-node.ts:1220`). **What it closed is not a limiter applied late. It is a path the limiter never reached.** `charge` was reachable only by a frame that had already been decoded, and `allowHandshake` only by one that had already been decoded *and* turned out to be a Bifrost challenge. A plaintext frame naming any protocol other than `handshake` was decoded IN FULL — the `JSON.parse`, the canonical re-serialisation and the two SHA-256s inside `decodeRune` — and only then counted as `unauthenticated`, with **nothing charged to any bucket at all** (`ratatoskr.ts:187-194`). What that was worth is measured in §11.2 item 1: 275.8 MB/s of decode from eight sockets on one loopback address, with `rejected` holding nothing but `unauthenticated` and no rate-limit entry of any kind. Per byte and not per frame, for the same reason `GLEIPNIR_BYTES_PER_SECOND` exists: the 65 KB shape and the 262 KB shape cost the sender one token each and cost the node four times apart. **Where 512 KiB/s comes from, and it is derived rather than picked.** At the measured ~4 ns of one core per pre-session byte — one second of core per 240 MB, the mean of the two flood shapes in §11.2 — half a megabyte a second is **0.21% of one core**. The honest floor is the Bifrost legs, and their sizes are measured rather than guessed: challenge **6,851** bytes, response **16,261**, confirm **14,047**. A responder takes challenge + confirm, **20.9 KB per handshake**; a dialer takes the response, **16.3 KB**. With class 2 already capping answered handshakes at 2/s and `hestia.ts` opening at most 4 dials per 5 s turn, the largest honest sustained pre-session volume this code can produce at one node is about **60 KB/s** — eight times under the budget (`ratatoskr.ts:208-222`). The 4 MiB burst is sized the same way: thirteen nodes on `127.0.0.1` coming up together offer any one of them twelve inbound handshakes and twelve outbound dials at once, which is `12 × (6,851 + 16,261 + 14,047) = 446 KB` of pre-session plaintext in one moment. Four megabytes is nine times that (`ratatoskr.ts:227-243`). It also **must** exceed `MAX_FRAME_BYTES`, and by a margin: a frame larger than the whole burst could never be paid for however long its sender waited, which would be a permanent refusal of the largest legal frame rather than a rate limit on it. Four megabytes is eight times the 512 KiB wire cap. The frame dimension — 32/s sustained, 128 burst — is deliberately **looser** than the handshake class it sits in front of. Two answered handshakes a second is four pre-session frames a second, so class 3 can never be what refuses a peer class 2 would have answered (`ratatoskr.ts:246-266`). Both dimensions are checked before either is spent, as in `charge`, so a refused frame costs the sender nothing (`ratatoskr.ts:500-509`). **Neither class disconnects anyone.** A refusal is a wait: nothing records a strike, blacklists an address or drops the socket, because `hestia.ts` grows its dial backoff on dial failures and a budget that hung up would turn a full bucket into a partition of a deployment that shares one address — which every loopback testnet is. --- ## 6. Praeco — hostless discovery `PraecoDirectory` `praeco.ts:439`. `PRAECO_VERSION = 'praeco-v1'`, `DEFAULT_RECORD_TTL_MS = 30 min` (`praeco.ts:30-31`). Three discovery paths, none of them requiring a host (`praeco.ts:12-26`): self-signed announcements, peer exchange, and per-chain rendezvous ids derived from the genesis hash, the chain id and the hour (`gaiaChainRendezvousAt` in `src/entropy/gaia.ts`, announced by `HestiaNode.selfRecord`, read by `PraecoDirectory.rendezvousPeers`, which nothing dials from yet). The chain-unbound `gaiaRendezvous` is kept for its readers; no live record ever carried it. ### 6.1 The record `PeerClaim` (`praeco.ts:197`) carries version, nodeId, address, both public keys, sorted endpoints, sorted unique capabilities, chainId, rendezvous ids, `announcedAtMs`, `expiresAtMs`. `announce` (`praeco.ts:288`) signs the canonical claim with `signGemini` — hybrid ed25519 + ML-DSA-65. A record is 11,132 bytes measured (`mnemosyne.ts:96-105`). `isPeerRecord` (`praeco.ts:356`) is a shape check and nothing more, run before anything reads a field. It exists because `admit` used to open with `record.claim`, and one `{ records: [null] }` frame on the PEX protocol threw a TypeError out of the receive path and stopped the node (`praeco.ts:175-186`). Note it excludes `NaN` deliberately (`praeco.ts:207-210`): every timestamp comparison against `NaN` is false, so a record announcing `expiresAtMs: null` would pass the expiry, the lifetime and the skew checks all three by failing to be comparable. ### 6.2 `admit` — every rejection is a class of attack `praeco.ts:257`, in order: malformed shape · wrong `praeco` version · wrong chainId · empty nodeId · banned · expiry at or before announcement · already expired · lifetime over `maxRecordTtlMs` · **address does not derive from the announced keys** · announced more than `clockSkewMs` (default 120 s) in the future · signature does not verify. Then, for a node id already held: keys must match (a node id is bound to its keys for as long as the record lives; rotation is a new id) · a strictly older announcement is stale · a byte-identical re-announcement is accepted and changes nothing. Then, for a new node id: the public key must not already be announced under a different node id (`praeco.ts:342-349`), and `evictWorst` runs if the directory is full. ### 6.3 Scoring — an interaction, not a claim Records enter at `score: 0.5` (`praeco.ts:355`). Score moves only on `recordDialSuccess` (+0.1, capped at 1, `recordDialSuccess` `praeco.ts:800`) and `recordDialFailure` (−0.2, floored at 0, `recordDialFailure` `praeco.ts:788`). Re-announcing used to raise the score by 0.05. Reputation was therefore something a peer hands itself: an announcement costs one signature, records last half an hour, and nothing stops a node re-announcing every second. **Measured against the previous code: ten fresh announcements took a sybil from 0.5 to the 1.0 ceiling — and `sample` sorts by score, so at 1.0 that identity is what this node hands to every peer that asks, and `evictWorst` drops honest records to make room for more of them. That is an eclipse bought with signatures** (`praeco.ts:327-338`). Test: `tests/integration/praeco.integration.test.ts:241`. What re-announcing buys now is `lastSeenAtMs`, which is what it is evidence of. ### 6.4 Address-group diversity `addressGroupOf` (`praeco.ts:1181`) takes the **first parseable endpoint** — and endpoints are sorted at announcement time, so the group is a stable function of the record rather than of the order this node reads it in. A peer cannot move itself between groups by reordering what it announces, and cannot claim several groups at once: one record is one place. `hostGroup` (`praeco.ts:1217`): | Host | Group | |---|---| | IPv4 | `v4:` + first 2 octets (a /16) | | IPv6 | `v6:` + first 2 hextets (a /32), normalised through `expandIpv6` — **currently unreachable**, see §2 | | a name | `host:` — resolving it would let a record choose how much work reading it costs | | no dialable endpoint | `node:` — it can only be dialled by someone who already knows where it is, so it cannot be part of a flood that fills a dial budget, and lumping them together would make them compete for one slot | A /16 and a /32 are the widths a Bitcoin node uses for the same reason: renting a second /16 is a purchase; generating a second keypair is a millisecond (`praeco.ts:58-72`). **`sample` is round-robin over groups** (`sample` `praeco.ts:650`): rank within a group by score then `lastSeenAtMs`, then take the best from each group, then the second best from each, and so on. "The best `limit` records" out of a directory an attacker has filled is still the attacker's records, because they are the ones there are most of. Measured in `tests/integration/praeco.integration.test.ts:275`: 16 sybils on one /16 plus two honest peers elsewhere, `sample(4)` returns both honest peers and exactly two sybils. **`evictWorst` takes the slot from the biggest group** (`evictWorst` `praeco.ts:1122`), ordered: quarantined first, then group size descending, then score ascending, then `lastSeenAtMs` ascending. The old order was quarantined → lowest score → oldest, which is precisely backwards against a flood: every record starts at 0.5 and a record that has never been dialled has no failures to lower it, so honest peers this node had not got round to trying were tied at the bottom with the newcomers and lost the tiebreak on age. The directory could be filled from one machine, one keypair at a time, evicting an honest peer per sybil (`praeco.ts:562-572`). Test: `tests/integration/praeco.integration.test.ts:293` — 16 further sybils on one /16 arrive and the one honest record survives all of them. ### 6.5 Quarantine — the dial-back reserve `PRAECO_DIAL_FAILURES_BEFORE_QUARANTINE = 5` (`praeco.ts:39`), `PRAECO_QUARANTINE_SIZE = 32` (`praeco.ts:57`). The directory used to delete a record on its fifth failed dial. That reads as hygiene and behaves as amnesia: five failures is a peer that is down, and it is equally a link that is down, and the two are indistinguishable from here. **An outage lasting five dial rounds emptied the directory outright — measured at 8 peers to 0 — after which the only way to learn a peer is to ask a peer, and a node started without `--peers` had nobody left to ask** (`praeco.ts:41-47`, `praeco.ts:453-460`). Test: `tests/integration/network-faults.integration.test.ts:339` — five rounds against eight peers leaves `size() === 8` and `quarantined().length === 8`, and ten more rounds change nothing. A quarantined record is **kept and still dialled**, and **not offered to PEX** (`praeco.ts:382-386`) — recommending an address that has not answered us five times running spends someone else's dial budget on our behalf. It leaves quarantine the moment the peer answers a dial (`praeco.ts:490`) or announces again (`praeco.ts:337`). `trimQuarantine` (`praeco.ts:1148`) drops the oldest entry past 32, and **never when the directory is down to one record** — a node with one place left to go must not trade it for a cap. `ban` (`praeco.ts:833`) is the one removal allowed to empty the directory: keeping an address we have decided is hostile so that we have somewhere to dial is worse than having nowhere to dial. `prune` (`praeco.ts:865`) removes expired records including quarantined ones, because a signed claim that has run out is not an address, it is a memory. ### 6.6 What the node does with all this `StarwNode.sharePeers` (`starw-node.ts:2448`) sends `directory.sample(4)` to every peer, direct and unrelayed. The PEX handler (`starw-node.ts:1607`) refuses a frame carrying more than `MAX_PEX_RECORDS = 8` records **before verifying any of them** — verifying a record is a hybrid signature check, and at the per-peer frame rate the frame limit alone would allow thousands of post-quantum verifications a second bought with one peer's bandwidth (`starw-node.ts:169-177`). It then requires `merged.admitted > 0`, so a frame whose records were all rejected is not relayed onward. **What one record may weigh, added 2026-11-22.** A record was any size its signer chose, up to a whole frame. One that filled a frame was admitted, and a later round that sampled it built a frame over the ceiling, which was dropped whole and in silence with this node's own record in it. `admit` now holds a record to exactly its fields and each of them to a length (`recordBoundsProblem`), and `sharePeers` and the Sleipnir answer pack a frame by bytes, own record first. Both are per record and never per frame: a node on an older build may still relay a bloated record beside honest ones, and the honest ones are taken. Every record any build has signed is inside the bounds (`tests/integration/announcement-bounds.integration.test.ts`). ### 6.7 Gastropnir — the peer table's eclipse and seed defences Added 2026-11-15 for the audit of 2026-11-12 (NET-01 to NET-05, NET-07, NET-09). Praeco's address-group rules (§6.4) decide which RECORDS a node keeps and hands on; nothing decided which SESSIONS it keeps, and that is where an eclipse is won. The audit found sessions with no direction, inbound sessions counted toward the dial target, no slot reserved for a peer the node chose, and a full table that refused instead of choosing. Every limit below is in `src/network/gastropnir.ts` and registered in Logberg under `net.*` as `local`: none is carried in a block, a handshake or a peer record, so a node with these defences and one without them handshake and sync exactly as before. | Defence | What it does | Default | |---|---|---| | Direction | `TcpTransport.directionOf` and `PeerSession.direction` record who opened each connection; the transport's `maxConnections` now counts INBOUND sockets only | — | | Outbound reservation | inbound sessions are capped at the class's `maxPeers` less `OUTBOUND_RESERVE`, so those sessions are only ever peers this node dialled | 8 sessions (quasar: 120 inbound, pulsar: 16) | | Inbound eviction | a full inbound table makes room with `chooseInboundEviction`, after the newcomer's confirm leg has verified: the oldest peer of each of the 4 oldest /16s, the 4 most recent block providers and the older half of the rest are protected; the youngest of the most crowded /16 goes | counted as `inbound-evicted` | | Outbound floor | the dial loop keeps dialling while it holds fewer than `min(OUTBOUND_RESERVE, target)` outbound sessions, however many peers dialled in | 8 | | Dial target | `sqrt(max(directory, producing roster))`, floored at 8, capped by the class and by `MAX_DIAL_TARGET`; the directory alone is capped at 256 on a quasar and held the target at 16 against the 37 the roll needs | 64 | | Handshaking table | inbound sockets that have not authenticated are bounded on their own; a full table drops the youngest attempt of the most crowded /16, or refuses a newcomer from that group with `too many connections are still handshaking` | 64 sockets | | Pre-handshake frame cap | a declared length over the cap is refused from the four header bytes before authentication; the protocol caps a handshake leg at 24 KiB | 32 KiB | | Learned-endpoint filter | a learned address in loopback, RFC1918, link-local or shared (100.64/10) space is not dialled unless the node runs with `--lan` or one of its own `--peers` is in the same range; unspecified, multicast and reserved addresses never are | off | | Resolved diversity | a learned name is resolved (2 s, 8 names per turn, cached 10 min, 256 names), the ADDRESS is filtered and grouped, the address is what is dialled, and candidates are ordered so each pick goes to the /16 holding the fewest outbound sessions | — | | Global sync serve budget | Verdandi's per-peer 2 MiB/s now sits under a node-wide bucket, so many peers cannot multiply the upload | 8 MiB/s | | Seed mode | `strblk node --seed-only`: never seals, refuses a producer or seat key and a block interval, announces `bootstrap` without `validator` | off | | Seeds bootstrap only | `strblk node --seeds-bootstrap-only` (added 2026-11-26): once the node holds 8 outbound sessions to non-seed peers and its directory names 16 non-seed peers it could dial, it keeps 1 seed session, releases one surplus seed session per turn while it holds 2 non-seed sessions over the floor, never dials a seed back in as a learned peer, and counts only non-seed sessions toward the outbound floor; under the floor it dials every seed again. Without it every unconnected seed is redialled every turn, exempt from the target. Every `--peers` entry is a seed to this rule, LAN siblings included | off | | Dialable target | `strblk node --dialable-target` (added 2026-11-26): on a node with no advertised endpoint the dial target is capped at `max(8, min(2 x (seeds + dialable records), 24))`, so a NAT leaf does not chase a roster-sized target it cannot dial. A node that advertises is unchanged | off | **What it does not do.** It does not provision seeds: the published Asgard seeds are seven producing seats on one address, and moving them onto at least two non-producing seed hosts on separate providers is an operator decision (`--seed-only` is the code half). The outbound order is a preference, not a cap of one per /16, because the live fleet sits in a handful of /16s and a hard cap would leave seats short of their target. And an attacker with many /16s, connected longer than the honest peers it competes with, can still win inbound slots; what it cannot win is the reserved outbound sessions. Tests: `gastropnir.integration.test.ts` (the policies), `eclipse-flood.integration.test.ts` (a flood of 48 authenticated sessions and 32 silent sockets over real TCP that leaves all 8 reserved outbound sessions in place), `eclipse-dial.integration.test.ts` (the dial loop), `seed-bootstrap.integration.test.ts` and `dialable-target.integration.test.ts` (the two opt-in dial rules) and `verdandi-global-serve-budget.integration.test.ts`. --- ### 6.8 Names and claims: what a stranger's word is worth Added 2026-11-23, after a desk cut a node off with one held connection. Local policy: no frame, record or handshake field changed, and a build from before it notices nothing. **A name.** The handshake proves a key. The node id beside it is text, and the session table, the dial loop and every bound per peer were keyed by it. A session is now known by its key, and by the id it claims only where something else says so (`src/network/session-identity.ts`): - **proved**: the id derives from the address (`STR.` and twelve characters of it). Every id this software has made for itself is of this kind, so for every node it made there is nothing to be first at. - **listed**: an id of an operator's own choosing that the peer directory holds under the same keys. - **free**: such an id nothing is known of. Kept while nobody else in session has it. *Left as it is on main, and noted:* the first key to claim such an id keeps it, and a later key that claims it, the real node with a hand-chosen id included, goes by its derived id until the first leaves or the directory lists the id under the later key. - **unproved**: anything else. The peer keeps a session, under the id its own key derives. Nobody is refused for a name, with one exception: an id that is in session under the key that derives it, or is this node's own, claimed by another key. That is told so on the first leg, in the refusal frame every build reads, before any signature is spent. A key that proves a name takes it from one that did not. What an operator sees: `nodeIdClashes` and `nodeIdClashCount` in the status and on Astrolabe, the reason in `handshakeRefusals`, `sourceless_node_id_clashes_total`, and the warning `SourcelessNodeIdClaimed`. *For an honest node that restarts with a new key:* its id is made from the key, so it has a new id and nothing is different. A node given an id by hand keeps its session and goes by its derived id on a peer that still lists the old key (a record lives thirty minutes) or is still in session with it, and by its own after. **A claim of height: observed, not acted on.** One stranger's claim of being a few blocks ahead stops a seat for ten minutes a block, with honest peers level with it, and the rule that would stop that is not ready. The weighing in this change was run against this fleet by the review and did harm: a place was a /16 and the whole home network is one place, so thirty seats on a stale head outweighed three honest ones after twenty seconds and went on sealing, which is the fork of 2026-11-22; two seats behind one dead uplink broke the ten-minute rule of 2026-10-08; and two liars on two addresses made a node that was behind report ready, and it then sealed. So sealing, readiness, `syncBehind` and `bestPeerHeight` are decided exactly as before, on the raw claims. What remains is the observation: when a claim WOULD be outweighed (`VERDANDI_CLAIM_GRACE_MS` after it came, per place and per height), the node logs it once per head with the places and keys on each side, keeps it in `claimWouldBeOutweighed` in the status, counts it in `sourceless_claims_would_be_outweighed_total`, and later marks whether its own chain came to hold the claimed block (`claim_held`) or another one there (`claim_not_held`). That is the measure a rule needs before it is one. *The safer design, for a later round, as the review set it down:* count places only, with no tie-break by keys; never count this node's own /16, loopback or a LAN range as a place; cap sealing over a set-aside claim by the last block that came from a DIFFERENT place, not from any peer; and decide readiness on the raw claims unless a claim was refuted. **A refused block.** When the block that links to this node's head is refused, its height, hash and reason are kept (`refusedNextBlock`, `strblk status`, Astrolabe, readiness) and the `sync-stalled` fault says "invalid block from a peer" and the reason, where it said that no common ancestor was found. ## 7. Verdandi — continuous block sync `VerdandiSync` `verdandi.ts:724`. ### 7.1 Shape It never asks whether it should run (`verdandi.ts:14-37`): every node advertises its head unprompted, anything behind is already pulling with no threshold and no operator switch, a finished response immediately starts the next one, and a silent peer costs nothing because more than one request is outstanding at a time. `tick(connected)` (`verdandi.ts:416`) drops state for peers that went away, re-arms every ancestor search that gave up if the local height moved by any route (and ends a search still in progress only if the local chain was reorganised, not merely extended), advertises on change or on `VERDANDI_ADVERT_INTERVAL_MS` (2,000 ms) whichever comes first, expires unanswered requests, and then asks whoever is ahead. ### 7.2 Every bound | Constant | Value | What it bounds | |---|---|---| | `VERDANDI_MAX_SPAN` (`:101`) | 64 | blocks a peer may **name** in one request; checked before anything is looked up (`:614`) | | `VERDANDI_MAX_BLOCKS_PER_RESPONSE` (`:104`) | 32 | blocks in one response; checked against the array length **before anything in it is parsed** (`:677`) | | `VERDANDI_MAX_RESPONSE_BYTES` | 519,139 | body bytes in one response, and no more than what is left of the asking peer's serve budget; derived as the sync protocol's frame limit less `VERDANDI_RESPONSE_ENVELOPE_BYTES` (4 KiB), so a full response still encodes and still seals. 196,608 until 2026-11-15, which sent a 241 KB Asgard block alone; an old receiver checks only the block count and the frame limit, so every build accepts the larger response | | `VERDANDI_SERVE_BYTES_PER_SECOND` (`:116`) | 2 MiB | bytes one peer may pull **out of** this node, per-peer token bucket (`refillServeTokens`, `:932`) | | `VERDANDI_REQUEST_TIMEOUT_MS` (`:119`) | 3,000 | how long an unanswered request is waited on | | `VERDANDI_PARALLEL_REQUESTS` (`:122`) | 2 | outstanding requests **globally**, on a node that does not stage | | `VERDANDI_PIPELINED_PARALLEL_REQUESTS` | 4 | outstanding requests on a node that stages, each for a DIFFERENT range | | `VERDANDI_STAGING_BYTES` | 8 MiB | blocks held above the head while the gap below them is fetched; only a class that keeps a full chain is given it (`starw-node.ts`), and it is counted in the sync retention bucket | | `VERDANDI_TIMEOUT_COOLDOWN_MS` (`:141`) | 5,000 | how long a peer is passed over after its request expired | | `VERDANDI_MAX_ANCESTOR_DOUBLINGS` (`:163`) | 8 | doublings before the backward search gives up and raises a fault | | `MAX_RETAINED_FAULTS` (`:343`) | 32 | faults kept for reading back | Two more rules that are not constants: - **A response is only accepted from a peer this node has an outstanding request to** (`:663-667`). Without it, any authenticated peer can push block bodies at an idle node. - **The first block of a response is always sent even if it alone is over budget** (`:648`), or a chain containing one large block could never be synced past. - **Blocks are parsed one at a time inside the loop, and one unreadable block ends the response** (`:698-703`) rather than the process. - **A class that does not serve sync says nothing rather than lying about it** (`:600-604`), and a request for a height this node does not have gets silence rather than an empty frame, because an empty answer is a free frame for an attacker to make everyone send (`:620-625`). ### 7.3 The cooldown The parallel limit counts outstanding requests globally, so two peers holding both slots is the whole of this node's ability to pull blocks. Nothing scored or cooled a peer down when its request expired: the slot was released, the next selection walked the peer list in the same order and handed the same two peers the same two slots, and they went quiet again. > **Measured against the previous code with two silent peers and one good one connected: 40 > ticks, 80 timeouts, zero requests ever sent to the peer that would have answered. A node with > peers, none of them broken, that could not sync.** (`verdandi.ts:126-133`) The cooldown backs off at `timeoutCooldownMs × min(consecutiveTimeouts, 4)` (`:461-463`) and is cleared **only by the peer answering a request** (`:687-688`) — not by a head advertisement, or a peer that advertises busily and answers nothing would keep clearing its own cooldown and go on holding a slot. ### 7.4 Why progress is measured by head movement This is the most important paragraph in the file. The host's `acceptBlock` returns `true` both for a block it put on the chain **and** for a block it merely remembered as a fork candidate. Counting those returns reported **195 blocks applied to a chain that had not moved off height 3** — a stall that looked like the fastest sync the node had ever done (`verdandi.ts:232-237`). And that false success re-requested immediately, so the node spun the same futile range at the speed of the link rather than the speed of the tick. So `onBlocks` (`verdandi.ts:1318`) reads `localHeight()` before the loop and after it, and `heightGain` (`verdandi.ts:2342`) is the only measure of progress: - gain > 0 → `applied += gain`, end any ancestor search, request the next range immediately. - gain = 0 → `forkCandidates += taken`, **no** immediate re-request, and deepen the ancestor search. `heightGain` reports a negative gain as zero, because a reorg onto a shorter-but-denser branch is a real outcome and a counter of work done does not run backwards. A node that held nothing and now holds head H gained H+1 blocks, genesis included. `stats().stuck` (`verdandi.ts:568`) is `behind && aheadPeers > 0 && every one of them searched out` — the condition the audit found and nothing named. `behind` alone cannot say it, because `behind` is equally true of a node that is catching up perfectly well. ### 7.5 The backward ancestor search "Behind" has an obvious cure: ask for `localHeight + 1`. That was the only thing this asked for, and it made divergence terminal. **Measured with local head 3, peer head 8 and the fork at height 1: 39 requests for [4..8], nothing linked, height never left 3** (`verdandi.ts:62-67`). A response that moved nothing starts a search (`deepenAncestorSearch` `verdandi.ts:2068`). The request window walks down `localHeight - 2^k`, doubling each time (`probeFrom`, `verdandi.ts:809`), until a response contains a block whose parent this node holds. Doubling rather than stepping is what keeps a divergence a few hundred blocks deep from costing a few hundred round trips. Bounded at both ends: - **Floored at `head - finalityDepth`** (default `CHAIN_CONFIG.requiredConfirmations`, `finalityDepth` `verdandi.ts:734`). Below that the chain refuses to reorganise at all, so a fork point found there is one nothing could act on. When the walk stops descending because it is pinned on the floor, the search ends rather than burning the remaining budget on identical requests (`verdandi.ts:855-866`). - **Capped at 8 doublings**, reaching 256 blocks below the local head. At the cap the search for that peer **stops** — no further requests go to it — a `sync-stalled` fault is raised naming the peer and the depth reached, and the exhaustion is counted in `stats()` (`giveUpSearch` `verdandi.ts:2193`). Re-armed only by new information: the peer advertising a different head hash (`verdandi.ts:589`) or the local chain moving by any route (`verdandi.ts:441-443`). A permanent refusal to ask a peer that has since changed would be the original stall rebuilt one level up. **A search still in progress is NOT restarted by an extension** (2026-11). It used to end on every local head move and every new head hash a peer advertised, and with one ~241 KB Asgard block per sync response a search a few hundred blocks deep had to finish inside one block interval - which is why two connected halves of Asgard stayed apart for fourteen hours after the partition at height 32,307. An extension, ours or the peer's, leaves the fork point where it was, so the walk keeps its place; it is anchored at the height it started from (`probeBase`), not at the moving head. A reorganisation of the local chain, or a peer head that went down or sideways, still ends it. Reproduced in `partition-convergence.integration.test.ts` and `verdandi-search-survives-head-moves.integration.test.ts`. `onFault` is optional, and the fault is retained either way (`verdandi.ts:379`, `faults` `verdandi.ts:1120`): a fault whose only home is a callback the host forgot to wire is a fault nobody can read afterwards. `hestia.ts:453` wires it to Eir's `reportUnrepairable`, because a divergence deeper than the depth line is a governance question, not a retry. **The property that makes all of the above meaningful:** a block that arrives by sync goes through the same acceptance as a block that arrives by gossip, because the host hands Verdandi the very same callback (`starw-node.ts:509-511`). A sync path that trusts more than the gossip path is not a sync path, it is a way around the gossip path. --- ## 8. Bragi — the identity protocol `PROTOCOLS.identity = '/sourceless/identity/1.0.0'` (`PROTOCOLS` `protocol.ts:71`). Handler and queue in `starw-node.ts`. Registry entry: `docs/NAMING.md:32`. ### 8.1 What it carries Two kinds, `allocation` and `registration` (`protocol.ts:159`), one field for both: `{ kind, record }` (`protocol.ts:145`). One field on purpose — `kind` already says which decoder reads it, and a second name would be a second shape for one message, which is a second message id for one record, which is the amplifier `RUNE_FIELDS` exists to close. An STR.domain allocation is a wallet claiming a name; a registration is the proof that completes it. It is the one record the chain requires before anybody can transact at all. ### 8.2 Why it exists There was no protocol for these at all. `HestiaNode.flowOnce` announced Rhea entries of kind `tx` and nothing else, so an allocation or a registration never left the node it was submitted to. That cost nothing while every node sealed every height, and became the whole story under Tyr (slot leadership): a claim submitted to a node that is not the current leader waits for **that node's** slot (`protocol.ts:51-62`). The arithmetic, from `protocol.ts:57-60` and `docs/NAMING.md:32`: | Roster | Slot | Worst-case wait | |---|---|---| | 3 members | 3 s | measured **6,126 ms**, against **135 ms** with the protocol | | 13 members | 3 s | up to **39 s** | | 1313 members (genesis) | 3 s | **65.65 minutes** | The end-to-end figure an operator sees, measured through `HestiaNode.submitAllocation`, is **~6000 ms → ~200 ms** (`tests/integration/hestia-node.integration.test.ts:1036`). The multi-producer testnet found it by having to wait for node 1's turn before any transfer was possible. Note the second half of that measurement, which is a separate defect worth knowing about: `JsonRpcSurface.allocateDomain` called `BlockchainCore` directly, so every wallet — which reaches a node through the RPC surface and through nothing else — still paid the latency floor the gossip work had already removed (`hestia-node.integration.test.ts:1037-1041`). ### 8.3 The limit, and why it is the tightest on any flooded protocol 4,096 bytes (`protocol.ts:91`). Both record kinds are fixed shapes over fixed-width fields — a 68-character domain at most, an address, a 64-hex key, a 128-hex signature — so the largest frame either kind can honestly build is **measured, not guessed: 495 bytes for an allocation and 604 for a registration**, both at the longest domain the format allows (`protocol.ts:88-90`). The test builds the honest maximum and asserts it is under 700 bytes and that the limit is more than five times it (`tests/integration/network-amplification.integration.test.ts:642`). Every byte of headroom above that is bandwidth a stranger can spend on the whole fanout for the price of one signature. Four kilobytes is six times the honest maximum, which leaves room for a longer address format without leaving room for a payload. What one peer can make this node do with it: at Gleipnir's 64 frames a second, at most 64 domain-signature verifications and 256 KB a second from one sender — the same order as the `tx` protocol beside it, and unlike `tx`, it cannot be turned into a 64 KB frame (`protocol.ts:93-97`). ### 8.4 Handling `starw-node.ts:1551`. Decoded, then **verified** (`verifyDomainClaim` / `verifyDomainProof`), and only then offered to this node. He announces and does not decide. The relay decision follows the `tx` rule and not the `block` rule: the verifier authorises the relay, and what this node does with the record does not. Refusing to forward a record this node could not use itself would make propagation depend on local state — a node that already holds the name, or one that keeps no state at all, would silently cut off every peer behind it from a perfectly valid record (`starw-node.ts:1569-1575`). So a Pulsar verifies and relays and keeps nothing (`acceptIdentityFromPeer` `starw-node.ts:3746`). Measured: a Pulsar between two Quasars delivered and forwarded all 100 allocations, held zero, and its `mempool` bucket stayed at 0 bytes (`tests/integration/network.integration.test.ts:535`). A Quasar or Supernova queues them in `pendingIdentity`, keyed by `kind:domain` so a domain announced twice occupies one slot, bounded at `MAX_GOSSIP_IDENTITY = 1_024` (`starw-node.ts:126`), evicted oldest-first. They are held **here** rather than pushed into the chain's own pending queue, because the chain's queue is emptied only by a successful seal — a follower that queued every record it heard would still be holding a record some other node's block had already settled, and would seal it a second time when its own slot came round (`starw-node.ts:456-468`). **The Kvasir records beside them share one map with a reserved part** (added 2026-11-26). Every other record kind a peer floods (governance, wraps, Oort, presence, Fenrir bonds and the rest) waits for a producer in `pendingRecords`, bounded at `MAX_GOSSIP_RECORDS` = 1,024 places and evicted oldest-first. Presence (Hervist) and Fenrir bond records, `RESERVED_RECORD_KINDS`, are reserved `GOSSIP_RECORD_RESERVE` = 256 of those places, two blocks of presence. Every other kind is left the remaining 768. The shares only decide eviction. Either side may borrow free room the other is not using, so a node hearing only presence holds 1,024 of them, and a node hearing none holds 1,024 of everything else. When the map is full, the record evicted is the oldest of whichever side holds more than its share, or of the arriving side when both are exactly at their shares. Before this, a flood of any kind arriving after a burst of presence evicted the presence records first, because they were older. This is local policy only. It decides which already-screened records this node keeps when it holds too many. It never decides whether a record is valid, what a block may carry, or what is relayed. The total bound and the eviction counter (`record-evicted`) are unchanged, and a node without it peers with one that has it exactly as before. Tests: `tests/integration/gossip-record-reserve.integration.test.ts`. **Limit, stated.** The reserve protects presence and bonds from other kinds. It does not protect them from junk of their own kind: - **Presence** is refused at the relay screen on every chain today, because no chain schedules the bond-driven rule (`kvasir.ts`, `case 'presence'`). So in practice the reserve holds no presence until rule v5 is scheduled. - **Fenrir bonds** are screened only for shape, a signature by the key that derives the validator address, and an amount above zero (`verifyFenrirRecord`). Whether that amount is actually held is a state question, judged at the chain's door and not on relay. Anyone can mint fresh addresses and sign unfunded bonds, and those junk bonds can occupy the 256 reserved places. The other kinds keep their 768 whatever happens. A pull path for records would close the gap and is not built. ### 8.5 Rollout `targetsFor` (`starw-node.ts:2792`) filters the fanout to peers that advertised this protocol in the handshake — **and only for this protocol**. `SLNN_WIRE_VERSION` is unchanged, so a node on the previous build stays fully connected and simply drops an identity frame as an unknown protocol; but the handshake already negotiated the shared set, so a fanout slot spent on a peer that cannot use the frame costs the peer that could. Every other protocol is in every version's `ALL_PROTOCOLS`, so filtering them could only ever go wrong. Test: `tests/integration/network.integration.test.ts:566`. --- ## 9. The two sockets a node opens `src/network/` contains two servers, and until 2026-09-08 this volume documented one of them. **§9.1 to §9.5 are the peer transport** (`tcp.ts`): mutually authenticated, framed, for other nodes. **§9.6 to §9.9 are Iris** (`iris.ts`, 1,688 lines): unauthenticated, HTTP, for programs outside the chain. They are different doors with different threat models and they share exactly one thing — Gleipnir's buckets — which is §9.8 and is the most interesting fact about either. ### The peer transport `src/network/tcp.ts`. Defaults: `idleTimeoutMs = 120_000`, `maxConnections = 256`, `connectTimeoutMs = 5_000`, `handshakeTimeoutMs = 15_000`, `frameTimeoutMs = 30_000` (`tcp.ts:280-284`). `hestia.ts:483` overrides `maxConnections` to the class's `maxPeers`. ### 9.1 The reassembler, and why it is linear `RuneReassembler` `tcp.ts:307`. A single `Buffer` with `startIndex` / `endIndex`, not a chunk list. The previous version kept a chunk list and called `Buffer.concat` on **every** chunk while claiming, in its own comment, to be linear. > **A 512 KB frame trickled one byte at a time made 524,288 concats averaging a quarter of a > megabyte each — 137 GB of memcpy and 8,046 ms of a fully blocked event loop, from one > unauthenticated socket, for 512 KB of the attacker's bandwidth. Every other peer, every timer > and every block waited for it. The same frame through this costs 1.05 MB of copying and > 15.5 ms.** > > `tcp.ts:155-166`; the 8,046 / 15.5 figures are `docs/BUILD_STATUS.md:236-237`. What makes it linear (`tcp.ts:128-136`): - a chunk is copied in at `end` and nothing else moves (`push` `tcp.ts:337`); - the length prefix is read at an offset rather than by joining anything (`next` `tcp.ts:382`); - the buffer is compacted or grown only when there is no room at the end, and then only to a size **at least twice what is being kept** (`tcp.ts:171-183`) — so a copy of N bytes buys at least N free appends, and each byte is copied a constant number of times on average however small the chunks are; - growth doubles and is capped at `MAX_REASSEMBLY_BYTES = MAX_FRAME_BYTES + 4 = 524,292`. The bound is checked **before** the copy (`tcp.ts:170-173`), so a peer cannot make this node allocate for bytes it is about to refuse. The tests assert the *property*, not the wall clock, because a stopwatch on a shared CI box measures the box (`tests/integration/tcp.integration.test.ts:169-183`). `copiedBytes` is what went wrong, so `copiedBytes` is what is bounded: the ratio of bytes copied to bytes received must stay under 4 and must not grow as the frame grows. **On the old code the same two cases came out at 32,768 and 262,144 bytes copied per byte received.** **The allocation is 2x to 4x the frame, not 1x.** `REASSEMBLY_KEEP_BYTES = 64 KiB` (`tcp.ts:45`) is the size of the *buffer* above which it is released when it drains, and it is routinely read as a statement about frames. It is not. Measured and pinned at `tests/integration/tcp.integration.test.ts:268`: | Frame | Buffer allocated | Ratio | Released on drain? | |---|---|---|---| | 16 KiB | 64 KiB | 4.00x | **no** — exactly at the threshold | | 32 KiB | 128 KiB | 4.00x | yes | | 512 KB (maximal) | 512 KB + 4 | 1.00x | yes | So the release fires for any frame over about 16 KiB, and a peer sending 16 KiB frames leaves a 64 KiB buffer alive on that connection for the life of the session. This is deliberate and documented (`tcp.ts:22-42`): the alternative is weakening the doubling, and quadratic reassembly is the defect the class was written to end. §10.3 accounts for what it costs. ### 9.2 The deadlines Three, and the distinctions between them are the whole point. **The handshake deadline** (`tcp.ts:60`, armed at `tcp.ts:432`, cleared only by `noteAuthenticated` `tcp.ts:803`). Deliberately **not** `socket.setTimeout`, which is an *idle* timeout: it resets on every byte, so one byte every few seconds held a connection open forever while never completing a frame — a slot in `maxConnections` and a reassembly buffer, held for the cost of a byte, by someone who has proved nothing. 15 s is longer than Hestia's own 10 s handshake deadline (`hestia.ts:268`) so the runtime's cleanup runs first on an honest slow link, and well under `BIFROST_MAX_AGE_MS`, past which the handshake could not complete anyway. **The frame deadline** (`tcp.ts:73`, `armFrameDeadline` `tcp.ts:960`). Armed while bytes are buffered, cleared by a frame **completing**, never by bytes arriving — so a trickle cannot extend its own deadline. The half that was missing: arming only on a `data` event was not enough, because one segment routinely carries `[complete frame][start of next]` — that is what a peer keeping up looks like, not an attack. The deadline was cleared when the first frame completed, and the bytes behind it waited for a `data` event a peer under no obligation to send never sends. The incomplete frame was then held by the idle timeout alone: two minutes by default against a thirty second frame deadline. **Measured with a 250 ms deadline: still connected 825 ms later, 3.3x past it** (`tcp.ts:528-537`; test `tests/integration/tcp.integration.test.ts:390`). `ingest` now arms it again after every completed frame for whatever the segment left behind (`tcp.ts:498-500`). **The connect deadline** (`tcp.ts:326`, 5 s). Without one the OS decides, and for an address that is routed but answers nothing that is tens of seconds during which the dial loop holds a slot for a peer that is never going to answer. A peer record naming a blackholed address would otherwise be a way to make every node that learns it wait. ### 9.3 The write-queue bound `MAX_WRITE_QUEUE_BYTES = MAX_FRAME_BYTES * 8 = 4,194,304` (`tcp.ts:103`), checked **before** the write (`tcp.ts:396-400`), so the queue is bounded by this limit plus one frame rather than by this limit plus whatever the caller had left to send. `socket.write` returns false when the kernel buffer is full and Node has started queueing in user space, and that queue has no size of its own — it is however much the writer keeps handing it. Nothing read that return value, so a peer that stopped reading (or read slowly enough, which a peer chooses) made this node buffer every frame the gossip fanout produced for it, on the heap, until the process died. **It is the cheapest remote memory exhaustion in a P2P stack: cost to the attacker is not reading** (`tcp.ts:86-94`). The connection is dropped, not the frame: dropping frames silently leaves both sides believing a sync response was sent, whereas a dropped socket is a condition the dial loop already knows how to repair. Tests: `tests/integration/network-faults.integration.test.ts:538` (a server that accepts and never reads is dropped before the bound is passed four times over) and `:574` (a peer that reads takes all 200 frames and stays connected). The return value is deliberately not awaited (`tcp.ts:402-404`): this is called from the receive path, where blocking on one slow peer would stop serving every other. The queue depth is what is acted on, on the next send to that peer. ### 9.4 Identity, and two bugs that are easy to reintroduce - **Handlers read `peer.id`, not a captured id** (`tcp.ts:474-476`). Captured, a rename by `identify` leaves the handlers looking up a name the map no longer has: the close handler finds nothing, returns, and the connection is never removed — a dead peer that `connectedPeers` still lists, that `send` still writes to, and that the dial loop therefore never re-dials. - **`identify` never overwrites an existing entry** (`tcp.ts:428-431`). `nodeId` is self-asserted, so allowing the overwrite lets a peer claim an honest peer's id and redirect every send meant for it. It throws; `StarwNode.openSession` catches and drops the *new* socket (`starw-node.ts:1476-1480`), so an established session is never displaced by a later claim to the same identity. That path still calls `onSession` for the established peer, or two nodes that dial each other simultaneously would leave the loser re-dialling an address it is already connected to forever. - **`remoteAddress` is kept on the record** (`tcp.ts:288-293`), because `socket.remoteAddress` is `undefined` once the socket is destroyed, and the moment a peer needs charging for what it did is exactly the moment its socket is going away. - **`normalizeAddress`** (`normalizeAddress` `tcp.ts:1008`) flattens `::ffff:203.0.113.7` to `203.0.113.7`. A dual-stack listener and a v4 listener report the same sender two ways, and two spellings of one sender is two rate buckets, which is one bucket too many. ### 9.5 The last line before an exception is the process exiting `ingest` wraps the receive handler in a `try` (`tcp.ts:570-587`). This is a `data` handler: nothing above it catches, so anything the node throws while reading a frame escapes into the event loop and takes the node with it. On a throw the **peer** is dropped and reading stops rather than continuing through the rest of the buffer — a handler that failed part-way leaves this connection's state unknown, and the honest response to unknown state is to end the connection. The node's own receive path is separately responsible for never throwing (`tryHandlePayload`, `starw-node.ts:1506`; `VerdandiSync.onPayload` `verdandi.ts:930`; `MnemosyneAccount.observeBytes` `mnemosyne.ts:350`). Both layers exist because `{ records: [null] }` on the PEX protocol stopped a node, and a supervisor turns one frame from one authenticated peer into a restart loop (`starw-node.ts:1487-1505`). ### 9.6 Iris — the public door, and the only write-capable port in this directory `src/network/iris.ts`. **This is the only surface in `src/network/` that something outside the chain can reach, and the only one that accepts writes from an unauthenticated caller.** Added after every other section of this volume was written, which is why it was absent from it until 2026-09-08 — a gap worth naming, because the opening line of this document promises everything here is read off `src/network/` as it stands and 1,688 lines of it were not. **What it closes.** `JsonRpcSurface` (`src/core/rpc.ts`) is the whole in-process API a client needs and it had **no transport**. Six HTTP servers existed in this tree — `saga.ts` and `vedrfolnir.ts` for the explorer, `gungnir/server.ts` for the owner, `ops/astrolabe.ts` for the operator, `cli/strblk.ts`, and `tcp.ts` for peers — and not one of them served it. The class carrying `submitTransaction`, `balances`, `nonce` and `transaction` was reachable only by `import`, so no external wallet, dapp, exchange or block explorer could talk to a node at all. **Shape.** JSON-RPC 2.0 over HTTP. `POST /` takes one call or a bounded batch; `GET /rpc` is the method catalogue, `GET /health` and `GET /metrics` complete the routes (`IRIS_ROUTES` `src/network/iris.ts:1310`). `createIrisServer` (`src/network/iris.ts:3115`) builds it over `node:http` or `node:https`; `handleIrisRequestSync` (`src/network/iris.ts:1359`) is the whole request path and is synchronous and pure enough to test without a socket. **Params are a named object and never a positional array** — a public API whose arguments are an array is one where inserting a parameter silently re-reads every caller's third argument as its fourth. Every `bigint` travels as a decimal string, in both directions, at every depth. `IRIS_METHODS` (`src/network/iris.ts:1137`) is the published catalogue, and every entry carries a **declared cost class** so a client sees what it will be charged before it is charged: | Class | Count, read off the catalogue 2026-09-12 | What it is | |---|---|---| | `read` | 24 | map lookups and short scans over state this process already holds | | `compute` | 1 | `simulateCall`, which runs the AresLang VM under `DEFAULT_GAS_LIMIT` — terminating, and three orders of magnitude past a map lookup | | `write` | **19** | a signature verified, and usually a record queued | The writes are **every record kind the block plane accepts**, plus the two contract doors, plus the six hostless operations §9.10 describes. `compute` and `write` are charged the traffic token *and* a token from the expensive class, so a write cannot be paid for out of the read budget. **The class is a PRICE and not a verb**, and two rows make that visible: `spaceManifest` and `spaceChunk` change nothing at all and are charged the expensive class, because each costs a signature verification and up to 350 KB of answer — which is the expensive class's own definition, *one expensive answer a stranger can draw before anything has authenticated*. Charging them to the read budget would let a read allowance buy post-quantum verifications. **`submissionReach` is a read method and it is the honest one.** Seven of those eleven writes put a record in a queue that no protocol carries off this node (§3.6 has the protocol table; `RheaKind` is `tx | allocation | registration`). Rather than let a client discover that by polling, the catalogue says `Does NOT gossip` on each affected method and `submissionReach` answers it as data, per call. ### 9.7 Nobody authenticates, and that is the design rather than the gap **Every write here is a record already signed over its own fields plus this chain's genesis hash.** There is no caller to check: the record proves its own author, and a node demanding a second credential would be demanding one no holder has. `submitRegistration` takes a finished proof, never a key; no method in the catalogue has a keypair, a seed or a private key among its params. What that leaves unbounded is not authorship but **work** — a stranger with a socket spending this node's signature verifications and queue slots. That is a rate limit's job and not an authenticator's, which is why §9.8 is where this door's security actually lives. **Charged before the work, from the length prefix.** The framing rule this layer already enforces on the wire — the length precedes the body, so an oversized frame is refused unallocated (§3.2) — is *applied* to HTTP rather than restated. `Content-Length` **is** the length prefix, and a POST is judged in this order: 1. no `Content-Length` → **411**. A body with no length prefix cannot be charged before it is allocated, and charging afterwards is what §11.2's pre-session finding already measured as worthless: 275.8 MB/s of free JSON decode from one address. 2. declared length over `IRIS_MAX_BODY_BYTES` (`src/network/iris.ts:205`, 512 KB) → **413**, before a byte is read. Sized by the largest legitimate request, a contract deployment, whose `MAX_RECORD_BYTES` is 383,616 canonical bytes before JSON escaping. 3. the declared length charged to the byte budget → **429**, before a byte is read. 4. the body read, refused if it exceeds what it declared. 5. `JSON.parse`. 6. the per-method class charged, **per batch element**. 7. `assertRecordFitsABlock` on a submitted record, at the door. 8. dispatch. `IRIS_MAX_BATCH` (`src/network/iris.ts:247`) is 20, because a batch is an amplifier by construction: one HTTP request, one TCP round trip, N dispatches. Every element is charged its own class before it runs — a batch of twenty reads costs twenty read tokens, not one — so the cap is a *second* bound, on how much work a single parse can queue ahead of any charge at all. Twenty because the batch a wallet actually sends is four. **A refusal is a wait and never a disconnect.** 429 with `Retry-After`, computed from the bucket that could not pay. No ban, no strike, no socket dropped — dropping instead would turn a full bucket into a partition the moment a client has dial backoff, which is the failure §9.4 records this branch already fixing once on the peer transport. **Transport security is decided, not defaulted.** `IRIS_DEFAULT_HOST` (`src/network/iris.ts:195`) is loopback. A non-loopback bind is **refused** unless the operator supplies `--rpc-tls-cert`/`--rpc-tls-key` — terminated here in `node:https`, with no new dependency, via `loadIrisTls` (`src/network/iris.ts:735`) — or states `--rpc-behind-tls-proxy`. `irisExposureRefusal` (`irisExposureRefusal` `src/network/iris.ts:654`) carries the argument and `isLoopbackHost` (`src/network/iris.ts:626`) the test. Two accepted shapes rather than one, because either alone pushes an honest operator into defeating the check; a refusal rather than a warning on Snotra's precedent — **the wrong answer must not be the one you get by forgetting**. There is no TLS anywhere else in this tree, and public plaintext would put transactions, balances, addresses and the IP that asked for them on the wire: the signature protects the payload and protects nothing about who asked what. `IRIS_DEFAULT_PORT` (`src/network/iris.ts:192`) is **8083**, continuing the local series — 8080 explorer, 8081 Astrolabe, 8082 Gungnir — and **deliberately not 8545**, which is Ethereum's. A wallet that finds a SourceLess endpoint where it expected `eth_chainId` fails in ways that read as a broken node rather than as a wrong port. ### 9.8 Gleipnir as a cost class, not a peer-transport detail — and no fourth limiter This is the load-bearing design fact about Iris, and it is a fact about §5.5 as much as about this section. `irisGleipnir` (`src/network/iris.ts:1078`) builds a `RatatoskrRouter` and uses it for its buckets alone. **Two of Gleipnir's cost classes map exactly, not by analogy:** - the **traffic** class meters requests and their bytes, which is what it meters on a socket; - the **handshake** class is defined in §5.5 as *one expensive answer a stranger can draw before anyone has authenticated, at a fixed per-address allowance that closing the connection does not return*. **A public RPC write is that, precisely.** So no fourth limiter was written. What the classes gained for this consumer is `admitTraffic` / `admitHandshake` / `admitPresession` — the existing `allow*` methods returning the wait that `shortfallMs` already computed and the boolean threw away. A frame receiver drops a frame and the sender retries; an HTTP caller needs a `Retry-After`, and the honest value for it is the moment the bucket could pay. **Reads and writes do not share a policy**, eight times apart because the costs are: | | sustained | burst | citation | |---|---|---|---| | reads | **32/s** | 128 | `IRIS_READS_PER_SECOND` (`src/network/iris.ts:271`), `IRIS_READ_BURST` (`src/network/iris.ts:281`) | | writes and `simulateCall` | **4/s** | 32 | `IRIS_WRITES_PER_SECOND` (`src/network/iris.ts:300`), `IRIS_WRITE_BURST` (`src/network/iris.ts:310`) | | bytes | **1 MB/s** | 4 MB | `IRIS_BYTES_PER_SECOND` (`src/network/iris.ts:341`), `IRIS_BYTE_BURST` (`src/network/iris.ts:352`) | The read rate is derived from what a client needs rather than from what the link carries: a wallet at rest polls one transaction every two seconds, a wallet in use asks about three calls per human decision, a dapp backend asks for a handful at once — which is what the burst is for. 32/s is 1,920 a minute from one address. **The dearest read was measured rather than assumed, and the guess was wrong.** `transaction` walks up to 512 blocks and looked like a candidate for the expensive class. It costs **3.37 µs on an 8-block chain and 6.81 µs on a 512-block one** — the whole 512-block scan is 3.4 µs — against the **3.3 µs of fixed per-request overhead every call pays anyway**. It is a read and it is priced as one. **The bucket key is the socket's peer address and nothing a caller can write.** `X-Forwarded-For` is a string a stranger writes, and a bucket key a stranger chooses is a fresh full burst per request. `IrisOptions.clientAddressOf` (`src/network/iris.ts:694`) carries the reasoning. The consequence is stated on `/rpc` rather than left to be discovered: **behind a proxy every client shares one bucket, and the remedy is to meter at the proxy.** `IRIS_MAX_BUCKETS` (`src/network/iris.ts:369`) caps the table at 4,096; it self-drains, because Gleipnir forgets a bucket once it has refilled — the moment at which forgetting it stops meaning anything. Measured: **6,000 distinct addresses each spending a full burst left 1,957 buckets and 109.6 KB.** `IrisMeter` (`src/network/iris.ts:550`) counts refusals by reason, so an operator can tell a rate limit from a malformed client from a body over the cap. ### 9.9 Measured, and three results the design did not predict Eight concurrent loopback clients against one endpoint for 10.0 s, **the server forked into its own process** so the event-loop histogram is the node's and not the attacker's. Both runs of each pair offered the same load. | | offered | **accepted** | node user CPU | event-loop max | |---|---|---|---|---| | `submitTransaction`, no budget | 88,082 (8,807/s) | **8,807/s** | 5.81 s / 10 s | 10.117 ms | | `submitTransaction`, this budget | 88,219 (8,820/s) | **7.1/s** | 3.58 s / 10 s | 7.213 ms | | `getStatus`, no budget | 84,850 (8,484/s) | **8,484/s** | 4.05 s / 10 s | 6.345 ms | | `getStatus`, this budget | 92,256 (9,225/s) | **44.7/s** | 3.70 s / 10 s | 5.775 ms | The accepted figures are the budgets, arithmetically: 32 + 4/s × 10 s = 72 writes (71 seen), 128 + 32/s × 10 s = 448 reads (447 seen). **A flood of 8,800 write attempts a second from one address puts 7.1 records a second into the queue** — a factor of 1,240. Three things the numbers say that the design did not predict, reported because they are true rather than because they are flattering: 1. **The budget did not materially move mean or p99 event-loop delay.** Mean 1.025 ms against 1.028 ms, p99 2.173 ms against 2.263 ms; only the maximum improved, 10.1 ms → 7.2 ms. What it moved is CPU (5.81 s → 3.58 s of a 10 s window) and the number of records that reached the chain. **The residue is Node's own accept-and-parse-headers loop, which runs for a refused request exactly as for a served one — bounding that is a kernel's or a proxy's job, and this door cannot honestly claim it.** 2. **The byte dimension is not where the burn is here**, which is the opposite of the peer transport. `decodeRune` costs ~4 ns a byte because it re-serialises canonically and hashes twice (§3.7); a plain `JSON.parse` at this door costs **0.43 ns a byte on a 383 KB body, about 2.2 GB/s**, and the dominant cost is the fixed 3.3 µs per request. So the *request-rate* budget binds and the byte budget is the backstop, rather than the other way round. 3. **A refusal is cheaper than the attempt**, ~2.0 µs against ~3.4 µs — the property `RheaEngine.submit` states a defence has to have. **What Iris does not serve, named rather than hidden.** `JsonRpcSurface` exposes no block read, so neither does Iris, and `/rpc` says so and points at Fylgja, which follows the chain and holds its own copy. She is deliberately **not Bifrost** — that is the mutual handshake between two peers on one chain who end up sharing a session key, and nobody authenticates here in either direction; **not Hermes**, reserved for cross-ledger message passing between chains rather than between the world and one chain; and **not Saga, Astrolabe or Gungnir**, which are a reader's page, an operator's instrument and an owner's console. This one is for programs: it holds no key, mounts no privileged action, and cannot seal a block. ### 9.10 The hostless half of the door, which did not exist Nine methods added 2026-09-12, and the reason they are here rather than in §15 or §16 is that the gap they close was never in Arecibo or Roche: it was that **no door reached them**. Before this, `BlockchainCore.submitOortRecord` had no caller under `src/` at all, `RocheStore.publish` and `StarwNode.fetchSpace` were reached only by tests, and `AreciboDirectory.holdersOf` answered an empty list on every node in the network. The machinery was finished and there was no way in. | Method | Class | Authority it needs | |---|---|---| | `space`, `spaceList`, `spaceHolders` | `read` | **none.** A space's existence, owner, visibility, price and content commitment are chain state every node computed from the same blocks. Asking for a signature to read public chain state would be theatre | | `submitOortRecord` | `write` | **its own.** The record is signed by the space's creator and the chain re-derives that signer — the same reasoning every other write on this door rests on | | `spacePublish`, `spaceAnnounce` | `write` | the **creator's**: the request must be signed by the address the chain records as the space's creator | | `spaceFetch`, `spaceManifest`, `spaceChunk` | `write` | the **chain's verdict about the caller**, through `OortRegistry.mayRead` | The last row is the one worth dwelling on. `mayRead` is the access decision this whole subsystem exists to make, and before this door the only thing that called it outside tests was an operator console reporting a verdict about *somebody else*. It had never been asked about the party in front of it. **What a caller is, and how the door knows.** Not a session and not a password: a signed `OortAccessRequest` (`src/hostless/oort.ts`) naming the space, one of three purposes, the reader it claims to be, a millisecond and sixteen bytes of nonce — bound to the chain like every Oort record, so a request for one realm is not a request on another. The purpose is checked against the method that was called, so a reader's own read request cannot be replayed into a publish. An **address** claim is checked by re-deriving it from the signing key; a **domain** claim is checked against who the chain says holds that name, and a node that cannot resolve it refuses the claim rather than falling back to the address — a domain and the address behind it are two different grantees and the chain knows them apart. **Freshness is a window and not a challenge**, `OORT_ACCESS_WINDOW_MS` = 120,000, which is the clock skew Arecibo already allows rather than a second number. Stated exactly: outside the window a captured request is refused; inside it, anybody who observed one may replay it for the same answer. Nothing remembers a nonce, because a nonce table on a public door is memory a stranger chooses the size of, and the door is stateless by design. The transport is the defence for that and it is the operator's decision — see `irisExposureRefusal`. **No key crosses this door in either direction, in any method's parameters or results.** That is structural: nothing in `src/cli/space-door.ts` imports a cipher or takes a key, exactly as nothing in `src/network/roche.ts` does. A publisher seals before it calls; a reader opens after the answer comes back. It is what makes it safe to point `strblk space` at a node somebody else runs — and what such an operator *does* learn is stated rather than hidden: which spaces an address asked about, and when. **The one exception to the catalogue's own rule, named.** §9.6 says every method name here matches `JsonRpcSurface`'s. These nine do not, because `JsonRpcSurface` holds nothing hostless — no space, no Oort record, no chunk — so there is no name to match. They mirror `IrisHostlessDoor` instead, which is satisfied in `src/cli/space-door.ts` where the node, its Oort registry, its Arecibo index and its Roche store are all in scope at once. Widening the in-process surface is a change every other client of the chain shares and belongs to whoever owns `src/core/rpc.ts`. **A node with no chain refuses all nine and stays on the catalogue.** A Pulsar cannot re-derive a space's anchored root, so it can check nothing; the answer is *this node keeps no chain, so it holds no hostless spaces*, with the reason, rather than a method that disappears from the published catalogue depending on which node a client happened to ask. --- ## 10. Mnemosyne — node classes and the retention budget `src/network/mnemosyne.ts`. `ONE_MEGABYTE = 1_048_576` (`mnemosyne.ts:43`). ### 10.1 The classes `STARW_CLASSES` `mnemosyne.ts:200`. | | **Pulsar** | **Quasar** | **Supernova** | |---|---|---|---| | retention budget | 716,800 (700 KiB) | 268,435,456 (256 MiB) | 4,294,967,296 (4 GiB) | | max peers | 24 | 128 | 512 | | retained blocks | 0 | 4,096 | all | | keeps full state | no | yes | yes | | validates contracts | no | yes | yes | | keeps ledger history | no | yes | yes | | produces blocks | no | yes | yes | | **serves sync** | **no** | yes | yes | | max directory records | 16 | 256 | 1,024 | | **max space records** (Arecibo, §15) | **0** | 64 | 1,024 | | max seen messages | 512 | 4,096 | 8,192 | | default power | 10 | 50 | 100 | `validationPower` (`src/network/mnemosyne.ts:525`) caps a granted power at the class default, so a Pulsar handed Supernova weight still validates at 10. The two per-peer sizes are measured, not guessed: `PEER_RECORD_BYTES = 11,264` and `PEER_SESSION_BYTES = 8,192` (`mnemosyne.ts:104-105`). A peer record measures **11,132 bytes** — a Gemini identity is ed25519 + ML-DSA-65 + ML-KEM-768, and post-quantum keys are kilobytes. The previous figure was 3,500, a guess from before those keys existed, which under-counted the largest structure a stranger can grow by threefold (`mnemosyne.ts:93-103`, `starw-node.ts:1735-1742`). ### 10.2 What the account does `MnemosyneAccount` (`src/network/mnemosyne.ts:295`) is a map of named buckets to byte counts. Sizes come from `canonicalStringify` — the same bytes that would hit disk or the wire. Two write paths, and the difference matters: - `setBytes` / `set` (`src/network/mnemosyne.ts:247`, `:242`) **refuse** a write that would breach the budget, and leave no residue. - `observeBytes` / `observe` (`src/network/mnemosyne.ts:273`, `:280`) **record what a bucket actually holds**, whether or not it fits, and let `withinBudget` say no. The reasoning is at `mnemosyne.ts:258-272` and it is right: the accounting for peers, gossip and sync runs inside the transport's receive handler, so a budget breach there is not a refused write, it is the node stopping — and every honest node running the same code stops at the same frame. Refusing the write quietly is worse still, because the bucket keeps its old value and `withinBudget` goes on saying yes about a node that is over. > **Since 2026-11-18 there is an opt-in enforcing half, and it sheds rather than refuses.** > `strblk node --mnemosyne-enforce` (or `SOURCELESS_MNEMOSYNE_ENFORCE=true`) gives the node a > `MnemosyneEnforcer` (`src/network/mnemosyne-enforce.ts`). **At the class ceiling it is a backstop > expected to shed nothing**: the caps below already hold every class inside its budget, so it acts > only under a tighter budget (`--mnemosyne-budget BYTES` / `SOURCELESS_MNEMOSYNE_BUDGET`, which > may not exceed the ceiling). Every accounting call then queues one coalesced pass on a microtask, > which runs after the receive handler has returned. The pass re-measures every bucket from its > structure before judging the overage. When over, it releases, cheapest to rebuild first, expired > peer records (`PraecoDirectory.prune`), expired space offers (`AreciboDirectory.prune`) and then > the oldest gossip seen-cache ids (`RatatoskrRouter.shedSeenBytes`), keeping the newest eighth of > the class cap. That last tier is skipped if any bucket cannot be re-measured. A bucket in > `MNEMOSYNE_NEVER_SHED` (checkpoint, blocks, ledger, Eljudnir, mempool, sessions, sync, Roche) is > refused as a tier at construction. A forgotten seen id takes its known-peer set with it, so a late > copy is judged again and, if it passes, relayed to up to the fanout (6) peers under its hop limit, > including peers that already hold it and its sender. Each of them drops it as a duplicate, and no > verdict changes. Passes are reported on `footprint.enforcement` (`strblk status`) and > `sourceless_retention_shed_*` (`/metrics`), and an unresolved one is logged at most once a > minute. **Off by default**, and the paragraph below is still exactly true of a default node. **Consequence, stated plainly: on the running node path nothing is enforced by Mnemosyne.** Every call site in `starw-node.ts` is `observe` or `observeBytes` — `checkpoint` (`:798`), `sessions` and `praeco` (`:1952-1953`), `arecibo` (`:1970`), `roche` and `roche-store` (`:1987-1988`), `gossip` (`:2011`), `sync` (`:2021`), `mempool` (`:2001`); eight of them, re-read 2026-09-12. There is no production caller of `setBytes` in `src/network/` or anywhere under `src/`, and none of `wouldFit` (`wouldFit` `src/network/mnemosyne.ts:366`) or `urdCheckpointBytes` (`urdCheckpointBytes` `src/network/mnemosyne.ts:433`) at all. `MnemosyneBudgetExceeded` is thrown from one line nothing production reaches. The budget is a **report**, and two surfaces said otherwise until 2026-09-12: `docs/WALLET_EXPLORER_HOSTLESS.md` and the note on every `strblk status` footprint (`src/hostless/orrery.ts:618`), both now corrected and the second pinned by a test (`tests/integration/orrery.integration.test.ts`). What actually holds a node inside the figure is the structural caps: `maxPeers`, `maxDirectoryRecords`, `maxSeenMessages`, `maxBuckets`, `MAX_GOSSIP_MEMPOOL`, `MAX_GOSSIP_IDENTITY`, `PRAECO_QUARANTINE_SIZE`, `TX_DROP_JOURNAL_SIZE`, `MAX_RETAINED_FAULTS`. ### 10.3 What the megabyte does and does not account for **Accounted.** Nine buckets, all of them memory a stranger's traffic causes this node to hold. Line numbers re-read on 2026-09-12; the `arecibo`, `roche` and `roche-store` rows were missing from this table until then, along with the two modules that fill them (§15, §16): | Bucket | Formula | Source | |---|---|---| | `checkpoint` | canonical size of the `UrdProof` | `src/network/starw-node.ts:798` | | `sessions` | `sessions × 8,192` | `accountForPeers` (`src/network/starw-node.ts:3895`) | | `praeco` | `directory.size() × 11,264` | `accountForPeers` (`src/network/starw-node.ts:3895`) | | `arecibo` | `offerCount() × 12,288` | `accountForSpaces` (`src/network/starw-node.ts:3916`) | | `roche` | `peers × 192 + per-fetch bookkeeping` | `accountForRoche` (`src/network/starw-node.ts:3937`) | | `roche-store` | `heldChunks × 526,336 + manifests × 66` | `RocheStore.approximateBytes` (`src/network/roche.ts:1181`) | | `mempool` | `pendingTx×512 + txAttempts×64 + txDrops×128 + pendingIdentity×640` | `accountForMempool` (`src/network/starw-node.ts:3953`) | | `gossip` | `RatatoskrRouter.approximateBytes()` | `approximateBytes` (`src/network/ratatoskr.ts:1208`) | | `sync` | `peers×320 + rivalHashes×80 + faults×256 + stagedBytes + staged×96` (staging only on a class that keeps a chain, so a Pulsar's is the first three terms) | `approximateBytes` (`src/network/verdandi.ts:1174`) | A Pulsar creates four of those nine and never the other five: it is given no Arecibo index and no chunk store (`maxSpaceRecords` is 0, and `hestia.ts:695`/`:718` wire both only on a class that keeps a chain), so the `arecibo`, `roche` and `roche-store` keys are **absent** rather than zero on a Pulsar's report — measured on a live one, which reported only `checkpoint`, `gossip`, `praeco`, `sessions` and `sync`. A live quasar reported `"roche":0,"roche-store":0` on the day that measurement was taken, because nothing on a production path published or fetched content; both buckets are non-zero on a node that has been published to through the door in §9.10, and the `arecibo` bucket — which no live node had ever created — is created the moment a node announces that it is holding a space (§15.3). The Pulsar worst case, computed from the class's own caps (`tests/integration/network.integration.test.ts:340`): ``` sessions 24 × 8,192 = 196,608 praeco 16 × 11,264 = 180,224 gossip 512×32 + 512×(32 + 25×16) + 24×4×40 + 24×48 = 242,560 sync 24 × 160 = 3,840 ------- 623,232 of 716,800 ``` The checkpoint goes into the remaining 93,568 bytes, and it does not grow with the chain — that is the point of the recursive fold. Measured: 40 blocks change the retained checkpoint by **under 16 bytes**, which is the digits in the height and the folded-block count (`tests/integration/network.integration.test.ts:316`). Over a real socket, a Pulsar following a hub from height 8 to height 16 changes its `checkpoint` bucket by under 16 bytes and stays `withinOneMegabyte` (`tests/integration/slnn-mesh.integration.test.ts:177`, `:192`). **A discrepancy worth knowing about, and it widened.** The worst-case model above is hand-written in the test and is *not* the formula `RatatoskrRouter.approximateBytes` actually uses. Run the code's own formula (`ratatoskr.ts:522-534`) at the same worst case — `seen=512`, 25 peers per propagation set, `buckets = maxPeers × 8 = 192`, `rateKeys = keyPeers = 24`: ``` 512×40 + 512×432 + 192×56 + 24×48 + 24×32 + 24×16 = 254,720 ``` against the test's 242,560 — **12,160 bytes apart**, with the production formula the larger. The total becomes 635,392, still inside 716,800, leaving 81,408 for the checkpoint rather than 93,568. **And a third layer, measured 2026-09-12 by driving the structures rather than either formula.** The real `RatatoskrRouter` and the real `VerdandiSync` were taken to each class's caps and asked for their own `approximateBytes`. A Pulsar's honest worst case is **649,861 bytes** — 649,472 capped plus a 389-byte checkpoint — against 716,800, which is **90.7% used and 66,939 bytes of margin, 9.3%**. Not the 13% the 623,232 figure implied. Two further undercharges, beyond the four below: `VerdandiSync` charges **320** bytes a peer where the test charges 160, and driving the router reaches **264,960** against the formula's 254,720 because `accept` marks a sender *before* the duplicate check, which is what "every remembered message known to every peer" actually costs. 635,392 + 3,840 + 10,240 = **649,472**. So the three figures are one quantity measured three ways, and only the third is a ceiling: the test's arithmetic (**623,232**), the production formula (**635,392**), and the structures themselves (**649,861**). `tests/integration/network.integration.test.ts` now asserts its own arithmetic is a lower bound — `expect(649_472 - arithmetic).toBe(26_240)` — so the gap is pinned rather than rediscovered, and the test can no longer read as a footprint. **This is also why the byte total is observed and not enforced.** 9.3% of margin on a figure that has been understated twice is not a number to halt a node on; the per-structure caps refuse *before* the memory is taken and carry a reason, which is the enforcement that exists. See `src/ops/control-register.ts`, where the four unreached halves now carry a disposition. The 12,160 is four separate disagreements, and it is worth breaking down rather than quoting, because only one of them is about the new cost classes: | Term | Production (`ratatoskr.ts:522-534`) | Test (`network.integration.test.ts:353-359`) | Gap | |---|---|---|---| | seen cache | `512 × 40` = 20,480 | `512 × 32` = 16,384 | +4,096 | | propagation sets | `512 × (32 + 25×16)` = 221,184 | same | 0 | | rate buckets | `192 × 56` = 10,752 — `maxBuckets` is `policy.maxPeers × 8` (`starw-node.ts:496`) | `24 × 4 × 40` = 3,840 — four buckets per peer at 40 bytes | +6,912 | | `rateKeys × 48` | 1,152 | 1,152 | 0 | | `keyPeers × 32` | 768 | absent | +768 | | `rateKeys × 16` | 384 | absent | +384 | So the per-bucket figure is **56 in production against 40 in the test**, not 56 against 48 — the 48 is the `rateKeys` term, which both formulas carry identically and which is not a bucket. The 56 is where the new cost classes show up: the class now sits on the bucket record, and one address can cause three buckets of its own (traffic envelope, handshake budget, pre-session budget). The *count* moved too, from four per peer to eight. The gap widened when class 3 landed and the test's copy of the formula did not move, which is exactly the failure mode: the budget proof and the runtime accounting are two formulas for one thing, and neither reads the other. That is the shape of defect this codebase has repeatedly found in decoders. Worth reconciling; the direction is safe today — the production formula is the larger, so the test's worst case is the optimistic one, which is the wrong way round for a proof. **Not accounted, and this is the honest part.** The retention account covers *data structures the node chose to keep*. It does not cover: - **TCP reassembly buffers.** `RuneReassembler.capacity` is exposed (`RuneReassembler.capacity` `tcp.ts:327`) and nothing reads it. Two different ceilings, and the distinction was missing here until 2026-09-12: - *Retained while idle.* A connection that carried a 16 KiB frame holds a 64 KiB buffer for the life of the session (§9.1). A Pulsar's `maxConnections` is 24 (`hestia.ts:483`), so `24 × 65,536 = 1,572,864 bytes` — **1.5 MB, which on its own exceeds the megabyte the tier is named for**, and none of it appears in `withinOneMegabyte`. Buffers *larger* than `REASSEMBLY_KEEP_BYTES` are handed back to the allocator the moment the reassembler drains (`next` `tcp.ts:397`), so this is the steady-state figure and not the peak. - *Concurrently held.* `push` doubles from `REASSEMBLY_CHUNK_BYTES` while `capacity` is under `required × 2`, capped at `MAX_REASSEMBLY_BYTES` = 524,292 (`tcp.ts:210-212`), and the release above fires only when the buffer empties. A peer that starts a 512 KiB frame and stops therefore holds 524,292 bytes, and 24 of them hold `24 × 524,292 = 12,583,008 bytes` — **eight times the idle figure** — for as long as the 30 s frame deadline allows (`armFrameDeadline` `tcp.ts:959`). Bounded in time rather than unbounded, and absent from every budget in this section. Both figures are arithmetic over the code's constants and the measured 16 KiB→64 KiB allocation; **neither is a measurement of a running Pulsar, and no such measurement exists in the tree** — nobody has pushed 512 KiB frames from 24 peers and read the resident set. - **Socket write queues.** Up to `MAX_WRITE_QUEUE_BYTES + one frame ≈ 4.5 MiB` per peer (`tcp.ts:103`, `tcp.ts:349`), and a Pulsar does relay blocks — `block` is flooded and nothing in `NON_RELAYED_PROTOCOLS` or the class policy exempts it. Unaccounted. At the class cap that is `24 × 4,194,304 = 100,663,296 bytes`, arithmetic again and measured by nothing. - **The Node/V8 runtime itself.** The 700 KiB budget leaves a third of its megabyte unspent, nominally "for the runtime's own overhead" (`mnemosyne.ts:120-128`), which is a reservation and not a measurement. **It is now measured, and it does not fit.** A shipped `strblk node --class pulsar --dev`, in its own process, read **94,224,384 bytes** resident (`ps -o rss`, 12 s after start; 74,547,200 bytes at 32 s) while its own retention report said `usedBytes: 0`. The Node and V8 baseline before any node object existed was 62,472,192 bytes, so most of the 94 MB is the runtime and the imported module graph rather than the node — but the node's own share is **unattributed**, and the arithmetic difference between two resident-set readings is not a measurement of it. Measured on darwin 25.6.0 / Node v22.22.3; one host, loopback, no hostile peer (`docs/reality/NODE_AND_HOSTLESS.md`). This sentence said **unmeasured** until 2026-09-12. - **Handshake state.** `pendingChallenges` and `pendingConfirms` (`starw-node.ts:412`, `:414`) hold a `BifrostChallenge` and a `BifrostResponse` — kilobytes of post-quantum key material each — per in-flight connection, bounded only by the connection cap and the 15 s handshake deadline. Unaccounted. - **The `delivered` / `rejected` counters** (`starw-node.ts:422-423`), which are bounded by the number of distinct keys the code emits, so small — but zero in the report. - **Valkyrie's own bookkeeping.** `attested` is a bounded FIFO of 128 block hashes (`attested` `starw-node.ts:1112`, `MAX_ATTESTED_BLOCKS` `starw-node.ts:866`) — 128 × 64 hex characters, about 8 KB — and `valkyrieStats` is four integers (`starw-node.ts:454`). Neither is observed into any bucket. Small, bounded, and still zero in the report. What is *not* small is what collection does to the `gossip` bucket, which is accounted and is §10.4. - **Anything on disk.** `OrreryFootprint` (`src/hostless/orrery.ts:126`) is the surface that adds disk to memory and reports `withinBudgetIncludingDisk` separately, and it says so on every report rather than in a document an operator has not read (`orrery.ts:607`). **The claim that is actually supported by the code and the tests:** the state a Pulsar keeps *on account of the chain* is constant in the chain's height — measured over a real socket, the `checkpoint` bucket moved **387 → 389 bytes across 61 real blocks**, the two bytes being the digits in the height and the folded-block count — and the structures it keeps on account of its peers are bounded by its class caps at **649,861 bytes, measured** — see the third layer below; the 623,232–635,392 range this sentence carried until 2026-09-12 was a lower bound twice over. A live Pulsar following that chain with one peer reported **20,659 → 25,853 accounted bytes**, the growth being the `gossip` bucket filling toward its 512-message cap rather than anything about height, and its data directory held **20,221 bytes at height 0 and at height 61** while a supernova at the same height held 131,469. **The claim that a Pulsar process fits in 1 MB of memory is not supported by anything in this repository, and is now measured false: 94,224,384 bytes resident.** Four quantities can be meant by "a node under 1 MB" — the process, the accounted retention, the data directory, the download — and two of them hold. `src/network/mnemosyne.ts:4-40` now states which is which at the source of the claim, and `docs/SLNN_PROTOCOL.md` §5 and `docs/reality/NODE_AND_HOSTLESS.md` §A.1 carry the table. `docs/ARCHITECTURE.md:53` and `docs/NAMING.md:44` still render it unconditional as `Pulsar (<1MB)`, which is the first reading a reader meets and the one that is false. ### 10.4 What Valkyrie attestation collection costs this layer Wired on 2026-09-07 and now real traffic on the `attest` topic (§3.6). The authority is `docs/design/QUORUM_FINALITY.md` §1; the numbers below are **measured**, by `scripts/attest-measure.mjs`, on **one machine, one process, one clock, with no hostile peers, no partitions and no packet loss**. A latency here is a floor and not a forecast, and every "works" is a statement about a mesh that is not being attacked. At the scale the network actually runs at, it works and the retention account absorbs it: | | 13 seated nodes | 40 seated nodes | |---|---|---| | fraction of the seating attesting per block | **96.4%** (min 12, mean 12.54, max 13) | **95.8%** (min 28, mean 38.40, max 40) | | nodes reaching quorum, every block | 13 / 13 | 40 / 40 | | collection spread, block seal → last signature | 34–127 ms | **502–1152 ms** | | frames per peer per second | **4.3 mean, 4.5 max** | **11.3 mean, 12.7 max** | | … against Gleipnir's traffic class | 64 sustained / 128 burst | 64 sustained / 128 burst | | frames rate-limited | **0** | **0** | | bytes on the wire, collection wired ÷ not wired | 5,157,348 ÷ 2,296,644 = **2.25×** | **4.53×** | | peak retention used | **64.9 KB** (49.9 KB without) | **95.6 KB** | Two things to carry away, and the second is the one that decides the ceiling. **Attestation traffic roughly doubles the network's byte volume at thirteen seats and roughly quadruples it at forty**, and it always will, because it is one signed message per seat per block. And the cost is dominated by **gossip amplification rather than by the signatures**: at forty seats the mesh carried **51,730 attestation frames to deliver 10,919 distinct ones, a factor of 4.7**. Every node relays what it has not seen, `fanout` is 6, and most of what arrives is already known. The seen-cache is the retention structure this lands on, and the class sizes tell the story on their own. One block's worth of a 1313-seat roll is 1313 distinct message ids: a Pulsar's cache of 512 (`STARW_CLASSES` `mnemosyne.ts:200`) holds **0.39 blocks** of it and a Quasar's 4,096 holds **3.12**. A cache that cannot hold one block's attestations deduplicates nothing across that block, which is the same amplification factor arriving twice. Why it does not fit at 1313 seats, and why the refusal is **measured rather than inferred**, is §11.2 item 15. --- ## 11. Attacks this layer has been shown to survive, and ones it has not **Scope, stated because an operator reads this section to decide whether to expose a node.** The two columns below cover the peer transport, the handshake, the flooded protocols and sync. They do **not cover `arecibo` or `roche`**, the two request/response protocols that move hostless announcements and content, which were absent from this volume until 2026-09-12. Neither has a row here. What each one refuses, with the tests that assert it and the trust-boundary entries that record the open gaps, is **§15.2** and **§16.2**; read those as the statement of record for those two protocols, and read the absence of a row here as "not assessed at the socket level by this section", not as "nothing found". The items below keep their numbers because other documents cite them by number. ### 11.1 Survived, with the measurement | Attack | Mechanism | Measurement | |---|---|---| | **Event-loop kill by trickle** | one unauthenticated socket sends a 512 KB frame one byte at a time | **8,046 ms** blocked, **137 GB** memcpy → **15.5 ms**, **1.05 MB** (`docs/BUILD_STATUS.md:236`, `tcp.ts:155-166`). Bounded as a property: copied/received ratio < 4 and flat as the frame grows; on the old code the same two cases were 32,768 and 262,144 (`tcp.integration.test.ts:185-231`) | | **Oversized-length lie** | declare 4 GB in the length prefix | refused from the four header bytes, `buffered` still 4 (`tcp.integration.test.ts:234`) | | **Reassembly flooding** | never complete a frame, keep sending | refused at `MAX_FRAME_BYTES + 4` before the copy (`tcp.integration.test.ts:244`) | | **Slot-holding by trickle** | one byte every few seconds to hold a connection slot | 15 s handshake deadline that traffic does not reset (`tcp.integration.test.ts:317`) | | **Half-frame parking** | send `[frame][start of next]` and stop | **825 ms with a 250 ms deadline, 3.3x past it** → deadline re-armed for the remainder (`tcp.ts:568`, `tcp.integration.test.ts:390`) | | **Slow-reader memory exhaustion** | accept and never read | dropped at 4 MiB queued, before four times the bound is offered (`network-faults.integration.test.ts:538`) | | **Gossip id padding (tx)** | add a field the decoder ignores, or respell a field that coerces | **70 spellings → 70 dedup keys, 61 relays, 61 cache entries** → 1 key, 1 delivery, 1 cache entry (`protocol.ts:317`, `network-amplification.integration.test.ts:460`, `:478`) | | **Gossip id padding (block)** | pad the largest payload the wire carries | **1,001 payloads → 1,001 keys** → 1 key; **25 deliveries and 25 relays of one block** → 1 (`protocol.ts:323`, `network-amplification.integration.test.ts:517`, `:533`) | | **Unknown-field / unknown-kind amplification** | `{block: X, z: "1"}` | refused at the decoder by `RUNE_FIELDS` / `RUNE_KINDS` (`protocol.ts:526`) | | **TTL inflation** | set the hop byte to 255 | clamped to 8 on ingress *and* on egress (`network-amplification.integration.test.ts:157`) | | **Direct-protocol laundering** | build a `head` payload with a hop budget so it takes the flood path | routing decided by protocol, not by TTL (`starw-node.ts:1275-1281`, `network-amplification.integration.test.ts:199`) | | **Ghost receipt amplification** | 32 KB of arbitrary text as a "receipt", relayed to six peers each | three SHA-256-shaped fields required, and the protocol is not relayed at all (`starw-node.ts:1629`, `network-amplification.integration.test.ts:222`, `:241`) | | **Handshake-oracle reset by reconnect** | one precomputed challenge, replayed: connect, one frame, read the answer, close, reconnect | **2,536 expensive answers in 20.0 s (126.7/s) from 8 sockets on one address, `rejected` empty** → **71** (3.5/s), and `burst + rate × seconds` at every duration (`allowHandshake` `ratatoskr.ts:1005`; `tcp.integration.test.ts` › "bounds expensive answers per address over TIME"). The held-socket shape is bounded separately and was already sound: 64 answers over 20 s from 128 held sockets, before and after | | **Rate-limit reset by reconnect** | spend the burst, drop the socket, reconnect from a new port | bucket keyed by address and kept past the disconnect (`ratatoskr.ts:550`, `network-amplification.integration.test.ts:300`; over a real socket `tcp.integration.test.ts:436`) | | **Envelope credit hoarding** | hold twelve sockets, let the envelope fill, drop eleven | `detachBucket` clamps to one connection's entitlement (`detachBucket` `ratatoskr.ts:1282`, `network-amplification.integration.test.ts:362`) | | **Bucket-table eviction of one's own penalty** | arrive from enough addresses to push your throttled bucket out | the **fullest** bucket is evicted, ranked on fraction spent (`evictFullestBucket` `ratatoskr.ts:1585`) | | **Byte flooding inside the frame limit** | 64 maximal frames per second = 32 MB/s | byte budget added: 4 MiB/s, 8 MiB burst (`ratatoskr.ts:120`, `network-amplification.integration.test.ts:274`) | | **Unauthenticated decode burn** | hold sockets open and stream well-formed plaintext `block` frames that are not handshakes | **42,080 frames fully decoded in 10.0 s from 8 sockets on one address — 2.758 GB, 275.8 MB/s, `rejected: {unauthenticated: 42080}` and no rate-limit entry at all** → **143 (0.009 GB)** against 10.153 GB offered, bounded by `byteBurst + byteRate × seconds` (`allowPresession` `ratatoskr.ts:1058`; `tcp.integration.test.ts` › "bounds unauthenticated plaintext by BYTES over time"). The maximal-frame shape is bounded elsewhere and more tightly: two maximal frames do not fit in `MAX_REASSEMBLY_BYTES`, so it self-limits to 34.4 MB/s across 139,984 reconnects | | **Node-halt by malformed PEX frame** | `{ records: [null] }` | shape check before any field read, at three layers (`praeco.ts:196`, `starw-node.ts:1506`, `tcp.ts:582`); over a real socket `network-faults.integration.test.ts:264` | | **Eclipse by score pumping** | re-announce to farm reputation | **ten announcements took a sybil from 0.5 to 1.0** → score moves on interaction only (`praeco.ts:329`, `praeco.integration.test.ts:241`) | | **Eclipse by PEX capture** | fill the directory from one machine, then be the whole sample | round-robin over address groups: **16 sybils on one /16 + 2 honest peers → `sample(4)` returns both honest and exactly 2 sybils** (`praeco.integration.test.ts:275`) | | **Eviction-driven eclipse** | one keypair at a time, evicting an honest peer per sybil | eviction takes from the biggest address group: **16 further sybils, the honest record survives all of them** (`praeco.integration.test.ts:293`) | | **Eclipse by inbound flood** | dial in faster than honest peers until every session is yours, then show the node your chain | **48 authenticated sessions and 32 silent sockets against a pulsar that had dialled 8 peers: all 8 outbound sessions still held, inbound at its cap of 16, the handshaking table within its cap** → outbound reservation, inbound eviction and a handshaking table of its own (`gastropnir.ts`, `eclipse-flood.integration.test.ts`) | | **Directory wipe by outage** | be unreachable for five dial rounds | **8 peers to 0** → quarantine keeps all 8 dialable (`praeco.ts:449`, `network-faults.integration.test.ts:339`) | | **Sync denial by silence** | accept requests, answer nothing, hold both parallel slots | **40 ticks, 80 timeouts, 0 requests to the good peer** → per-peer cooldown, backed off ×4, cleared only by answering (`verdandi.ts:126`) | | **Sync stall by divergence** | be on a different branch below the local head | **39 requests for [4..8], height never left 3, 195 "applied"** → progress measured by head movement, backward doubling search, bounded fault (`verdandi.ts:62`, `:232`) | | **Unsolicited block push** | send `blocks` to an idle node | refused unless a request is outstanding (`onBlocks` `verdandi.ts:1309`) | | **Honest-traffic starvation behind one NAT** | not an attack — this is the DoS mechanism misfiring | **3,107 of 4,992 frames refused (62.2%) on a 13-node mesh, nodes hearing as few as 42 of 72 transactions** → 0 refused, all 72 heard (`ratatoskr.ts:687`, `tcp.integration.test.ts:626`) | | **Application frames from an unauthenticated peer** | send a sealed or cleartext `tx` before the handshake | refused (`starw-node.ts:1168`, `:1035`; `network.integration.test.ts:425`) | | **Frame replay on an established link** | record and resend a sealed frame | counter must strictly increase (`bifrost.ts:522`) | | **Handshake replay** | replay a recorded response or confirm | nonce echo + 30 s window + session proof (`bifrost.ts:212`, `:215`, `:331`; `network.integration.test.ts:158`, `:169`) | | **KEM substitution by a relay** | swap the challenger's KEM key in leg 1 | the challenger's KEM key is inside the signed transcript (`bifrost.ts:133`); stolen-ciphertext case at `network.integration.test.ts:196` | | **Cross-chain / cross-genesis peering** | connect a node from another deployment | refused on chainId and genesis hash, checked before spending a signature (`starw-node.ts:1387-1391`; over a socket `tcp.integration.test.ts:508`) | | **Node-id squatting on a live connection** | connect and claim an established peer's id | the new socket loses (`tcp.ts:428`, `starw-node.ts:598`) | | **Node-id squatting while the node is away** | hold a connection under its id from before it returns | **140 s with the real node at 0 peers and its peer behind, through a four-node mesh at one connection per peer; no status field said so** → a session is known by its key and by a name only that key may have; the squatter keeps a session under its own id and the node gets its name (`session-identity.ts`, `session-identity.integration.test.ts`) | | **Peer-cap bypass by pipelining** | send every challenge while `sessions` is 0, then every confirm | the cap is checked again where the session is created (`starw-node.ts:1453-1458`) | | **Relay of invalid payloads** | send a forged transaction, attestation, claim or block | nothing is relayed that did not validate (`starw-node.ts:1309-1310`); forged-claim and forged-attestation cases at `network.integration.test.ts:466`, `:632` | ### 11.2 Not survived, or not shown to be survived Everything in this section is a real surface. Where a number appears it is arithmetic over the code's own constants unless it says it was measured. **Two items are measured and the rest are not: item 1, over real sockets, in both the flood shapes it names; and item 15, over real TCP links through the real rate limiter. Nothing else in this section has a measurement in the tree.** Item 1 is here rather than in §11.1 because its residual is open, not because the bounds are unproven. Item 15 is here because the thing measured is a refusal. 1. **The handshake was an unauthenticated asymmetric-crypto oracle. Bounded in three ways, and the third was added on 2026-09-07 because the first measurement of the first two described a flood shape rather than the surface. One residual named, and now measured.** Leg 1 is unsigned. Answering it costs the responder an ML-KEM-768 encapsulation plus a hybrid ed25519 + ML-DSA-65 signature — the code puts that at about 5 ms (`starw-node.ts:1394-1404`). `crossBifrost` never verifies the challenge it is answering, so the attacker's whole cost is **one precomputed challenge, replayed**. The peer-limit check on the challenge leg was `sessions.size >= maxPeers`, which is 0 for every unauthenticated socket, so it gated nothing; `TcpTransport` had a total connection cap but no per-address cap, so one address could hold all 128 inbound slots. **The arithmetic, and the first measurement.** The arithmetic put one address's entitlement at `128 × 64 = 8,192` handshake frames/s and ~41 CPU-seconds offered per wall-second. The measurement overstated it: the node is single-core CPU-bound at the crypto long before that entitlement. A harness holding 128 sockets open against a Quasar victim over real TCP and flooding valid challenges answered **~191 expensive handshakes per second**, not 8,192 — and the denial of service was total anyway: all 128 inbound slots taken, the event loop stalled up to ~4.5 s at a stretch, an honest peer's 200 ms sync tick fired 4.4 s late. **The first two levers (shipped 2026-09-06), and exactly what each bounds:** - a **per-remote-address inbound connection cap** in `TcpTransport` (`maxConnectionsPerAddress`, default 64) — bounds the **share of the inbound table** one address may hold. Chosen well above the twelve peers a 13-node loopback testnet holds on one address. **Configurable since 2026-10-26**, because on Asgard one office address running hundreds of seats filled all 64 on every VPS seat port and the next node from it was refused without a word: `strblk node --max-connections-per-address N`, or `HestiaOptions.maxConnectionsPerAddress`. A value below 1 is refused at start. A dialler over the cap now receives the refusal frame of §3.2 instead of a dead connection; - a **newcomer reserve** at the top of the same table (`NEWCOMER_RESERVE_FRACTION`, a quarter of `maxConnections`; `TcpTransportOptions.newcomerReserve`, 0 turns it off), since 2026-10-26. The per-address cap alone did not keep a seed open: 64 is half a quasar's 128, so two crowded addresses fill the table and every stranger after them is refused as a full table. MEASURED on Asgard that day, and already happening: the DGX seats on 47001-47003 each held 128 of 128 — 64 from the Mac's address, 63-64 from the workstation's, one loopback — so no other address could connect to them. Every VPS seat port held 64 inbound sockets from one home NAT that has two public addresses, and on four ports the 64 moved from one address to the other within half an hour. Once the table reaches `maxConnections - reserve`, an address that already holds a connection is refused with `remaining slots are reserved for new addresses`; an address holding none is admitted up to the full table. Not a Sybil defence — an attacker with many addresses is a new address each time — but a bound on how much of the table repeat addresses can take; - a **per-socket in-flight handshake guard** in `StarwNode`: the challenge leg counts `sessions.size + pendingConfirms.size` against `maxPeers` (since 2026-11-15 against the INBOUND cap, `maxPeers - OUTBOUND_RESERVE`, with eviction rather than refusal once a stranger has proved its identity — §6.7), and a second challenge on a socket whose challenge was already answered is refused as `handshake-inflight` without touching the cryptography — bounds **concurrent** pre-authentication crypto, and gives **one expensive answer per socket**. **What was recorded, and what was wrong with it.** The record said *"64 expensive handshakes total over 20 s (~3/s), flat regardless of flood duration"*. Re-measured 2026-09-07 on `3ee6f38`: against **128 held sockets** that figure is **exactly right** — 64 answers in 20.0 s, 3.2/s. It is right because 64 sockets is the per-address cap and each socket is worth one answer. It is a measurement of the per-socket guard, and it was written down as a property of the handshake. **Both guards key on live state the attacker releases by hanging up:** `forget` deletes the `pendingConfirms` entry on close, and `connectionsFromAddress` walks the live peer table. Gleipnir did not cover the gap either — its address envelope is *scaled by the number of connections the address currently holds*, which is right for twelve honest peers behind one NAT and exactly backwards here, because pre-authentication connections are free to open. **The flood shape that was not measured, measured.** One loopback address, **eight** sockets, each cycling connect → one replayed challenge → read the answer → close → reconnect: | shape | 5 s | 20 s | 60 s | `stats().rejected` | |---|---|---|---|---| | 128 sockets held open | — | **64** (3.2/s) | — | `handshake-inflight`, `rate-limited` | | 8 sockets, connect/close | **680** (134.9/s) | **2,536–3,224** (126.7–161.1/s) | — | **empty** | Forty times the recorded figure, **rising with the length of the flood rather than flat**, and not one Gleipnir refusal in the whole run. Cost to the attacker per ~5 ms of the node's only core: one TCP connect and one frame it built once. **The before figure is a range, and it has to be.** It is CPU-bound, so it is a property of the machine as much as of the code: five 20-second runs on one developer laptop gave **126.7, 161.1, 167.3 and 168.6 answers per second** depending on what else the machine was doing. Any single number here is that laptop on that afternoon. The after figure is not a range — 71 answers in 20.0 s in every run — because it is bounded by a token bucket rather than by a processor, and that difference is the fix. **The third lever (shipped 2026-09-07): a budget over TIME, per address.** `RatatoskrRouter.allowHandshake` (`ratatoskr.ts:1005`) is a second Gleipnir cost class, charged in `handleHandshake` after the free chain/genesis checks and before `crossBifrost`. It is keyed by the sender's **address alone**, at a **fixed** allowance — not scaled by live connections, which is what made the envelope buyable with TCP connects — and it is **not released when the socket closes**: `forgetPeer` detaches it and the sweep forgets it only once it has refilled. `GLEIPNIR_HANDSHAKE_BURST = 32`, `GLEIPNIR_HANDSHAKE_PER_SECOND = 2`. Expensive answers are now counted where they are spent, as `stats().delivered['/sourceless/handshake/1.0.0']`, because the quantity every claim on this page is about had no counter and could only be measured from the attacker's side of the wire — which under-counts exactly when the node is most overloaded. **Measured after the third lever**, same machine, same harness, node-side counter: | shape | before | after | worst event-loop lag | |---|---|---|---| | 8 sockets, connect/close, 5 s | 680 (134.9/s) | **41** (8.2/s) | 101 ms → 48 ms | | 8 sockets, connect/close, 20 s | 2,536–3,224 (126.7–161.1/s) | **71** (3.5/s), every run | 120 ms → 44 ms | | 8 sockets, connect/close, 60 s | — | **151** (2.5/s) | 73 ms | | 128 sockets held, 20 s | 64 (3.2/s) | **62** (3.1/s) | 373 ms → 214 ms | | 8 sockets held, 5 s | 8 (1.6/s) | **8** (1.6/s) | 42 ms → 61 ms | The after column is `burst + rate × seconds` to within two tokens at every duration, which is the point: **the total is now flat in the flood and grows only with the clock**, converging on 2/s however long the attack runs. The held-socket shape is unchanged, because it was already bounded — by a different mechanism, for a different reason. **State the shape or do not state the number.** "64 expensive answers over 20 s" is true of 128 held sockets and false by a factor of forty of the same flood reconnecting. Both numbers above name the shape they were measured against. **This is a wait, not a ban.** A per-address budget on a network where a whole deployment shares one address partitions that network if a spent budget is a verdict, so nothing here records a strike, blacklists an address or disconnects the socket: the bucket refills, and the peer refused a moment ago is answered on a later attempt. Dropping the socket would also have turned a full bucket into a dial failure on the honest side, and `hestia.ts` grows its dial backoff on those. Measured against the honest case: on `npm run testnet` — thirteen nodes, one loopback address, therefore one bucket — the busiest node answered **12** handshakes for the whole run against a burst of 32, and **no node reported a single `handshake-budget` refusal**. Regression: `tests/integration/tcp.integration.test.ts` › "the handshake is not an unauthenticated crypto oracle" — three tests, one per property (the time bound under connect/close cycles, the refused peer getting in on a later attempt, and thirteen simultaneous dials from one address answered on the shipped defaults). The first two fail without the third lever: 232 answers against a bound of 10. **The fourth lever (shipped 2026-09-07): a budget on the DECODE, per address, per byte.** The three levers above bound the *crypto*. They did not bound the *decode*, and on the pre-session plaintext path the limiter was not merely applied late — it was never reached. A plaintext frame naming any protocol but `handshake` was JSON-parsed, canonically re-serialised, SHA-256'd for its message id, shape-checked and dedup-keyed by `decodeRune`, and only then counted as `unauthenticated`, with **nothing charged to any bucket at all**. Measured 2026-09-07 on this branch, eight sockets from one loopback address for 10.0 s, counted by the node's own `stats().rejected.unauthenticated` and not by what the attacker read back: | frame size | frames decoded | bytes decoded | rate | `rejected` | |---|---|---|---|---| | 65,542 B | 42,080 | 2.758 GB | **275.8 MB/s** | `{unauthenticated: 42080}` | | 262,006 B | 7,973 | 2.089 GB | **208.5 MB/s** | `{unauthenticated: 7973}` | | 523,241 B (maximal) | 792 | 0.414 GB | 34.4 MB/s | `{unauthenticated: 792}` | No rate-limit entry of any kind in any of them. **State the shape or do not state the number** applies here too: the *maximal* frame is a worse attack rather than a better one, because two maximal frames do not fit inside `MAX_REASSEMBLY_BYTES` together, so the transport drops the socket after each one and the flood spends itself on 139,984 reconnects. The sustained burn is the 64–256 KB shape. **An earlier measurement of this hole disagreed and is recorded rather than overwritten.** It reported *2,598 maximal 522,813-byte frames decoded in 10.0 s — 1.27 GB, 129.5 MB/s*. That shape did not reproduce here: on this machine back-to-back maximal frames trip `MAX_REASSEMBLY_BYTES` and the socket is dropped after each one, which caps the same flood at 34.4 MB/s. The two runs agree on everything that matters — the decode is unbudgeted, the counter shows only `unauthenticated`, and no rate limit fires — and disagree on which frame size is worst, which is a difference between machines and harnesses, not between claims. The numbers below are this machine, this harness, 2026-09-07. Driven from a separate process so the CPU number is the node's alone, the 65,542 B shape cost the node **1.00 core for 2.116 GB in 10.0 s — 4.96 ns per byte**. `RatatoskrRouter.allowPresession` (`ratatoskr.ts:1058`) is a **third Gleipnir cost class**, charged in `StarwNode.receive` on the **raw wire bytes, before `decodeRune`**, for every frame from a peer that does not yet hold a session. Per byte and not per frame, for the same reason `GLEIPNIR_BYTES_PER_SECOND` exists: the two shapes above cost the sender one token each and cost the node four times apart. Keyed by the **address alone at a fixed allowance**, and **not released when the socket closes** — the same two properties that make `allowHandshake` survive an attacker who hangs up. `GLEIPNIR_PRESESSION_BYTES_PER_SECOND = 512 KiB`, `GLEIPNIR_PRESESSION_BYTE_BURST = 4 MiB`, `GLEIPNIR_PRESESSION_PER_SECOND = 32`, `GLEIPNIR_PRESESSION_BURST = 128`. **Where the numbers come from.** 512 KiB/s is 0.21% of one core at the measured 240 MB/s mean decode rate. The honest floor is the Bifrost legs, measured rather than guessed: challenge 6,851 B, response 16,261 B, confirm 14,047 B, so a responder takes 20.9 KB per handshake and a dialer 16.3 KB. With `allowHandshake` already capping answered handshakes at 2/s and `hestia.ts` opening at most 4 dials per 5 s turn, the largest honest sustained pre-session volume this code can produce at one node is about 60 KB/s — eight times under the budget. The 4 MiB burst is nine times the **446 KB** a thirteen-node loopback deployment offers in one moment (12 × 37,159 B of legs). The frame dimension is deliberately looser than the handshake class it sits in front of, so it can never be what refuses a peer `allowHandshake` would answer. **Measured after the fourth lever**, same machine, same harness, node-side counter: | shape (8 sockets, 10.0 s, one address) | decoded before | decoded after | offered after | |---|---|---|---| | 65,542 B frames | 42,080 (2.758 GB) | **143 (0.009 GB)** | 10.153 GB | | 262,006 B frames | 7,973 (2.089 GB) | **36 (0.009 GB)** | 12.403 GB | | 523,241 B frames | 792 (0.414 GB) | **19 (0.010 GB)** | 0.455 GB | The after column is `byteBurst + byteRate × seconds` in every row — 9.1 MB against a 4 MiB burst and 512 KiB/s over ten seconds — which is the property: **flat in the flood, growing only with the clock**, whatever the frame size. **This is a wait, not a ban**, and it does not drop the socket: `hestia.ts` grows its dial backoff on dial failures, so a budget that hung up would turn a full bucket into a partition. Measured against the honest case: on `npm run testnet` — thirteen nodes, one loopback address, therefore one bucket — **no node reported a single `presession-budget` refusal**, and no node reported `rate-limited` or `handshake-budget` either; the whole `rejected` map across all thirteen was `duplicate` and `tx-attempts-exhausted`. Regression: `tests/integration/tcp.integration.test.ts` — four tests, one per property (the byte bound under a held flood, the bound surviving connect/close cycles, the refused peer getting in on a later attempt, and thirteen **full three-leg handshakes** from one address on the shipped defaults). **Residual, not survived, and measured.** The budget removes the decode. It does not remove the *receive*. Driven from a separate process, the 65,542 B flood after the fix costs the node **1.19 cores for 10.868 GB offered in 10.0 s — 1.09 ns per byte**, against 4.96 ns per byte before. So the per-byte cost is down 4.6× and the bandwidth an attacker must sustain to spend one of this node's cores is up from **202 MB/s to 913 MB/s**, but it is not gone: what remains is the socket read and the `RuneReassembler` copy, which happen before any application-layer charge can be reached. The frame length *is* knowable earlier — the 4-byte prefix is read by `RuneReassembler.next()`, and a declared length above `MAX_FRAME_BYTES` is already refused from the header alone without allocating — but charging there would save only the reassembly copy, not the read, and the transport does not know which peers hold sessions. Removing the rest needs TCP backpressure: `socket.pause()` on a peer that is over its pre-session budget, resumed when the bucket refills, which is a wait rather than a drop and therefore compatible with everything above. That is a transport change with its own failure modes (the frame deadline and the idle timeout both have to understand a paused socket) and it has not been attempted here. 2. **No forward secrecy.** §4.2. The KEM keypair is long-lived and on disk; compromise of a node's KEM secret retroactively decrypts every session that node dialled. There is no ephemeral key and no rekey. `docs/HARDENING_AND_PERFORMANCE.md:27` asked for "a rekey after N frames or T seconds"; the sealing that shipped has neither — the counter runs to 2^53−1 and the session then ends (`starw-node.ts:1140`). 3. **Bare ML-KEM-768 for confidentiality: fixed 2026-09-12.** §4.2. `slnn-handshake-2.0.0` moved the session key to ML-KEM-768 + X25519, so a break of either one alone no longer opens a link. What remains of this exposure is item 2: there is no forward secrecy. 4. **The handshake is in the clear.** A passive observer learns the full peer graph, both node identities, all three public keys per node, the chain id, the genesis hash and both head checkpoint hashes, before anything is encrypted. There is no traffic analysis resistance and none is claimed. 5. **The Pulsar megabyte does not cover the transport, and the process is ninety times it.** §10.3. Reassembly buffers alone reach 1,572,864 bytes retained on a 24-connection Pulsar by arithmetic and 12,583,008 concurrently held, and write queues 100,663,296. Those three are still **unmeasured** — nobody has saturated a Pulsar and read its memory. What *is* measured, as of 2026-09-12, is the idle case: **94,224,384 bytes resident** for a shipped `strblk node --class pulsar` whose own retention report said 0. Nothing in this repository measures or bounds that, and the node's own share of it is unattributed. 6. **Nothing enforces the retention budget on the running path.** §10.2. `withinBudget` is a report. Three documents said otherwise and two are now corrected: `docs/WALLET_EXPLORER_HOSTLESS.md` and the note on every `strblk status` footprint (`src/hostless/orrery.ts`), the latter pinned by a regression test. `docs/SLNN_PROTOCOL.md` §5 was already correct. Still open as a *code* matter rather than a documentation one: the refusing path exists, is tested, and is reached by nothing — `setBytes`, `wouldFit` and `urdCheckpointBytes` have no production caller, which is either a decision to make explicit or code to delete. 7. **No NAT traversal, no hole punching, no relay.** A node behind a NAT with no port forward can dial out and be dialled by nobody; `hestia.ts:74-78` handles this honestly by advertising **no endpoint at all** when the node cannot know its own address, rather than announcing one that does not answer. Test: `tests/integration/slnn-mesh.integration.test.ts:236`. **Public seeds: the mechanism ships, the list is empty.** A node behind a NAT can still join if it has somewhere public to dial OUT to. `PUBLIC_SEED_PEERS` in `src/core/snotra.ts` is the ONE place each realm's public `host:port` seeds are listed (DNS names preferred, e.g. `seed1.example.org:47004`); `strblk node --network ` dials them when `--peers` is omitted, and `--peers` always overrides them. Development and Midgard publish none, and a node started on one of them with no `--peers` is told at start that it will dial nobody. **Asgard publishes seven, from one source of truth (owner decision, 2026-10-26).** The built-in list is `asgard.xplstr.org:47001`-`47007`, which is exactly `deploy/get/asgard-seeds.txt`: the list `scripts/himinbjorg.mjs` derives from `launch/asgard-public-hosts.json` (the machines a stranger can dial) and `launch/manifests/asgard-vps.tsv` (the p2p port of each seat), and that every installer passes as `--peers`. So a bare `strblk node --network asgard` now dials the same hosts an installed node does. The copy in `snotra.ts` cannot drift: `tests/integration/public-seeds.integration.test.ts` re-derives the list from those two files and fails on any difference, and himinbjorg refuses to publish on any difference. All seven are on ONE machine, the VPS. Lose it and a fresh node has nothing to dial until a second public host is declared. That cost is the same one the download page already states. How the owner fills it: name the hosts; give each a public DNS name, the realm's P2P port open inbound, and a node started with `--advertise `; check from OUTSIDE that network that `strblk node --network --peers :` reports a peer; add the entries to `PUBLIC_SEED_PEERS` (loopback, RFC1918, link-local and malformed entries are refused, at build and every time a node reads the list); update the "has no seeds today" observation in `tests/integration/snotra.integration.test.ts`; release. **No genesis digest moves:** the register is not an input to any genesis hash (dev and Midgard are built by `core/genesis.ts` and `core/midgard.ts`, which do not import it; Asgard's is the hash of its genesis file), and `tests/integration/public-seeds.integration.test.ts` pins all three digests and that separation. 8. **`ws`, `wss` and `mesh` transports do not exist.** `TransportKind` names them (`TransportKind` `protocol.ts:583`) and `parseStrAddress` accepts them; only `tcp` and `memory` have implementations. A `str://` address naming one of the other three parses and then cannot be dialled. 9. **128-bit dedup keys.** §3.3. Birthday-bound at 2^64; a collision suppresses a legitimate message. Unmeasured, and probably not worth acting on, but it is a property a reimplementer should preserve rather than rediscover. 10. **The gossip mempool is a second mempool, and eviction is a griefing surface.** `MAX_GOSSIP_MEMPOOL = 4_096` (`starw-node.ts:116`) with oldest-first eviction (`starw-node.ts:1538-1548`). A peer that fills it with 4,096 well-formed, correctly signed, never-sealable transactions evicts honest ones. `MAX_TX_ATTEMPTS = 3` and the drop journal (`starw-node.ts:190`, `:199`) bound how long any one of them survives, but the eviction itself is unmeasured under adversarial load. 11. **Verdandi's serve budget is per-peer, not global.** `VERDANDI_SERVE_BYTES_PER_SECOND = 2 MiB` per peer (`verdandi.ts:116`). A Supernova at its 512-peer cap can be asked for 1 GiB/s of block bodies within every per-peer limit. Gleipnir's inbound bucket bounds the *requests* (64/s per peer), not the upload they cause. Unmeasured. 12. **`onWant` walks the local chain synchronously.** Up to 32 blocks per request via `serializedBlockAt`, and on Hestia that indexes an in-memory array (`hestia.ts:448-450`). The span bound is checked first (`verdandi.ts:614`), so the work is bounded per request; the aggregate under many peers is unmeasured. 13. **The `ghost` protocol is accepted but unverifiable.** By design, and it is not relayed — but a 32 KB payload cap on a protocol whose contents nothing can check is 32 KB a peer can spend on this node's decode path at 64 frames a second. It is charged bytes, so Gleipnir binds it; the payload limit is nevertheless eight times the largest receipt the ledger produces. 14. **The Aether transport implements none of the optional hardening.** `AetherNetwork` (`AetherNetwork` `starw-node.ts:4287`) provides `send` / `onReceive` / `disconnect` and no `identify`, `noteAuthenticated`, `rateKeyFor` or `onPeerGone`. It is keyed by node id, so it does not need them — but a test that passes over Aether has exercised none of the socket-transport hardening. Read every Aether-only result with that in mind. 15. **Attestation collection does not fit the 1313-seat genesis roll, and the refusal is measured rather than inferred.** Not an attack — this is the rate limiter firing on the honest case, the same shape of defect as the NAT starvation in §11.1, found before it shipped rather than after. Measured by `scripts/attest-measure.mjs` on **one machine, one process, one clock**, against the real `StarwNode`, the real `RatatoskrRouter` and real TCP sockets. Authority: `docs/design/QUORUM_FINALITY.md` §1.2–§1.3. **It is not the byte budget.** One attestation is 272–285 bytes of JSON — the spread is the length of the seat's STR domain — and one `attest` frame encodes to **450 bytes**, 2.7% of the topic's 16,384-byte cap (`PROTOCOL_LIMITS[PROTOCOLS.attest]`, `protocol.ts:103`). All 1313 signatures on one link is **590,850 bytes per block**, which over a slot is **4.70% of a peer's 4 MB/s** (`GLEIPNIR_BYTES_PER_SECOND` `ratatoskr.ts:323`). **It is the frame budget.** Gleipnir bounds how often a peer speaks as well as how much it says, and one seat's signature is one frame however small it is: **438 frames per second on one link against 64 sustained** (`ratatoskr.ts:359`). Experiment C put that through the real limiter rather than reasoning about it — one receiving node, the load spread across **six** real TCP links (Ratatoskr's default `fanout`), over **four consecutive slots**, four because one slot is paid out of the 128-frame burst and a burst proves nothing: | slot | offered | counted / threshold | quorum | |---|---|---|---| | 1 | 1313 | **143** / 876 | no | | 2 | 1313 | **792** / 876 | no | | 3 | 1313 | **789** / 876 | no | | 4 | 1313 | **816** / 876 | no | 5,264 frames read, **2,540 delivered, 2,712 rate-limited — 51.5% refused**. Receiver retention **465.5 KB**, against a Pulsar's *entire* 700 KB budget (`mnemosyne.ts:130`). **The deficit is structural and small, which is what makes it fatal: 219 frames per link per slot are needed and 192 refill.** Fourteen per cent short, every slot, forever — a shortfall that does not close by waiting. And this is the *generous* case: the six senders publish directly, so there is no relay amplification at all, against the **4.7×** measured in a real mesh (§10.4). **The ceiling, as two estimates put it until 2026-10-07**, when the live chain carried 751 to 772 signatures on a block and the figure was withdrawn (nothing was run at 230 seats). From the frame rate: 11.3 frames/peer/s at 40 seats, linear in seats, hits 64 frames/peer/s at **≈227 seats**. From the structural bound: 6 links × 192 frames refilled per slot = 1152, ÷ 4.7 amplification → **≈245 seats**. That gave an estimate of 230, for what arrives within a slot; the per-slot figure on real hardware is unmeasured. Nothing here was fixed by raising a limit, and that was deliberate: the limits are what §11.1 is about, and the bound to move is the number of attesting seats, which is a governance question `QUORUM_FINALITY.md` §7.1 escalates rather than answers. Until it moves, a 1313-seat deployment collects attestations that no node can count into a quorum, and the `attest` topic spends bandwidth for nothing at that scale. --- ## 12. Wire compatibility ### 12.1 What the wire version is, and what a bump costs `SLNN_WIRE_VERSION = 1` (`protocol.ts:23`). `decodeRune` throws on any other value, as its third act, before the protocol id is even read (`decodeRune` `protocol.ts:879`). **There is no frame-level version negotiation.** A node speaking version 2 and a node speaking version 1 cannot exchange a single frame — including a handshake frame, since the handshake travels as a Rune. A bump is a hard network partition between the two builds, not a rollout. The mechanism that *is* meant to carry change is the libp2p-style versioned protocol id (`protocol.ts:10-13`): `/sourceless/tx/1.0.0` can coexist with `/sourceless/tx/2.0.0` as two entries in `PROTOCOLS`, negotiated per stream through the handshake's `protocols` list. Use that. `SLNN_WIRE_VERSION` should only move if the **envelope** changes. ### 12.2 Breaking - **Any change to the envelope layout** — field order, widths, the position of the length prefix, the 16-byte message id. `decodeRune`'s offsets are hard-coded (`protocol.ts:452-476`) and the minimum-length check is the literal `27` (`decodeRune` `protocol.ts:879`). - **Any change to `canonicalStringify`.** `messageId` is a hash of the canonical form of the payload (`runeIdFor` `protocol.ts:654`) and `decodeRune` recomputes it (`protocol.ts:481`). Two builds that canonicalise differently reject each other's every frame. `canonicalStringify` is `JSON.stringify(normalize(value))` with byte-order key sorting (`canonicalStringify` `src/core/canonical.ts:6`); treat it as consensus-critical, because it is. - **Adding a field to a protocol.** `RUNE_FIELDS` refuses unknown top-level fields (`protocol.ts:391-395`), so a new field means old nodes reject every frame carrying it. This is the intended trade — the alternative is the amplifier of §3.4 — but it means field additions are protocol-version bumps, not additive changes. - **Adding a `kind`.** Same: `RUNE_KINDS` is checked at the decoder (`protocol.ts:388`). - **Raising a protocol's payload limit.** Old nodes refuse on the declared length (`protocol.ts:475`) before parsing. - **`BIFROST_VERSION`** (`bifrost.ts:44`), compared exactly on both verifying legs (`bifrost.ts:202`, `verifyBifrostSeal` `bifrost.ts:864`). Changing the transcript in `bifrostSigningPayload` (`bifrost.ts:570`) or `sealSigningPayload` (`bifrost.ts:787`) — field set, order, or the sort applied to `protocols` — changes what verifies and requires the bump. - **Moving to the hybrid KEM.** `kemPublicKeyHex` goes 1184 → 1216 bytes and `kemCipherTextHex` 1088 → 1120, both inside the signed transcript, so it is a handshake version bump rather than a silent swap (`aegis.ts:385-391`). - **`SEALED_MAGIC` / `SEALED_VERSION`** (`bifrost.ts:444-445`). `openFrame` returns `null` on a different version (`openFrame` `bifrost.ts:1124`), so a mismatch is not an error message — it is every frame silently failing, counted as `unsealed` (`starw-node.ts:1175`). Diagnose accordingly. - **The frame cipher's derivation strings** — `slnn-frame-key-v1`, `slnn-frame-nonce-v1` (`bifrost.ts:466-467`) — and the session key's domain, `slnn-session-key-v1` (`bifrost.ts:403`), and the session proof's, `slnn-session-proof-v1` (`sessionProof` `bifrost.ts:809`). - **`PRAECO_VERSION`** (`PRAECO_VERSION` `praeco.ts:52`), checked in `admit` and in `verifyPeerRecord` (`praeco.ts:269`, `:224`). It is inside the signed claim, so it is also a signature change. - **The `str://` grammar**, in the widening direction only for hosts (see §2); in the narrowing direction, any change breaks stored peer records. ### 12.3 Not breaking - **Adding a protocol id.** An old node refuses the frame as `unknown protocol` (`protocol.ts:466`) and counts it `malformed` (`starw-node.ts:1182`); the connection survives and every other protocol keeps flowing. This is exactly how `identity` shipped: `SLNN_WIRE_VERSION` unchanged, and `targetsFor` (`starw-node.ts:2792`) does not even spend a fanout slot on a peer that did not advertise it. Verified in a mixed mesh at `tests/integration/network.integration.test.ts:566`. - **The connection refusal frame (§3.2).** An old dialler that receives `SLRF` hands it to its node, which refuses it as `not an SLNN frame`, and then sees the listener close — the same end state as the silent destroy it replaces. A new dialler against an old listener sees the silent destroy, as before. Nothing about a session, a Rune or `SLNN_WIRE_VERSION` changes. - **Changing the dedup projection.** `dedupKey` is derived locally and never sent (`protocol.ts:248-256`). Two nodes with different projections still agree on every frame; they just deduplicate differently. Stated explicitly at `protocol.ts:275-279`. - **Changing any Gleipnir, Verdandi, Praeco or Mnemosyne bound.** All local policy. Two nodes with different `fanout`, `maxSpan`, `seenCacheSize` or class budgets interoperate. **Gleipnir's three cost classes are all in this category**, including the two added on 2026-09-07: a node with a wider or narrower pre-session budget speaks the same wire to a node without one. It refuses more or less of what it is offered, which is a policy difference and not a protocol difference — the sender is never told a budget exists, and the refusal is a dropped frame, not a message. - **Giving `attest` a publisher.** Not a wire change: `PROTOCOLS.attest` (`protocol.ts:107`), its 16,384-byte limit (`protocol.ts:103`), its `RUNE_FIELDS` and `RUNE_KINDS` entries (`protocol.ts:150`, `:162`) and its `dedupContentOf` projection (`protocol.ts:350-355`) all existed before anything sent one. A build without the publisher still decodes, verifies and relays what a build with it emits. **One caution, which is a consequence rather than a break.** Because the collected set is bounded by a *local* Gleipnir bound (§11.2 item 15), two nodes with different frame budgets offered the same attestation traffic will collect **different sets**. That is harmless while nothing in consensus reads the set — today nothing does. It stops being harmless the moment a header commits to it, which is what `docs/design/QUORUM_FINALITY.md` proposes; at that point a local policy knob has become consensus-critical and belongs in §12.2 instead. Said here so the move is noticed when it happens rather than after. - **Changing the relay policy** (`DIRECT_PROTOCOLS`, `NON_RELAYED_PROTOCOLS`). Local. - **Adding a `TransportKind`**, as long as `parseStrAddress` still accepts the old ones. - **Lowering a protocol's payload limit** — old nodes will still accept what you send; you will refuse frames they are entitled to build, which is a compatibility loss in one direction only. ### 12.4 The checklist for a wire change 1. Does it change the envelope, `canonicalStringify`, or anything inside a signed transcript? If yes, it is a version bump and a coordinated cutover, because there is no negotiation. 2. Does it add a field or a kind? Add it to `RUNE_FIELDS` / `RUNE_KINDS` **and** treat it as a new protocol version id. 3. Does it add a flooded protocol? Add a projection to `dedupContentOf` (`protocol.ts:719`), or the raw payload becomes the dedup key and you have rebuilt the 1,001-key block amplifier. 4. Does it add a decoder? There must be exactly one per object, in `protocol.ts`, reachable from both the handler and the dedup projection. Two parsers for one object is how one of them ends up looser, and the looser one becomes the way in. 5. Can the largest frame it can build still be sealed under `MAX_FRAME_BYTES`? Check against `MAX_FRAME_BYTES - SEALING_HEADROOM_BYTES`, not against `MAX_FRAME_BYTES`. --- ## 13. Contradictions with other documents Named rather than silently corrected. Governance decides which source moves. **Update 2026-09-06.** The two documents below have now been corrected against the code, on instruction, because the code is ground truth and these were plainly stale rather than a live disagreement to escalate. `docs/SLNN_PROTOCOL.md` §2/§5/§8 and its status line, and `docs/HARDENING_AND_PERFORMANCE.md` S1/S5 and the "Now" list, were edited. The findings are kept here as the record of what was wrong and why. **Update 2026-09-12.** Three more, same reasoning. `docs/SLNN_PROTOCOL.md` §5 now says which of four quantities "under 1 MB" is about and records the measured resident set; `docs/WALLET_EXPLORER_HOSTLESS.md` said the Pulsar budget was "enforced over RAM" and now says observed; and `src/hostless/orrery.ts` is corrected in the code, with a test. Two unconditional renderings of the claim survive in documents this pass could not touch and are listed at the end of §10.3: **`docs/ARCHITECTURE.md:53`** (`Pulsar (<1MB)`) and **`docs/NAMING.md:44`** (`compact node, under 1 MB`). Both are the first thing a reader meets and both read as a statement about a process. Escalated rather than edited from here. **`docs/SLNN_PROTOCOL.md`** — dated 2026-08-29, status line "implemented and tested over an in-memory transport; no socket transport yet". Five statements in it were false against the current code (now corrected in that document): | Statement | Where | Code | |---|---|---| | "no socket transport yet" | status line, §8 | `src/network/tcp.ts` exists and is exercised over real sockets (`tests/integration/tcp.integration.test.ts`) | | "The session key is derived but not yet used to encrypt frames" | §8 | `sealFrame` / `openFrame` (`bifrost.ts:478`, `:466`), and every application frame goes through `StarwNode.deliver` (`starw-node.ts:2844`) | | "No block sync protocol… requesting and streaming a range of blocks is not implemented" | §8 | `src/network/verdandi.ts`, 987 lines of it | | protocol table omits `/sourceless/identity/1.0.0`, and gives `sync` a 64 KB cap | §2 | `PROTOCOLS.identity` (`protocol.ts:64`); `sync` is 523,235 (`protocol.ts:107`) | | "`RetentionAccount` … *refuses the write*" | §5 | renamed `MnemosyneAccount`, and every production caller in `src/network/` uses `observe*`, which never refuses (§10.2) | Its §6 also predates the byte budget and the shared-address envelope entirely — it describes "per-peer token buckets" and nothing else, which is one of Gleipnir's three cost classes and the one an attacker never reaches (§5.5) — and its §3 does not mention `MAX_RUNE_TTL`. Not corrected here: that section describes a mechanism whose shape has changed twice since it was written, and rewriting it is a rewrite rather than a fix. **`docs/design/QUORUM_FINALITY.md`** is *not* on this list, and the distinction matters. It is a design document that opens by saying nothing in it is built, and then immediately excepts its own §1 and §2, which describe the collection path that shipped. That is a document being precise about which of its halves is a claim about the code, and it is the authority this volume cites for §10.4 and §11.2 item 15 rather than a source that disagrees with the tree. **`docs/HARDENING_AND_PERFORMANCE.md`** — two items were done and still listed as open (now marked in that document): - **S1 "Encrypt frames with the session key `CRITICAL`"** (`:36`) — done, except for the rekey it asks for, which does not exist (§11.2 item 2). - **S5 "Eclipse resistance in Praeco `HIGH`"** (`:75`) — its fix reads "bucket peers by address prefix and require selection across buckets", which is `addressGroupOf` + the round-robin `sample` (§6.4). Two further clauses of that fix are **not** done: "reserve a fraction of slots for randomly chosen peers regardless of score", and "make the rendezvous a required fraction of the peer set rather than a preference" — `seedSet` (`praeco.ts:767`) still prefers rendezvous rather than requiring it. - Its "Now" list (`:198-200`) puts socket transports and frame encryption ahead of everything; both have shipped. **`src/hostless/orrery.ts`** described `retention.withinBudget` as "the enforced one", and its footprint note — which every `strblk status` prints — opened with "the enforced retention budget". `mnemosyne.ts:258-272` explains why the network path cannot enforce and therefore observes, and the network path is the only writer, so both were wrong. **Corrected 2026-09-12**: the note now says *observed, not enforced*, names the structural caps that do the holding, and says that neither figure beside it is the process's memory. A regression test asserts the wording against the call sites that justify it — it failed on the old string and passes on the new one (`tests/integration/orrery.integration.test.ts`). `docs/WALLET_EXPLORER_HOSTLESS.md` carried the same error and is corrected with it. **The task framing this document was written against** ("Protocol done over the Aether in-memory transport. Socket transports and frame encryption with the session key are the next steps and block real deployment") describes the same superseded state as `SLNN_PROTOCOL.md`. Both have shipped. What still blocks deployment from this layer is §11.2 items 1 (its residual), 2, 3 and 15 — the last of which did not exist when that framing was written, because the topic it is about had no publisher. --- ## 14. Quick reference — every constant Three modules were absent from this list until 2026-09-12 and have sections of their own after it: **§15 Arecibo**, **§16 Roche**, **§17 Sleipnir**. They are numbered after the reference rather than beside the components they belong with because several documents outside this volume cite these section numbers, and renumbering would break citations in files this pass may not touch. ``` protocol.ts SLNN_MAGIC "SLNN" SLNN_WIRE_VERSION 1 MAX_FRAME_BYTES 524,288 SEALED_FRAME_OVERHEAD_BYTES 29 SEALING_HEADROOM_BYTES 1,053 MAX_RUNE_TTL 8 (encodeRune default 4) PROTOCOL_LIMITS handshake 16,384 · praeco 131,072 · tx 65,536 · identity 4,096 arecibo 131,072 · roche 360,448 · ghost 32,768 · block 523,235 attest 16,384 · sync 523,235 · ping 1,024 (eleven entries, and eleven is the whole of PROTOCOL_LIMITS. `arecibo` and `roche` were missing from this block until 2026-09-12 — see the note under the header. Measured frames: eight Arecibo offers 95,540 bytes, one Roche chunk with a maximal Merkle path 350,916.) bifrost.ts BIFROST_VERSION "slnn-handshake-3.0.0" BIFROST_MAX_AGE_MS 30,000 nonce size 32 bytes, both legs SEALED_MAGIC / SEALED_VERSION "SLNS" / 1 SEALED_HEADER_BYTES 13 (4 magic + 1 version + 8 counter) GCM_TAG_BYTES 16 GCM nonce 12 bytes = 4-byte per-direction prefix + 8-byte counter SEALED_MAX_COUNTER 2^53 − 1 ratatoskr.ts — cost class 1, traffic (peer bucket AND address envelope) seenCacheSize (default) 4,096 (class: pulsar 512 / quasar 4,096 / super 8,192) seenTtlMs 600,000 perPeerRatePerSecond / burst 64 / 128 GLEIPNIR_BYTES_PER_SECOND 4,194,304 (:120) GLEIPNIR_BYTE_BURST 8,388,608 (:123) GLEIPNIR_MAX_SHARED_PEERS 64 (:132; StarwNode passes policy.maxPeers) GLEIPNIR_MAX_BUCKETS 4,096 (:142; StarwNode passes maxPeers × 8) fanout 6 ratatoskr.ts — cost class 2, handshake (address alone, fixed allowance) GLEIPNIR_HANDSHAKE_PER_SECOND 2 (:168) GLEIPNIR_HANDSHAKE_BURST 32 (:182) HANDSHAKE_BUCKET_PREFIX U+0000 + "handshake:" (:274) ratatoskr.ts — cost class 3, pre-session (address alone, fixed allowance, charged on raw wire bytes before decodeRune) GLEIPNIR_PRESESSION_BYTES_PER_SECOND 524,288 (512 KiB, :224) GLEIPNIR_PRESESSION_BYTE_BURST 4,194,304 (4 MiB, :244 — must exceed MAX_FRAME_BYTES) GLEIPNIR_PRESESSION_PER_SECOND 32 (:256) GLEIPNIR_PRESESSION_BURST 128 (:266) PRESESSION_BUCKET_PREFIX U+0000 + "presession:" (:277) praeco.ts PRAECO_VERSION "praeco-v1" DEFAULT_RECORD_TTL_MS 1,800,000 clockSkewMs (default) 120,000 maxPeers (default) 256 (StarwNode passes policy.maxDirectoryRecords) PRAECO_DIAL_FAILURES_BEFORE_QUARANTINE 5 PRAECO_QUARANTINE_SIZE 32 IPV4_GROUP_OCTETS / IPV6_GROUP_HEXTETS 2 / 2 score: enter 0.5 · dial success +0.1 (cap 1) · dial failure −0.2 (floor 0) verdandi.ts VERDANDI_VERSION "verdandi-1" VERDANDI_MAX_SPAN 64 VERDANDI_MAX_BLOCKS_PER_RESPONSE 32 VERDANDI_RESPONSE_ENVELOPE_BYTES 4,096 VERDANDI_MAX_RESPONSE_BYTES 519,139 (sync frame limit − envelope; 196,608 until 2026-11-15) VERDANDI_SERVE_BYTES_PER_SECOND 2,097,152 VERDANDI_REQUEST_TIMEOUT_MS 3,000 VERDANDI_PARALLEL_REQUESTS 2 VERDANDI_PIPELINED_PARALLEL_REQUESTS 4 (a node that stages) VERDANDI_STAGING_BYTES 8,388,608 (full-state classes only) VERDANDI_TIMEOUT_COOLDOWN_MS 5,000 (× min(consecutiveTimeouts, 4)) VERDANDI_ADVERT_INTERVAL_MS 2,000 VERDANDI_MAX_ANCESTOR_DOUBLINGS 8 MAX_RETAINED_FAULTS 32 tcp.ts LENGTH_PREFIX_BYTES 4 MAX_REASSEMBLY_BYTES 524,292 REASSEMBLY_CHUNK_BYTES 8,192 REASSEMBLY_KEEP_BYTES 65,536 (a BUFFER size, not a frame size) DEFAULT_HANDSHAKE_TIMEOUT_MS 15,000 DEFAULT_FRAME_TIMEOUT_MS 30,000 MAX_WRITE_QUEUE_BYTES 4,194,304 DEFAULT_MAX_CONNECTIONS_PER_ADDRESS 64 (share of the inbound table one address may hold; --max-connections-per-address moves it) REFUSAL_MAGIC "SLRF" (connection refusal frame, §3.2) MAX_REFUSAL_REASON_CHARS 96 REFUSAL_LINGER_MS 1,000 MAX_LINGERING_REFUSALS 64 idleTimeoutMs / maxConnections / connectTimeoutMs 120,000 / 256 / 5,000 (hestia sets maxConnections = policy.maxPeers) arecibo.ts — §15 ARECIBO_VERSION "arecibo-v1" ARECIBO_DEFAULT_TTL_MS 1,800,000 (matched to Praeco's record TTL, :147-154) ARECIBO_MAX_OFFERS_PER_SPACE 16 (holders per space — the whole sybil exposure) ARECIBO_MAX_SPACES 1,024 (StarwNode passes policy.maxSpaceRecords) ARECIBO_STANDING_LIFE_MS 1,209,600,000 (14 days, PROPOSED: the owner's decision, §15.4) ARECIBO_HOLDING_LIFE_MS 1,800,000 ARECIBO_MAX_WITHDRAWALS 4,096 ARECIBO_MAX_NOTICES_PER_CREATOR 8 STANDING_MAX_PER_FRAME 8 STANDING_VERIFY_PER_SECOND / BURST 4 / 32 (signature checks per peer) MAX_SPACE_OFFERS 8 (offers one frame may carry, starw-node.ts:213) SPACE_OFFER_BYTES 12,288 (mnemosyne.ts — measured offer: 11,938) maxTtlMs / clockSkewMs both caller-set; Hestia takes the defaults roche.ts — §16 ROCHE_CHUNK_B64_CHARS 349,528 (derived from ACCRETION_CHUNK_BYTES, never written) ROCHE_MAX_WANT_INDICES 4 (chunks one request may name) ROCHE_SERVE_BYTES_PER_SECOND 2,097,152 (Verdandi's figure, matched deliberately) ROCHE_MAX_INFLIGHT_PER_PEER 1 ROCHE_MAX_INFLIGHT_TOTAL 4 ROCHE_REQUEST_TIMEOUT_MS 10,000 ROCHE_MAX_MANIFEST_CHUNKS 1,024 (a refusal, never a truncation) ROCHE_MAX_HELD_CHUNKS 64 (16 MiB of content ≈ 34 MiB of memory) ROCHE_MAX_HELD_SPACES 8 ROCHE_CAPACITY_CEILING_CHUNKS 1,024 (a SOURCELESS_HOLD_FOR holder's raise stops here) ROCHE_CAPACITY_CEILING_EPOCHS 128 ROCHE_MAX_FETCHES 8 (2 until 2026-11-22; idle ones give way, see §16.4) ROCHE_MAX_FETCHES_PER_CREATOR 2 ROCHE_MAX_FETCHES_PER_READER 2 ROCHE_FETCH_IDLE_MS 90,000 (roche-fetch.ts) ROCHE_FETCH_DEADLINE_MS 600,000 ROCHE_MAX_FETCH_HOLDERS 16 (= ARECIBO_MAX_OFFERS_PER_SPACE) ROCHE_MANIFEST_TIMEOUT_MS 4,000 ROCHE_HOLDER_BACKOFF_MS / MAX_MS 1,000 / 60,000 ROCHE_HELD_CHUNK_BYTES 526,336 (ACCRETION_CHUNK_BYTES × 2 + 2,048) MAX_PROOF_LENGTH 16 (module-private; ACCRETION_MAX_CHUNKS is 2^16) sleipnir.ts — §17, LIVE (opt-in) SLEIPNIR_KEY_BITS 256 (sha256(nodeId), not the node id) SLEIPNIR_BUCKET_SIZE 16 (Kademlia k) SLEIPNIR_CONCURRENCY 3 (Kademlia α) position sha256("sleipnir-address-v1:" + address) for a record's peer sleipnir-wire.ts — §17 SLEIPNIR_MAX_ANSWER_RECORDS 8 (= MAX_PEX_RECORDS) SLEIPNIR_QUERY_TIMEOUT_MS 4,000 SLEIPNIR_ANSWER_INTERVAL_MS 1,000 (one answer per peer per interval) SLEIPNIR_MAX_PENDING 32 PEER_LOOKUP_INTERVAL_MS 60,000 (hestia.ts: one dial-loop lookup a minute at most) mnemosyne.ts ONE_MEGABYTE 1,048,576 PEER_RECORD_BYTES / PEER_SESSION_BYTES 11,264 / 8,192 (measured record: 11,132) retention budgets pulsar 716,800 · quasar 268,435,456 · supernova 4,294,967,296 maxSpaceRecords pulsar 0 · quasar 64 · supernova 1,024 (Arecibo's bound) starw-node.ts MAX_GOSSIP_MEMPOOL 4,096 MAX_GOSSIP_IDENTITY 1,024 MAX_PEX_RECORDS 8 MAX_TX_ATTEMPTS 3 TX_DROP_JOURNAL_SIZE 64 MAX_ATTESTED_BLOCKS 128 (block hashes this node has signed for) DIRECT_PROTOCOLS sync, praeco, ping NON_RELAYED_PROTOCOLS ghost hestia.ts (runtime, for context) DEFAULT_SELF_REFRESH_MS 600,000 DEFAULT_TARGET_PEERS 8 MAX_DIALS_PER_TURN 4 HANDSHAKE_DEADLINE_MS 10,000 DIAL_BACKOFF_BASE_MS / MAX_MS 1,000 / 60,000 sharePeers sample limit 4 core/config.ts (not this layer's, but the handshake compares them) ASGARD_CHAIN_ID 1313 (mainnet, :47) DEV_CHAIN_ID 31337 (development chain, :34) ``` --- ## 15. Arecibo — announcing which hostless spaces exist and who holds them `src/network/arecibo.ts`. Read off the tree on 2026-09-12; absent from this volume until then. **Live**: `HestiaNode` constructs one for every class that holds a chain (`hestia.ts:695`), hands it to the node (`hestia.ts:742`), prunes it every round (`hestia.ts:1374`) and re-announces from it every round (`hestia.ts:1390`). ### 15.1 What it does `src/hostless/oort.ts` puts a hostless space on the chain — owner, visibility, price, manifest root. It does **not** say who is holding the bytes, because the bytes are off chain. So a reader who has synced knows a public space exists and has nobody to fetch it from, and a reader who has not synced does not know that much. Arecibo closes both gaps without a directory server, because a directory server is an operator who can be asked to delist a space. An announcement is a `SpaceOffer`: a creator's **beacon** inside a node's **serving claim**, with two independent signatures under two different authorities. | | Signed by | Says | Verified by | |---|---|---|---| | beacon | the space's **creator**, with the account key and address derivation the chain used to accept the `oort-create` | space id, creator domain, price, token, manifest root, and an expiry | `verifySpaceBeacon` (`src/network/arecibo.ts:584`) | | serving claim | the **node's** hybrid Gemini keys, the identity Praeco already knows it by | "I will serve this space", bound to one beacon by `beaconHash` | `verifySpaceOffer` (`src/network/arecibo.ts:618`) | The beacon is not redundant with the chain for the peer that has **not** synced: it is the creator's statement made portable, so a light client can judge an announcement before it has a chain to judge it with. And because a beacon expires and only the creator's key can mint another, a creator who stops re-issuing takes a public space off the mesh within a TTL — no transaction, no vote, nobody to petition. `ARECIBO_DEFAULT_TTL_MS` is 1,800,000, matched to Praeco's record TTL on purpose: an offer names a nodeId and nothing else, so it is only actionable while Praeco still holds a record saying where that node is. On the wire it is `PROTOCOLS.arecibo`, **direct** — `{ kind: 'spaces', offers: SpaceOffer[] }`, at most `MAX_SPACE_OFFERS` = 8 per frame (`MAX_SPACE_OFFERS` `src/network/starw-node.ts:406`), sent by `shareSpaces` (`src/network/starw-node.ts:1159`) to every peer whose handshake negotiated the protocol. Direct and not flooded for Praeco's reason: an unchanged sample is byte-identical to the last one, and a content-deduplicating flood would drop precisely the repeat a newly connected peer has never seen. **One space per offer, deliberately.** A record listing six space ids publishes the set atomically, and an unusual set is a stronger identifier than the key it was signed with — rotate the nodeId, keep serving the same six spaces, and you are the same node to anyone watching. Splitting them does not make correlation impossible; it stops the set being handed over in one signed object. ### 15.2 What it refuses `AreciboDirectory.admit` (`src/network/arecibo.ts:870`) is the only door in, and `merge` (`merge` `src/network/arecibo.ts:1031`) runs it per entry. In order, cheapest first: 1. **Shape** — `isSpaceOffer` (`src/network/arecibo.ts:505`), before any field is read. Checked again at the frame boundary (`starw-node.ts:1805`), because `Array.isArray` plus a length is not a type: an array of nulls satisfies both. 2. **Version and chain** — `claim.chainId` and `serving.chainId` must both be this node's. 3. **Time** — expiry after announcement, not already expired, lifetime within `maxTtlMs`, announcement not beyond `clockSkewMs` in the future, and **an offer may not outlive the beacon it carries**, which is what makes a creator's silence a real switch rather than a preference. 4. **Both signatures** — `verifySpaceOffer`, which verifies *before* deriving an address. That ordering is a fuzz finding (`MOMUS-002`): `isSpaceOffer` checks only `typeof === 'string'`, so a malformed `pqPublicKeyHex` reached `deriveGeminiAddress`, which **throws** — a `TypeError` out of the crypto layer from a function typed `boolean`, on a stranger's bytes. 5. **The chain's own answer, and this is the gate that matters.** The beacon carries **no visibility field at all**, so there is nothing on the wire to be believed. A node holding a chain re-derives it from its own `OortRegistry`: a space absent from the chain is a **refusal**, not a shrug, and a space the chain calls dedicated or private is refused however correctly its creator signed for it. **Public is not enough.** Since 2026-11-18 every field the beacon repeats from the record must equal it: the creator (which, with the signature, means the signing key derives the chain's creator address), the creator domain, the price, the token and the manifest root the chain anchors now. Oort keeps no root history, so there is no older root to allow. Before that a node checked visibility alone, and any key could sign a self-consistent beacon for somebody else's public space and take its slot (`tests/integration/arecibo-beacon-binding.integration.test.ts`). A node given a domain resolver (`provedHolderOf`, absent by default) also refuses a domain the creator is not proved to hold. The other four gates stop an honest node announcing what it should not; this one stops a **dishonest creator**, who holds the key and can sign a beacon saying anything about their own space. Measured: a dedicated-space beacon its own creator signed dies at the first node holding the chain and never reaches `sample` (`tests/integration/arecibo-wire.integration.test.ts:426`, `:460`). Three further refusals inside the index: - **A space id is bound to the creator key that announced it** for as long as the entry lives, so a second creator cannot claim an id and start replacing beacons for it. On a node holding the chain the held entry is re-judged first: one the chain now contradicts — a squatter, or a beacon for a root the chain has rotated past — is dropped, with its offers, once a beacon that verifies and agrees with the chain arrives, so nobody holds a slot against the chain's own creator. On a node with no chain the binding is first-come, because nothing else could decide it there. A strictly newer beacon replaces a held one, and an older one never does, or a replay would resurrect a stale price. - **A full holder list refuses the newcomer rather than churning.** `placeOffer` (`placeOffer` `src/network/arecibo.ts:1239`) evicts only something strictly weaker: a holder Praeco does not know loses to one it does, and among equals the oldest announcement loses. A list that reshuffles on every arrival is a list an attacker controls simply by arriving. - **A record that weighs more than an announcement does.** Added 2026-11-22: an offer is exactly its fields, each of a bounded length (`offerBoundsProblem`). Before, an offer carried whatever its signer put in it, and four of them, each most of a frame, were sampled into every round: the frame was over the ceiling, `sendDirect` counted `oversized-outbound` and sent nothing. Measured on the node: 100 of 100 rounds lost, each with this node's own announcements. A round now carries this node's own offers first and is packed by bytes, so what somebody else announced never decides whether they leave. The other places go to the spaces that have waited longest, by turns, where every round used to send the same first entries of the index. The bound is on one record and not on a frame, for the reason given in §6.6 (`tests/integration/announcement-bounds.integration.test.ts`). **The relay rule, and it is structural.** `sample` (`src/network/arecibo.ts:1067`) returns **nothing** when the directory holds no chain view, and otherwise only entries this node re-derived as public. The protocol is direct, so an arriving frame is never forwarded; the only way an offer leaves this node is out of `sample`. So a node that could not check an announcement discovers fully and relays nothing — Praeco's quarantine rule applied to announcements. Tested (`tests/integration/arecibo-wire.integration.test.ts:536`). **Bounds.** `ARECIBO_MAX_SPACES` = 1,024 spaces × `ARECIBO_MAX_OFFERS_PER_SPACE` = 16 holders is the entire memory bound, and `StarwNode` passes `policy.maxSpaceRecords` for the first: **0 on a Pulsar, 64 on a Quasar, 1,024 on a Supernova**. A nodeId is a keypair, so an attacker *can* fill one space's holder list; the cap turns that from unbounded memory into sixteen useless entries for one space. A full index evicts the space whose most recent beacon is oldest (`evictStalestSpace` `src/network/arecibo.ts:1296`), and refuses the newcomer when there is nothing staler. The byte cost is charged to retention at `SPACE_OFFER_BYTES` = 12,288 per offer (`accountForSpaces` `src/network/starw-node.ts:3916`), measured from a real offer at 11,938 bytes and rounded up. The module states the one thing it does not know: the byte cost of the index itself is **unmeasured** — no benchmark has been run against it — so its bound is stated in records, which is what is actually enforced. **Corrected 2026-11-22: a share round rotates, and a repeat is not verified again.** Until then every round sent the first four entries of the index in the order they arrived, so a fifth public space was never announced by that node; and every repeat of a held offer cost both signature checks on every peer. A round now sends this node's own offers first, in at most half the frame while it knows of anything else, and then whichever spaces have waited longest. The turn belongs to the space and not to the holder, because an identity is free and a space costs its creator a transaction. An offer held byte for byte is admitted on the chain checks alone, as a Praeco record is, and a node signs its own again only when that would make it last longer (`tests/integration/arecibo-share.integration.test.ts`). **What an announcement leaks, stated because it cannot be recalled.** Not the content, not a chunk, not a key, not a grantee, not an endpoint. It does leak **that this node holds this space** — which is the question a takedown, a subpoena or a targeted denial of service starts from, and there is no version of hostless discovery that does not — and **when a space changed**, because a beacon whose `manifestRootHex` differs from the last one dates a re-key without decrypting a byte. Private and dedicated spaces never appear here at all, so an observer cannot count them or date them. ### 15.3 Origination, which was the gap and is now the path **This section said *nothing in the runtime originates an offer*, and that was true until 2026-09-12.** `offerSpace` (`src/network/arecibo.ts:776`) had no caller under `src/`, so `sample()` returned nothing, `shareSpaces` sent nothing, `holdersOf` answered an empty list on every node in the network, and **the `arecibo` retention bucket was never created on any live node** — neither a live quasar nor a live pulsar had the key. A reader who did not already know who held a space could not find out. `StarwNode.announceHeldSpace` is the origination. Given a beacon signed by the space's **creator**, it mints the serving half with this node's own identity key through `offerSpace`, admits the result through its own `AreciboDirectory.admit` — so the four gates refuse this node's own offer exactly as they refuse a stranger's — and keeps the beacon so the offer can be re-minted. `shareSpaces` calls `refreshOwnOffers` before it samples, which is what puts a just-published space in the frame the same round rather than the next one; a beacon whose own expiry has passed is forgotten rather than retried, because an offer may not outlive the beacon it carries. **A holder mints no beacon, and that is the whole of the refusal.** The creator's half says a space is public; this node signs only that it is holding it. A beacon that does not verify, or that names another chain, or whose space this node's own chain says is `dedicated`, is refused — the third case is the fourth Arecibo gate doing the thing it was built for, and it is asserted in `tests/integration/space-cli.integration.test.ts`. The beacon reaches a node through `spaceAnnounce` on the public door (§13.4), which is refused unless the request is signed by the address the chain records as the space's creator. **Measured, two nodes, real sockets, 2026-09-12.** A publisher ran `strblk space put`; both nodes then answered `holdersOf` with the publisher's node id — `STR.7E7FDF429534` — and the reader's node had learned it over the socket on a maintenance turn, having received the space on its own chain first. `discover` (`src/network/arecibo.ts:1108`) is still reached only through `holdersOf`, which is now reached from the door as well as from `StarwNode.fetchSpace`. Receive-side refusals are covered by `tests/integration/arecibo.integration.test.ts` and `tests/integration/arecibo-wire.integration.test.ts`, with the trust boundary recorded as `announcer-to-indexer/offer` (`src/ops/trust-boundaries.ts:375`). That entry carries an open gap this volume does not improve on: on a node with cold peer state every holder candidate ranks equal and the tie-breaker is an attacker-chosen timestamp inside the clock skew. **No test attacks it.** ### 15.4 Standing announcements — built, OFF, waiting for the owner `src/network/arecibo-standing.ts`, `arecibo-standing-record.ts`, `arecibo-standing-wire.ts`, `arecibo-standing-file.ts`, on an opt-in protocol of its own, `/sourceless/arecibo/2.0.0`. A node without `--standing-announce` negotiates and sends what it did on every protocol, and v1 above is unchanged. One answer is new on it: `GET /v1/holders/` gives that path's own 404, the same one a node that did opt in gives for a space it may not name, where it gave the surface's general one. - **What it fixes.** A v1 beacon lives thirty minutes and nothing renews it, so a space left discovery half an hour after its creator last signed, with every chunk still held. Here the creator signs one **standing** and each holder renews its own thirty-minute **holding** under it. - **How long a standing lives is the owner's decision.** `ARECIBO_STANDING_LIFE_MS` is fourteen days, proposed. It is the trade: in v1 a creator's silence withdraws a space within thirty minutes, and here silence takes as long as the standing. - **Withdrawal is therefore an act.** A standing with a higher serial that says `withdrawn` ends every announcement of the space, is told to peers before anything else, and lives as long as the longest standing it could end, across restarts. One shorter than that is refused. In one frame half the places are for the withdrawals a peer has waited longest for and half for the newest, and no creator has two. Another withdrawal of a space that is withdrawn already is in force at once and is told as new once an hour at most. Everything is told again every ten minutes to a peer that has heard all there was when the last telling began, whatever came since. Changing the space's visibility on the chain ends it too. - **What is forgotten is refused, where it ended something here.** A creator has at most 128 withdrawals on a node, and past that its own oldest gives way. The list is 4,096 in two halves: withdrawals by creators who had something announced on this node when they came, and all others. When a half is full, the oldest of the creator with the most in it gives way. For the first half, and for a creator over its own share, the node then refuses everything that creator signed up to it, so a creator who withdraws very many spaces must sign its older announcements again there. Nothing of the kind is ever set for everybody. A withdrawal in the second half may be forgotten with nothing left in its place. **That is a trade, and this is its cost:** some two thousand creators with a space each, a chain transaction for every one, can flush that half by withdrawing them, and then a standing signed before a flushed withdrawal, by a creator nothing was announced of here, is taken again until it runs out, fourteen days at most. The other way round, where what gives way always left a floor and an overflow of floors closed everybody, the same creators ended every announcement on the node, again and again, for no new cost. - **A list that is damaged is closed.** `arecibo-standing.json` carries a digest of itself. One that is cut short, too large or of another format is copied aside, the node starts, and every standing signed before that start is refused until its creator signs another. A node that refused to start would stop everything else it does for one file, and one that started empty would let every withdrawn space back in. A file that is there and cannot be **read** is not damaged: it is tried again at once and then every minute, the node is closed the same way until it is read, and nothing is written over it. A serial in the file later than now counts as now. Not covered: a withdrawal heard from a peer in the last minute before a crash, which is how often those are written; its other holders tell it again. One taken at the node's own door is written before it is answered, and not called done when it could not be. - **`accept` and `send`.** `accept` learns, and passes on withdrawals and nothing else; `send` also announces what this node holds every chunk of, and shares what its index admitted. A node set to hold no content behaves as `accept` whatever it was started with. A validator seat passes nothing on at all, and says so to a creator who hands it a withdrawal. - **A holder is its address.** It is kept, ranked and answered by the address its keys derive, never by the node id it writes. `GET /v1/holders` names a node only where the peer directory has that name under that address and no session goes by it under another, so no name is shown beside a door somebody else signed for. A peer in session that calls itself something the directory does not know is listed unnamed. - **Bound to one chain.** Both records name the chain id and the genesis hash. - **Keepers need not be nodes.** A standing may name up to six `https:` origins and the digest of a longer list; any node can then answer who keeps a public space that no node holds. A holding may name the holder's own door (`--door-url`). **No node fetches any of them**: a name is not resolved, an origin is refused at an address that is private, reserved, for documentation or carries a private one inside it, and on any port but 443 and 8443, and the reader decides. - **Bounds.** A record is exactly its fields, each of one width or a short one, refused one by one where it is admitted; a frame is packed by bytes and a peer's place moves only over what was sent. Eight records a frame, at most half of them withdrawals while anything else waits; four signature checks a second per peer after a burst of 32; a holding renewed no sooner than five minutes and a standing replaced, or signed again after a withdrawal, no sooner than one; sixteen holders a space, where a peer in session displaces a stranger and a date never does; a quarter of the index, at most 128 spaces, and eight keeper lists per creator, and a full list gives up a space of the creator with the most. Holdings, keeper lists and withdrawals are all in the node's retention account. `tests/integration/arecibo-standing.integration.test.ts`, `-wire` and `-hostile`. - **What a hostile creator or holder can still do.** A creator can keep a space they no longer hold named by keepers until the standing ends. Sixteen identities can fill a space's holder list on a node that has no session with any honest holder. A stranger can take the name of a node nobody here has met, in a fetch's list of who to ask, and is then asked in vain. A host name an origin gives can resolve to a private address, which only a reader that resolves it can refuse. A holder can announce content and answer nothing (§16.4). Creators with a space each, one for every place in a list, can fill it and keep it: no one of them has more than another, so nobody gives way and a newcomer is refused until something runs out. It costs a chain transaction a space, 64 on a Quasar and 1,024 on a Supernova, a signature a space every fourteen days and one a holding every thirty minutes, and no content. A node's own announcement is refused there like anybody else's, and the node says so to whoever asks it to announce; another node whose index has room still tells it. - **Not built:** the signing verb in `strblk space` and the wallet, and the third-party mirror. --- ## 16. Roche — moving the chunks, and refusing the bad ones `src/network/roche.ts` and, since 2026-11-22, `src/network/roche-fetch.ts`. Read off the tree on 2026-09-12; absent from this volume until then. **Live**: `RocheStore` and `RocheTransfer` are built for every class that holds a chain (`hestia.ts:718`, `:720`), handed to the node (`hestia.ts:742`), and `rocheTick` is driven on every turn of the flow loop (`hestia.ts:996` → `rocheTick` `src/network/starw-node.ts:2571`). ### 16.1 What it does Oort says who may read a hostless space and what its content commits to; Accretion is the sealed chunks; Arecibo says which peers hold them. Roche is the transfer, and until it existed a reader who knew all three still could not fetch a byte. **Ciphertext crosses; the space key never does, in either direction.** Nothing in the file takes a key, imports a cipher or can decrypt a byte — not as a courtesy but because it is the property the hostless design rests on: a peer serves content it cannot read. `verifyChunkAgainstRoot` takes no key precisely so a relay can run it, and this module runs it in both directions: - **On the way in.** `RocheStore.admit` (`src/network/roche.ts:1033`) is the only door into the store and it verifies before it places. There is no `put` a caller could reach past it. - **On the way out.** Every chunk is re-verified against the root the chain holds **now**, immediately before the bytes are framed (`onWantChunks` `src/network/roche.ts:1733`). A corrupted chunk is never sent, rather than sent and refused at the far end. Those are not one check written twice: admission asks *did this belong when it arrived*, serving asks *does it belong now*, and a key rotation between the two is exactly the case that separates them — a new epoch is a new anchored root, so chunks of the retired epoch stop verifying and stop being served with nothing here having to be told. `RocheTransfer.fetched` (`src/network/roche.ts:1568`) is the only way out of the module and it hands back nothing until **every** chunk of the epoch has verified. That makes "verify, then decrypt" a property of the structure rather than of a caller's discipline: there is no partial result to be tempted by. On the wire it is `PROTOCOLS.roche`, **direct**, five kinds — `want-manifest`, `manifest`, `want-chunks`, `chunk`, `miss` — with a 360,448-byte ceiling. One chunk per frame, because the wire unit must be the verifiable unit: a frame holding half a chunk would be bytes nobody can check until something else arrives. The ciphertext travels as base64 rather than the hex `SealedChunk` holds it in, because hex is two characters a byte and 262,144 bytes of ciphertext in hex is `MAX_FRAME_BYTES` exactly, before the tag, the header, the proof, the JSON or the Bifrost seal — one chunk in hex cannot be put on this wire at all. Measured: a real chunk frame with the longest Merkle path `ACCRETION_MAX_CHUNKS` allows is **350,916 bytes**, 9 KB under the ceiling (`tests/integration/roche-wire.integration.test.ts:202`). ### 16.2 What it refuses **A node with no chain view serves nothing and fetches nothing.** The root is the only thing that makes a chunk checkable and it lives on the chain, so both halves refuse and say so through `stats()` rather than going quiet (`servingChain` `src/network/roche.ts:2141`; `fetch` `src/network/roche.ts:1479`). The fetching half of that is stronger than Arecibo's: an announcement a light client cannot confirm is still an announcement it may act on at its own risk, while an unverifiable chunk is bytes that could have come from anywhere. `serves` comes from the class policy and never from a claim — `keepsFullState`, the same line that decides whether a node produces blocks. Every bound is a size a stranger picks, so every one has a number on it: | Bound | Value | What it is protecting | |---|---|---| | `ROCHE_MAX_WANT_INDICES` | 4 | A request is a couple of hundred bytes; four chunks is 1.4 MB of answer. Naming the epoch instead — 65,536 chunks at the Accretion ceiling — is 16 GiB for the same request, which is an amplifier with a `spaceId` field. | | `ROCHE_SERVE_BYTES_PER_SECOND` | 2,097,152 | Verdandi's figure, matched deliberately: both are a peer pulling bulk data it asked for, and treating content as cheaper than blocks would move the cheapest way to exhaust a node from one protocol to another. Refused, never disconnected — a full bucket must not become a partition. | | `ROCHE_MAX_INFLIGHT_PER_PEER` | 1 | Makes "is this chunk one I asked **this** peer for" an exact question rather than a search through a history. | | `ROCHE_MAX_INFLIGHT_TOTAL` | 4 | Without a total the bound would be the peer count, which the network chooses. | | `ROCHE_REQUEST_TIMEOUT_MS` | 10,000 | Longer than Verdandi's 3,000 because the answer is two orders of magnitude larger. A timeout releases the slot, puts the indices back and makes the holder wait, so a silent holder costs one timeout rather than a stalled fetch. *Not true until 2026-11-22: see §16.4.* | | `ROCHE_MAX_MANIFEST_CHUNKS` | 1,024 | A **refusal, never a truncation**: a manifest missing some digests verifies against nothing, and a reader that accepted one would be reassembling a document from a list it was told was complete. | | `ROCHE_MAX_HELD_CHUNKS` / `_SPACES` | 64 / 8 | 64 chunks is 16 MiB of content and about 34 MiB of memory, because `SealedChunk` holds ciphertext as hex. A store sized by content bytes would be half the size it reports. | | `ROCHE_CAPACITY_CEILING_CHUNKS` / `_EPOCHS` | 1,024 / 128 | The most a dedicated holder may raise the store to with `SOURCELESS_HOLD_MAX_CHUNKS` / `_EPOCHS` (HOSTLESS-A3). Honoured only where `SOURCELESS_HOLD_FOR` names creators, because on an open holder a larger store is more room for anybody with a few keys. Sized by memory: 1,024 held chunks is about 514 MiB; whether a raised holder fits its memory limit is UNMEASURED, and by arithmetic a full ceiling does not fit the k8s overlay's 1536Mi. It is also `ROCHE_MAX_MANIFEST_CHUNKS`, so a higher bound would buy more spaces and never a larger one. The in-flight and serve limits are not raised. | | `MAX_PROOF_LENGTH` | 16 | `ACCRETION_MAX_CHUNKS` is 2^16, so an honest path is at most 16 long. Refuses the siblings that would be walked to find that out. | Four refusals worth reading as an order rather than a list: - **An unsolicited chunk is refused before it is verified** (`onChunk` `src/network/roche.ts:1888`). Solicited, from this peer, for this epoch, for this index — anything else is a peer pushing 350 KB at a node that did not ask, and each one would otherwise cost a Merkle verification to refuse. Same rule on `manifest`, refused before the root is read and before the digest list is walked. - **The chain is read before the store is touched** (`onWantChunks`). Nothing has been sent at that point and the root comes from this node's own state rather than from anything in the frame. - **A repeated index is refused**, because it is a way to ask for one chunk four times inside one bounded request; and the request's length is counted before anything is looked up, because the cost of refusing has to be below the cost of asking. The gap between the two is the widest anywhere on this node. - **A chunk this node holds but cannot stand behind is not passed on.** `refusedToRelay` counts it, the asker is told `miss`, and the bad chunk dies at the first honest hop. Zero on an honest node with an intact store, and the counter that matters when it is not. Tested end to end: a forged chunk is refused at the relay and the reader behind it never sees it (`tests/integration/roche-wire.integration.test.ts:354`), and an unauthenticated peer is served nothing at all (`:418`). `RocheTransfer.onPayload` (`src/network/roche.ts:1621`) never throws — Verdandi's contract for Verdandi's reason: this is the receive path, and an exception here is a node-wide halt any peer can trigger and every honest node reaches at the same frame. **What a request leaks, and what this module does and does not do about it.** A peer serving chunk 7 knows somebody wanted chunk 7. The unit of a fetch is therefore the whole epoch — there is no range request in the API at all — so a holder that answers everything learns nothing beyond the fact that this node fetched this space, which it would learn from serving one chunk. It does **not** hide which space is being fetched from the peer serving it, and it cannot: that peer has to look the space up to answer. It does **not** hide the subset a given holder served, so a fetch spread across four holders tells each of them which chunks the others supplied. There is **no cover traffic, no decoy request and no private information retrieval** here. Those are real answers to this leak and none of them is implemented. ### 16.3 Who initiates, which was nobody and is now a command **This section said *nothing on a production path ever initiates a fetch or publishes content*, and that was true until 2026-09-12.** `StarwNode.fetchSpace` and `RocheStore.publish` were called from tests only, so on a shipped node `rocheTick` turned over two empty maps: a live quasar reported `"roche":0,"roche-store":0` and a live pulsar reported neither bucket, because a Pulsar is given no store at all. Both halves have a caller now and it is the same one, `src/cli/space-door.ts`, reached over the public door (§13.4): - **Publishing.** `spacePublish` takes one sealed chunk and the manifest it belongs to, opens the epoch with `RocheStore.open` and places it with `RocheStore.admit`, computing the Merkle path itself from the manifest's digest list rather than accepting one from the caller. One chunk per request, because one 256 KiB chunk as base64 is 349,528 characters against a 512 KiB body cap. It is refused unless the request is signed by the address the chain records as the space's creator, so a stranger cannot fill a node's store with content for a space they do not own. - **Fetching.** `spaceFetch` calls `StarwNode.fetchSpace`, which asks the holders Arecibo named. It is refused unless `OortRegistry.mayRead` says this reader may read this space — the access decision the whole subsystem exists to make, which until this door had never been asked about the party in front of it. **No key crosses this door in either direction**, which keeps Roche's own property intact: the node holds ciphertext and cannot read it, and nothing in `src/network/roche.ts` or `src/cli/space-door.ts` takes a key or imports a cipher. A reader verifies each chunk against the root **its own** view of the chain holds and then opens it in its own process. **Measured, two nodes, real sockets, 2026-09-12, through documented commands alone.** A 14,649-byte CSV: `strblk space create` anchored the space, `strblk space put` sealed it into one chunk, anchored the root in a block and uploaded the chunk to the publisher's node; `strblk space grant --kem-public` wrapped the content key to the reader's KEM public key; `strblk space get` on the **second** node fetched the chunk over `PROTOCOLS.roche`, verified it against the root that node's own chain held, opened it with the unwrapped key and wrote **14,649 bytes with an identical SHA-256**. The earlier measurement in this section — 8,196 bytes in, 8,195 back — was an in-process call for every write-side step, with the space key handed over by hand. The trust boundary is recorded as `seeder-to-reader/chunk`, trusted `nobody`, fuzzed, with adversarial tests named (`src/ops/trust-boundaries.ts:235`). **Roche has no row in §11**, in either column: the attacks it refuses are the ones listed above and they are asserted by `tests/integration/roche.integration.test.ts` (37 cases) and `tests/integration/roche-wire.integration.test.ts` (14), not by the socket-level measurements §11.1 reports. Treat §11 as assessing the peer transport and the flooded protocols, and this section as the statement of record for this one. ### 16.4 How a fetch ends **Corrected 2026-11-22.** Four statements above were not true of the code, each reproduced by a failing test before it was changed (`tests/integration/roche-fetch-liveness.integration.test.ts`): - *A fetch was never released unfinished.* Two spaces nobody could serve held both slots until the process restarted, and every later `spaceFetch` was refused. A space held here in full now takes no slot; a fetch with nobody to ask is refused with a reason; an open one ends after 90 seconds without a verified answer or ten minutes in all; a full table, and one creator's two fetches, give their stalest idle one to a newcomer; an epoch no chunk of which was served gives its place in the store back; one that was served in part, with no fetch finishing it, gives way to whoever needs the place; and a creator who publishes takes the place of an unfinished one at once, whether or not its fetch is open. An epoch of a space this node's chain does not hold yet gives way to nobody for being unfinished. - *The holder list was read once.* A later ask and the space index now add holders to an open fetch. - *A spent upload budget was answered `miss`*, and the asker dropped that holder for good, which stalled a single-holder fetch at about the ninth chunk on a fast link. The server is now silent about a chunk it holds and cannot afford, the asker paces itself to the same bucket, and a `miss` makes a holder wait instead of dropping it, so a new asker still finishes against an older server. - *A silent holder named first was asked again ahead of one that answers.* Holders that have served go first, the rest wait with a doubling backoff, and a slow manifest or chunk is also asked of another. Only serving something that does not verify removes a holder from a fetch. **What one hostile reader can still do:** hold two of the eight slots per key and, with spaces of enough creators, keep the table full of idle fetches, each of which gives way to the next newcomer after ten seconds; the two fetches of one creator give way to a third of that creator's the same way. **What a hostile holder can still do:** answer just often enough to keep one fetch open for ten minutes, and eight of them with spaces of four creators keep the table for that long. **And what is still not built:** nothing renews a beacon, so a space leaves discovery about thirty minutes after its creator last signed one (§15.3); nothing dials a holder the index names; and a node that fetched a space does not announce that it holds it. --- ## 17. Sleipnir — the Kademlia routing table. LIVE, OPT-IN **Updated 2026-11-18: the lookup runs in a node, behind `strblk node --peer-lookup`.** The text below the rule is the record of what this section said while Sleipnir was dormant, and its measurements are unchanged. What runs now: - **The table** is fed by `PraecoDirectory.admit` under `--peer-shadow` or `--peer-lookup`. - **The lookup** is `PraecoDirectory.routingLookup`, driven by `StarwNode.lookupPeers`, which asks only session peers whose handshake negotiated the opt-in `PROTOCOLS.sleipnir` topic (`/sourceless/sleipnir/1.0.0`, in `OPT_IN_PROTOCOLS`). A peer with no session is never asked and never dropped for it (`SleipnirLookupOptions.canAsk`), so a lookup opens no socket of its own. - **The wire** (`src/network/sleipnir-wire.ts`): `find-node { target }` and `nodes { target, records }`, direct, never relayed, 128 KB ceiling, at most eight records. An unsolicited `nodes` frame is refused before a record is read; answers are rate-limited to one per peer per second; every record is re-verified through `admit` before the lookup counts it. - **Positions are addresses.** A peer from a record sits at `sleipnirAddressKey(claim.address)`, the address `admit` checked derives from its keys — not at `sleipnirKey(nodeId)`, which anybody can grind by hashing a free string. Moving a position costs a hybrid keypair per try; it is costlier, not impossible. - **The caller** is `HestiaNode`'s dial loop: when it wants more peers it starts a lookup at most once a minute — its own position first, then this chain's rendezvous points in turn. It does not act on the lookup's nearest set: at most one peer per answering session and one per /16 is PROMOTED (`PraecoDirectory.routingLookup`), and promoted peers are interleaved behind the dial loop's own order, never placed in front. One hostile answerer with eight self-signed records gets one slot, second. Seeds are dialled first and unconditionally, exactly as without the flag. - **Off by default.** Without `--peer-lookup` the handshake, the frames and the dial order are exactly what they were; pinned in `tests/integration/sleipnir-lookup.integration.test.ts`. - **Still unmeasured:** a lookup on a real network under churn, or against an adversary. The flag exists so that measurement can be taken. --- *Historical, until 2026-11-18:* `src/network/sleipnir.ts` had no importer under `src/`, `consensus/`, `scripts/`, `runtime/` or `sdk/` and was exercised only by `tests/integration/sleipnir.integration.test.ts`. It is in this volume because an unreferenced routing table in this directory is exactly what the book's dormant convention exists to catch (`CONSENSUS.md` §9, `CRYPTOGRAPHY.md` §12), and because `docs/NAMING.md:70` registers it without saying that nothing builds one. What it is: the **routing structure and the lookup algorithm**, and nothing else. `SleipnirTable` (`SleipnirTable` `src/network/sleipnir.ts:196`) and `sleipnirLookup` (`src/network/sleipnir.ts:379`). It holds no sockets, sends no bytes and imports no transport — a lookup is driven by a `query` function the caller supplies, which is how the same code runs over a thousand simulated nodes in a test and would run over Rune frames in a node. It does **not** store values: Kademlia's `STORE`/`FIND_VALUE` half is a key-value store, and this chain already has one that is committed and replayed. A second, uncommitted one reachable over gossip would be a place to put things nobody agreed to. What it would replace: Praeco is a **directory** — everything it knows, it knows because somebody told it, and its answer to "who is near this key" is the whole table filtered. That is `O(n)` messages per lookup and `O(n)` memory per node, which is fine at thirteen nodes and is not a network at thirteen hundred. Three constants, and two design decisions worth keeping if it is ever wired: ``` SLEIPNIR_KEY_BITS 256 sha256("sleipnir-v1:" + nodeId), never the node id itself SLEIPNIR_BUCKET_SIZE 16 Kademlia k SLEIPNIR_CONCURRENCY 3 Kademlia α ``` - **The key is a hash and not the nodeId.** XOR distance is only meaningful over uniformly distributed fixed-width keys, and a nodeId is variable length from an alphabet an operator partly chooses — routing position would otherwise be a position an attacker picks. - **A full bucket keeps its incumbents and refuses the newcomer**, which is a security property and not a cache policy: least-recently-used lets anyone who can mint identities walk a node's table by being new often, which is how a routing table is eclipsed. The cost is stated where it is paid — a peer that has genuinely gone holds its slot until a lookup finds it unreachable. What its own tests assert, and it is less than the registry claims: the exact target is found among **1,000 simulated nodes** having asked **fewer than 100** of them, convergence is inside 64 rounds, and a lookup through dead peers still finishes and reports which were unreachable (`tests/integration/sleipnir.integration.test.ts:128`, `:140`, `:156`, `:172` — 13 cases, all passing). The scaling figures `docs/NAMING.md:70` records — 27.4 peers asked at 100 nodes, 51.4 at 1,000, 73.0 at 5,000, target found 20/20 at every size — are **not reproduced by any test in this tree**, so they are attributed there rather than repeated here as this volume's own measurement. **Unmeasured:** anything over a real transport, under churn, or against an adversary — it has never carried a frame.