Skip to content

Redesign origin addressing: namespace-as-address, drop per-hash claims and the default-open allow-list #1394

Closed

Description

@alpergundogdu

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/v1 request 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 with namespaceId 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 from OriginAssignment.
  • 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:

  1. 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.
  2. 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.
  3. 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.
  4. 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/ContentClaimed and the whole setDefaultOpenAllowlist/add/remove/defaultOpenMaxOrigins + 3 DefaultOpen* events surface, plus their storage/validation special-casing.
  • Simpler node resolution — origin discovery becomes getOrigins(request.namespaceId); the on-chain namespaceOf(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 == 0 is 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. StreamRequest gains a namespace_id field — a breaking cdn/client/v1 change. Acceptable because the protocol is pre-finalisation (same posture as ADR 038), but it threads through protocol → client-pull → node client handler → every test fixture that builds a StreamRequest.
  • 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 the hasClaimed check; 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 PublisherRegistry interface. (drafted)
  • 011 (takedown) — remove default-open allow-list from OriginAssignment (interface + dedicated subsection + recaps + consequences); drop hasClaimed in appeals Standing.
  • 016 (contracts) — PublisherRegistry / OriginAssignment contract inventory.
  • 005 (protocol) — StreamRequest.namespace_id + routing semantics.
  • 022 (discovery) — origin discovery drops the on-chain namespaceOf step; 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-1 hasClaimed/namespaceId claim check).
  • Tests: PublisherRegistry.t.sol (~17), OriginAssignment.t.sol (~25), ContentBlacklist.t.sol, and InterfaceFreeze.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 following namespaceOf + DefaultOpen* events. New: resolve directly from the request's namespaceId; delete the hash→namespace lookup, the DEFAULT_OPEN_NAMESPACE set, and the 3 DefaultOpen* event handlers. Lookup signature changes from hash-keyed to namespace-keyed.
  • crates/node/src/dht/origin.rs — OriginDirectory trait signature.
  • crates/protocol/src/client.rs — add namespace_id to StreamRequest.
  • crates/client-pull/src/endpoint.rs — populate namespace_id.
  • crates/node/src/handlers/client/{mod,dispatch}.rs — read + route on namespace_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:

  1. Core — 002 + 011 + 016 + stray-reference cleanup (001/003/009/019/037, glossary, architecture).
  2. 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

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions