Skip to main content

Decision

cdn/dht/v1 — a Kademlia-subset content discovery ALPN — is the primary discovery mechanism. Broadcast probe fan-out is retained as a bootstrap and emergency fallback. Two popularity signals are surfaced: popular_hashes gossip (advisory) and DHT FIND_VALUE query frequency (non-suppressible). No discovery fees — all revenue stays on delivery.

Why not broadcast-only

Probe fan-out is O(N) per cache miss and does not scale beyond ~100 nodes. At thousands of nodes, a single cache miss would generate thousands of probe RPCs.

Why not gossip content hints

Broadcast gossip of content inventories (Bloom filters, hash lists) was rejected — traffic would scale with cache churn, which is unbounded. Hash-prefix range hints were also rejected as economically irrational: nodes cache popular content regardless of hash prefix, so prefix-based routing provides no real locality.

How cdn/dht/v1 works

  • Nodes self-publish (hash → NodeId) STORE records when caching a blob — the record attracts paying clients, so self-interest aligns with publishing.
  • FIND_VALUE lookups are O(log N).
  • No discovery fees. The probe step (cdn/probe/v1) remains the final availability confirmation before delivery commitment.

Popularity signals

Each NodeAnnounce includes a capped list of hashes the node is currently serving heavily (cap of 5 — privacy). Self-reported and suppressible, but suppression is self-limiting: the LoadHint + selection score already handicap nodes under load, so lying downward about popularity gains no advantage.

DHT FIND_VALUE query frequency (non-suppressible)

Kademlia routing means FIND_VALUE traffic reaches nearby-keyspace nodes regardless of whether any gossip advertised the hash. A node sitting in the keyspace can observe real query pressure and prefetch accordingly.

Prefetching

Nodes can prefetch with two signals:
  1. Local demand — cache miss frequency per hash (default: 3 misses in 5 minutes)
  2. Network popularity — hashes appearing in 3+ peers’ popular_hashes within 10 minutes
All prefetch pulls use the same DHT FIND_VALUE → probe → cdn/client/v1 path. Nodes pay for prefetched bytes just like clients pay for delivery — self-interest filters out speculative prefetching of content that won’t recoup the pull cost. Source ADR: 022-content-discovery.md