Repository navigation
Description
Component
cli (decdn binary)
Who it affects
publisher (someone importing content or sponsoring downloads), client (someone running decdn get or the gateway)
Problem
Every identifier the network accepts is a BLAKE3 hash: decdn:<hash> (ADR 002). The customers the demand-side work targets already have identifiers for the same bytes:
- model and dataset repos publish SHA-256 (HuggingFace LFS pointers,
SHA256SUMSnext to a Linux ISO); - IPFS users have a CID;
- a torrent has an infohash and per-file piece hashes.
A publisher mirroring an existing release cannot let their users verify against the digest they already hold, and the hosted gateway (linked below) cannot answer a HF_ENDPOINT request without knowing which blob a SHA-256 names.
Proposed solution
Accept SHA-256, CID (v1, raw or dag-pb leaves with sha2-256) and BitTorrent v1 infohash at ingress, and map each to BLAKE3 internally. Nothing below ingress changes: nodes, vouchers, bao ranges and the DHT keep BLAKE3.
- Where the map lives.
decdn origin importanddecdn publish(linked below) compute SHA-256 alongside BLAKE3 as they encode, and write an alias table into the bundle manifest (appendix-bundles):sha256 → blake3per entry, plus the whole-file CID when the publisher asks for it. A torrent infohash resolves to the bundle whose manifest records it (--torrent <file>at import stores the infohash and piece layout). - Where it resolves.
decdn getand the gateways acceptdecdn:sha256:<hex>?ns=<id>,decdn:cid:<base32>?ns=<id>anddecdn:btih:<hex>?ns=<id>; the namespace's manifest answers the lookup. A lookup that misses is a plainNotFound. - Verification. The client still verifies BLAKE3 as bytes land. When the request carried a SHA-256, the client also streams SHA-256 and compares at the end, so a user who pasted a digest from
SHA256SUMSgets what they asked for even if a manifest lied.
The ?ns= is required: a foreign hash is only unique within the namespace that published the alias table.
Alternatives considered
- Publish the alias table on chain. Content gates on chain are a non-goal ("payment is content-agnostic by design"), and a per-blob record is unbounded state. The bundle manifest is already the publisher's signed statement about its entries.
- A global resolver service. Reintroduces a trusted index. The namespace-scoped manifest is already fetched and verified by every client.
- Hash the same bytes under both trees on nodes. Doubles the outboard footprint per blob for a lookup that the manifest answers in one read.
Design scope
- This proposal changes the protocol, the economics, or the contract surface.
The decdn: URI grammar and the bundle manifest schema change. That is an ADR 002 and appendix-bundles edit, not a contract change.
Related
- One-command publish (writes the alias table): cli:
decdn publish ./dirpublishes a directory to a namespace in one command #2591 - Hosted gateway (resolves
HF_ENDPOINTand webseed requests through it): gateway: hosted public HTTP gateway at<ns>.decdn.linkthat pays a pool behind the scenes #2593
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsBacklog
Activity