feat(holdings): holdings are DECLARED, not inferred from transport
Until now every receive path recorded the SENDER in `file_holders`, and
those rows went straight back out on the wire to third parties as
`cdn_redirect_peers`, as worm holder answers, and as HTTP 302 targets.
Exchanging bytes with a peer enrolled its node id -- and its addresses --
into a list we republished to anyone who asked.
Two things follow, and both matter. The concealment model the erasure
work depends on ("hold k shards quietly, announce exactly one slot") is
impossible on an inferred foundation: acquiring a shard registers you as
its holder whether you consented or not. And an enumerator never had to
hold anything -- it just asked holders who else holds.
`file_holders` rows now split two ways:
* local hint (`declared = 0`) -- "we exchanged bytes about this file
with that peer". Drives fetch retry, diff-propagation targets and
manifest refresh. Never published as a holder of a specific file.
* declaration (`declared = 1`) -- the peer told us "I hold this and you
may advertise me for it" (0xD3). The only holder list that may leave
the node.
All 12 inference sites were triaged into hints with a per-site reason
rather than deleted. 0xD3 became the declaration handler and is validated
hard, since it is now the only unauthenticated input reaching an outbound
holder surface: 16 KB read ceiling (was MAX_PAYLOAD, 64 MB), reject rather
than truncate oversized batches, a `tracks_file` gate so a stranger cannot
mint rows for arbitrary 32-byte ids, a per-peer token bucket and row
budget, and normalised publicly-routable addresses capped at 4. An
introducer nominee must be a known anchor -- otherwise a peer could make
us publish an arbitrary victim's address.
Declarations are soft state: a rotating per-peer sweep rides each
content-sync cycle and `DECLARATION_TTL_MS` (30d) ages out a holder that
goes quiet, so a peer that wipes its database re-learns them.
Durability decisions count EVIDENCE, never claims. A new `witnessed`
column records transport events we handled ourselves, independent of
`declared` because a peer can be both; keying the count on `declared = 0`
instead dropped every honest custodian that declared out of its author's
durability count, making the post look less durable and provoking
replication it did not need. Gating replication on claims would also let
five Sybil identities declare a post and silently stop its author
replicating it -- the data-availability attack the erasure study rules
against.
Alpha policy defaults are deliberately generous (both classes declare,
per-author cap off) because a tight cap makes content unfindable and
there is no spare holder population yet. Own-authored content is never
declared by default: it publishes device <-> posting identity, the
binding the manifest address strip exists to prevent. Non-public content
is never declared at all, at a single chokepoint. Policy changes are
retroactive, so the open alpha shape is transitional.
Known limit, documented in `holdings.rs` and design.html: this hides
WHICH and HOW MANY of an author's posts you hold, not THAT you hold some
of that author's content -- `build_own_uniques` still announces every
distinct author, deliberately interest-blind-but-complete so discovery
works. The one-shard-announcement property holds at file granularity
only; closing the author-level surface is a discovery trade Round 10 has
not ruled on.
Wire format (clean break, zero users): drops
`BlobRequestPayload.requester_addresses`, `BlobResponsePayload`'s
`cdn_registered`, and `CdnManifest.host` -- the last rode every blob
response and was relayed verbatim, so a third party learned "node A holds
this CID" with no declaration from A. ALPN is NOT bumped here; see the PR.
301 core tests (was 267), a3 23/23 (12 pre-existing + 11 new behavioural
assertions), c_topology 33/33 unchanged. Policy knobs reachable from the
desktop app, not CLI-only.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LGiPD2cF75mnvneSCjdDC5
This commit is contained in:
parent
eebf0d86f0
commit
3430a9d4c9
17 changed files with 3560 additions and 157 deletions
|
|
@ -907,31 +907,58 @@
|
|||
|
||||
<h3>Blob transfer flow (<code>0x90</code>/<code>0x91</code>) <span class="badge badge-complete">Implemented</span></h3>
|
||||
<ol style="padding-left: 1.25rem; margin: 0.5rem 0; color: var(--text-muted);">
|
||||
<li>Requester sends <code>BlobRequest { cid, requester_addresses }</code></li>
|
||||
<li>Requester sends <code>BlobRequest { cid }</code>. It carries no addresses: asking for a file is not an application to be advertised as one of its sources.</li>
|
||||
<li>Host checks local BlobStore and delivery budget:
|
||||
<ul style="margin-top: 0.3rem;">
|
||||
<li><strong>Has blob, budget OK</strong>: Return base64-encoded data + CDN manifest (with current holder count). If the host knows fewer than 5 holders, register the requester (<code>cdn_registered: true</code>); otherwise return the known holders as <code>cdn_redirect_peers</code>.</li>
|
||||
<li><strong>No blob / budget exhausted</strong>: Return <code>found: false</code></li>
|
||||
<li><strong>Has blob, budget OK</strong>: return base64-encoded data + the author-signed manifest.</li>
|
||||
<li><strong>No blob, or budget exhausted</strong>: return <code>found: false</code>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Requester verifies CID, stores blob locally, records the host in <code>file_holders</code> (direction <code>received</code>), and stores any redirect peers as additional holder knowledge.</li>
|
||||
<li><strong>All three outcomes carry <code>cdn_redirect_peers</code></strong> — the <em>declared</em> holders of that CID, minus the requester. The budget-exhausted case is where a redirect matters most: the host has the bytes and is declining to send them, so the requester needs somewhere else to go.</li>
|
||||
<li>Requester verifies the CID, stores the blob, and records the host as a <strong>local hint</strong>. If its own policy admits it, it then sends a <strong>holding declaration</strong> (<code>0xD3</code>) — the only way it enters anyone's publishable holder list.</li>
|
||||
</ol>
|
||||
|
||||
<h3>Manifests <span class="badge badge-rework">Rework</span></h3>
|
||||
<ul style="padding-left: 1.25rem; margin: 0.5rem 0; color: var(--text-muted);">
|
||||
<li><strong>AuthorManifest</strong>: ed25519-signed by the post author (posting key). Contains the anchor post, creation/update timestamps, and the author's post neighborhood. In v0.8 the neighborhood is capped to the <strong>2–5 post concealment budget</strong> and the manifest carries <strong>no device addresses</strong> — readers reach the author's content through <code>file_holders</code> search, never through addresses tied to the posting identity.</li>
|
||||
<li><strong>CdnManifest</strong>: AuthorManifest + serving-host metadata. The v0.8 wire format drops the legacy tree fields (source, source addresses, downstream count) as part of the clean protocol break (see <a href="#sync">Sync Protocol</a>).</li>
|
||||
<li><strong>CdnManifest</strong>: the author-signed manifest, and nothing else. The v0.8 wire format dropped the legacy tree fields (source, source addresses, downstream count) as part of the clean protocol break (see <a href="#sync">Sync Protocol</a>); v0.8.1 dropped the last one, the serving host’s NodeId. It was never read, it rode every blob response and manifest push, and the manifest-push relay forwarded received entries verbatim — so a third party learned “node A holds this CID” with no declaration from A. A receiver already learns the serving host from the QUIC-authenticated connection.</li>
|
||||
</ul>
|
||||
<div class="note">
|
||||
<strong>v0.8 change (privacy fix):</strong> 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 (<a href="#discovery">Discovery & First Contact</a>).
|
||||
</div>
|
||||
|
||||
<h3>Declared holdings — holding vs. being advertised <span class="badge badge-complete">Implemented</span></h3>
|
||||
<p>Until v0.8.1 holdings were <strong>inferred from transport</strong>: every receive path recorded the <em>sender</em> in <code>file_holders</code>, and those rows went back out on the wire to third parties as <code>cdn_redirect_peers</code>, as worm holder answers, and as HTTP 302 targets. Merely exchanging bytes with a peer enrolled your node ID — and your addresses — into a list that peer republished to anyone who asked. Two things follow from that, and both matter: the concealment model below (“hold several shards quietly, announce exactly one slot”) is impossible on an inferred foundation, and an enumerator never had to hold anything — it just asked holders who else holds.</p>
|
||||
<p>Holder registration is therefore a <strong>deliberate self-declaration</strong>:</p>
|
||||
<table>
|
||||
<tr><th>Row</th><th>Means</th><th>Used for</th></tr>
|
||||
<tr><td><strong>Local hint</strong> (<code>declared = 0</code>)</td><td>“We exchanged bytes about this file with that peer.”</td><td>Fetch retry, diff-propagation targets, manifest refresh. Never published as a holder of a specific file.</td></tr>
|
||||
<tr><td><strong>Declaration</strong> (<code>declared = 1</code>)</td><td>The peer told us “I hold this and you may advertise me for it” (<code>0xD3</code>).</td><td>The only holder list that may go on the wire, into a worm answer, or into an HTTP redirect.</td></tr>
|
||||
</table>
|
||||
<p>An <em>undeclared</em> holder stays invisible but still serves a direct request it receives — declaration governs advertisement, not willingness to serve. Declarations are <strong>soft state</strong>: they are re-sent on a rotating per-peer sweep riding each content-sync cycle, and they expire if not renewed, so a peer that wipes its database re-learns them and a holder that goes quiet drops out of other nodes’ lists.</p>
|
||||
<p>What a node declares is local policy. The alpha defaults are deliberately <strong>generous</strong> — both classes declare and the per-author cap is off — because a tight cap makes content unfindable and there is no spare holder population yet to absorb that:</p>
|
||||
<table>
|
||||
<tr><th>Knob</th><th>Default</th><th>Meaning</th></tr>
|
||||
<tr><td>Custodial declarations</td><td>On</td><td>Content pushed to us by a <code>ReplicationRequest</code>. Being findable <em>is</em> the function of holding it.</td></tr>
|
||||
<tr><td>Interest declarations</td><td>On</td><td>Content we fetched because we wanted it. These are the rows that carry the follow signal.</td></tr>
|
||||
<tr><td>Per-author listing cap</td><td>0 (unlimited)</td><td>Round 10’s per-(holder, author) axis. Target is 2, adopted once the activity digest exists to carry the coverage the cap gives up.</td></tr>
|
||||
<tr><td>Own authored content</td><td>Off</td><td>Declaring a post we authored publishes <code>device ↔ posting identity</code> — the binding the manifest address strip exists to prevent. Authors still serve direct requests.</td></tr>
|
||||
<tr><td>Introducer</td><td>Off</td><td>Publish a connected anchor’s address instead of ours; a fetcher reaches us through <code>RelayIntroduce</code> and the bulk transfer flows direct. Not session relay — no bytes cross the introducer.</td></tr>
|
||||
</table>
|
||||
<p>Non-public content is never declared, at a single chokepoint: advertising yourself as a holder of a DM, a group post or an FoF-closed post announces your membership in its audience. Policy changes are <strong>retroactive</strong> — tightening a knob retracts the declarations it no longer admits and tells the peers publishing us — so the alpha’s open shape is transitional rather than permanent.</p>
|
||||
<div class="note">
|
||||
<strong>Honest limit.</strong> Declaration governs the per-<em>file</em> holder lists. It hides <strong>which</strong> and <strong>how many</strong> of an author’s posts you hold; it does <strong>not</strong> hide <em>that</em> you hold some of that author’s content. The uniques index (see <a href="#layers">Network Knowledge</a>) announces every distinct author whose content you carry, deliberately interest-blind-but-complete so discovery works at all. So the per-author cap bounds post counts, never the author set, and the one-shard-announcement property holds at file granularity only. Closing the author-level surface means deriving that half of the announce from declared holdings — a discovery trade that has not been ruled on.
|
||||
</div>
|
||||
<div class="note">
|
||||
<strong>Upgrade behaviour.</strong> Every pre-existing <code>file_holders</code> row was inferred, so on upgrade it becomes a local hint and stops being republished — including its inferred addresses, which are cleared. Carrying those rows forward as declarations would have preserved exactly the leak the change closes, for subjects who can never be asked. The discovery cost is bounded by a one-time startup backfill that re-declares the public content a node already holds through the ordinary policy, plus the rotating re-declaration sweep.
|
||||
</div>
|
||||
|
||||
<h3>Blob eviction <span class="badge badge-complete">Implemented</span></h3>
|
||||
<pre><code>priority = pin_boost + share_boost + (relationship × heart_recency × freshness / (peer_copies + 1))</code></pre>
|
||||
<table>
|
||||
<tr><th>Factor</th><th>Calculation</th></tr>
|
||||
<tr><td><code>pin_boost</code></td><td>1000.0 if pinned, else 0.0. Own blobs auto-pinned.</td></tr>
|
||||
<tr><td><code>share_boost</code></td><td>100.0 at 3+ known holders; <code>50.0 × n / 3</code> for 1–2 holders; 0 otherwise. Holder count comes from <code>file_holders</code> (max 5) — content with a healthy holder set is being actively served and stays cached longer.</td></tr>
|
||||
<tr><td><code>share_boost</code></td><td>100.0 at 3+ known holders; <code>50.0 × n / 3</code> for 1–2 holders; 0 otherwise. Holder count comes from <code>file_holders</code> (max 5 per class) — content with a healthy holder set is being actively served and stays cached longer. <em>Durability decisions (is my own post under-replicated?) count only holders we have evidence for — transport events we witnessed, or corroborated replica announcements — never bare declarations: a claimed holder set is cheap to forge, and a forged “this is healthy” would suppress healing.</em></td></tr>
|
||||
<tr><td><code>relationship</code></td><td>5.0 (own content), 2.0 (followed author), 0.1 (stranger). <em>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 <a href="#identity-architecture">Identity Architecture</a>).</em></td></tr>
|
||||
<tr><td><code>heart_recency</code></td><td>Linear decay over 30 days since last access: <code>max(0, 1 - age/30d)</code></td></tr>
|
||||
<tr><td><code>freshness</code></td><td><code>1 / (1 + post_age_days)</code></td></tr>
|
||||
|
|
@ -1442,11 +1469,11 @@
|
|||
<ul style="padding-left: 1.25rem; margin: 0.5rem 0; color: var(--text-muted);">
|
||||
<li><strong>Jittered, tiered update cadence</strong>: CDN update checks run on a descending-frequency schedule (minutes → days) keyed on freshness × relationship tier, with jitter on every timer (see <a href="#keep-alive">Update Cadence</a>). No check fires <em>because</em> a post appeared; checks fire because a schedule slot came up.</li>
|
||||
<li><strong>Replication shaped as overhead</strong>: replication pushes are paced and jittered so an author seeding their own content is indistinguishable from a holder performing routine redundancy maintenance. The goal: update + replication traffic reads as uniform network overhead, with no observable "origin burst".</li>
|
||||
<li><strong>2–5 visible posts per author</strong>: the public CDN surface reveals at most 2–5 posts per author at any time; the surplus is pushed out to holders via replication requests and reached through the uniques index. This caps what enumeration of any single node's public holdings discloses about any author's corpus — and hides the author's own node behind ordinary public mesh IDs.</li>
|
||||
<li><strong>2–5 visible posts per author</strong>: the public CDN surface reveals at most 2–5 posts per author at any time; the surplus is pushed out to holders via replication requests and reached through the uniques index. This caps what enumeration of any single node's public holdings discloses about any author's corpus — and hides the author's own node behind ordinary public mesh IDs. The mechanism is the per-author cap on <a href="#files">declared holdings</a>, which is <em>implemented but defaulted open for the alpha</em>; the cap bounds posts per author, not the author set itself.</li>
|
||||
<li><strong>Open-slot comment TTL</strong>: long-lived comment trails are the easiest correlation anchors across time. The 30–365-day expiry bounds how long a <em>throwaway-ID</em> trail exists — it applies to the open-slot stranger channel (greetings), which is where the anonymity claim lives. Public and post-key-signed comments do not expire; they are attributable content, and their trail is bounded by nothing but deletion.</li>
|
||||
</ul>
|
||||
<div class="note">
|
||||
<strong>Honest scope</strong>: 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.
|
||||
<strong>Honest scope</strong>: this defeats passive observers correlating timing and public holdings. Holder-list enumeration specifically — asking holders who else holds — is bounded by <a href="#files">declared holdings</a>: an enumerator now sees only peers that consented to be named for that file, not everyone who ever exchanged bytes about it. 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.
|
||||
</div>
|
||||
</section>
|
||||
<section id="multidevice">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue