1.1 The Three Layers
| Layer | Purpose | Map contents | Update mechanism |
|---|---|---|---|
| L1 Peer Discovery | Find any node's address | NodeIds + hop distance + addresses (1-hop only). ~350K entries. | 2-min diffs (1-hop forwarding), worm lookup |
| L2 File Storage | Content-addressed storage + author update propagation | node:postid + media + author_recent_posts (256KB max) |
File replication, piggybacked updates, staleness pulls |
| L3 Social Routing | Direct routes to follows / audience | Cached routes to socially-connected nodes | Push (audience), pull (follows), route validation |
Layer 1 answers "where is this node?" Layer 2 answers "where is this content?" Layer 3 answers "how do I reach the people I care about?" Each layer operates independently but they reinforce each other — a file layer hit can bypass a Layer 1 worm entirely.
1.2 Follow vs Audience
| Follow | Audience | |
|---|---|---|
| Initiation | Unilateral — no request needed | Requires request + author approval |
| Delivery | Pull only — follower pulls updates | Push — author pushes via push worm |
| Author awareness | Author does not know | Author knows (approved the request) |
| Latency | Minutes (pull cycle or file-chain propagation) | Seconds (direct push) |
| Resource cost | Follower bears cost | Author bears cost |
| Scale | Unlimited followers (pull is distributed) | Author pushes to approved list |
Follows are private and passive — the author never learns who follows them. Content reaches followers via the file layer (author_recent_posts propagates through stored files) or via periodic pull. Audience is consented and active — the author pushes in real-time.
1.3 Connection Model — 101 Persistent QUIC
┌──────────────────────────────────┐ │ This Node (101 conns) │ ├──────────────────────────────────┤ │ 81 Social Peers │ │ ├─ Mutual follows │ │ ├─ Audience (granted) │ │ ├─ Users we follow (online) │ │ ├─ Recent sync partners │ │ └─ (evicted by priority) │ │ │ │ 20 Wide Peers │ │ ├─ Diversity-maximizing │ │ ├─ Re-evaluated every 10 min │ │ └─ At least 2 must be anchors │ └──────────────────────────────────┘ Mobile: 10 social + 5 wide = 15 connections.
All connections use a single ALPN (distsoc/2) with multiplexed message types.
One TLS handshake per peer. QUIC keep-alive every 20 seconds.
| Resource | Desktop (101) | Mobile (15) |
|---|---|---|
| Memory (connection state) | ~1.5 MB | ~250 KB |
| Keep-alive bandwidth | ~22 MB/day | ~3.2 MB/day |
| CPU | Negligible | Negligible |
1.4 Unified Protocol — Single ALPN
All communication over one ALPN distsoc/2. Message types via 1-byte header per QUIC stream:
Layer 1: Peer Discovery 0x01 RoutingDiff 2-min gossip diff 0x02 InitialMapSync Full map exchange on new connection 0x10 WormRequest Forwarded search 0x11 WormQuery Fan-out to peers (local check) 0x12 WormResponse Results to originator 0x20 AddressRequest Resolve NodeId → address 0x21 AddressResponse Layer 2: File / Content 0x30 FileRequest Request a post by PostId 0x31 FileResponse 0x32 AuthorUpdateRequest Request fresh author_recent_posts 0x33 AuthorUpdateResponse 0x34 AuthorUpdatePush Push updated author_recent_posts 0x35 PostNotification Real-time new post notification Layer 3: Social 0x40 PullSyncRequest Follower requests posts since seq N 0x41 PullSyncResponse 0x42 PushPost Audience push delivery 0x43 AudienceRequest Request to join audience 0x44 AudienceResponse General 0x50 ProfileUpdate 0x51 DeleteRecord 0x52 VisibilityUpdate
Previous design used 4 ALPNs (sync/6, addr/1, gossip/1, worm/1) requiring separate connections. Single ALPN means one TLS handshake per peer, connection reuse for all message types, simpler accept loop, easy to add new message types.