Repository navigation
Description
Tracker for the hosted public HTTP gateway at https://<namespace>.decdn.link/<path> (and https://decdn.link/<hash>[/<path>] for raw content). The gateway is itself a paying client: nodes see ordinary paid pulls, and nothing in the protocol, the economics or the contract surface changes.
Shipped
-
decdn gateway --public-urlserves anyone (feat(cli):decdn gateway --public-urlserves anyone from its own pool #2608). - Namespace pointers give each namespace a stable host (feat(cli): namespace pointers give a namespace a stable host on a public gateway #2614).
-
Rangeon a sized bundle entry (feat(cli): the gateway answersRangeon a sized bundle entry #2612). Raw-blob sizes are proven before the first byte (fix(gateway,client): size a verified raw blob, and adopt the size open's pull #2646, feat(gateway,client): prove a raw blob's size before its first byte #2654). - Every origin is answered (feat(gateway): answer every origin on a public gateway, and run the TypeScript SDK contract against it #2628).
- Metrics on a loopback listener (feat(cli): the public gateway serves its metrics on a loopback listener #2611).
- A blob cache: a request the cache holds costs no pull (refactor(cache): move the eviction driver loop from the node into decdn-cache #2886, refactor(client): let the Streamer fill a store the caller opens #2887, feat(cache): report progress and stop early in a streamed admit #2903, feat(gateway): cache what pulls deliver, and one cache store for node and gateway #2908).
- The deploy role, behind nginx with a wildcard certificate (feat(decdn_gateway): deploy the public gateway behind nginx with a wildcard certificate devops#187).
Remaining
-
HF_ENDPOINTresolve path (feat(cli): a namespace host on the public gateway is an HF_ENDPOINT #2615, open PR). The HF/api/subset is gateway: serve the HF/api/subset (revision, tree) sosnapshot_downloadworks against a namespace host #2617. - The real
decdn.linkdeployment: DNS, the DNS-01 token, the host and the public-suffix-list registration (decdn/fleet#47). - The
?ns=redirect host needs a certificate that no wildcard covers (gateway: the ?ns= redirect's <ns>.<hash32>.<host> needs a certificate no wildcard covers #2784).
Payment
On main the public gateway pays from a pool it holds, within a per-namespace allowance, and answers 402 above it. Open PR #2910 replaces that model: the gateway pays only with capabilities registered from outside, holds no keystore and no allowance, and answers 503 with the decdn: URI when nothing can pay. The allowance design in the original proposal below does not survive #2910.
Related
- One-command publish that prints the gateway URL: cli:
decdn publish ./dirpublishes a directory to a namespace in one command #2591 - Publisher dashboard: sponsord: publisher dashboard with card-to-USDC pool funding, per-namespace spend and per-user allowances #2594
- Foreign-hash ingress: ingress: accept SHA-256, CID and infohash identifiers and map them to BLAKE3 internally #2595
Original proposal
Component
cli (decdn binary)
Who it affects
client (someone running decdn get or the gateway), publisher (someone importing content or sponsoring downloads)
Problem
decdn gateway listens on loopback only (--listen must be a loopback address), takes a per-install token header, and holds capabilities in memory for one browser. It is a client-side tool. There is no URL a publisher can hand to someone who has installed nothing.
So fetching anything outside the seeded bundles today needs decdn, a keystore, Sepolia ETH and USDC, or a sponsord installer that still runs decdn. None of curl, a browser without the extension, HF_ENDPOINT, or a torrent client can reach the network. Every integration shim is a separate project, and none exists.
Proposed solution
A hosted public HTTP gateway at https://<namespace>.decdn.link/<path> (and https://decdn.link/<hash>[/<path>] for raw content). The gateway is itself a paying client: it holds a buyer pool and pulls through decdn-client like any other buyer, so nodes see ordinary paid pulls and nothing in the protocol changes. One surface gives every shim at once:
- Browser.
GET /on a namespace host serves the bundle'sindex.html; entries get their realContent-Type. One browser origin per namespace, which is the isolation gateway: serve bundles as websites, one browser origin per bundle, no extension needed #2457 designs for the loopback gateway, applied to a real hostname. curl/wget. PlainGETwithContent-LengthandAccept-Ranges: bytes. Range requests map onto bao verified ranges (ADR 038), so a resumed download pays only for the range it fetches.HF_ENDPOINT. Serve the handful of paths thehuggingface_hubclient expects (/api/models/<repo>,/<repo>/resolve/<rev>/<file>,HEADwithX-Linked-Etag/X-Linked-Size) for a namespace that publishes a model repo. Scope: the resolve path first; the API surface after.- Torrent webseed. A BEP 19 webseed is a plain HTTP URL with range support, so this falls out of the
curlcase; a publisher addsurl-listto their torrent.
Payment and abuse: the gateway pays from a pool its operator funds. A per-namespace allowance (set by the publisher, see the dashboard issue linked below) caps what the gateway spends on a namespace's behalf; above it the gateway answers 402 with the decdn: URI so a paying client can continue. No-allowance namespaces get a small Labs-funded default on the testnet. HEAD is answered from the bundle manifest, which the gateway caches, so it costs no pull (the loopback gateway returns 405 for the same reason).
Where it lives: the request handling is the loopback gateway's with the token/capability layer swapped for the allowance layer, so a gateway library in crates/cli or a new decdn-gateway crate, plus a binary and an image. Deployment goes to devops/fleet once the binary exists.
Alternatives considered
- x402 edge on every node (gateway: optional x402 HTTP payment edge for non-QUIC (browser/agent) clients #866, closed). Puts HTTP on nodes and makes every node an HTTP target. A hosted gateway is one deployment and keeps nodes QUIC-only.
- Browser extension only. The extension needs an install. The customer's users have installed nothing.
- sponsord installers only. Already shipped; still requires running a script that installs
decdn. Right for large downloads, not for a link in a release note.
Design scope
- This proposal changes the protocol, the economics, or the contract surface.
The gateway is a client. Nodes, pools and contracts see paid pulls.
Related
- Loopback gateway, one origin per bundle: gateway: serve bundles as websites, one browser origin per bundle, no extension needed #2457
- One-command publish that prints the gateway URL: cli:
decdn publish ./dirpublishes a directory to a namespace in one command #2591 - Publisher dashboard, per-namespace allowance: sponsord: publisher dashboard with card-to-USDC pool funding, per-namespace spend and per-user allowances #2594
- Foreign-hash ingress (the gateway is where it applies): ingress: accept SHA-256, CID and infohash identifiers and map them to BLAKE3 internally #2595
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsBacklog
Activity
feat(cli): `decdn gateway --public-url` serves anyone from its own pool
feat(cli): `decdn gateway --public-url` serves anyone from its own pool
feat(cli): `decdn gateway --public-url` serves anyone from its own pool
feat(client): `Streamer::open_range` streams one verified byte window (…
feat(cli): `decdn gateway --public-url` serves anyone from its own pool
feat(cli): `decdn gateway --public-url` serves anyone from its own pool
feat(cli): the gateway answers `Range` on a sized bundle entry
feat(cli): `decdn gateway --public-url` serves anyone from its own po…
feat(cli): the gateway answers `Range` on a sized bundle entry
feat(cli): the gateway answers `Range` on a sized bundle entry
feat(cli): the gateway answers `Range` on a sized bundle entry (#2612)
feat(cli): the public gateway serves its metrics on a loopback listener
feat(cli): the public gateway serves its metrics on a loopback listen…
feat(cli): namespace pointers give a namespace a stable host on a pub…
thiras commentedon Nov 10, 2026
Status on
main(ee1d12d):Done:
decdn gateway --public-urlserves anyone from the gateway's own pool (feat(cli):decdn gateway --public-urlserves anyone from its own pool #2608).Rangeon a sized bundle entry (feat(cli): the gateway answersRangeon a sized bundle entry #2612), and raw-blob sizes are proven before the first byte (fix(gateway,client): size a verified raw blob, and adopt the size open's pull #2646, feat(gateway,client): prove a raw blob's size before its first byte #2654).crates/cli/src/commands/gateway.rs:1265-1281). Every origin is answered (feat(gateway): answer every origin on a public gateway, and run the TypeScript SDK contract against it #2628).Remaining:
HF_ENDPOINTsupport (feat(cli): a namespace host on the public gateway is an HF_ENDPOINT #2615, open).decdn.linkdeployment: DNS, the DNS-01 token, the host and the public-suffix-list registration (decdn/fleet#47).?ns=redirect host needs a certificate that no wildcard covers (gateway: the ?ns= redirect's <ns>.<hash32>.<host> needs a certificate no wildcard covers #2784).