v0.8-design — 2026-07-29

Design Document

This is the canonical technical reference for ItsGoin. It describes the vision, the architecture, and the target state of every subsystem — with full implementation detail. This edition describes the v0.8 target design as one coherent architecture; status badges — Implemented Rework Planned — mark where the code has and hasn't caught up. See the download page for the release changelog.

1. The Vision

"A decentralized fetch-cache-re-serve content network that supports public and private sharing without a central server. It replaces 'upload to a platform' with 'publish into a swarm' where attention creates distribution, privacy is client-side encryption, and availability comes from caching, not money."

The honest promise: The CDN is an attention-driven delivery amplifier, not a storage guarantee. Hot content spreads naturally through demand; cold content decays unless intentionally hosted. Authors are responsible for their own content durability — a post backup/export tool is the author's safety net, not the network's job. The system is a loss-risk network — best-effort availability, not durability guarantees.

Guiding principles

2. Identity & Bootstrap

First startup

  1. Identity: Load or generate ed25519 keypair from {data_dir}/identity.key. NodeId = 32-byte public key. This is the network identity only — posting personas use separate keys (see the identity architecture). A unique device identity is also generated for multi-device coordination (see multi-device).
  2. Storage: Open SQLite database (distsoc.db), auto-migrate schema.
  3. Blob store: Create {data_dir}/blobs/ with 256 hex-prefix shards (00/ through ff/).
  4. Port mapping: Attempt UPnP-IGD + NAT-PMP + PCP via the portmapper crate (parallel; first router response wins; ~3s wait). PCP adds IPv6 firewall pinholes and works on iOS without the multicast entitlement. Auto-renewal is internal to portmapper. On Android, WiFi/Ethernet links acquire a WifiManager.MulticastLock for the lifetime of the mapping (cellular skipped). See port mapping.
  5. NAT type detection: STUN probes to two public servers (3s timeout each). Classifies as Public/Easy/Hard/Unknown. Port-mapping success overrides to Public. Anchors skip probing. Result stored on ConnectionManager, shared in InitialExchangePayload, stored per-peer. See relay & NAT traversal.
  6. Stale knowledge sweep: Remove all stored network-knowledge entries tagged to peers not in the current mesh. Clears stale reach data from previous sessions (e.g., unclean shutdown). Today this sweeps the N2/N3 share-list tables; under the target model it sweeps the uniques store.
  7. Bootstrap anchors: Load from {data_dir}/anchors.json. If missing, use hardcoded default anchor.
  8. Bootstrap: If the node has fewer than 5 connections at startup, probe known anchors — discovered (non-bootstrap) anchors first, bootstrap anchors only as a fallback phase when every discovered anchor failed. Probes run in batches of 3 (2s stagger between batches, 10s per-anchor timeout, no abort on first success). First success unblocks the bootstrap flow; remaining probes continue in background and fill peer connections naturally. Failed probes to anchors with last_seen > 3 days are immediately pruned from known_anchors. From the connected anchor: run a NAT filter probe, then request convection referrals and begin the growth loop immediately.

Mesh target Rework

The mesh target is ~20 peers (plus +4–10 temporary referral slots that carry no knowledge exchange — see connections). Knowledge reach comes from depth (uniques known to 4 bounces, N1–N4), not from connection count.

v0.8 change: Replaces the 101-peer mesh (10 preferred / 71 local / 20 wide on desktop). That width was designed for the pre-CDN push-event world; per-client overhead was too high, and the CDN now carries depth. The preferred tier was deleted in Iteration B; current code runs 71 local + 20 wide (91 slots desktop, 12 mobile). Narrowing to the single ~20-slot pool remains target (Roadmap item 4).

Startup cycles

Spawned after bootstrap completes:

CycleIntervalPurposeStatus
Update cadence schedulerDescending scale (minutes → days) per author, keyed on freshness × relationship tier, jitteredCDN update checks + uniques-list refresh; timing shaped to look like uniform network overhead. See update cadence.Rework — today: 60s pull tick with a 4h stale-author threshold
Routing diff120s (2 min)Announce network knowledge to mesh peers as a full two-pool uniques snapshot; skipped when the content digest is unchangedImplemented
Rebalance600s (10 min)Clean dead connections, signal growthRework — preferred-peer Priority 0 deleted (Iteration B); remaining priorities still target the wide model
Growth loopReactive (signal-driven on knowledge receipt)Fill the single mesh pool toward 20 with the most diverse candidates (fewest reporters wins, shallower bounce breaks ties); secondary peer-finding path alongside convectionImplemented
Convection triggerStochastic, per-disconnectOn each mesh disconnect (temp referral expiry does not count), random choice: do nothing / ask a random known anchor for an introduction / ask a mesh peer. See anchors.Implemented
Recovery loopReactive (mesh drops below 2)Emergency reconnect: mine retained uniques pools for anchor addresses, then known_anchors cache, then any connected anchor peers. Non-stochastic — below 2 it always acts.Implemented
Anchor reachability watcherEvent-driven (portmapper watch channel)Clears anchor candidacy after >5min of no port mapping; restores it when the mapping comes back. Network roams self-heal without restart. Mobile never auto-anchors.Implemented
v0.8 change: The 600s anchor register loop is removed. Nodes no longer maintain ongoing registration with anchors; the per-disconnect stochastic convection action replaces it, and mesh churn makes convection callbacks self-sustaining.

3. Anchors & Connection Convection

Intent

An anchor is any directly-reachable, opted-in node — a standard ItsGoin node with a routable address, running the same code with no special protocol. Anchors are the network's entry and re-entry points: they serve bootstrap (first startup), recovery (mesh loss), and convection (topping up under-connected meshes), and they serve public posts over HTTP to browsers (see HTTP delivery). Anchors include VPS-deployed nodes (always-on) and any desktop with a working port mapping.

v0.8 change: An anchor is no longer a "well-connected" role — the old candidacy checklist (mesh ≥ 50 peers, 2h uptime) is gone. Candidacy is pure reachability + opt-in. The anchor's referral service changes from a use-count-tiered registration list to the rolling convection window described below.

Candidacy: reachability, not popularity

A node is a viable anchor when a complete stranger can connect to it directly — no introduction, no hole punch, no relay. Candidacy has three parts:

Anchor self-verification

A port mapping or public IPv6 address is a claim, not proof. The node selects a witness from its network knowledge that is NOT a current peer — a genuine stranger with no prior connection, no cached address, no warm path — reached via the peer that reported it (AnchorProbeRequest, 0xC3). The witness performs a raw cold QUIC connect to the candidate's external address (15s timeout), deliberately skipping the entire resolution cascade — hole punch, introduction, or relay success would be a false positive.

Asymmetric return path: on success the witness reports back over its fresh direct connection (AnchorProbeResult, 0xC4); on failure there is by definition no direct path, so the result routes back through the reporting peer.

v0.8 (Iteration C): the anchor register cycle the probe used to ride is gone. The probe now rides the convection loop's 10-minute maintenance tick. Note the consequence: is_anchor_candidate no longer requires a successful probe — candidacy is reachability + opt-in, and the probe is confirmation that runs alongside, not a gate in front. Triggering re-probes from the reachability watcher (on mapping acquisition/restoration) and on failed inbound connections remains Planned.

Connection convection Implemented

The anchor's referral service is a rotating referral chain — "connection convection." The anchor keeps only a small rolling window of recent callers; there is no peer database and no persistent registration.

  1. A caller connects and announces "I'm joining / I need peers."
  2. The anchor returns the addresses of the 2 most recent viable prior callers.
  3. The caller's own address is handed out to the next 2 callers, then rotates out of the window.

Window parameters (previously open, now decided in code): the window holds 16 entries; each entry is handed to 2 callers before rotating out; an entry older than 15 minutes is not handed out at all — a stale address is worse than none, because it costs the next caller a hole-punch timeout. A caller with no routable address is admitted to nothing. Self-reported addresses are a caller's unverified claim: at most 2 are kept, and when the anchor has an observed address for the caller (essentially always over QUIC) self-reported entries are kept only if they share its IP — a different port is the legitimate endpoint-dependent-mapping case, a different host is not. Only the observed address is ever named in an anchor-initiated introduction; self-reported ones ride the referral payload as a hint the referred peer may try itself.

Sparse-window supplement: a young anchor with an empty window may fill referrals from its own live mesh peers — but those peers never called and never offered themselves for redistribution, so the supplement is consent-shaped. It discloses no address (the referral carries an empty address list and relies on the coordinated introduction, so the target discloses its own addresses on its own terms), it is used only for peers the anchor can actually introduce, and each supplemented peer carries its own hand-out budget (2 per 15 minutes). Without that budget, unconditional entry-class service plus a reshuffle would be an enumeration oracle over the anchor's entire mesh membership.

Request classes: convection requests carry a one-bit class — entry (bootstrap or recovery: fewer than 2 connections) versus top-up (growth with a working mesh). Anchors always serve entry; top-ups are served capacity-permitting and refused cheaply (a single refusal message, no timeout burned), so deprioritizing the non-needy is harmless. The refusal doubles as the load signal the adaptive weights consume. Top-ups are not freeloading: every caller freshens the anchor's referral window, so top-up traffic is the convection medium — a network where nobody tops up hands its next genuine joiner stale referrals.

Referral quality: the anchor prefers callers it is still connected to — and when both the referred peer and the caller are live on the anchor, it coordinates a RelayIntroduce hole-punch introduction between them instead of handing out a cold address. A referred peer lands in whatever slot class is free: a mesh slot first, and only the temporary referral band above the cap when the mesh is full — from there it graduates into a freed mesh slot or expires.

