Skip to content

client: decdn get ends with a signed receipt (hash, bytes, nodes, USDC paid, settlement once it lands) #2599

Description

@thiras

Component

client (decdn-client SDK)

Who it affects

client (someone running decdn get or the gateway), publisher (someone importing content or sponsoring downloads)

Problem

"Every byte verified" is a claim the site makes and nothing shows. decdn get ends with a destination path and, under --json, a PullReport (fetched, paid_bytes, spliced_bytes, …) that exists for debugging. Nothing a user can keep, show a publisher, or paste in a bug report says: this hash, these bytes, these nodes, this much USDC, at this time, signed.

Proposed solution

decdn get ends with a receipt, and --receipt <path> writes it:

decdn receipt v1
hash        9194000d…69e5  (bundle, 29.0 GB, 14 entries)
namespace   1
bytes       28,995,469,846 verified · 28,995,469,846 paid
nodes       4   0x2a…f1 (DE) 11.2 GB · 0x9c…03 (US) 9.8 GB · …
paid        0.29 USDC from pool 0x7d…e2 (sponsored by example.org)
started     2026-10-24T14:02:11Z   finished 2026-10-24T14:09:48Z
signed      0x5e…a7 (the buyer key)   0xsig…

What it contains and what each part proves:

  • The client's own statement, signed by the lane signer that paid: hash, namespace, bytes verified, bytes paid, time window, pool id. This is the client attesting what it did; it is not evidence against anyone.
  • Per node: the node's signed StreamResponse body ({hash, ok, rate_per_mb, total_bytes, pool_id, …}, which it already signs and the client already verifies) and the cumulative voucher the client sent last. Both exist today in the pull; the receipt keeps them instead of dropping them.
  • Settlement, later. A voucher is redeemed by the node in its own sweep, so the settlement tx is not known when the pull ends. decdn receipt settle <file> (or the gateway's receipt page) fills it in afterwards from PoolRedeemed for that pool and lane signer, and a receipt viewer shows "settled" once it is.

A publisher embeds a receipt (or its hash) as a badge in a release note: "N downloads verified via deCDN". The gateway (#2593) returns the same receipt for a completed download as /_receipt/<id> and renders it as the page people screenshot.

Format: a JSON document under crates/client with a stable schema (it will outlive wire formats), a decdn receipt verify <file> that re-checks every signature offline against the deployment's chain id, and a short appendix in adr/ that names what a receipt proves and what it does not. Nothing in it is slashing evidence; ADR 014's probe-slash and bytes-regression paths stay what they are.

Alternatives considered

  • Print the PullReport prettier. Unsigned and client-only; no publisher can show it to anyone.
  • On-chain receipt per download. A tx per pull is the thing the off-chain voucher design exists to avoid.

Design scope

  • This proposal changes the protocol, the economics, or the contract surface.

A receipt is assembled from messages that already exist and are already signed. The receipt schema is a client artifact.

Related

Activity

  1. added
    kind:feature
    area:cli
    area:client
    on Oct 24, 2026
  2. added theissue type on Oct 24, 2026
  3. assigned and unassigned on Oct 25, 2026
  4. moved this from Backlog to In progress in deCDNon Oct 26, 2026
  5. moved this from In progress to Done in deCDNon Oct 26, 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:clientkind:feature

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions