Repository navigation
Backlog
Description
Problem
The sponsord stack is five crates and two binaries in this repo, and most of it is not protocol:
sponsord+sponsord-core+sponsord-api(~4.5k lines) wrap one job: sign adcap1:capability for a key, within a maximum cap and TTL.decdn pool assignalready does that signing offline.sponsord-onramp+sponsord-e2e(~4.2k lines) are a public web app: the Turnstile gate, the browser-to-installer hand-off, thedecdn.sh/decdn.ps1installers and the~/.decdn/sponsored/layout. The installer pins a releaseddecdnby digest, so the onramp already ships behind decdn releases, like the demo apps.
The onramp is the part every deployment changes (the gate above all), and it is built as an embeddable library (Gate, CapabilitySource) so people can change it without forking. Forking a small app is simpler than a plugin surface. Keeping it here also makes its installer arguments and state layout decdn's breaking-change rules.
Proposal
1. decdn sponsor: the signer as a CLI subcommand
- The issuing logic (
Issuer, the maximum terms, the registered-terms check and409 signer_expired) moves into a library crate the CLI already depends on (decdn-incentiveordecdn-client).decdn pool assignanddecdn sponsorshare it. decdn sponsorserves the same HTTP API assponsordtoday:POST /v1/capabilities,GET /v1/info,/healthz,/metrics, bearer token on/v1. It runs on the gateway's hyper-basedlocal_http, so the CLI's dependency footprint (check_crate_edges.py) does not grow.- It is an internal service. It binds localhost by default and runs next to the caller's backend, behind whatever proxy that backend uses. It does no rate limiting, TLS, CORS or gating; the caller decides who gets a capability. The pool deposit is the bound on what it can lose.
- The keeper (top up below a low-water mark) becomes an optional flag. With an open
topUp(PaymentPool: owner-set capability issuers, ECDSA-only capability signatures, open topUp #2993) it funds from its own wallet, not the owner's. - With issuers (PaymentPool: owner-set capability issuers, ECDSA-only capability signatures, open topUp #2993) the signing key can be a pool issuer, not the owner.
- The OpenAPI document stays in this repo and is snapshot-tested. It is the contract for every caller, in any language.
Removed: the sponsord, sponsord-core and sponsord-api crates, the sponsord binary and image, SPONSORD_* env config (replaced by decdn sponsor flags / config), the typed DaemonClient. decdn sponsor ships in the existing decdn release archives and image.
2. The onramp moves to its own repo, as a reference app
sponsord-onramp, the installers, the~/.decdn/sponsored/layout andsponsord-e2emove to a separate repo. It is not published to crates.io and is not a library: theGateandCapabilitySourcetraits go, and the gate is code you edit in your fork.- It defines its own copies of the three request/response bodies from the OpenAPI document; it shares no crate with decdn.
- Its e2e runs the onramp and its installer against a released
decdnbinary (decdn sponsor) on anvil.
Scope in this repo
- Crates: delete
sponsord,sponsord-core,sponsord-api,sponsord-onramp,sponsord-e2e; add the issuing library anddecdn sponsor. .github/scripts/check_crate_edges.pyand the CLAUDE.md dependency-flow paragraph and crate list.- CI:
anvil-e2e-sponsord, the onramp test matrix, the OpenAPI path filter, and thedocker-buildvolume check for the two sponsord images. - Release: drop the
sponsordandsponsord-onrampbinaries, archives and images fromrelease.yml. deploy/sponsord/anddocs/sponsord/: replace with onedecdn sponsorpage (run it next to your backend, never expose it, the deposit is what you can lose). The installer, onramp and integrator docs move with the onramp.- CLAUDE.md: drop the sponsord-specific rules (installer arguments,
~/.decdn/sponsored/, the onramp's rustls provider note) that leave with the onramp.
Issues that move with the onramp
- feat(onramp): allow-all gate for internal use #2548 (allow-all gate), feat(onramp): signed-JWT gate #2549 (signed-JWT gate), feat(onramp): webhook gate #2550 (webhook gate).
- onramp/gateway: web-facing pages lack framing and cross-site spend protections #2772 (framing and cross-site protections): the onramp half moves; the gateway half stays here.
Open questions
- Keep the maximum cap and TTL as a config guard against a caller's units mistake, or drop them and let the pool deposit be the only bound. They do not bound a compromised caller, which can request any number of maximum-size capabilities.
- Where the issuing library lives:
decdn-incentive(next toCapabilityGrant) ordecdn-client. - sponsord: publisher dashboard with card-to-USDC pool funding, per-namespace spend and per-user allowances #2594: moves with the onramp or closes.
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Priority
None yet
Projects
- StatusShow more project fieldsBacklog
Activity