Trigger — stochastic, per-disconnect Implemented: each time a mesh peer disconnects — a temp referral slot expiring is not mesh churn and does not roll the dice — the node randomly chooses one of three actions: do nothing, request an introduction from a random known anchor (mined from the uniques pools — see bookkeeping below), or request an introduction via a connected mesh peer (the growth loop's diversity-scored path — see connection lifecycle). The randomness itself de-synchronizes the network's reaction to shared disconnection events — no jitter timer, no threshold. Because every caller becomes a referral for the next callers, ordinary churn keeps the chain circulating: convection. With IPv6 making anchors abundant (an estimated 20–30% of nodes), anchors rebuild the mesh among themselves and with their callers, absorbing even large disconnection events. The action-choice weights are adaptive, not fixed. The anchor ratio is locally observable — anchor entries are the ones carrying addresses in the pools, so anchor density among known uniques is a free statistic needing no census — and it sets the prior: anchor-rich networks lean anchor-heavy (which also keeps convection windows fresh), anchor-poor lean mesh-ward. Refusals then steer: an anchor refusing a growth request shifts the caller's weights toward mesh introductions and other anchors, drifting back as requests succeed. How many operators will announce addresses versus hide them (or lack public ones) is unknowable before deployment — the adaptive weights are designed to find that ratio rather than assume it. (The node-ID–to–persona ratio stays deliberately unknowable; this statistic never needs it.)

Done (Iteration C): the older registration model is gone — 0xC0 AnchorRegister and the periodic register cycle are removed along with the in-memory referral list, its tiered use caps and least-used-first selection. The rolling window replaced all of it, and recovery (below 2 mesh peers) stays non-stochastic: it always acts immediately.

Anchor bookkeeping Implemented

Target: the uniques pools ARE the anchor directory. Anchor entries carry addresses in the N0–N3 pools (see Network Knowledge), so a node needing a connection mines its retained pools for a random anchor-flagged entry. Pool knowledge is overwritten memory: a slot's contributed entries are wiped only when a new handshake replaces them — so a node knocked down from 20 peers to 4 still holds 16 dead peers' pools full of anchor addresses to reconnect through. No separately curated anchor list is needed.

The shipped known_anchors table survives as the bootstrap cache, capped at 32 entries and ordered by last_seen_ms (freshest first). Its old success_count ranking solved an anchor-scarcity problem that pool-mined abundance retires. It is written only for anchors we have actually connected to — never from a peer's announce — which is both what keeps gossip from re-inflating a table the ruling deliberately demoted, and what makes its recency ordering mean something again (a cache refreshed by hearsay would evict the DNS-resolved bootstrap anchor first).

Selection order:

  1. Uniques pools Implemented — anchor-flagged entries, shallowest and freshest first, including entries from disconnected peers' retained pools.
  2. known_anchors bootstrap cache Implemented — ordered by last_seen_ms descending. Failed probes to entries not seen for 3 days are deleted on the spot (self-healing against stale data dirs).
  3. Hardcoded default anchor(s) — only if everything above is empty or exhausted. A brand-new node hits the hardcoded anchor once on first bootstrap, populates its caches from that session, and the hardcoded list recedes to pure fallback.

When anchors are used

Session fallback for full anchors

When an anchor's mesh is full, callers fall back to a session connection. The anchor serves convection requests over session connections, not just mesh — a full mesh never makes an anchor unreachable for referrals.

4. Connections & Slot Architecture Implemented

Connection types

Slot architecture

Slot kindDesktopMobileStatusPurpose
Mesh (single pool)2015ImplementedLong-lived routing backbone; every slot equal, filled by growth loop + inbound
Temp referral+10+4ImplementedIntroduction facilitation above the cap; no knowledge exchange; graduate or expire. The +4..+10 ruling is a range; these are the shipped points in it.
Sessions (interactive)205ImplementedActive DM, group interaction, anchor matchmaking. At capacity, the oldest idle session is evicted for a new one.
Relay pipes102ImplementedSession-relay byte pipes. Serving others is opt-in and default OFF (see Relay & NAT Traversal).
v0.8 change: The Preferred/Local/Wide slot taxonomy (10+71+20 = 101 desktop, 3+7+5 = 15 mobile) is replaced by one flat mesh pool of ~20 slots. Preferred peers are eliminated entirely — the CDN's file_holders model replaced the N+10 direct push/pull that preferred relationships existed to serve. Depth now comes from knowledge (4 bounces), not from connection count.
Why 20: the old 101-peer mesh was sized for the pre-CDN push-event world, and its per-client overhead was too high. The mesh's job is width — diverse random connectivity for searches and post propagation. Knowledge depth (N1–N4) recovers the reach that raw connection count used to provide. If uniques-list RAM proves excessive at 20 peers @ 4 bounces, the fallback is fewer peers at 3 bounces.

MeshConnection struct

Each mesh connection tracks: node_id, connection (QUIC), remote_addr (captured from Incoming before accept), last_activity (AtomicU64, updated on every stream accept), connected_at. The per-slot slot_kind discriminator (Preferred/Local/Wide) is gone with the pool merge; a small enum distinguishes Mesh from TempReferral { expires_at_ms }. Allocation is mesh-first, then the temp band, then refuse — nothing in the rule can evict anything, so an established mesh peer is never displaced by an arriving stranger.

Temp referral slots Implemented

Nodes hold temporary connections above the mesh cap — +10 on desktop, +4 on mobile, within the +4..+10 ruling. These exist so that introductions (anchor convection referrals, growth-loop introductions) never fail for want of a free slot, without paying the knowledge-state cost of a full mesh peer:

Mutual mesh blacklist Planned

Targeted two-node stranger relationship. Both nodes opt in, maintaining genuine N2 stranger status indefinitely regardless of growth loop behavior. Stored in a local mesh_blacklist { node_id } table (table does not exist yet).

Mesh-cap override Implemented

Topology control for testing, shipped as the ITSGOIN_TEST_MESH_SLOTS environment override rather than the originally-planned --max-mesh <n> CLI flag. It caps a node's mesh pool below the 20 default so the integration suite can reach the temp-referral boundary with four nodes instead of twenty-one, and so a node can be held permanently in other nodes' N2. Read once into a OnceLock at first use — the cap cannot change under a running node. Refusals reuse RefuseRedirect (0x05) — no new protocol machinery. Testing affordance only.

Keepalive Implemented

5. Connection Lifecycle

Growth Loop (reactive, signal-driven) Rework

There is no periodic growth timer. The loop blocks on a signal channel, coalesces queued signals, then runs connection attempts until slots fill or it backs off. Signals fire on:

v0.8 change: growth targets the whole 20-slot pool. (Today the loop stops when the Local sub-pool is full and Wide slots only fill from inbound — a casualty of the old taxonomy that dies with it.) Rework
v0.8 — stochastic growth Implemented: threshold triggers are replaced by a per-disconnect random choice among {do nothing | convection request to a random known anchor | introduction via a connected mesh peer}. The mesh path uses the diversity-scored candidate machinery below; the anchor path defers candidate choice to the anchor's convection window. Randomness replaces jitter for de-synchronization (see Anchors & Connection Convection).

Candidate selection (N2 diversity scoring) Implemented:

score = 1.0 / reporter_count + (0.3 if not_in_N3)

Connection attempt cascade:

  1. Direct connect (15s timeout) — stored address, or resolved via AddressRequest to the N2/N3 reporters who announced the candidate
  2. Introduction fallback — ask each connected reporter to relay-introduce us (hole-punch coordination)

Failure handling: consecutive-failure counter; after 3 consecutive failures the loop breaks and waits for the next signal. Failed candidates are marked unreachable and skipped in future scoring. After each success the counter resets, a routing diff is broadcast, and the loop pauses 500ms so the new peer's initial exchange can expand the candidate pool before the next pick.

Rebalance Cycle (every 600s) Rework

Executed in order:

  1. Dead connection removal: connections with close_reason() set, or idle > 600s (zombie)
  2. Stale knowledge pruning: entries tagged to a disconnected reporter are cleared immediately at disconnect time; the cycle adds an age-based sweep (5 hours) plus social-route watcher pruning (30 days)
  3. Reconnect recently dead: re-establish dropped mesh connections from stored addresses
  4. Signal growth loop: backstop signal to fill any remaining free slots
  5. Idle session cleanup: reap interactive sessions idle > 300s (5 min). Sessions with a reason to live are exempt: anchor-side referral-list peers and client-side sessions to known anchors.
  6. Relay intro dedup pruning: clear seen_intros entries older than 30s once the map exceeds 500 entries
v0.8 change: the cycle's old Priority 0 — preferred-peer reconnection with eviction of low-diversity peers — is deleted along with preferred peers (MeshPrefer, the 7-day unreachable prune, and the 30-day reconnect watcher all die with it). That was the only eviction path in rebalance, so the target cycle evicts nothing: low diversity alone never disconnects a peer, and temp referrals graduate only into free slots.

Recovery Loop (reactive, mesh < 2) Rework

Trigger: fires when the mesh drops below 2 connections — the one non-stochastic case: at the edge of isolation the node always acts, immediately.

  1. Debounce 2 seconds (let cascading disconnects settle), coalesce queued signals
  2. Gather anchors: mine the retained uniques pools for anchor-flagged addresses (Implemented — disconnected peers' pools survive as overwritten memory until new handshakes replace them), then the known_anchors bootstrap cache, then anchor-flagged entries in the peers table. Anchors that recently refused us are pushed to the back rather than dropped — a refusal is a load signal, not a blacklist.
  3. Make a convection call to each anchor in turn: receive referrals, try direct connect to each, fall back to anchor-coordinated hole punch for unreachable referrals (15s per attempt)
  4. Signal the growth loop as soon as any connection lands; stale anchors are pruned per the 3-day rule (see Anchors & Connection Convection)
v0.8 change: recovery today sends AnchorRegister and pulls from the anchor's registration-based referral list. The registration step dies with the convection redesign — the recovery call itself enrolls the caller in the anchor's rolling referral window.

Initial Exchange (on every new mesh connection) Implemented

When two nodes connect into mesh slots, each sends an InitialExchange (0x02) carrying:

Processing: their N1 → our N2 table (tagged to reporter), their N2 → our N3 table (tagged to reporter). Store profile, apply deletes, record replica overlaps. New N1 knowledge signals the growth loop immediately.

v0.8 (Iteration C, done): the knowledge-share component is now the uniques announce (two pools: forwardable N0–N2 + terminal N3; stored N4 is never transmitted), with the receiver storing each entry shifted one bounce deeper, our terminal pool becoming their N4 (see Network Knowledge). The handshake's other fields carry forward unchanged, except that a temporary referral slot now sends null uniques and an empty peer-address list. Implemented

Incremental Routing Diffs (every 120s + 4h full state) Rework

NodeListUpdate (0x01) carries N1 added/removed and N2 added/removed, sent to connected peers on a 120s cycle; every 4 hours a full-state re-broadcast catches missed diffs. Diffs are also pushed eagerly after each growth-loop connection. Receiver processing mirrors the initial exchange: their N1 adds → our N2 adds, their N2 adds → our N3 adds; diffs with N1 additions signal the growth loop.

v0.8 (Iteration C, done): the 2-minute broadcast is now a full uniques announce under the N1–N4 model, skipped entirely when the content digest is unchanged. Folding its cadence into the update-cadence system's traffic shaping (see Update Cadence & Keep-Alive) is Planned for Iteration D.

6. Network Knowledge: N1–N4 Uniques Implemented

Every node maintains a layered index of uniques — IDs it can help other nodes reach. The index spans four bounces (N1–N4) and is exchanged only between directly-connected mesh peers. Collectively, these per-node indexes form the network's distributed search index: a pull (see Sync Protocol) is an exchange of uniques lists — "if you want these IDs, talk to me and I'll help you find them" — and answering "who can get me to ID X?" is a walk down reporter chains. Content never travels with the index; it lives in the CDN (see Files & Storage).

v0.8 change: replaces the N1/N2/N3 share-list model (101-peer mesh, 3 bounces, mesh NodeIds only). The shipped code is the seed and survives: N1/N2 shares on connect (build_n1_share/build_n2_share), incremental diffs, reporter-tagged reachable_n2/reachable_n3 tables — extended one bounce deeper and widened from "mesh NodeIds" to all uniques.

What is a unique

A unique is any ID a node has a live path to, regardless of why it knows it:

Sources are merged before announcing — a receiver cannot tell whether we know an ID from a mesh slot, a friendship, or a file transfer. Anonymous and throwaway IDs (temporary poster IDs in comment chains, greeting senders) are deliberately kept in the lists: they are network noise that protects anonymity and future hooks for anonymous encrypted messaging over temp IDs. Comment TTL expiry (see Delete Propagation) retires them naturally — when the content dies, the throwaway ID falls out of everyone's uniques.

Our own posting identities are never in our own uniques Implemented. Our node ID — and, when we are an anchor, our address — ride slice 0 of the same announce, so listing one of our personas at bounce 1 would be a signed-by-transport persona→device mapping handed to all ~20 mesh peers. It is also the easiest possible mapping to extract: our own personas are the invariant across every announce we send while everything else churns. Every persona is excluded (not just the default posting ID), as is the author of any comment we wrote locally — which covers the per-greeting throwaway IDs we mint, where we would otherwise be the first node in the network to announce the ID, at bounce 1, the instant the greeting was created. Our personas stay discoverable through everyone else who holds our content; we simply must not be the reporter. See Graph Privacy.

Temp referral slots (see Connections) are the one class of direct connection that does not enter the exchange: they carry no knowledge state in either direction until they graduate into mesh slots.

The four layers

LayerBounceSourceAnnounced?Stored in
N11Our own uniques (merged from all sources above)YesDerived at build time from mesh_peers + social_routes + file_holders + post_replicas + cdn_manifests + comments
N22Peers' announced N1, tagged to reporterYesreachable, bounce = 2
N33Peers' announced N2, tagged to reporterYesreachable, bounce = 3
N44Peers' announced N3, tagged to reporterNever — terminatesreachable, bounce = 4

There is one reachable table, keyed (reporter_node_id, reachable_id), with bounce, id_class, is_anchor, addresses and updated_at columns — not a table per layer. The composite key gives per-reporter set-merge for free, and the upsert keeps the shallowest bounce ever heard from that reporter, so one ID can never occupy two depths from one source (the ambiguity the old reachable_n2/reachable_n3 pair papered over by sorting).

Announce protocol Rework

Deduplication

Dedup happens at both store and announce. Store side: incoming uniques are set-merged per reporter — the same ID reported twice costs one row. Announce side: an ID already announced at a shallower layer is not repeated at deeper layers, so each announcement names each ID at most once, at its closest bounce. Duplication counts are never transmitted (topology leak); dedup keeps the lists to their unique-ID floor.

Size budget

Upper bounds at 20 mesh peers, pure fan-out (real graphs overlap heavily and dedup shrinks all of this):

LayerBoundRaw size (32-byte IDs)
N1~20 mesh + directs + CDN contacts< 10 KB
N2≤ 400~13 KB
N3≤ 8,000~256 KB
N4≤ 160,000+~5 MB

Because N1 includes directs and CDN contacts (not just the 20 mesh slots), per-node branching runs above 20 and real N4 lists can exceed the pure-mesh bound — the "160k+" is a planning floor, not a ceiling. With reporter tags and SQLite index overhead, expect low tens of MB worst-case on disk. That is acceptable on desktop; if list sizes blow past the budget in practice, the depth default shrinks (<20 peers @ 3 bounces was the explicit fallback in the design ruling).

Device-tiered depth

Depth is a per-device choice, not a protocol constant. Desktop and anchor nodes hold the full N1–N4. Mobile holds 3 bounces Implemented: it drops the terminal pool on receipt and advertises depth = 3 in its announce, so senders skip building the terminal slice for it — the single biggest bandwidth saving on a cellular link. Mobile still announces its own N3, so it remains a full participant in the network's depth; it only declines to store the terminal layer.

Bloom-compressed N4 Planned was the alternative (~10 bits/entry at 1% false-positive → ~200 KB for 160k entries) and is not implemented. A Bloom N4 would answer the only question N4 exists for — "can this peer help me reach ID X?" — without supporting enumeration, which N4 never needs since it is never announced. Dropping is the simpler of the two and is what ships.

Indexed access

A node has indexed access to a target if the target appears anywhere in its N1–N4: the target is then resolvable by reporter-chain queries alone, with no worm search or relay introduction. The update-cadence system (see Update Cadence & Keep-Alive) uses indexed access to decide whether extra session connections are needed for social and file operations. (This replaces the old "<N4 access" term, which meant "within 3 hops" back when N4 didn't exist as a layer.)

What is NEVER shared

Address resolution cascade (connect_by_node_id) Implemented

StepMethodTimeoutSource
0Social route cachesocial_routes cached addresses, then known-peer referrals
1Peers tableStored address from previous connection
2–3N2/N3 reporter chainvariesAsk the peer who reported the target; N3 chains through the reporter's reporter
4Worm searchboundedPoint query beyond the index (see Worm Search)
5Relay introduction15sHole punch coordinated via an intermediary (see Relay & NAT Traversal)
6Session relayOpt-in only, default OFF on both the serving and using side (see Relay & NAT Traversal)

Peers that fail all direct steps are marked likely-unreachable, so later attempts skip straight to introduction rather than burning timeouts on dead addresses — but only when a reporter was actually available to ask; failing for want of a connected reporter says nothing about the candidate and must not suppress it. Resolution and growth-candidate scoring now share one horizon (bounces 2–4), and depth is a graded penalty in the scorer so a bounce-4 sighting can never outrank a bounce-2 one. The third reporter-chain link — resolving an N4 hit through the reporter's reporter — has not landed Planned: today an N4 entry is resolved by asking its direct reporter, exactly like N2 and N3.

7. Three-Layer Architecture (Mesh / Social / File) Rework

The network operates across three layers, each with its own connections, routing, and purpose. The division of labor is: mesh is width, CDN is depth. The mesh gives every node a diverse random slice of the network — enough width that searches terminate and the uniques index covers the graph. The CDN gives content a home and every lookup a concrete target — updates, messages, and FoF-adjacent content discovery all resolve to "find a holder, fetch from it."

LayerJobConnectionsWhat travels
MeshWidth: diverse connectivity, N1–N4 uniques index, searches, referrals~20 mesh slots + 4–10 temp referral slots (see Connections)Uniques announcements, worm queries, introduction traffic
SocialFollows, audience, DMs — the human relationshipsSocial routes + on-demand session connectionsAddress updates, check-ins, DM delivery
FileDepth: content storage and distributionFlat file_holders, cap 5 per file (see Files & Storage) + on-demand fetchesPosts, blobs, comments, engagement

Key principle: the mesh carries the index, the CDN carries the content

Pulls between mesh peers exchange uniques lists — the search index — never post bodies or blobs. When the index says an author or file exists, the actual bytes come from a CDN holder via a point fetch. So mesh connections stay cheap and optimizable purely for topology (diversity scoring has no social bias), while content bandwidth concentrates on the flat holder set where replication and eviction manage it.

v0.8 change: replaces the old rule "pull sync never pulls posts from mesh peers." Under uniques pulls, mesh peers are exactly who you pull from — but what you pull is the index, not content. The old rule's intent (no content flooding over mesh links) survives; the post-carrying pull it was guarding against is retired (see Sync Protocol).

Cross-layer benefits

Each layer feeds the others through the uniques index. Social directs and CDN file contacts enter our N1 alongside mesh peers, so a friendship or a file transfer improves everyone's reach — a follow can provide the N2 entry that helps a stranger's chain query terminate, and a mesh peer can provide the reporter chain that reconnects two friends after an address change. Because sources are merged before announcing, this sharing costs no relationship privacy.

8. Social Routing Implemented

Caches addresses for follows and audience members, separate from mesh connections. Social contacts are consented relationships, so — unlike the uniques exchange — these payloads do carry addresses: that is the point of the layer (see Graph Privacy for the exact scoping). Every social route is also an N1 unique, announced source-merged like any other.

social_routes table

FieldPurpose
node_idThe social contact's NodeId
addressesTheir known IP addresses
peer_addressesKnown-peer referral addresses (PeerWithAddress list) — peers of theirs we can ask when their own addresses go stale
relationFollow / Audience / Mutual
statusOnline / Disconnected
last_connected_msWhen we last connected
last_seen_msWhen we last heard anything about them
reach_methodDirect / Relay / Indirect
v0.8 change: the preferred_tree column and all N+10 semantics are retired with preferred peers (see Connections). peer_addresses survives as plain known-peer referrals with no preferred-tier meaning.

Wire messages Implemented

CodeNameStreamPurpose
0x70SocialAddressUpdateUniSent when a social contact's address changes or they reconnect
0x71SocialDisconnectNoticeUniRemoved in v0.8 — zero senders existed; social-route staleness is inferred from checkin timeouts
0x72SocialCheckinBiKeepalive with address + known-peer referral updates

Reconnect watchers Implemented

reconnect_watchers table: when peer A asks about disconnected peer B, A is registered as a watcher. When B reconnects, A gets a SocialAddressUpdate notification and the watch is cleared. Watchers are pruned after 30 days.

Social route lifecycle

Role under the v0.8 model

Social routing is the warm path for the people you actually talk to: step 0 of the address resolution cascade, the delivery route for DMs, and the freshness signal that drives the top tiers of the update cadence (see Update Cadence & Keep-Alive — messaged, followed, and vouched relationships check most often). Content from social contacts still arrives via the CDN like everything else; the social layer only carries the addresses and the relationship state.

9. Relay & NAT Traversal Implemented

How a node reaches a peer behind NAT: a mutual contact performs introduction (signaling only), then both sides hole punch. Relaying actual session bytes through a third party is a separate, opt-in facility (see below) — introduction and hole punching are always on.

Relay selection (find_relays_for) Rework

Find up to 3 relay candidates from knowledge-layer reporters, prioritized:

  1. N2 reporters: Our mesh peers who announced the target among their own uniques. They are connected to the target right now (or were very recently). TTL=0.
  2. N3 reporters: Peers whose announced knowledge places the target two hops away. TTL=1 — the relay chains the introduction through its own peer.
  3. Deep uniques reporters: With N1–N4 knowledge (see Network Knowledge), the uniques index names which mesh peer "can help reach" the target even when the target sits three or four bounces out. The introduction chains along the announce path, decrementing TTL at each hop (max TTL=2).
v0.8 change: the two preferred-tree candidate tiers (intersecting the target's ~100-node preferred_tree with our connections) are removed along with preferred peers. Done (Iteration B): the tiers were deleted from find_relays_for (connection.rs); code now keeps only knowledge-layer reporters.

RelayIntroduce flow (0xB0/0xB1)

  1. Requester → opens bi-stream to relay, sends RelayIntroduce { target, requester, requester_addresses, ttl }
  2. Relay handles three cases:
    • We ARE the target: Return our addresses, spawn hole punch to requester
    • Target is our mesh or session peer: Forward request to target on new bi-stream, relay response back. Inject observed public addresses for both parties (session peers carry remote_addr from their inbound connection).
    • TTL > 0 and target in our N2: Forward to the reporter with TTL-1 (chain forwarding, max TTL=2)
  3. Requester receives RelayIntroduceResult { target_addresses, relay_available }, then:
    • hole_punch_parallel(): Try all returned addresses in parallel, retry every 2s, 30s total timeout
    • If hole punch fails, relay_available is true, and the local user has enabled session relay: open SessionRelay (0xB2) pipe through the intermediary

Anchors also perform introduction as part of connection convection: when a convection caller and a referred peer are both live on the anchor, the anchor coordinates RelayIntroduce between them (see Anchors).

Session relay (relay pipes)

Intermediary splices bi-streams between requester and target. Desktop: max 10 concurrent pipes. Mobile: max 2. Each pipe has a 50MB byte cap and 2-min idle timeout.

Session relay is OPT-IN ONLY and DISABLED BY DEFAULT — including for anchor-mode nodes (servers are most likely to pay for bandwidth). Gated by the relay.session_relay_enabled setting on both serving (can_accept_relay_pipe) and using (the auto-fallback after a failed hole punch). Settings UI exposes the toggle. Hole-punch-failure never silently routes a peer-to-peer session through an unrelated third party's bandwidth.

This rule covers only full byte-piping. Small relay-style signaling/discovery — RelayIntroduce for hole-punch coordination, worm_lookup multi-hop search, uniques-list announce exchange — remains always-on; that's not session relay. The anchor's HTTP proxy path (anchor fetches a post via QUIC and serves it back over HTTP) is also not session relay — it's the anchor doing its own QUIC fetch on the browser's behalf.

Deduplication & cooldowns

MechanismWindowPurpose
seen_intros30sPrevents forwarding loops
relay_cooldowns5 min per targetPrevents relay spamming

Hole punch mechanics

Both sides filter self-reported addresses to publicly-routable only (no Docker bridge, VPN, or LAN IPs) and prepend the port-mapped external address if available. The relay injects each party's observed public address (from the QUIC connection) at the front of the list. All paths use hole_punch_parallel(): parse returned addresses into QUIC EndpointAddr, spawn parallel connect attempts to every address simultaneously. Each attempt: 2s timeout, retried until 30s total deadline. First successful connection wins.

NAT type detection Implemented (interim: public STUN servers)

On startup, each node classifies its NAT type as one of four categories:

Current implementation (interim)

Raw STUN Binding Requests (20 bytes, no crate dependency) sent to stun.l.google.com:19302 and stun.cloudflare.com:3478 from a single UDP socket. XOR-MAPPED-ADDRESS parsed from each response (IPv4 + IPv6 supported). Comparison: same mapped port = Easy, different = Hard, matches local = Public. 3s timeout per server. Port-mapping success overrides to Public. Anchors skip probing entirely (already Public).

Target design (multi-anchor STUN) Planned

When the network has enough anchors, replace public STUN servers with anchor-reported your_observed_addr from InitialExchange. Connecting to two or more anchors at different public IPs provides the same classification without external dependencies. Anchor convection makes this cheap: the convection trigger already contacts anchors periodically.

NAT type sharing

NAT type is included as a string field ("public"/"easy"/"hard"/"unknown") in InitialExchangePayload. Stored per-peer in the peers table (nat_type TEXT column). Available for hole punch decisions before any connection attempt.

Hole punch strategy

Peer APeer BStrategy
Public / EasyAnyHole punch (likely success)
Hard NATEasy NATHole punch (B's port is predictable)
Hard NATHard NATPort scanninghole_punch_with_scanning() tries standard punch first, then escalates to tiered port scanning (±500, ±2000, full ephemeral range). Currently disabled — see below.

All hole punch paths use hole_punch_with_scanning(). NAT profiles (NatMapping + NatFiltering) from InitialExchange determine whether scanning is attempted. Behavioral inference updates filtering classification from connection outcomes.

Advanced NAT traversal (EDM port scanner) Rework

Disabled since v0.7.3. hole_punch_with_scanning() currently does only Step 1 (quick punch to the anchor-observed address) and Step 2 (parallel punch to all known addresses over a 30s window). No port scan.

Why: iroh's Endpoint accumulates every endpoint.connect() target into a per-endpoint paths set and probes them all in the background under QUIC NAT-traversal. A 100-probes/sec / 5-min scan inserted ~30,000 paths; iroh then probed all of them. Observed at 22MB/s outbound from a single client — DoS-grade.

Refactor target: replace per-probe endpoint.connect() with raw socket.send_to() on the endpoint's bound UDP socket. The probe still opens a NAT mapping on our side; we just don't ask iroh to manage the path. The original scanner body is preserved as edm_port_scan_disabled_v0_7_3 in connection.rs, including PortWalkIter, scanner_semaphore, role-based scanner/puncher split, and the tokio::select! orchestration — refactor against that.

The description below documents the intended design the refactor will deliver against.

NAT "hardness" has two independent dimensions:

STUN probing at startup classifies mapping (EIM/EDM). Filtering is determined reliably via the anchor filter probe.

NAT filter probe (0xC6/0xC7)

At startup, after first anchor contact, each node with Unknown filtering sends a NatFilterProbe bi-stream request to its anchor. The anchor creates a temporary QUIC endpoint on a random port and attempts to connect to the node’s observed address (2s timeout). If the connection succeeds, the node is Open (address-restricted or better — accepts packets from any port on the anchor’s IP). If it times out, the node is PortRestricted.

The result feeds into all subsequent InitialExchange payloads, so peers know each other’s exact filtering type.

Note: “Public” NAT type does not automatically mean Open filtering. A node may be public on IPv6 but NATed on IPv4. The filter probe tests actual reachability from a different port, regardless of self-declared NAT type. Startup logs report public (v4 only), public (v6 only), or public (v4+v6).

NAT combination matrix

Side ASide BResult
addr-restricted, EIMaddr-restricted, EDMBasic hole punch
port-restricted, EIMaddr-restricted, EDMA scans to find+open port; B punches A’s stable port regularly
addr-restricted, EDMport-restricted, EDMB scans to find+open port; A waits then responds
port-restricted, EDMport-restricted, EDMBoth scan+punch alternately
addr-restricted, EIMaddr-restricted, EIMBasic hole punch
port-restricted, EIMaddr-restricted, EIMBasic hole punch
addr-restricted, EDMport-restricted, EIMB scans to find+open port; A punches B’s stable port regularly
port-restricted, EDMport-restricted, EIMB scans to find+open port; A punches B’s stable port regularly

Key insight: if both sides have Open (address-restricted) filtering, scanning is never needed — should_try_scanning() returns false and basic hole punch handles it.

Role-based scanning protocol

Each side independently determines its role based on its own NAT profile:

The scanner opens ports on its own firewall. The other side’s periodic punch (one every 2s to the scanner’s observed address) checks if the scanner has opened a port matching the puncher’s actual port. For both-EDM pairs, both sides scan and punch simultaneously.

Scan parameters

Why 5-minute scan duration is acceptable

The cost is time, not resources (~20 in-flight at any time, ~100 probes/sec). For connections that would otherwise be impossible (both EDM + port-restricted), accepting a longer setup time is far better than giving up entirely. Most successful connections resolve within the first 40 seconds (±2000 port range).

Design principle: This protocol eliminates the need for full relay in virtually all NAT scenarios. Session relay remains opt-in only — it is never used as an automatic fallback. The scanning approach respects the user’s intent that peers communicate directly whenever physically possible.

10. Port Mapping — UPnP-IGD + NAT-PMP + PCP Implemented

Purpose

Asks the local gateway router to forward an external port to this node's local QUIC port. A successful mapping makes the node directly reachable from the internet without hole punching — any peer with the external address can connect immediately. Three protocols are attempted in parallel; the first router-response wins.

Protocols

Implementation uses the portmapper crate (also used by iroh internally), wrapped in the upnp.rs module (named for historical reasons; it covers all three protocols); network.rs holds the resulting mapping handle alongside the iroh Endpoint — port mapping is an Endpoint concern, not a connection concern.

Startup flow

bind Endpoint → spawn portmapper Client (UDP) → wait up to 3s for first protocol response → bootstrap (TCP mapping fires in parallel for HTTP serving)
  1. Probe all three protocols in parallel: portmapper's background service fires UPnP-IGD discovery + NAT-PMP unicast + PCP unicast concurrently. First success wins; failures from the others are absorbed silently.
  2. UDP mapping for QUIC: maps the local QUIC port to an external port. Required for direct inbound. Address feeds self-identification, InitialExchange, anchor candidacy, and peer address advertisements.
  3. TCP mapping for HTTP: separate parallel attempt for HTTP serving (see HTTP Content Delivery). Independent of UDP — either can succeed alone. Phones with permissive NAT can serve HTTP directly to browser fetches.
  4. Per-platform behavior: All three protocols on desktop. On Android, a WiFi/Ethernet gate skips probing on cellular (no UPnP/PCP gateway exposed by carriers) and a WifiManager.MulticastLock is held for the lifetime of the mapping so UPnP-IGD's SSDP responses actually arrive. On iOS, PCP and NAT-PMP work without the multicast entitlement; UPnP-IGD silently fails until the entitlement is granted.

Auto-renewal

The portmapper::Client renews leases internally in a background task. No external renewal cycle to schedule. Dropping the PortMapping handle aborts the renewal task and releases the mapping.

Bidirectional anchor reachability watcher

A startup-spawned task watches the UDP mapping's reactive external-address channel:

Network roams between UPnP-capable WiFi networks self-heal. Mobile devices never auto-anchor regardless — cellular IPs look public but sit behind CGNAT.

Port mapping drives anchor candidacy

A node with a successful mapping is directly reachable from the internet — which is the only thing that makes an anchor an anchor. Anchor candidacy under v0.8 is exactly this: stable direct reachability (the watcher above) + opt-in, not a peer-count threshold. When the mapping succeeds on an opted-in non-mobile node, is_anchor is set and the node begins offering the convection service (see Anchors); when the mapping is lost, it reverts to non-anchor and peers prune the stale entry via failed-probe pruning. Any desktop on a home network with a mapping-capable router becomes a potential entry point for the network, with no manual server deployment.

Shutdown

Explicitly release the mapping on clean shutdown. Routers have finite mapping tables — releasing is good citizenship.

Integration with existing address logic

The mapped external address is treated the same as any other address the node knows about. It feeds into:

Why this matters for mobile

Mobile devices on cellular networks cannot use UPnP (carrier NAT doesn't expose it). However, if the peers they're trying to reach (especially desktop nodes and anchors) have port mappings, those peers become directly reachable from the phone without hole punching. The phone doesn't need a mapping — the other side does.

Honest limitations

LimitationImpact
UPnP disabled on routerSome ISPs ship routers with UPnP off. Mapping silently fails, fallback to hole punch.
Double NATISP modem + user router: mapping reaches inner router but not outer. Partial help at best.
Cellular networksNo UPnP at all. This is purely a desktop/home-network feature.
Carrier-grade NAT (CGNAT)ISP shares one public IP across many customers. Mapping reaches the ISP's NAT, not the internet. Same as double NAT.
Design principle: Port mapping is a best-effort enhancement that improves direct connection reliability for the common case. It is not a dependency. The hole punch fallback chain already handles all failure cases — mapping just reduces how often you fall back to it.

11. LAN Discovery Planned (passive lookup Implemented)

What exists today: passive mDNS address lookup

iroh's built-in MdnsAddressLookupBuilder is registered on the endpoint (service name "irohv1", backed by the swarm-discovery crate). It resolves addresses passively: when this node already knows a peer's NodeId and tries to connect, mDNS supplies the peer's LAN address if the peer is on the same network segment, and the connection rides the local link. There is no subscribe loop, no proactive session establishment, and no LAN-specific treatment beyond address resolution.

v0.8 change: earlier revisions of this document badged the full active flow as complete; an audit found only the passive lookup exists. The active design below is kept as a low-priority target.

Active discovery flow

  1. Hold the mDNS handle: Build MdnsAddressLookup explicitly (not via the endpoint builder) so we retain a clone for subscribing.
  2. Spawn a LAN scan loop: Call mdns.subscribe().await to get a stream of DiscoveryEvent::Discovered and DiscoveryEvent::Expired events.
  3. On discovery: Extract NodeId + LAN addresses from the event. If not already connected, initiate a direct connection + initial exchange. Register as a LAN session (its own planned session class — see below).
  4. On expiry: Clean up the LAN session. Peer left the network or powered off.

LAN sessions

LAN peers are special: zero-cost bandwidth, sub-millisecond latency, and very likely someone you know (same household/office). They deserve their own treatment beyond regular mesh or session slots:

Design rationale

Today, two devices on the same WiFi network only connect over the LAN if one already knows the other's NodeId. That's a narrow win — they're on the same network segment and should find each other unaided. Active LAN discovery turns mDNS from a passive address resolver into an active peer source, exploiting the fact that local bandwidth is essentially unlimited.

The LAN-session pattern means a household with one well-connected desktop and several phones creates its own mini-mesh: the desktop provides anchor-like connectivity (routing the phones' traffic through it requires the owner's session-relay opt-in), and everyone syncs instantly over the LAN even when the internet connection drops.

Implementation note: iroh's MdnsAddressLookup::subscribe() returns a Stream<DiscoveryEvent>. The DiscoveryEvent::Discovered variant includes EndpointInfo with NodeId + IP addresses. Custom user_data can be set via endpoint.set_user_data_for_address_lookup() to embed app-specific metadata (e.g., display name) in the mDNS TXT record. Low priority relative to the v0.8 mesh work.

12. Worm Search Implemented

The network's point-query mechanism: given a specific NodeId, post ID, or blob ID, find someone who has it. Used at step 4 of connect_by_node_id, after direct-address and N2/N3 resolution fail. Under v0.8 it is the fallback behind the uniques index — deep N1–N4 knowledge answers most "who can reach X" questions locally, and worm search covers the remainder.

No keyword search — by design. Worm search takes exact IDs only. A global keyword flood-search was considered and rejected for v0.8: in a 20-wide mesh it degenerates into hop-TTL flooding whose abuse and jamming limits would destroy its value. Person-discovery is handled by the opt-in registry instead (see Discovery & First Contact).

Algorithm

  1. Build needles: target NodeId + up to 10 of the target's recent peers (from their stored profile) — 11 needles total. Finding anyone who can reach any needle gives a path to the target.
  2. Local check: Search own connections + N2/N3 for any needle. Also check local storage, known file_holders, and the blob store for any requested post/blob content.
  3. Burst (500ms timeout): Send WormQuery{ttl=0} (0x60) to all mesh peers in parallel. Each peer runs the same local check against its own knowledge.
  4. Nova (1.5s timeout): Each burst response includes a random referral to one of the responder's other peers (historically called a "wide referral," after the retired Wide slot tier). Connect to those referrals and send WormQuery{ttl=1}; the referred peer fans out to its own mesh with ttl=0. Expansion is one hop at a time rather than a flood, keeping network pressure low.
  5. Total timeout: 3 seconds for the entire search.

With a ~20-peer mesh the raw two-hop fan-out is a few hundred nodes — smaller than the old 101-mesh's reach — but under the v0.8 knowledge model Rework each queried peer will answer from much deeper knowledge: its N1–N4 uniques (tens of thousands of IDs at 4 bounces) plus its file_holders map. (Today peers answer from N2/N3 share lists.) Coverage shifts from "how many nodes did the query touch" to "how much does each touched node know".

Content search

WormQuery carries optional post_id and blob_id fields, enabling unified search for nodes, posts, and blobs in a single query. Each peer checks:

WormResponse carries post_holder and blob_holder fields alongside the node search results. A content hit (post or blob holder found) is treated as a successful response even without a node match.

PostFetch (0xD4/0xD5)

Lightweight single-post retrieval after worm search identifies a holder. Opens a bi-stream to the holder and requests one post by ID. Much lighter than a full pull exchange — no filtering, no batch processing, just the target post.

Dedup & cooldown

MechanismWindowPurpose
seen_worms10sPrevents loops during fan-out
Miss cooldown5 min (in DB)Prevents repeated searches for unreachable targets

13. Update Cadence & Keep-Alive Rework

Purpose

One scheduled system drives all recurring traffic: content freshness checks, uniques-list refresh, and connection keep-alive. Every node runs a check cycle whose per-item frequency descends from minutes to days, computed from two axes:

The effective interval is the product of both axes: a followed author's post commented on an hour ago might check every few minutes; a reacted-to post untouched for a month checks daily.

What rides the cycle

Same-author dedup

A successful check against one of an author's posts is evidence about all of them: their other posts' checks are deprioritized (pushed later in the cycle) rather than fired back-to-back. This is the main lever for finding the lowest viable cadence — per-author, not per-post, contact frequency.

Jitter as traffic shaping

Every interval carries random jitter, and checks are spread rather than batched at tier boundaries. The goal is that a node's outbound request stream looks like uniform network overhead: an observer watching traffic timing should not be able to infer which authors the user cares about, which posts are theirs, or where content originated. Request-timing correlation is the primary deanonymizer in a P2P network; the cadence system is the defense (adversary model in Graph Privacy).

Mobile

Mobile stretches all cadence bands and batches wakeups — the radio is the battery cost, not the bytes. Background-restricted platforms run the cycle only while the foreground service is alive.

v0.8 change: this replaces the previously planned "keep-alive session pool" (a 60s connectivity check holding up to 50% of session capacity open to social/file contacts). Deep N1–N4 knowledge plus CDN holder search make standing reachability sessions unnecessary — sessions open on demand and close when idle; only the shaped check cycle recurs.

Implementation status

The seed exists: a freshness-tiered engagement check in storage (get_posts_due_for_engagement_check) schedules per-post checks at 5 min / 1 h / 4 h / 24 h keyed on last-engagement age. The relationship-tier axis, same-author dedup, jittered shaping, and the uniques-refresh piggyback are not built — the current code is the freshness axis only.

14. Content Propagation

Intent

"Attention creates propagation": when you view something, you cache it. The cache is optionally offered for serving. Hot content spreads naturally through demand. Cold content decays unless intentionally hosted.

Content travels through the network exclusively via the CDN: the mesh provides width (who exists, who can reach whom — the N1–N4 uniques index), the CDN provides depth (the actual posts, blobs, comments, and updates). A pull tells you who to talk to; the CDN holder model is how the bytes move.

v0.8 change: the flat holder model replaces the CDN hosting tree (1 upstream + 100 downstream per blob, relay-down-tree ManifestPush, BlobDeleteNotice healing). There are no upstream/downstream relationships anywhere — every holder is a peer of equal standing.

The flat holder model Implemented

Every file (blob CID) has a single flat set of known holders in the file_holders table, capped at 5 per file with LRU eviction — the 5 most recently interacted-with holders survive, older entries are dropped. A holder entry records the peer's NodeId, last-known addresses, last interaction time, and a direction flag:

DirectionMeaning
sentWe served this file to the peer — they likely hold it now
receivedWe fetched this file from the peer — they definitely held it
bothTraffic has flowed both ways (entry promoted on conflict)

Holder knowledge accretes as a side effect of every transfer: serving a blob registers the requester, fetching a blob registers the source, replication acceptance registers both ends, and engagement propagation refreshes entries. No registration protocol exists — the table is a passive record of observed reality, which is why the LRU cap is safe: stale entries age out under real traffic.

Holder redirect at capacity Implemented

When a node serving a BlobRequest already knows 5 holders for the file, it still serves the bytes but declines to register the requester (cdn_registered: false) and instead returns its holder list as redirect candidates. The requester records those peers as additional sources for future lookups. This spreads lookup load across the holder set instead of concentrating it on whichever node happens to be well-known.

Manifest freshness Implemented

Passive discovery via manifest neighborhoods

Every AuthorManifest carries a neighborhood of the author's surrounding PostIds. Holding any file by author X therefore passively reveals some of X's other recent posts — hosts of old content are pulled toward new content by the same author. Attention creates propagation. In v0.8 the neighborhood is deliberately small: it is capped to the author's concealment budget of 2–5 publicly revealed posts (below), not a full recent-history window.

Active replication cycle Rework

Authors own durability for their own recent content. Every 10 minutes, a node checks its own posts younger than 72 hours; any with fewer than 2 known holders are offered to connected peers via ReplicationRequest. Target selection ranks peers by device role (Available desktops > Persistent anchors > Intermittent phones) plus advertised cache pressure. Accepting peers store the blob and both ends record each other in file_holders.

Known bug (fix required): the cycle queries "own posts" by network NodeId, but posts are authored under posting IDs (split in v0.6.1) — the under-replicated set is always empty and the cycle is currently inert. The machinery is correct; the author lookup must move to posting identities.

Author concealment & traffic shaping Planned

The replication cycle is also the privacy mechanism. An author's node publicly holds and reveals only 2–5 of its own posts at any time; the surplus is pushed out to holder sets on other nodes via replication requests, so the full catalog is served from behind public mesh IDs rather than from the author's device. Combined with the jittered update cadence, the goal is that update and replication traffic is indistinguishable from uniform network overhead — an observer watching traffic cannot tell where content originates or which node is the author. The adversary model is detailed in Network Graph Privacy.

Deletion

There is no delete notification message. Deletes are signed control posts that propagate through the same manifest/pull machinery as any other post; holders that process one drop the content and its holder entries, and everyone else's copy ages out via LRU eviction. Details in Delete Propagation & Expiry.

15. Files & Storage

Blob storage Implemented

PropertyValue
CID formatBLAKE3 hash of blob data (32 bytes, hex-encoded)
Filesystem path{data_dir}/blobs/{hex[0..2]}/{hex} (256 shards)
Metadata tableblobs (cid, post_id, author, size_bytes, mime_type, created_at, stored_at, last_accessed_at, pinned)
Max blob size10 MB
Max attachments per post4
Delivery budgetPer-hour outbound serving cap set by device role; auto-resets hourly. Requests beyond budget answered found: false.

Blob content immutability

Blob data is BLAKE3-addressed — the CID is the hash of the content. This means blob content is immutable by definition. Any mutable metadata (engagement, holder knowledge, signatures) MUST be stored separately in a BlobHeader. Inline mutable headers are architecturally incompatible with content addressing.

BlobHeader Implemented

Mutable structure stored and transmitted separately from blob data. Carries engagement state and encrypted slots for private posts; mutations travel as BlobHeaderDiff ops between holders.

BlobHeader {
    post_id,                // PostId this header belongs to
    author,                 // Author posting ID
    reactions,              // Vec of public reactions (emoji + reactor + timestamp)
    comments,               // Vec of comments (text + author + timestamp + signature)
    policy,                 // Author-controlled CommentPolicy (incl. FriendsOfFriends)
    updated_at,             // Timestamp of last header update
    thread_splits,          // Linked thread posts when comments exceed 16KB
    receipt_slots,          // Encrypted delivery/read/react receipt slots (private posts)
    comment_slots,          // Encrypted comment slots (private posts)
    prior_author,           // Original author before cross-identity post merge (optional)
}

Header diffs also carry the FoF lifecycle ops (FoFRevocation, FoFAccessGrant, FoFKeyBurn — see Friend-of-Friend Visibility) and, in the v0.8 target, each comment carries its expiry timestamp fixed at creation (see Delete Propagation & Expiry).

Blob transfer flow (0x90/0x91) Implemented

  1. Requester sends BlobRequest { cid, requester_addresses }
  2. Host checks local BlobStore and delivery budget:
    • Has blob, budget OK: Return base64-encoded data + CDN manifest (with current holder count). If the host knows fewer than 5 holders, register the requester (cdn_registered: true); otherwise return the known holders as cdn_redirect_peers.
    • No blob / budget exhausted: Return found: false
  3. Requester verifies CID, stores blob locally, records the host in file_holders (direction received), and stores any redirect peers as additional holder knowledge.

Manifests Rework

v0.8 change (privacy fix): today's AuthorManifest ships the device's real addresses under a posting-identity author and a 10+10 post neighborhood. Both violate the v0.8 privacy rulings: posting identities must be location-anonymous, and the neighborhood must not reveal more than the concealment budget. This fix is a prerequisite for the discovery registry (Discovery & First Contact).

Blob eviction Implemented

priority = pin_boost + share_boost + (relationship × heart_recency × freshness / (peer_copies + 1))
FactorCalculation
pin_boost1000.0 if pinned, else 0.0. Own blobs auto-pinned.
share_boost100.0 at 3+ known holders; 50.0 × n / 3 for 1–2 holders; 0 otherwise. Holder count comes from file_holders (max 5) — content with a healthy holder set is being actively served and stays cached longer.
relationship5.0 (own content), 2.0 (followed author), 0.1 (stranger). The own-content tier currently compares against the network ID and never matches post-split; own blobs stay protected via auto-pin. Fix rides the ID-class sweep (see Identity Architecture).
heart_recencyLinear decay over 30 days since last access: max(0, 1 - age/30d)
freshness1 / (1 + post_age_days)
peer_copiesKnown replica count from post_replicas, counted only if confirmed within the staleness window

Eviction is also the passive half of delete propagation: unreferenced blobs (orphaned by a delete control post that hasn't reached this node) simply score low and age out.

Pin modes Planned

The CDN is delivery infrastructure, not storage. Authors own durability. Pinning extends content in the local delivery pool — it is not a network obligation.

ConceptStatus
Anchor pin vs Fork pinNot started. Anchor pin = host the original (author retains control). Fork pin = independent copy (you become key owner).
Personal vaultNot started. Private durability for saved/pinned items.

16. Erasure-Coded CDN Replication Planned

Problem

Full-copy replication works well when the replicating node chose to pull the content — a follow relationship or explicit action establishes user consent. But the ReplicationRequest (0xE1) protocol also pushes content to infrastructure nodes that never chose to host it. A node holding a full copy of content it never reviewed faces potential liability for that content.

Encryption does not solve this for public posts: the content is plaintext by definition. A different mechanism is needed that makes it technically impossible for a CDN node to possess reconstructable content.

Approach: sub-threshold erasure shards

Instead of replicating full blobs, public post auto-replication distributes erasure-coded shards using a 3-of-10 scheme (k=3, n=10). Each shard contains 1/3 of the data. Reconstruction requires cooperation from any 3 of the 10 shard holders. A single shard is mathematically meaningless noise — not encrypted content where the full payload exists behind a key, but genuinely incomplete data that cannot be reconstructed alone.

Where sharding applies

The existing storage tiers each have their own liability story. Sharding only fills the gap for public auto-replication:

TierStorageDefense
Author’s nodeFull copyPublisher responsibility (content originator)
Pulled content (follows)Full copyUser consent — explicit follow relationship
Private auto-replicationEncrypted (CEK envelope, Encryption Architecture)Replicating nodes are provably not keyring recipients — existing encryption architecture handles this
Public auto-replicationErasure-coded shardsSub-threshold shard — reconstruction impossible from any single holder

Composition with the flat holder model

Each shard is content-addressed like any other blob and tracked through the same file_holders machinery, keyed on the shard's own CID. The 5-holder LRU cap applies per shard, so the 10 slots of a 3-of-10 chain are 10 independent holder sets — the cap and the slot count do not interact. Eviction scoring, holder redirect, and manifest refresh work unchanged; sharding is an additional layer on the auto-replication path only, and full copies continue to flow through the flat model untouched.

Shard assignment

Slot assignment is deterministic from the PostId via DHT-style hashing, carried in the existing BlobHeader metadata — no additional discovery round required. Each node enforces single-slot acceptance: it only accepts shard push offers for its assigned slot, rejecting others. This prevents a bad actor from accumulating multiple shards toward the reconstruction threshold. Slot assignment is acceptance policy, not exclusivity — transient duplicate holders for the same slot are harmless and add redundancy.

Health monitoring

Interaction with full copies

As content gains followers, the follow graph naturally absorbs redundancy through full-copy pulls. The shard layer can back off:

This means popular content automatically shifts from CDN shard infrastructure to the social follow graph. The shard layer only works hard for content nobody has explicitly chosen to keep — exactly the content with the highest liability exposure.

Re-replication

When a slot goes dark, a new shard holder is assigned via DHT. The new holder determines which chunks belong to its slot and pulls only those chunks from the live shard holders that have them. No shard holder ever reconstructs the full content — each node only ever possesses its own slot’s chunks. The pulling node identifies what it needs, requests those specific chunks, and aggressively refuses anything outside its assigned slot. The author’s node can go offline permanently once shard replication is established.

Replication window

Active shard push replication applies the same 72-hour window as full-copy replication: only posts less than 72 hours old are actively pushed to shard holders. Beyond 72 hours, the shard chain relies on natural decay and pull-based replication only.

Exception — share link re-promotion: When a share link is added to a post’s BlobHeader, the 72-hour active replication window resets from that event. This ensures that content being actively shared gets CDN-prioritized delivery regardless of original post age. The re-promotion window is 72 hours from the share link addition, not from the original post timestamp.

Implementation path

Extends the existing ReplicationRequest/ReplicationResponse (0xE1/0xE2) protocol. Shard slot metadata fits in the existing BlobHeader. Flat holder tracking and eviction scoring continue to work unchanged for full copies. Shard traffic also serves the traffic-shaping goal: shard pushes are one more class of replication traffic that makes origin-tracing harder.

17. Sync Protocol Rework

v0.8 change: clean protocol break. v0.8 has no wire compatibility with v0.7.x or earlier. All v0.6.x receive-only compat handlers (DeleteRecord 0x51, VisibilityUpdate 0x52), the dual pull-matching path (have_post_ids fallback), and serde-default field shims are removed rather than maintained. There is no ALPN negotiation and never was — a node speaks exactly one protocol version.

Wire format Implemented

[1 byte: MessageType] [4 bytes: length (big-endian)] [length bytes: JSON payload]

Max payload: 64 MB. ALPN: itsgoin/4. Every message travels on its own QUIC stream — uni-directional for fire-and-forget pushes, bi-directional for request/response pairs. Unknown message-type bytes fail the stream; unknown fields inside known payloads are ignored by serde.

Done (Iteration B): the v0.8 break bumped the ALPN to itsgoin/4, so pre-v0.8 nodes are refused cleanly at the QUIC handshake rather than failing mid-conversation. The constant is now named plain ALPN (the versioned name ALPN_V2 had rotted against its value).

Message types (40 total; rows marked “Removed in v0.8” are kept for history) Implemented

HexNameStreamPurpose
0x01NodeListUpdateUniIncremental knowledge-layer diff broadcast
0x02InitialExchangeBiFull state exchange on connect: N1/N2 IDs, profile, post IDs, peer addresses, NAT observations, device role, anchor address
0x03AddressRequestBiResolve NodeId → address via tagged reporter
0x04AddressResponseBiAddress resolution reply
0x05RefuseRedirectUniRefuse mesh + suggest alternative
0x40PullSyncRequestBiPull exchange (v0.8: uniques-index exchange — see below)
0x41PullSyncResponseBiPull exchange reply
0x50ProfileUpdateUniPush profile changes
0x51DeleteRecordUniReceive-only compat; deletes are signed control posts (Delete Propagation). Removed in v0.8.
0x52VisibilityUpdateUniReceive-only compat; visibility re-wraps propagate via control posts. Removed in v0.8.
0x60WormQueryBiPoint query for nodes, posts, or blobs beyond local knowledge (worm search)
0x61WormResponseBiWorm search reply (node + post_holder + blob_holder)
0x70SocialAddressUpdateUniSocial contact address changed
0x71SocialDisconnectNoticeUniSocial contact disconnected. Removed in v0.8 — zero senders existed; checkin timeouts carry the signal.
0x72SocialCheckinBiKeepalive + address + peer-address update
0x90BlobRequestBiFetch blob by CID
0x91BlobResponseBiBlob data + CDN manifest + file header
0x92ManifestRefreshRequestBiCheck manifest freshness
0x93ManifestRefreshResponseBiUpdated manifest reply
0x94ManifestPushUniPush updated manifests to known file holders
0xA1GroupKeyRequestBiOrphaned: no live sender, handler has an ID-class bug. Removed in v0.8 — group seeds travel as encrypted posts (Encryption).
0xA2GroupKeyResponseBiOrphaned reply pair of 0xA1. Removed in v0.8.
0xB0RelayIntroduceBiHole-punch introduction via mutual peer (always-on signaling, not session relay)
0xB1RelayIntroduceResultBiIntroduction result with addresses
0xB2SessionRelayBiSplice bi-streams (opt-in; relay.session_relay_enabled OFF by default on every role, including anchors — see Relay & NAT Traversal)
0xB3MeshPreferBiPreferred-peer negotiation. Removed in v0.8 — the preferred tier is eliminated.
0xB4CircleProfileUpdateUniEncrypted circle profile variant
0xC0AnchorRegisterUniRegister with anchor. Still live; retires when anchor convection replaces the register loop (Roadmap item 5, Anchors).
0xC1AnchorReferralRequestBiRequest peer referrals (v0.8: the convection call)
0xC2AnchorReferralResponseBiReferral list reply
0xC3AnchorProbeRequestBiA → B → C: test cold reachability of address
0xC4AnchorProbeResultBiC → A (success) or C → B → A (failure)
0xC5PortScanHeartbeatUniDormant: part of the disabled EDM scanner; no live senders or handlers. Fate rides the raw-UDP scanner refactor.
0xC6NatFilterProbeBiNAT filtering classification probe via third party
0xC7NatFilterProbeResultBiFiltering probe result
0xD0BlobHeaderDiffUniIncremental engagement update (reactions, comments, policy, slots, FoF ops)
0xD1BlobHeaderRequestBiRequest full engagement header for a post
0xD2BlobHeaderResponseBiFull engagement header response (JSON, only if newer)
0xD3PostDownstreamRegisterUniHolder registration: “I now hold this post” → sender's file_holders (name is historical; no tree exists)
0xD4PostFetchRequestBiRequest a single post by ID from a known holder
0xD5PostFetchResponseBiSingle post response (SyncPost or not-found)
0xD6TcpPunchRequestBiAsk holder to punch TCP toward browser IP
0xD7TcpPunchResultBiPunch result + HTTP address for redirect
0xE0MeshKeepaliveUni30s connection heartbeat
0xE1ReplicationRequestBiRequest peer to cache specific posts (Content Propagation)
0xE2ReplicationResponseBiAccept/reject replication request

Retired type bytes, never reused: 0x420x45 (PostNotification/PostPush/AudienceRequest/AudienceResponse, v0.6.2), 0x95 (BlobDeleteNotice — holders evict via LRU, no notice needed), 0xA0 (GroupKeyDistribute — group seeds travel as encrypted posts).

Pull = uniques-index exchange Implemented

In v0.8 a pull is not a post transfer. A pull exchanges uniques lists: the set of unique IDs each side can help the other reach — mesh peers, direct contacts, CDN file authors, and CDN file peers, including throwaway/anonymous IDs (deliberate noise that protects real identities). The semantics are “if you want one of these IDs, talk to me and I'll help you find their CDN holders to connect to and search.” The union of these lists across the mesh forms a distributed search index — the same index that powers person-discovery for the registry. What a node knows and announces at each depth (N1–N4, termination rules, dedup, size budgets) is specified in Network Knowledge; this section covers only the wire exchange.

Content itself never rides the pull path: posts and blobs travel through the CDN (PostFetchRequest/BlobRequest against holders resolved through the index — see Content Propagation). The old “never pull from mesh peers” principle dissolves cleanly: the mesh exchanges the index, the CDN carries the content.

The pull opcodes (0x40/0x41) now carry only the index — that is what makes "a pull is not a post transfer" literally true of them. Post bodies still move between mesh peers over a separate, explicitly transitional content-sync pair (0x46 ContentSyncRequest / 0x47 ContentSyncResponse) Rework, which exists until the CDN cadence work in Iteration D can carry everything. Read caps differ accordingly: the uniques opcodes read against a 2 MB ceiling, not the 64 MB file-transfer cap.

What it replaces: today PullSyncRequest (0x40) carries a merged query list plus per-author since_ms timestamps (Self Last Encounter), and the responder returns posts newer than each timestamp after should_send_post() visibility filtering, plus visibility updates for own posts the requester already holds. The cycle ticks every 60s: a full pull from all connected peers on the first tick, then pulls only for authors stale beyond 4 hours. This per-author post-pull dies with v0.8; its staleness-tiering idea survives inside the update cadence system.

Recipient matching (merged pull) Implemented

The query list a node sends with a pull merges its public follows with every posting identity it holds, so DMs addressed to any of its personas match. The responder's filter, should_send_post(), sends a post when:

  1. Author is the requester → always send (own posts relayed back)
  2. Public or FoFClosed + author in the query list → send (FoFClosed carries no recipient IDs on the wire; it propagates by author like public content)
  3. Encrypted + any wrapped-key recipient in the query list → send
  4. GroupEncrypted + any known group member in the query list → send
  5. Otherwise → skip

The network NodeId is never an author or recipient (persona split), so it never appears in query lists. This matching machinery survives the v0.8 pull redefinition as the visibility filter on CDN content fetches.

Manifest machinery Implemented

Each post's AuthorManifest carries the author, creation/update timestamps, a post neighborhood (up to 10 previous + 10 following ManifestEntry items), and an ed25519 signature over the canonical digest. It travels wrapped in a CdnManifest alongside blob responses and via ManifestPush (0x94). On receipt:

ManifestRefreshRequest/Response (0x92/0x93) let any holder check manifest freshness for a CID and receive the newer copy. This is how a post's neighborhood keeps growing on CDN copies after the author publishes newer posts.

v0.8 change: manifests lose all device-address fields. AuthorManifest.author_addresses and the CdnManifest host metadata (host_addresses, source, source_addresses, downstream_count) link a posting identity to device locations — a privacy bug — and the tree fields describe a topology that no longer exists. Holder resolution goes through the uniques index + file_holders instead. The neighborhood is also capped to the 2–5 post concealment budget (see Files & Storage).

Engagement propagation via file holders Implemented

Reactions, comments, policy changes, slot writes, and FoF ops propagate as BlobHeaderDiff (0xD0) batches through the flat holder set — there is no tree:

Diff opPurpose
AddReaction / RemoveReactionSigned reaction add; removal by reactor or post author
AddComment / EditComment / DeleteCommentSigned comment lifecycle, gated by CommentPolicy
SetPolicyAuthor-controlled comment/react permissions + blocklist
ThreadSplitRegister a comment-overflow post
WriteReceiptSlot / WriteCommentSlot / AddCommentSlotsEncrypted slot writes (below)
FoFRevocation / FoFAccessGrant / FoFKeyBurnFoF key lifecycle ops, author-signed (Friend-of-Friend Visibility)
Unknownserde catch-all: ops from newer versions are silently skipped

Engagement security Implemented

Engagement operations are cryptographically verified on receipt to prevent forgery and unauthorized modification:

v0.8 change: the empty-signature acceptance path for reactions (a v0.6.x #[serde(default)] compat shim) is removed with the clean break — signatures become mandatory.

Encrypted receipt & comment slots Implemented

Private posts (Friends, Circle, Direct) carry encrypted slots in their BlobHeader for delivery receipts, read receipts, reactions, and private comments. The CDN propagates these as opaque bytes — only participants with the post's CEK can decrypt them. (FoFClosed posts skip this path; their wrap-slot mechanism covers both reads and comments.)

DM conversations render these as delivery indicators: sent → delivered → seen checkmarks, emoji on react. Opening a conversation auto-marks incoming messages as seen.

Device roles & bandwidth budgets Implemented

Each node advertises its device role in InitialExchange, which sets hourly budgets for replication (pulling posts to cache) and delivery (serving requests from peers):

RoleReplication / hourDelivery / hour
Intermittent (phones)100 MB1 GB
Available (desktops)200 MB2 GB
Persistent (anchors)200 MB1 GB

Connection rate limiting Implemented

Incoming QUIC connections that fail authentication are rate-limited per source IP to prevent CPU exhaustion from rogue or stale nodes:

Knowledge freshness Implemented

Gossiped knowledge decays unless refreshed. Today's timers, which carry forward under the N1–N4 uniques model (Network Knowledge):

Bootstrap isolation recovery Implemented

Prevents network segments from becoming permanently isolated from the main network:

Schema versioning Implemented

SQLite databases track their schema version via PRAGMA user_version. On startup:

IPv6 HTTP address advertisement Implemented

Nodes with public IPv6 addresses advertise their actual routable address (from endpoint.addr().ip_addrs()) paired with their bound port, rather than the bind address (0.0.0.0). This enables direct browser-to-node HTTP serving for share links. Unroutable addresses (0.0.0.0, 127.x) are filtered out in the tiered web-serving redirect path (HTTP Delivery).

18. Encryption

Envelope encryption (1-layer) Implemented

  1. Generate random 32-byte CEK (Content Encryption Key)
  2. Encrypt content: ChaCha20-Poly1305(plaintext, CEK, random_nonce)
  3. Store as: base64(nonce[12] || ciphertext || tag[16])
  4. For each recipient (including self):
    • X25519 DH: our_ed25519_private (as X25519) * their_ed25519_public (as montgomery)
    • Derive wrapping key: BLAKE3_derive_key("itsgoin/cek-wrap/v1", shared_secret)
    • Wrap CEK: ChaCha20-Poly1305(CEK, wrapping_key, random_nonce) → 60 bytes per recipient

Recipients are posting identities (personas), never network identities. The wrapping key derivation runs against the recipient's posting pubkey; the sender wraps with the authoring persona's posting secret.

Visibility variants

VariantOverheadAudience limit
PublicNoneUnlimited
Encrypted { recipients }~60 bytes per recipient~500 (design target; not enforced in code)
GroupEncrypted { group_id, epoch, wrapped_cek }~100 bytes totalUnlimited (one CEK wrap for the group)
FoFClosed98-byte wrap slot + 32-byte pub_post_set entry per admitted V_x, bucket-paddedBucketed (8/16/32/64/128/256, then +128 steps)

PostId integrity

PostId = BLAKE3(Post) covers the ciphertext, NOT the recipient list. Visibility is separate metadata. This means visibility can be updated (re-wrapped) without changing the PostId.

Group keys (circles) Implemented

v0.8 change: the orphaned GroupKeyRequest/Response (0xA1/0xA2) pair is deleted — its handler compares network IDs against posting-ID member lists and can never grant (ID-class bug family), and no sender was ever wired. Post-based distribution is the only path.

Three-tier access revocation

Three levels of revocation, chosen based on threat level:

Tier 1: Remove Going Forward (default) Implemented

Revoked member is excluded from future posts automatically. They retain access to anything they already received. This is the default behavior when removing a circle member — no special action needed.

When to use: Normal membership changes. Someone leaves a group, you unfollow someone. The common case.

Cost: Zero. Just stop including them in future recipient lists.

Tier 2: Rewrap Old Posts (cleanup) Rework

Same CEK, re-wrap for remaining recipients only. The revoked member can no longer unwrap the CEK even if they later obtain the ciphertext. The updated visibility propagates as a signed control post authored by the post's persona — peers verify the control post's signature against the target's author before applying, so only the author can rewrite visibility.

When to use: Revoked member never synced the post (common with pull-based sync — encrypted posts only sent to recipients). You want to clean up access lists.

Cost: One WrappedKey operation per remaining recipient, no content re-encryption.

Required fix: the entry-point guard compares post.author (a posting ID) against the node's network ID — always different since the identity split — so every revoke currently bails before doing anything, and the rewrap is keyed with the wrong identity pair. Same ID-class bug family as the group-key handler. The control-post propagation machinery underneath is correct.

Tier 3: Delete & Re-encrypt (nuclear) Rework

Generate new CEK, re-encrypt content, wrap new CEK for remaining recipients, issue a control-post delete for the old post ID (see Delete Propagation), repost with new content but same logical identity. Well-behaved nodes honor the delete.

When to use: Revoked member already has the ciphertext and could unwrap the old CEK. Only for content that poses an actual danger/risk if the revoked member retains access. Recommended against in most cases.

Cost: Full re-encryption + delete propagation + new post propagation. Heavy.

Required fix: shares the Tier-2 entry-point author-check bug.

Trust model: The app honors delete requests from content authors by default. A modified client could ignore deletes, but this is true of any decentralized system. For legal purposes: the author has proof they issued the delete and revoked access.

Private profiles Implemented

Different profile versions per circle, encrypted with the circle/group key. A peer sees the profile version for the most-privileged circle they belong to. CircleProfileUpdate (0xB4) wire message. Public profiles can be hidden (public_visible=false strips display_name/bio).

19. Friend-of-Friend Visibility Implemented

Distinct from directory vouches. The "FoF vouch" described here is a cryptographic primitive for post readership and comment gating (per-persona symmetric key V_me). It is unrelated to the directory vouch system in the Directory Trust Layer, which governs discovery-layer trust and bot-ring resistance. The two share vocabulary but operate at different layers.

The problem

Existing visibility variants gate by explicit recipient lists (Encrypted{recipients}) or named-circle membership (GroupEncrypted). Neither expresses "people who are reachable through my social graph" without leaking the graph itself. FoF visibility fills that gap: posts whose readership emerges from cryptographic reachability through a unilateral vouch graph, with no recipient IDs on the wire and no centrally-computed membership lists.

User-facing model

Authors pick one of four visibility levels at compose time:

LevelReaches
PublicAll readers (unchanged)
Friends-onlyPersonas you have vouched for
Friends-of-FriendsYour vouchees + every vouchee of anyone who vouched for you (emergent FoF)
Custom PlannedAuthor-selected subset of held vouch keys

Core primitives

Distribution: vouches ride bio posts

Vouches are NOT delivered via DM. Instead, the voucher publishes anonymous sealed wrappers (one per recipient) inside their bio post. The sealing is an HPKE-style construction — per-batch ephemeral X25519 keypair, ECDH against the recipient's persona key, BLAKE3-derived wrapping key and nonce (domain itsgoin/vouch-grant/v1, bound to the bio post's ID), ChaCha20-Poly1305 seal. It is not RFC 9180 HPKE, but provides the same recipient anonymity property: wrappers carry no recipient identifier, the KDF context is recipient-free, and every wrapper in a batch shares one ephemeral pubkey. Each wrapper is 48 bytes (32-byte sealed V_me + 16-byte AEAD tag).

Readers auto-scan bio posts of accounts they follow, trial-decrypting each wrapper against each of their personas. Cost is ~60µs per wrapper per persona on mobile — a 200-wrapper bio scanned against 3 personas is ~36 ms. The bio's VouchGrantBatch is padded with dummy wrappers and shuffled on every publish so observers see neither vouch-set size nor change-targets.

Two modes

Mode 2: Public body, FoF-gated comments

Body is plaintext in the CDN (indexable, cacheable, shardable — unchanged from existing public-post path). Comments are encrypted under a CEK derived from the wrap-slot CEK, so only FoF members can read them. Non-FoF observers see only ciphertext + signature fields. The compose UI exposes this via CommentPermission::FriendsOfFriends, carried in the post's CommentPolicy.

Mode 1: FoFClosed (body + comments encrypted)

PostVisibility::FoFClosed variant. Body is encrypted under CEK (same wrap-slot mechanism as comments). Both readership and comment authority emerge from keyring intersection with the post's wrap_slots.

CDN-level comment verification

Each wrap slot is dual-derived: one half yields the shared CEK (read capability), the other yields a per-V_x Ed25519 signing keypair (priv_x sealed inside the slot; the corresponding pub_x published in the post's pub_post_set). Comments declare which pub_x signed them and carry the signature.

Propagation nodes verify three things before forwarding a comment:

  1. pub_x_index points to a valid entry in pub_post_set.
  2. That entry is not in the post's revocation_list.
  3. The comment's group_sig validates against that pub_x.

Any failure → drop, do not forward. This kills the bandwidth-amplification attack that a single admitted-but-malicious FoF member could otherwise mount: their forgeries cannot pass the propagation gate.

The first-contact mechanism reuses this exact gate: a bio post that opts into contact publishes a greeting-slot key in its pub_post_set, so stranger greetings pass CDN comment verification like any FoF comment. See Discovery & First Contact.

Privacy properties

Revocation & key lifecycle

Three complementary mechanisms:

Per-post comment revocation (default)

The author signs a RevocationEntry for a specific pub_x on a specific post. Propagation nodes delete locally-stored comments by that signer, remove the entry from pub_post_set, append to revocation_list, and forward the diff. Retroactive: the mesh self-cleans as the diff sweeps through. The same entry type is the off-switch for greeting slots (Discovery & First Contact).

Persona-wide V_me rotation

To remove a vouchee, the persona generates V_me_new and issues it to every non-revoked vouchee via the next bio-post batch. Revoked vouchees retain V_me_old. Old posts (sealed under V_me_old) stay readable by anyone who holds the old key — grandfathered by default. The CDN does not auto-cascade revocations.

Receivers append new V_me values to their keyring (chain), so newly-issued keys do not invalidate prior ones — the receiver keeps holding the old key for reading historical content.

Opt-in cascade + key burn (advanced)

If the author wants to cut off comment authority on old posts after a rotation, they cascade by publishing per-pub_x revocations on each affected post. Local-only own_post_slot_provenance table maps "which pub_x was sealed under which V_me" so the author can target precisely.

For the rare case of a leaked V_me, an optional KeyBurnDiff primitive swaps the V_old wrap slot for a V_new wrap slot in-place on a specific post. Scrubs the leaked key from the CDN copy of old posts. Body CEK unchanged.

Performance budget

At realistic scale (~500 vouchees, ~500 wrap slots per post), reader-side decryption uses an unlock cache: the first time persona P decrypts a post from author A via key V_x, the (P, V_x) tuple is cached. Subsequent posts from A try that key first — one HMAC + one AEAD attempt in the hot path. Full scan only on cache miss; newly-received V_x triggers a retry sweep over the unreadable-posts table.

Post-quantum readiness

Body encryption, wrap slots, and HKDF/HMAC are all symmetric — PQ-safe. Comment signing uses Ed25519 today; the spec shape is algorithm-agnostic so ML-DSA-65 (~2 KB pubkey, ~3.3 KB signature) can substitute, optionally with a Merkle-commit variant on pub_post_set to keep header size bounded.

Implementation

Full crypto-level byte layouts, data models, wire-format additions, ship criteria, and integration tests are specified in docs/fof-spec/. All five layers shipped in v0.7.0:

LayerScopeStatus
1Vouch primitive (V_x keys, keyring, bio-post sealed wrappers, scan policy)Implemented
2Mode 2: public posts with FoF-gated comments, CDN-level verificationImplemented
3Mode 1: FoFClosed body + wrap slots + anonymous prefilterImplemented
4Rotation, revocation, key lifecycle (grandfather + cascade + key-burn)Implemented
5Unlock cache + prefilter optimization (perf-critical at scale)Implemented

20. Delete Propagation & Comment Expiry

Deletes are signed control posts Implemented

A delete is a control post: a small public post with VisibilityIntent::Control, signed by the target's authoring persona, naming the PostId to delete. It propagates exactly like any other post — it enters the author's neighbor manifests (following_posts lists on their other posts) and rides manifest diffs out to file_holders; anyone following any of the author's posts picks it up via the normal CDN / pull paths.

On receipt, a node verifies the control post's signature against the target post's author before applying. Application is atomic with the control-post insert: record in deleted_posts (INSERT OR IGNORE), then DELETE the target from posts. The deleted_posts table also guards against re-ingesting the deleted post from a stale holder later.

v0.8 change: the direct-push delete paths are gone entirely — DeleteRecord (0x51) uni-stream push and BlobDeleteNotice (0x95) were retired in v0.6.2, and the receive-only 0x51/0x52 compat handlers die with the v0.8 clean protocol break. Control posts via manifests are the only delete path.

Blob cleanup on delete Implemented

  1. Locally: blob metadata and CDN records for the post's blobs are removed, blob files deleted from disk.
  2. Remotely: no notice is sent. Copies held by other file_holders become orphans — nothing references them, nothing re-shares them — and are evicted naturally by the CDN's LRU eviction cycle (see Content Propagation).

Comment expiry: rand(30–365 days) TTL Planned

Every comment gets an expiry timestamp at creation: created_at + rand(30–365 days). The expiry is fixed at creation, signed, and carried with the comment — it is part of the comment's identity, not a per-holder policy. Every holder in the network expires the comment at (near) the same moment.

21. Social Graph Privacy & Traffic Shaping

What is never shared

Where addresses do travel, and why

Routing needs somewhere to connect. Addresses appear in exactly these payload classes, all scoped to network identities:

Uniques lists as cover traffic

The N1 uniques list deliberately merges mesh peers, social contacts, CDN file authors, CDN file peers, and throwaway/anonymous IDs into one flat set. An observer diffing your announcements over time is looking at a list dominated by high-churn CDN-derived entries and deliberate throwaway-ID noise; the stable social core does not stand out the way it did when the share list was just mesh-plus-contacts. Throwaway IDs additionally age out of the network via comment TTL (above), so the noise floor is self-renewing rather than monotonically accumulating. Our own personas and our own greeting throwaways are the deliberate exception — they are excluded, because we would be the reporter. Implemented

The timing adversary Planned

With content encrypted and recipient lists off the wire, the remaining deanonymizer is request-timing correlation: an observer who can watch traffic sees who fetches what, when. If your device checks an author's CDN seconds after every new post, you are that author's reader; if fresh content always radiates outward from one node first, that node is the author. The v0.8 defenses are behavioral, not cryptographic:

Honest scope: this defeats passive observers correlating timing and public holdings. A global adversary who can watch every link, or an adversary who compromises your own device, is out of scope — as in every friend-to-friend design.

22. Identity Management

Multi-identity per device Implemented

A single device can hold multiple identities, each with its own ed25519 keypair, database, blob store, follows, and posts. One identity is active at a time — switching performs a hot-swap (Node teardown + rebuild, ~3-5 seconds).

Multi-device: posting-key bundles Implemented

Devices are linked by sharing posting keys, never network keys. Each device keeps its own network key (its own QUIC NodeId); what travels between your devices is the export bundle — a ZIP containing the identity key, all posting identities, posts, blobs, follows, and settings. Transfer happens out-of-band between your own devices; the network sees no linking message.

Raw key import restores the network key only. Pasting a bare identity.key hex string creates an identity around that network key — it carries no posting identities, posts, or follows. To move personas between devices, use the ZIP bundle.
v0.8 change: the earlier “same identity key on all devices” multi-device design is deleted — it predates the network/posting key split and contradicted it. Devices never share a network key; see Identity Architecture.

Post import & merge Implemented

Two ways to bring another identity’s posts into the current one, both wired into the import wizard:

23. Reciprocity (Reconsidered) Planned

The original Phase 2 design centered on hosting quotas (3x rule), chunk audits, and tit-for-tat QoS. On reflection, the attention-driven delivery model makes quota enforcement unnecessary. The CDN is a delivery amplifier, not a storage system — hot content propagates through demand, cold content decays. Authors are responsible for their own content durability.

Tit-for-tat QoS solves the wrong problem: it optimizes for fairness in a storage-obligation model that no longer exists. What matters is that the delivery network functions efficiently, which it does through natural attention dynamics.

If reciprocity mechanisms are needed at scale, they should address delivery quality (bandwidth, latency, uptime) rather than storage quotas. This remains an open design area.

24. Identity Architecture

ItsGoin separates network identity (per-device routing/connection key) from posting identity (the face/persona authoring content). This is the architectural foundation for multi-device, multi-persona, and DM-level traffic-graph privacy — and it fully survives into v0.8: the uniques index treats posting IDs (including throwaway ones) as first-class searchable entries, and the registry + greeting-comment first-contact design (Discovery & First Contact) builds directly on the split.

Two layers of identity Implemented

Each device has ONE network key — used for QUIC connections, endpoint ID, mesh routing. It’s never linked on the wire to any posting key.

Each user can hold MANY posting keys simultaneously — no “active” persona, no switching. Each posting key is a persona (Public, Private, Work, Family, etc). Posts are signed with the posting key chosen at compose time. The two key layers are always distinct: fresh installs generate an independent default posting identity, and the v0.6.1 migration rotates the network key of any install whose default posting key still equaled it. No node’s network key ever doubles as a posting key.

Privacy invariant: peers cannot determine which network IDs belong to a given posting ID, which posting IDs belong to the same network ID, or which posting IDs belong to the same user. These associations are private to the device owner.

Known violation — manifest addresses Rework: today’s AuthorManifest ships the device’s real addresses under a posting-identity author, linking persona to location on the wire. The v0.8 target removes device addresses from manifests entirely (holders are found via the CDN holder search, not via addresses embedded in author-signed data). This fix must land before or with the registry — location-anonymous discovery depends on it. Details in Files & Storage.

Persona types Implemented

Required fixes: network-ID/posting-ID confusion Rework

The key split left four code paths comparing the device’s network NodeId where posting IDs now live. Since the two are always distinct, each path silently fails. All four are required v0.8 fixes (first item on the roadmap):

The fix class is uniform: every self.node_id comparison or query against post/persona authors must use posting identities (all of them, not just the default). A full sweep for further instances is part of the fix.

Multi-device is a special case Implemented

“Two devices holding the same posting key” is a trivial case of the multi-key model. Link happens out-of-band between the user’s own devices via the export/import bundle (Identity Management) — the export includes all posting identities so they restore on the second device, which keeps its own network key. The network sees no cross-device message announcing the relationship; each device pulls content for its posting IDs via the normal CDN. The fact that two network nodes hold the same posting key is only discoverable if an observer has private knowledge (which they shouldn’t).

In-app QR / file-share flows for easy linking between an existing device and a new one are not wired yet — today it’s manual export-then-import.

Ephemeral rotating IDs for DM threads Planned

The intent: DM threads and group messages use per-thread unique posting IDs that rotate per message. Each encrypted message would include a handshake field — the next posting ID to use. Observer sees a stream of distinct posting IDs with no cryptographic tie between them, defeating thread-level traffic correlation. Desync recovery via a sliding window of the last N accepted IDs. Message history kept in a local encrypted-to-self archive that replicates across linked devices via self-follow.

v0.8 removes most of the old blockers. The uniques index deliberately carries throwaway/anonymous posting IDs (they double as network noise), so an ephemeral author is findable through the same distributed search as any other ID; comment TTL expiry retires spent IDs without leaving a permanent trail; and the greeting-comment machinery provides the cold-contact channel. What still needs a crisp design is freshness: how a just-generated posting ID becomes reachable fast enough to receive a reply before the next rotation.

CDN: per-file holder sets Implemented

Each file (post, blob, manifest) has its own flat holder set — up to 5 most-recent peers, LRU-capped. Once a file already has 5 holders, further requesters are redirected to existing holders instead of being registered. Eviction scoring is relationship-tiered (own content > followed > other). There is no tree rooted at the author and no upstream/downstream structure anywhere.

When a new post is created, the creator’s updated AuthorManifests (whose neighborhoods now reference the new post) are pushed to each prior post’s holder set via ManifestPush; recipients see the reference and fetch the new post via PostFetch. Notifications thus route via network-ID peers who happen to hold related files — content always arrives via pull, never pushed directly. Full mechanics in Files & Storage and Sync Protocol.

DM privacy model Implemented

Three mechanisms eliminate the “A messaged B” traffic signal:

  1. CDN-only propagation. There is no direct push for encrypted posts. All encrypted posts propagate via the file-holder CDN, indistinguishable on the wire from any other encrypted content.
  2. Merged pull + recipient-match. Content queries are a uniform list of IDs; a serving peer returns posts matching author ∈ query_list OR wrapped_key.recipient ∈ query_list. The client always includes every one of its own posting identities alongside follows, so there is no distinguishable “searching for DMs” traffic fingerprint. This matching machinery survives the v0.8 pull redefinition — it runs at the CDN content-fetch step (see Sync Protocol).
  3. Greeting comments for cold contact Planned. First contact from outside the graph arrives as an HPKE-sealed comment on a bio post, signed by a throwaway outer ID — see Discovery & First Contact.

What the user sees

Key/collision safety

Posting keys and network keys are ed25519 seeds (256 bits of entropy). Birthday paradox reaches 50% collision at ~2128 keys generated — not a concern even at aggressive rotation rates across a global userbase. The operational risk is weak RNG during key generation; we rely on the platform CSPRNG everywhere.

Status

The persona split is fully implemented: key-layer plumbing, multi-persona storage and UX, CDN-only encrypted propagation, and merged-pull recipient matching are all live. Ephemeral rotating DM IDs remain planned. The network-ID/posting-ID bug family above is the one required rework before v0.8 features (registry, concealment budget) can sit on this foundation.

25. HTTP Post Delivery Implemented

Intent

Every ItsGoin node that is publicly reachable can serve its cached public posts directly to browsers over HTTP — no extra infrastructure, no additional dependencies, no new binary. The same port number used for QUIC (UDP) carries a TCP listener for a minimal raw HTTP/1.1 handler baked into the binary. This makes every publicly-reachable node a browser-accessible content endpoint, enabling share links that deliver content peer-to-browser without routing post bytes through itsgoin.net.

Dual listener architecture

<port>/UDP  →  QUIC (app protocol)
<port>/TCP  →  HTTP/1.1 (read-only, two routes)

Both listeners bind the same port number. The OS routes UDP and TCP to separate sockets — no conflict, no protocol ambiguity. The handler is raw tokio::net::TcpListener, no HTTP crate, zero new dependencies.

Routes

RouteServes
GET /p/<postid_hex>Post rendered as a minimal HTML page (static compiled-in footer, no template engine)
GET /b/<blob_hex>Raw attachment bytes (images/video referenced from the post page via /b/ URLs)

Connection budget

The server runs a two-tier slot budget instead of a flat connection cap:

BudgetValuePurpose
Content slots5Full service: post pages + blob bytes
Redirect slots15302-only service when content slots are full
Per-IP cap1One connection per client IP across both tiers
Header timeout5 sSlow-request defense; exceeded → hard close

A new connection tries to acquire a content slot first; if those are full it gets a redirect slot, where post requests are answered with a 302 to another holder (below) and blob requests are hard-closed. Over-budget connections are closed immediately — no queue, no wait.

Security constraints

ConcernMitigation
Connection exhaustion5+15 slot budget, 1 per IP, immediate close over budget
Slow HTTP attacks5-second read timeout for request headers
Content enumerationIdentical response (hard close) for “not found” and “not public.” No timing oracle, no distinguishable error codes.
Malformed requestsHard close only. No error response, not even a 400.
Encrypted contentNever served. Public-visibility check is mandatory on both routes.

Which nodes serve HTTP

A node starts the HTTP listener only if it is publicly TCP-reachable, meaning any of:

Nodes behind a NAT that refuses all three mapping protocols cannot serve HTTP but can still appear as holders for app-protocol delivery; the share-link tiers (see Share Links) route around them. A serving node advertises its HTTP capability and address to peers so they can be selected as redirect targets. This is the same direct-reachability signal that drives anchor candidacy (see Anchors & Connection Convection) — in practice the HTTP-serving population and the anchor-candidate population are the same nodes.

302 load shedding via file holders

A redirect-slot request is answered from the flat holder model:

  1. Verify the post exists locally and is public (else hard close).
  2. Query file_holders for the post (flat set, cap 5 — see Content Propagation).
  3. Filter each holder's known addresses to publicly-routable ones.
  4. TCP-probe candidates with a 200 ms timeout; 302 → http://<addr>:<port>/p/<postid> to the first live one.
  5. All dead → hard close.

The receiving node applies the same logic recursively if its own content slots are full. Load spreads across whichever holders are publicly reachable, mirroring the attention-driven holder model at the HTTP layer.

v0.8 change: redirect candidates come from the flat file_holders set; the old post_downstream tree (and the “CDN tree” framing of HTTP load shedding) is gone.

27. Discovery & First Contact Planned

The problem

The mesh-CDN architecture deliberately has no global feed and no keyword flood-search (see Worm Search for why flooding is rejected). That leaves two gaps: discovery — how do you find a person you don't already have a graph path to? — and first contact — how does a stranger send you an initial message when every messaging rail (DMs, FoF comments) requires an existing key relationship? This section is the designed answer: an opt-in registry for discovery, and greeting comments for first contact. Both compose with machinery that already exists (bio posts, CDN comment verification, HPKE-sealed wrappers, RevocationEntry, comment TTL).

The registry: opt-in discoverable bio posts

Registration is a flag on a public bio post: “this persona wants to be findable.” A discoverable bio post links a public persona (display name, bio text, avatar) to a public author ID (a posting identity) — and nothing else. There is no directory server; the registry is the set of discoverable-flagged bio posts, replicated as ordinary CDN content.

The v0.6.2 Discover tab — a local list of named, public-visible profiles already held in storage — is the UI seed for this: the registry generalizes it from “profiles I happen to hold” to a replicated, searchable set.

The registry post: rendezvous & enumeration Planned — tester-critical

Discoverable bios alone leave a gap: how does a searcher enumerate them? The answer is a well-known “registrations here” post whose comment chain is the registry index. A registration is a signed public comment on that post — structurally the same open-slot comment as a greeting (see below), aimed at a well-known target instead of a stranger's bio. One implementation serves both features.

Honest threat model: personas are deliberately near-free in this system (throwaway IDs are a feature), so no per-key or proof-of-work measure changes the spam economics against a motivated adversary — and this network must expect motivated adversaries with an interest in making decentralized social feel broken. The alpha registry survives casual spam only. Two things make that acceptable: (1) bounded blast radius — searches are local and the registry is an opt-in convenience layer, so a fully-flooded registry blocks only new stranger discovery while every existing relationship, follow, vouch, and sync continues untouched; griefing spends real resources to inconvenience only people who haven't met anyone yet. (2) Vouch-gated registration (see Directory Trust Layer) is the durable fix once utilization supports vouch introductions — the registry post's format survives that transition, only the acceptance rule tightens. Sharding is deliberately deferred to the same moment: by the time volume demands shards, registration demands vouches.

Greeting comments: sealed first contact

First contact rides the comment rails. A bio post that opts into contact includes a greeting slot in its pub_post_set (see Friend-of-Friend Visibility) whose signing keypair is published — derivable by anyone from material in the bio post header. A stranger's greeting comment signed with the greeting key passes the CDN-level comment-verification gate that otherwise drops non-member comments, so it propagates like any FoF comment.

Spam controls

ControlMechanism
Active choiceNo greeting slot in the bio → no greetings possible. The choice is made visibly at first profile publish — pre-checked YES with opt-out before publishing (alpha default; revisit for public release). Revocable per persona at any time.
Size bucketGreetings fit a single small padded bucket — no attachments, no long-form spam payloads.
Holder-side count capsNodes holding a bio cap how many unexpired greetings they store and forward per bio.
Rate capsHolder-side per-bio limits on unexpired greetings stored and forwarded. (Proof-of-work stamps were considered and rejected — inverted cost: phones pay, botnets don't.)
Known limit: the greeting slot's pub_x_index is observable, so greetings are identifiable as a class (never by sender). Mitigation: friends can route innocuous chatter through the open greeting key as padding, so greeting traffic on a bio is not automatically stranger traffic.

The composed flow

Find a persona via registry search (or encounter their author ID through the graph) → greet with a sealed greeting comment on their bio post — real identity and a return path ("where I'll watch for a response") inside → the author unseals it and replies with a sealed message to that return path, from their own fresh temp ID. The conversation continues over rotating temporary IDs — each message names the next rendezvous, no two messages share an outer identity, and observers see only never-before-seen IDs dropping ciphertext on unrelated open-slot posts. No vouch is ever required to talk. Vouching is fully disconnected from messaging: it is a relationship act that lives in the People tab — granting FoF readership via the normal bio-post wrapper batch — and deliberately has no control on any messaging surface, so vouching someone is always a considered decision, never a reflex mid-conversation. Inbox actions: Reply (primary), Dismiss. People you message surface in People for relationship management. Every temp ID expires with its comment's TTL; nothing permanent links the approach, the conversation, or the relationship that followed.

v1 scope: return paths start as the participants' bio posts; full rendezvous-hopping across arbitrary open-slot posts follows once an open-slot post index exists. The anonymity set for hopping is exactly the set of posts accepting open-slot comments — made large by the default-checked greeting choice at first publish.

28. Directory Trust Layer (Future) Planned

The trust layer is an opt-in convenience layer for curated discovery and creator protection. It is not node access — losing trust-layer standing does not disconnect anyone from the network or from their existing connections. This asymmetry is load-bearing: humans with mature relationships shrug off directory loss; bots and content thieves depend on it entirely.

Distinct from FoF cryptographic vouches. The "vouch" described in this section is a directory-layer trust signal governing discovery and bot-ring resistance. It is unrelated to the cryptographic vouch (V_me) in Friend-of-Friend Visibility, which gates post readership and commenting via per-persona symmetric keys. The two share vocabulary but operate at different layers.
v0.8 change: the directory no longer defines its own entry/listing mechanics. The registry is the entry point — anyone can register a discoverable bio. The trust layer, when built, curates standing over registry entries: vouch-weighted visibility, moderation, and creator protection on top of the flat registry. Everything below is a future layer beyond the v0.8 scope.

Scope

Because trust-layer loss is a low-cost outcome for real humans and a high-cost outcome for bad actors, enforcement thresholds can be deliberately aggressive without meaningful false-positive risk.

Vouch capacity

A member's outbound vouch capacity is derived from received vouches:

Trust signals are internal, not purchasable. Aged off-platform accounts (FB, X, etc.) can be bought cheaply; in-system tenure crossed with graph density cannot. Vouch weight derives from the voucher's in-system graph depth and their history of non-revoked vouches — not account age.

Cascade punishment

A "bad vouch" is a vouch later determined to have been extended to a bot, impersonator, content thief, or other removable actor. Punishment is asymmetric — mild for humans who miscalled a single vouch, devastating for botnets whose strength is their dense internal vouch graph.

OffenseImmediate consequenceRecovery requirement
1st bad vouchAll given and received vouches invalidated (member remains listed, but cannot vouch)2 NEW vouches received before outbound vouching resumes
2nd bad vouchRemoved from trust-layer visibility1 new vouch to relist + 2 additional new vouches before vouching again
3rd bad vouchRemoved from trust-layer visibility; 1-year outbound vouch freeze4 new vouches to relist; no outbound vouching for 12 months regardless of received vouches

"NEW" is strictly defined: a voucher who has never previously vouched this member and is not within the first-degree graph of any prior voucher for this member. This blocks ring members from cycling each other through as "recovery" vouchers.

Cascade radius. Invalidation of received vouches propagates the effective penalty upward: the bad actor's vouchers lose the credibility granted by that downstream relationship. One verified human assertion against a single botnet node can cascade through the entire dense cluster because bots' own topology carries the invalidation. They build the weapon that points back at them.

Graph-relative visibility

Trust-layer discovery is not global. A viewer sees vouched entries N hops from their own social graph (N tunable; start with N=3). Bots at the fringe of the graph are structurally invisible to most humans. Visibility is further rate-limited (Y new profiles per viewer per day, Y tunable) to make harvesting economically unattractive without affecting normal discovery.

This scoping is also why the vouch system's bot-ring problem is bounded: even a successful ring has no harvest value if it cannot be seen by real users.

Verification (circuit breaker)

Verification is an emergency override, not a standing credential. In normal operation, the vouch system runs unassisted. When a creator notices their content suppressed or a bot cluster drowning legitimate signals, they invoke verification on their own terms.

Reporting

The reporting pipeline is lightweight, member-facing, and feeds a single review queue with multiple severity tracks:

Reports from verified accounts carry higher weight. A confirmed report against one member in a tight cluster opens review on the whole cluster.

Blacklist

Blacklist is a higher-severity tier than trust-layer suspension. Two states:

Escalation paths:

The blacklist must be slower and more evidence-bound than suspension. Suspension costs a bot everything but costs a human almost nothing; blacklist has real network consequences (below) and must not be a censorship weapon.

Voluntary network compliance

Nodes may configure policies to decline replication or delivery of blacklisted content and accounts. This is opt-in, not forced. The effect is architectural starvation: stolen or abusive content cannot sustain replication when hosts collectively decline to be its infrastructure, while the legitimately signed original continues propagating normally.

This is the key lever for creator protection. ItsGoin does not enforce copyright; it gives creators a network that structurally prefers their signed original over any derivative copy. Combined with embedded ads (below), there is no version of content theft that economically benefits the thief inside ItsGoin.

Creator-embedded ads

The platform does not insert or intermediate ads. Creators may embed ads directly in their content or feed, as part of the signed post.

Repost framework

A two-track fair-use model. Compliant reposts are unblocked; non-compliant reposts feed the content-theft reporting pipeline.

TrackContent limitAdsBacklinkValue requirement
AmplificationFullMust preserveRequired to signed originalReach is value; no further justification needed
Discussion / criticism≤1 minute per 4 minutes of originalNot requiredRequired to signed originalCommentary, review, or response

Edge cases (what counts as "amplification" vs. "wholesale copy masquerading as amplification") route to human reviewer capacity. The signed original is cryptographic evidence against the repost in any contested case — reviewers do not need to take anyone's word for what the original contained.

Philosophical position

Most platforms have a structural conflict of interest with creators: fakes inflate engagement metrics, thieves generate content volume, both drive ad revenue. ItsGoin's incentives are inverted by design. Fakes degrade the vouch system; thieves attack the network's most valuable users; bots pollute the replication layer the network depends on. Every bad actor makes ItsGoin worse as software, not just ethically. The enforcement mechanisms above are therefore load-bearing, not policy theater.

Implementation status

Designed, not implemented — and deliberately beyond the v0.8 scope. Requires:

Recommended staging: minimum viable slice = registry (see Discovery & First Contact) + single-vouch trust entries + impersonation reports → manual review queue. Defer cascade math, automated topology detection, verification override, and repost compliance until real graph data exists to calibrate thresholds.

Tunable parameters

ConstantInitial valuePurpose
DIRECTORY_VOUCH_INTERVAL30 daysTime between outbound vouches per received vouch
DIRECTORY_VOUCH_CAP5Hard cap on outbound vouches per 30-day window
DIRECTORY_GRAPH_HOPS3Visibility radius for discovery
DIRECTORY_DISCOVERY_RATE~10 / day (provisional)New profiles visible per viewer per day; tune against real graph data
RECOVERY_VOUCHES_1ST2NEW vouches to restore voucher status after 1st bad vouch
RECOVERY_VOUCHES_2ND1 + 2Relist + additional vouches after 2nd bad vouch
RECOVERY_VOUCHES_3RD4Relist vouches after 3rd bad vouch
RECOVERY_FREEZE_3RD365 daysOutbound vouch freeze after 3rd bad vouch
REPOST_DISCUSSION_RATIO1:4Max embed duration relative to original (discussion track)

Appendix A: Timeout & Interval Reference

Every constant below exists in code today (cited per row in source comments) or comes from a v0.8 ruling (marked Planned). Constants tied to retired subsystems (preferred peers, register loop, keep-alive pool) are gone; the two registration-model referral constants remain, badged Rework, until the convection window replaces them.

ConstantValuePurpose
MESH_KEEPALIVE_INTERVAL30sPing to prevent zombie detection + NAT timeout
ZOMBIE_TIMEOUT600s (10 min)No stream activity → dead connection
SESSION_IDLE_TIMEOUT300s (5 min)Reap idle sessions (referral-list peers and known anchors exempt)
QUIC_CONNECT_TIMEOUT15sDirect connection establishment
SESSION_KEEPALIVE_PROBE3sPer-peer keepalive send timeout; failure marks the connection dead
HOLE_PUNCH_TIMEOUT30sOverall hole punch window (parallel over all known addresses)
HOLE_PUNCH_ATTEMPT2sPer-attempt timeout before retry within the window
RELAY_INTRO_TIMEOUT15sRelay introduction request round-trip
RELAY_PIPE_IDLE120s (2 min)Session-relay pipe idle before close (opt-in serving only)
RELAY_MAX_BYTES50 MBMax bytes relayed per pipe before close (opt-in serving only)
RELAY_COOLDOWN300s (5 min)Per-target relay cooldown after a failed introduction
RELAY_INTRO_DEDUP30s (cap 500)Dedup window for forwarded introductions (seen_intros)
WORM_TOTAL_TIMEOUT3sEntire worm search
WORM_FAN_OUT_TIMEOUT500msPer-peer fan-out query
WORM_BLOOM_TIMEOUT1.5sNova round: follow-up queries to burst-response referrals (historically "wide referrals")
WORM_DEDUP10sIn-flight worm dedup
WORM_COOLDOWN300s (5 min)Miss cooldown before retry
CONVECTION_WINDOW_SIZE16Implemented Rolling caller window on the anchor. Small on purpose: the point is recency, not coverage. (Retired REFERRAL_DISCONNECT_GRACE 120s and REFERRAL_LIST_CAP 50 from the registration model.)
CONVECTION_HANDOUT_CAP2Implemented Hand-outs before a window entry rotates out ("2 before, 2 after")
CONVECTION_REFERRALS2Implemented Referrals returned per served request
CONVECTION_ENTRY_MAX_AGE15 minImplemented Older window entries are not handed out — a stale address costs the next caller a punch timeout
CONVECTION_SUPPLEMENT_CAP2 per 15 minImplemented Hand-out budget for mesh peers used to supplement a sparse window (address-free, introduction-only)
ANCHOR_REFUSAL_PENALTY5 minImplemented How long a refusing anchor is de-prioritised; the penalty map is swept on every insert
UNIQUES read cap2 MBImplemented Dedicated ceiling for 0x01/0x40/0x41, distinct from the 64 MB file-transfer cap
UNIQUES build / accept caps4,000 & 12,000 / 8,000 & 24,000Implemented Per-slice build caps (shallow, terminal) and per-bounce accept caps (N2–N3, N4); received slices are truncated, not rejected
KNOWLEDGE_STALE_PRUNEImmediate on disconnect + 5h fallbackRemove reach entries tagged to disconnected reporters; age fallback for stragglers. Boot sweep clears all non-mesh entries.
RECONNECT_WATCHER_EXPIRY30 daysReconnect-notification watchers pruned after expiry
GROWTH_LOOPSignal-driven (no timer)Runs on disconnects, knowledge additions, rebalance backstop; 3-failure backoff, 500ms pause between attempts
REBALANCE_CYCLE600s (10 min)Dead/zombie sweep, knowledge prune, session reap, growth backstop
ROUTING_DIFF_CYCLE120sIncremental knowledge diff broadcast to connected peers
FULL_STATE_BROADCAST4hFull knowledge-state broadcast (diff-loss repair)
RECOVERY_DEBOUNCE2sRecovery loop debounce after the mesh < 2 signal
STICKY_N1_TTL24hBootstrap peer advertised as sticky N1 (isolation recovery)
PULL_CYCLE_TICK60sPull cycle tick; first tick full pull. v0.8: replaced by the update-cadence scheduler.
SELF_LAST_ENCOUNTER4hPer-author staleness threshold before a pull fires
ENGAGEMENT_CHECK_TIERS5 min / 1h / 4h / 24hFreshness-keyed engagement re-check (active 72h / recent 14d / aging 30d / cold). Seed of the v0.8 update-cadence scheduler.
REPLICATION_CYCLE600s (120s initial delay)Own-post replication check: posts <72h old with <2 known holders. Currently inert (author-lookup bug, Roadmap item 1).
PORTMAP_DISCOVERY_WAIT3sWatch-channel wait for first router response across UPnP-IGD / NAT-PMP / PCP (never blocks startup; renewal is internal to portmapper)
ANCHOR_REACHABILITY_LOSS300s (5 min)Clear is_anchor after sustained port-mapping loss; restored on recovery
ANCHOR_PROBE_INTERVAL30 minAnchor self-verification re-probe spacing. Rework: today's gate also requires ≥50 connections + 2h uptime (dying peer-count model); v0.8 re-keys candidacy to the reachability watcher.
BOOTSTRAP_BATCH_SIZE3Concurrent anchor probes in flight
BOOTSTRAP_BATCH_STAGGER2sDelay between probe batch dispatches
BOOTSTRAP_PER_ANCHOR_TIMEOUT10sPer-anchor probe timeout during batched bootstrap
ANCHOR_STALE_THRESHOLD3 daysFailed probe to an anchor with last_seen older than this deletes the known_anchors row
NAT_FILTER_PROBE_TIMEOUT10sThird-party NAT filtering probe at startup anchor contact
HTTP_HEADER_TIMEOUT5sHTTP request header read timeout
HTTP_REDIRECT_PROBE200msTCP liveness probe of a holder before issuing a 302
CONVECTION_ACTIONstochastic, per-disconnectImplemented On each mesh disconnect: random {nothing | anchor introduction | mesh-peer introduction}; weights adaptive = local anchor-density prior + refusal feedback
CONVECTION_CLASSentry / top-up (1 bit)Implemented Entry (<2 connections) always served; top-up refused cheaply under load — refusal feeds the adaptive weights
COMMENT_TTLrand(30–365 days)Planned Comment expiry, fixed at creation and carried with the comment
UPDATE_CADENCEminutes → daysRework Descending-frequency check scale keyed on freshness × relationship tier, jittered (seed: ENGAGEMENT_CHECK_TIERS above; see Update Cadence & Keep-Alive)

Appendix B: Design Constraints

ConstraintValueNotes
Mesh slots~20 (Desktop) / 15 (Mobile)Single pool, no tiers. Rework — current code runs 101/15 across a Preferred/Local/Wide split
Temp referral slots+10 desktop / +4 mobile, above the capImplemented Introduction facilitation only; no uniques or peer-address exchange; graduate or expire (5 min TTL)
Knowledge depth4 bounces (N4 terminates)Planned Mobile may hold 3 bounces or Bloom-compress N4
Session slots20 (Desktop) / 5 (Mobile)Oldest-idle evicted at capacity
Relay pipes10 (Desktop) / 2 (Mobile)Session relay is opt-in, OFF by default on every role including anchors
Max payload (wire)64 MBLength-prefixed JSON framing
Max blob size10 MBPer attachment
Max attachments per post4
File holders per content5 (LRU)Flat file_holders set; registration past 5 answers with a holder redirect
Publicly revealed posts per author2–5Planned Concealment budget; surplus pushed out via replication (see Social Graph Privacy)
Comment TTLrand(30–365 days)Planned Fixed at creation, carried with the comment; retires throwaway greeting IDs
Max recipients (per-recipient wrapping)~500 / 256 KBDesign target for WrappedKey lists; not enforced in code
Public post encryption overheadZeroNo WrappedKeys, unlimited audience
known_anchors table{ node_id, addresses, last_seen, success_count }Ranked by success_count, capped at 5; failed probes to rows older than 3 days self-prune
Wire compatibilityNonev0.8 is a clean protocol break from ≤v0.7.x (zero-users ruling). ALPN bumps itsgoin/3itsgoin/4 so old nodes are refused at handshake (see Sync Protocol)

Appendix C: Implementation Scorecard

Code status as of v0.7.3, measured against the v0.8 target. Implemented = code matches the target today. Rework = built, but differently; migration required. Planned = not built.

AreaStatus
Mesh & knowledge
Single ~20-slot mesh pool (tiers eliminated)Implemented — Done (Iteration C): one pool, 20 desktop / 15 mobile
Preferred-peer elimination (slots, MeshPrefer, prunes, watchers)Implemented — Done (Iteration B, Roadmap item 3)
Temp referral slots (+4..+10, no knowledge exchange)Implemented — Done (Iteration C): +10 desktop / +4 mobile, above the cap, never evicting a mesh peer
Uniques announce, payload N1–N3 (N4 stored but terminates, dedup at store + announce)Implemented — Done (Iteration C): two-pool announce, terminal N3, single reachable table, size caps enforced
Pull as uniques-index exchange (distributed search index)Implemented — Done (Iteration C); post bodies moved to the transitional 0x46/0x47 content sync
Growth loop (signal-driven, diversity scoring, stochastic anchor path)Implemented — Done (Iteration C): whole-pool counting, bounded SQL shortlist, graded depth penalty, per-disconnect stochastic action
Worm search (point queries: posts, blobs, nodes; no keyword flooding)Implemented
Social routing cache + checkins + reconnect watchersImplemented — preferred_tree field retires with preferred peers
Update-cadence scheduler (freshness × relationship, jitter, dedup)Rework — freshness-only engagement tiers exist
Anchors & connectivity
Reachability-based anchor candidacy (portmapper watcher, bidirectional)Implemented
Anchor opt-in gatePlanned — reachable desktops auto-anchor today
Connection convection (2-before/2-after rolling referrals, per-disconnect stochastic trigger)Implemented — Done (Iteration C): rolling window, entry/top-up classes, adaptive weights, 0xC0 register loop retired
Batched bootstrap probes + 3-day stale-anchor self-pruneImplemented
Anchor self-verification probe (3rd-party witness)Implemented — scheduling re-keys to the watcher in v0.8
Port mapping (UPnP-IGD + NAT-PMP + PCP via portmapper, all platforms)Implemented
Relay introduction + hole punch (single quick + 30s parallel)Implemented
NAT type detection (STUN) + filter probeImplemented
EDM port scanner via raw UDP (bypassing iroh's path store)Planned — disabled body preserved as edm_port_scan_disabled_v0_7_3
Session relay (opt-in byte pipe, OFF by default, both sides gated)Implemented
Connection rate limiting (per-IP failure backoff)Implemented
LAN discovery — passive mDNS address lookupImplemented
LAN discovery — active flow (subscribe, LAN sessions, sync priority)Planned — low priority
Identity & personas
Network ↔ posting identity split + v0.6.1 key rotationImplemented
Multi-persona per device (create/switch/import/export)Implemented
Posting-key ZIP bundles: export, import-as-personas, post import & mergeImplemented
ID-class bug fixes (revocation, group-key grant, replication lookup, eviction own-content tier)Rework — Roadmap item 1
Ephemeral rotating DM identityPlanned
Throwaway-ID retirement via comment TTLPlanned
Encryption & visibility
Envelope encryption (X25519 + ChaCha20-Poly1305, itsgoin/cek-wrap/v1)Implemented
Group keys as encrypted posts + epoch rotationImplemented
Tier-2/3 revocation (control-post propagation)Rework — machinery built; entry-point author-check bug blocks every revoke
Private profiles per circleImplemented
FoF visibility Layers 1–5 (vouch, gated comments, FoFClosed, rotation/burn, unlock cache)Implemented
Sync & content
Wire protocol (length-prefixed JSON, 64 MB payload)Implemented — six types (0x51/0x52/0x71/0xA1/0xA2/0xB3) deleted in the clean-break purge (Iteration B); 0xC0 retired with anchor convection (Iteration C); the uniques opcodes read against a 2 MB cap
Merged pull with recipient matching (all posting identities)Implemented — payload semantics change with the uniques redefinition
Manifest machinery (push, refresh, header diffs)Implemented
AuthorManifest privacy (no device addresses, 2–5 neighborhood)Rework — code ships addresses + 10+10 neighborhood
Engagement propagation via flat file_holders + signature verificationImplemented
Deletes as signed control posts (+ LRU blob orphaning)Implemented
Comment TTL expiry (rand 30–365d, fixed at creation)Planned
Author concealment (2–5 visible posts) + traffic-uniformity shapingPlanned
Push notifications, reactions, comments, tombstones, auto-sync on followImplemented
Audience sharding (large-audience optimization)Planned
Files & CDN
Blob storage (BLAKE3, 256-shard layout) + transfer with delivery budgetsImplemented
Flat holder model (cap 5, LRU, redirect at capacity)Implemented
Blob eviction (pin / share-boost / relationship-tier scoring)Implemented
Active replication cycle (10 min, 72h window, <2 holders)Rework — cycle ships but is inert (author-lookup bug); becomes the concealment push-out path
Erasure-coded CDN replication (3-of-10 sub-threshold shards)Planned
Pin modes (anchor pin / fork pin / personal vault)Planned
Web, share links & discovery
HTTP post delivery (/p/ + /b/, 5+15 slot budget, holder redirect, mobile serving)Implemented
Share link Phase 1 (itsgoin.net/p/<postid>, anchor resolves holders)Implemented
itsgoin.net QUIC proxy + PostFetch + TCP punchImplemented
Universal Links / App LinksPlanned
Registry (registrations-here post + discoverable bios, location-anonymous)Planned — tester-critical, roadmap #2
Greeting comments (HPKE-sealed first contact via published slot key)Planned
Directory trust layer (vouch graph, cascade punishment, blacklist)Planned

Appendix D: Roadmap — v0.8 Critical Path

The path from today's code to the v0.8 target, in order. Items 1–2 clear the ground; 3–7 are the architecture shift; 8–10 build on it.

1. ID-class bug fixes

One bug family: the v0.6.1 persona split left code comparing the network NodeId where posting IDs now live. Four known instances: Tier-2/3 visibility revocation (author check bails on every revoke), the GroupKeyRequest handler (checks the wrong ID class, wraps with the wrong key — can never grant), the replication cycle (queries own posts by network ID, so the under-replicated list is always empty), and the blob-eviction relationship tier (own-content boost compares the network ID; masked by auto-pin). Fix all four, then sweep every self.node_id comparison against post/persona authors for further instances.

2. Registry + greeting comments — tester-critical

The app is eminently useful only if people can find each other — this is what makes it usable for testers, so it jumps the queue. Ship the “registrations here” post (open-slot signed registration comments, fixed 30-day TTL, one entry per persona, self-certifying signed deletes, holder-side rate/size caps — no PoW) and greeting comments (HPKE-sealed first contact via the published greeting-slot key, messaging-first with Reply/Vouch/Dismiss) — one open-slot comment implementation serves both. Prerequisite folded in: remove device addresses from AuthorManifest first (registered author IDs must be location-anonymous). Known-bounded: survives until deliberate bot-flooding; the trust layer (item 10) is the durable fix.

3. Cruft purge

Done (Iteration B) — landed with the itsgoin/4 ALPN bump; 0xC0 AnchorRegister deliberately kept until anchor convection (item 5). The zero-users ruling removes all wire-compat obligations. Delete: v0.6.x receive-only compat handlers (0x51/0x52), the sender-less 0x71 SocialDisconnectNotice, and the dual pull-matching path; the preferred-peer subsystem (slots, MeshPrefer negotiation, 7-day prune, 30-day watcher plumbing); dead senders and constants (hostlist encoder, no-op renewal cycle, orphaned GroupKeyRequest/Response); and legacy tree fields in wire structs. Clean protocol break — bump ALPN to itsgoin/4 here.

4. N1–N4 uniques knowledge layer

Done (Iteration C) — with size caps enforced, receive-side address filtering, and our own personas excluded from our own announce. Bloom-compressed N4 remains unbuilt; mobile drops the terminal pool instead. Narrow the mesh to ~20 slots (single pool), add temp referral slots (+4..+10, no knowledge exchange), and replace N1–N3 share lists with the two-pool uniques announce: forwardable N0–N2 + terminal N3, received entries stored shifted one bounce deeper, N4 held but never re-announced. Anchor entries carry addresses (the pools double as the anchor directory); everything else is bare IDs. Redefine pulls as uniques-index exchange. Device-tiered depth and Bloom-compressed N4 for mobile as needed.

5. Anchor convection

Done (Iteration C) — except the opt-in gate, which stays low priority per the ruling. Third-party anchor claims are index rows only; known_anchors and peers.is_anchor are written from proven handshakes. Retire the register loop. Anchor candidacy = reachability watcher + opt-in (opt-in gate is low priority — IPv6-abundant anchors are unlikely to be overwhelmed); the anchor service becomes a rolling referral window (caller gets 2 recent prior callers, is referred to the next 2), with RelayIntroduce coordination when both ends are live, and entry/top-up request classes (entry always served; top-up refused cheaply under load). Clients act stochastically on each mesh disconnect — random {do nothing | anchor introduction | mesh-peer introduction} with adaptive weights (anchor-density prior + refusal feedback). Anchors are mined from the uniques pools; known_anchors recedes to a bootstrap cache.

6. Post concealment (2–5 budget)

Cap the public post neighborhood to the 2–5 concealment budget (the AuthorManifest address removal already landed with item 2). Surplus posts are pushed out via replication so update/replication traffic hides content origin.

7. Update-cadence system

Replace the fixed pull tick with the descending-frequency scheduler: check intervals from minutes to days keyed on content freshness × relationship tier, same-author dedup, jittered timing so update and replication traffic reads as uniform network overhead. Uniques-list refresh rides these exchanges. Comment TTL (rand 30–365d) lands with this work.

8. Raw-UDP EDM refactor

Revive the disabled port scanner by replacing per-probe endpoint.connect() with raw socket.send_to() on the endpoint's bound UDP socket, so probes never enter iroh's path store (the v0.7.3 DoS-grade outbound cause). The preserved edm_port_scan_disabled_v0_7_3 body is the starting point.

9. Erasure-coded CDN replication

Replace full-copy auto-replication on the public tier with 3-of-10 sub-threshold shards, each shard a content-addressed blob with its own holder set. Removes the liability profile of infrastructure nodes holding reconstructable copies of content they never reviewed.

10. Directory trust layer

Vouch capacity, cascade punishment, graph-relative visibility, verification circuit-breaker, blacklist — built on top of the registry as the entry point. Minimum viable slice: single-vouch listing + impersonation reports → manual review. Defer cascade math until real graph data exists to calibrate thresholds.

Appendix E: File Map

As of v0.7.3 code. Use this as a navigation map, not an exhaustive line count.

crates/core/
  src/
    lib.rs                     — module registration, parse_connect_string, parse_node_id_hex,
                                 DEFAULT_ANCHOR_POSTING_ID
    types.rs                   — Post, PostId, NodeId, PublicProfile, PostVisibility (incl. FoFClosed),
                                 WrappedKey, VisibilityIntent, Circle, DeviceProfile slot tables,
                                 AuthorManifest/CdnManifest, BlobHeader + diff ops, DeviceRole budgets
    content.rs                 — compute_post_id (BLAKE3), verify_post_id
    crypto.rs                  — X25519 conversion, CEK wrap (itsgoin/cek-wrap/v1), group-key wrap,
                                 encrypt/decrypt_post, FoF wrap slots + prefilter, slot keys
    blob.rs                    — BlobStore (256-shard layout), compute_blob_id, verify_blob,
                                 delivery budget tracking

    identity.rs                — IdentityManager: multi-identity dirs, create/list/switch/delete,
                                 network vs posting identity (v0.6.0 split)
    profile.rs                 — profile posts (signed, content-addressed profile updates)
    control.rs                 — control posts: audience removal, delete control posts,
                                 persona admin ops
    fof.rs                     — Friend-of-Friend visibility: V_x wrap slots, anonymous prefilter,
                                 pub_post_set, CDN-level comment verification,
                                 V_me rotation / cascade-revoke / KeyBurnDiff
    group_key_distribution.rs  — circle group key distribution as encrypted posts + epoch rotation
    activity.rs                — in-memory ring buffer (200 events) of node activity
                                 (growth/rebalance/recovery/anchor/connection/relay) for the UI
                                 status panel — NOT engagement storage
    announcement.rs            — release announcement post handling

    storage.rs                 — SQLite (auto-migration): posts, peers, follows, profiles,
                                 circles/circle_members/circle_profiles, deleted_posts,
                                 post_replicas, peer_neighbors, mesh_peers, reachable_n2/n3,
                                 social_routes, reconnect_watchers, blobs, blob_headers,
                                 cdn_manifests, file_holders (flat CDN, cap 5), post_hosts,
                                 reactions/comments/comment_policies/thread_meta,
                                 seen_engagement/seen_messages, group_keys/group_member_keys/
                                 group_seeds, known_anchors, ignored_peers, relay_cooldowns,
                                 worm_cooldowns, settings, post_recipients, posting_identities,
                                 preferred_peers (dropped in v0.8 Iteration B), + 10 vouch/FoF tables
                                 (vouch_keys_own/received, vouch_bio_scan_cache, own_vouch_targets,
                                 fof_revocations, own_post_slot_provenance, vouch_unlock_cache,
                                 vouch_unreadable_posts, own_fof_post_ceks, fof_key_burns).
                                 post/blob_upstream+downstream tables dropped in v0.6.1-beta.
    protocol.rs                — MessageType enum, ALPN (itsgoin/4),
                                 length-prefixed JSON framing, InitialExchangePayload
    connection.rs              — ConnectionManager + ConnHandle/ConnectionActor (actor pattern):
                                 mesh + session slots, initial exchange, N1/N2 diff broadcast,
                                 pull sync, worm search, relay introduction, referral list,
                                 anchor self-probe, engagement diff handling. EDM scanner
                                 preserved as edm_port_scan_disabled_v0_7_3 (#[allow(dead_code)]).
                                 session_relay_enabled gate (opt-in OFF by default).
    network.rs                 — iroh Endpoint, accept loop, connect_to_peer, growth loop,
                                 connect_by_node_id support, mDNS passive address lookup,
                                 bidirectional anchor reachability watcher, per-IP rate limiting
    node.rs                    — Node struct, post CRUD, follow/unfollow, profile/circle CRUD,
                                 encrypted post creation, startup cycles, bootstrap with
                                 probe_anchors_batched + stale-anchor prune, pull/diff/rebalance/
                                 recovery/replication cycles, delete control posts,
                                 connect_by_node_id resolution cascade, blob eviction scoring
    web.rs                     — itsgoin.net web handler: QUIC proxy for share links, tiered
                                 serving (redirect/TCP punch/proxy), on-demand post fetch
    http.rs                    — raw-TCP HTTP listener: /p/ + /b/ routes, 5+15 slot budget,
                                 holder 302 redirect with 200ms probe, render_post_html
    upnp.rs                    — port mapping: UPnP-IGD + NAT-PMP + PCP via portmapper crate;
                                 PortMapping holds Client for service lifetime; watch_external()
    stun.rs                    — STUN probes (NAT type detection)
    android_wifi.rs            — Android-only JNI bridge: WifiManager.MulticastLock,
                                 WiFi/Ethernet detection, NodeService.stopFromNative
    export.rs / import.rs      — posting-key ZIP bundles: export, import-as-personas,
                                 import-as-new-identity, post import & merge (merge_with_key)

crates/cli/
  src/main.rs       — interactive REPL + anchor/daemon mode (--bind, --daemon, --web)

crates/tauri-app/
  src/lib.rs        — Tauri v2 commands (DTOs + IPC handlers): persona CRUD, identity
                       import/export, exit_app (Android NodeService stop), session-relay toggle
  gen/android/      — Android shell: NodeService.kt foreground service with
                       companion stopFromNative() static

frontend/
  index.html        — single-page UI: 5 tabs (Feed / My Posts / People / Messages / Settings),
                       close-app button with inline SVG power icon, session-relay toggle
  app.js            — Tauri invoke calls, rendering, identicon generator, circle CRUD
  style.css         — dark theme, post cards, visibility badges, transitions

website/
  design.html       — this document (canonical design reference)
  download.html     — release notes
  index.html, tech.html, contribute.html
  style.css         — shared site styling

License

ItsGoin is released under the Apache License, Version 2.0. You may use, modify, and distribute this software freely under the terms of that license.

This is a gift. Use it well.

Contribute

ItsGoin is open source and built in public. This project was started by a network/tech web dev vibe-coding beyond his skill level with AI assistance. The design is ambitious and the implementation is real — but more hands make lighter work. If any of this interests you, jump in.

Source code on Forgejo Join the Discord