Skip to content

sponsord: fold the signer into decdn sponsor, move the onramp to its own repo #3026

Backlog

Description

@alpergundogdu

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 a dcap1: capability for a key, within a maximum cap and TTL. decdn pool assign already 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, the decdn.sh / decdn.ps1 installers and the ~/.decdn/sponsored/ layout. The installer pins a released decdn by 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 and 409 signer_expired) moves into a library crate the CLI already depends on (decdn-incentive or decdn-client). decdn pool assign and decdn sponsor share it.
  • decdn sponsor serves the same HTTP API as sponsord today: POST /v1/capabilities, GET /v1/info, /healthz, /metrics, bearer token on /v1. It runs on the gateway's hyper-based local_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 and sponsord-e2e move to a separate repo. It is not published to crates.io and is not a library: the Gate and CapabilitySource traits 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 decdn binary (decdn sponsor) on anvil.

Scope in this repo

  • Crates: delete sponsord, sponsord-core, sponsord-api, sponsord-onramp, sponsord-e2e; add the issuing library and decdn sponsor.
  • .github/scripts/check_crate_edges.py and the CLAUDE.md dependency-flow paragraph and crate list.
  • CI: anvil-e2e-sponsord, the onramp test matrix, the OpenAPI path filter, and the docker-build volume check for the two sponsord images.
  • Release: drop the sponsord and sponsord-onramp binaries, archives and images from release.yml.
  • deploy/sponsord/ and docs/sponsord/: replace with one decdn sponsor page (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

Open questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    • Status
      Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions