Repository navigation
Description
Summary
Replace the current hash-centric origin model (per-hash on-chain claimContent + a DAO-maintained default-open allow-list for unclaimed content) with a namespace-centric one:
- The namespace is the unit of origin addressing. A
cdn/client/v1request carries(namespaceId, hash). The node routes on the namespace to that namespace's DAO-authorized origins (OriginAssignment). The bare hash carries no origin information. - No per-hash on-chain claims. Delete
PublisherRegistry.claimContent/namespaceOf/hasClaimed/ContentClaimed. The hash→namespace association is asserted by the requester at fetch time, out of band — the app already knows its namespace (e.g. a music app fetches withnamespaceId 3). The chain stores only namespace ownership + each namespace's origin set, never content hashes. namespaceId == 0= unclaimed. No publisher, no authorized origins, no allow-list. Retrieval is best-effort local cache / DHT only; if no peer advertises the hash, it fails. Delete the entire default-open allow-list surface fromOriginAssignment.- Redundancy is a namespace property. Multiple operators can be authorized as origins for one namespace, which replaces the per-hash "multi-claim" mechanism (and removes the stranded-hash / squatting failure modes it existed to solve).
The namespace on a request is a routing hint, not a trust anchor: BLAKE3 verification of returned bytes is independent, so a wrong/hostile namespace hint can only cause a failed fetch, never corrupt or mis-attributed delivery.
Motivation
The current design gives unclaimed content a DAO-curated "allow-list" of origins. This is:
- Incoherent — "default-open" content gated by an allow-list is a contradiction; and the term names the read-open half while gating the origin half.
- Pointless — the hash→namespace tie is only ever consumed at fetch time by an app that already knows it; putting it on-chain buys nothing.
- Dangerous — per-hash claims push the chain toward an on-chain index of all served content ("indexing the whole internet"); and an allow-list of origins for content nobody claimed makes the DAO implicitly vouch for arbitrary bytes.
- Conflated — it mixes origin authorization (who may serve) with origin possession (who holds the bytes). For a claimed namespace these align because the publisher uploads to the operators it authorizes; for unclaimed content, authorization grants a right with no bytes behind it.
It also surfaced as a concrete internal contradiction in ADR 002 (adr/002-content-addressing.md): the Default-open section said the allow-list applies "alongside" namespace operators after a claim, while the Multi-claim paragraph and ADR 011 say it applies only to unclaimed hashes.
Benefits
- Bounded on-chain state — chain size scales with number of namespaces + their origin sets, never with content volume. No path toward indexing arbitrary content.
- Clean separation — authorization lives with namespaces; the bare hash is purely an integrity check. Possession and authorization align only where they should (claimed namespaces).
- Simpler contracts — removes
claimContent/namespaceOf/hasClaimed/ContentClaimedand the wholesetDefaultOpenAllowlist/add/remove/defaultOpenMaxOrigins+ 3DefaultOpen*events surface, plus their storage/validation special-casing. - Simpler node resolution — origin discovery becomes
getOrigins(request.namespaceId); the on-chainnamespaceOf(H)hash→namespace lookup and its event-fed cache disappear. - Redundancy without per-hash bookkeeping — multiple origins per namespace; stranded-hash and squatting failure modes vanish because there are no per-hash claims to strand or squat.
- Safe routing hint — independent BLAKE3 verification means a bad namespace hint only fails the fetch.
Potential issues / risks
- Cold, app-less retrieval of a bare hash becomes genuinely best-effort. Reliable retrieval now requires knowing the namespace;
namespaceId == 0is cache/DHT-only with no durability guarantee. This is intended, but it is a real change to the "fetch any hash from the network" mental model and must be documented loudly. - Wire-format change.
StreamRequestgains anamespace_idfield — a breakingcdn/client/v1change. Acceptable because the protocol is pre-finalisation (same posture as ADR 038), but it threads throughprotocol→client-pull→ node client handler → every test fixture that builds aStreamRequest. - Appeals standing (ADR 011 path 1). "Affected publisher" standing relied on the on-chain
hasClaimed(namespaceId, hash)check, which no longer exists. Proposed resolution: path 1 keeps its number (ADR 030 references "path 2" by number — do not renumber) and drops only thehasClaimedcheck; the existing "permissionless self-assertion, confers no more than path 3" rationale carries it, and path 3 (bond) remains the universal path. - No on-chain "who is responsible for this hash". Takedown stays hash-keyed on provable serve, so it does not need claims; but any future feature wanting an on-chain hash→publisher binding is now out of scope by design.
- Publisher UX shift. Publishing changes from "claim each hash" to "create a namespace + have the DAO authorize origins", and apps must carry the namespace to consumers out of band.
Blast radius
ADRs (docs)
- 002 (content addressing) — rewrite Publisher Identity, delete Default-open / Multi-claim / content-claim, rewrite
PublisherRegistryinterface. (drafted) - 011 (takedown) — remove default-open allow-list from
OriginAssignment(interface + dedicated subsection + recaps + consequences); drophasClaimedin appeals Standing. - 016 (contracts) —
PublisherRegistry/OriginAssignmentcontract inventory. - 005 (protocol) —
StreamRequest.namespace_id+ routing semantics. - 022 (discovery) — origin discovery drops the on-chain
namespaceOfstep;namespaceId == 0= DHT-only. - Stray references in 001, 003, 009, 019, 037, plus
glossary.md/architecture.md.
Contracts (Solidity)
PublisherRegistry.sol(~10 claim sites + per-hash storage),IPublisherRegistryStanding.sol.OriginAssignment.sol(~30 default-open sites: functions, events, storage, validation).ContentBlacklist.sol(path-1hasClaimed/namespaceId claim check).- Tests:
PublisherRegistry.t.sol(~17),OriginAssignment.t.sol(~25),ContentBlacklist.t.sol, andInterfaceFreeze.t.sol(interface-freeze baseline must be updated for the removed functions).
Rust
crates/node/src/dht/chain_origin_directory.rs— heaviest. Today:namespaceOf(H) → getOrigins(namespaceId) → operators, with a default-open (getOrigins(0)) fallback and an event-fed cache followingnamespaceOf+DefaultOpen*events. New: resolve directly from the request'snamespaceId; delete the hash→namespace lookup, theDEFAULT_OPEN_NAMESPACEset, and the 3DefaultOpen*event handlers. Lookup signature changes from hash-keyed to namespace-keyed.crates/node/src/dht/origin.rs—OriginDirectorytrait signature.crates/protocol/src/client.rs— addnamespace_idtoStreamRequest.crates/client-pull/src/endpoint.rs— populatenamespace_id.crates/node/src/handlers/client/{mod,dispatch}.rs— read + route onnamespace_id.crates/incentive/src/publisher_registry.rs(remove claim methods),crates/incentive/src/origin_assignment.rs(remove default-open methods).crates/cli/src/commands/publish.rs+crates/common/src/cli/publish.rs— publish flow moves from per-hash claim to namespace-create + origin-propose.crates/node/src/runtime/mod.rs+reload.rs— wiring.- Tests: every
StreamRequest { .. }fixture (origin_range_pull.rs,client_loopback.rs, …);crates/e2e/tests/g_origin_04_default_open.rs(rewrite/remove),g_origin_01_publish.rs,cli_publish.rs,g_node_08_authorized_origin.rs,bindings.rs,chain.rs.
Rollout
ADRs first, as coupled PRs so the spec is never internally inconsistent:
- Core — 002 + 011 + 016 + stray-reference cleanup (001/003/009/019/037, glossary, architecture).
- Retrieval — 005 (
StreamRequest.namespace_id+ routing) + 022 (namespace-0 = DHT-only).
Contract + Rust implementation follows the ratified ADRs as its own tracked work (pre-finalisation, so no migration/compat shim).
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
docs(adr): namespace-as-origin-addressing, drop per-hash claims and d…
docs(adr): namespace-as-origin-addressing, drop per-hash claims and d…
test(protocol): re-bless public-api snapshot for StreamRequest.namesp…
feat: namespace-as-origin-addressing — drop per-hash claims + default…