Skip to content

ingress: accept SHA-256, CID and infohash identifiers and map them to BLAKE3 internally #2595

Description

@thiras

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, SHA256SUMS next 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 import and decdn publish (linked below) compute SHA-256 alongside BLAKE3 as they encode, and write an alias table into the bundle manifest (appendix-bundles): sha256 → blake3 per 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 get and the gateways accept decdn:sha256:<hex>?ns=<id>, decdn:cid:<base32>?ns=<id> and decdn:btih:<hex>?ns=<id>; the namespace's manifest answers the lookup. A lookup that misses is a plain NotFound.
  • 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 SHA256SUMS gets 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

Activity

  1. added
    kind:feature
    design:adr
    prio:medium
    on Oct 24, 2026
  2. added theissue type on Oct 24, 2026
  3. added
    area:cli
    area:protocol
    on Oct 24, 2026
  4. self-assigned this
    on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:cliarea:protocoldesign:adrkind:featureprio:medium

Fields

Priority

None yet

Projects

  • Status
    Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions