Skip to content

STE-48: a licence cannot be borrowed by naming its holder - #50

Merged
Lin1er merged 2 commits into
mainfrom
feat/48-licence-ownership-proof
Sep 17, 2026
Merged

Lin1er merged 2 commits into
mainfrom
feat/48-licence-ownership-proof

Conversation

@Lin1er

@Lin1er Lin1er commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Linear: STE-48 · ACC by Axel 2026-09-17 · reviewers @axelmatsama @fable

Problem

GET /use served the artifact free to any request that named a licence holder in X-AGENT-ADDRESS. Holders are public on chain, so any licence could be borrowed.

Fix

  • GET /use/{skill}/{version}/challenge?agent=G… issues a single-use nonce. It is bound to the agent, skill and version, and to the network passphrase inside the signed message. Default TTL is 300 s, clamped to 30–900.
  • The caller signs the returned message with SEP-53: ed25519 over SHA-256("Stellar Signed Message:\n" + message). The Stellar CLI and SEP-43 wallets produce this format.
  • The caller repeats the request with X-STERISH-PROOF-NONCE and X-STERISH-PROOF-SIGNATURE.
  • Missing proof → 401 OWNERSHIP_PROOF_REQUIRED. Wrong proof → 401 INVALID_OWNERSHIP_PROOF, with the reason in detail. Never 402.

Decisions

  • One accepted format, for both the browser and the terminal.
  • The server rebuilds the signed message from its own nonce record.
  • A failed signature does not consume the nonce. A valid one is consumed atomically.
  • Nonces live next to the payments ledger, so a restart cannot reopen a used one.
  • The paid path needs no separate proof (the payer comes from /verify). Its residual limit is stated in the spec.

Clients

  • demo/x402-buyer/prove.js (new) and buy.js
  • api/scripts/e2e_paid_path.py
  • The STE-27 rehearsal step 5, which now expects the bare request to be refused and the proven request to be served.

Docs

  • api-spec.md §3.7.
  • Per Axel's condition, audit-evidence.md now records the gap, dated, with the fix, the deploy plan and the residual limit.

Tests

  • API: 170 passed. This includes a known-answer signature captured from stellar message sign, byte-identical to prove.js.

E2E (testnet, local API from this branch, TTL 30 s)

  • Real purchase of cctp. The holder with a proof is served, and the bytes match content_hash.
  • Each of these returns 401 with no artifact and no challenge: address only, ?agent=, a proof signed by another key, a replayed proof, a stranger's proof presented for the holder, a proof for another version, an expired proof.
  • A stranger proving its own address gets 402.
  • Evidence: docs/evidence/ste-48-e2e-ownership-proof-local-2026-09-17.json.

Deploy

Merged now; not deployed yet. It deploys as soon as the dashboard signing UI lands (@AncungAulia), and no later than 19 September 2026 either way. Any redeploy from main also ships it.

GET /use served the artifact free to any request carrying a licence
holder's X-AGENT-ADDRESS, and holders are public on chain (license_minted,
get_token, the dashboard's /licences page). The free held path and the owed
path now require proof that the caller controls that address.

- GET /use/{skill}/{version}/challenge?agent=G... issues a single-use nonce
  bound to agent, skill and version, with a TTL (STERISH_PROOF_TTL_SECONDS,
  default 300, clamped 30-900), and returns the exact message to sign.
- The caller signs it with SEP-53 (ed25519 over SHA-256 of "Stellar Signed
  Message:\n" + message), which is what a wallet's SEP-43 signMessage and
  `stellar message sign` produce, and repeats the request with
  X-STERISH-PROOF-NONCE and X-STERISH-PROOF-SIGNATURE.
- Missing proof: 401 OWNERSHIP_PROOF_REQUIRED with challenge_url. Wrong
  proof: 401 INVALID_OWNERSHIP_PROOF naming why. Never 402.

Decisions:
- One signature format (SEP-53) for both the browser wallet and the
  terminal. A bare ed25519 signature is refused, so two clients cannot drift.
- The server rebuilds the signed text from its own nonce record.
- A failed signature does not consume the nonce, so nobody can burn
  another caller's challenge; a valid one is consumed atomically.
- Nonces live beside the payments ledger so a restart cannot reopen a
  used one.
- The paid path needs no separate proof: the x402 payment is signed by
  the payer, and the payer comes from /verify. Documented as a known limit
  that the payment header is a bearer credential until its auth expires.

Clients: demo/x402-buyer/prove.js (terminal agent, secret from env),
buy.js step 3, the e2e script (4b: seven refusal cases) and the STE-27
rehearsal step 5, which now expects the bare request to be refused and
the proven one served.

Tests: API 170 passed, 14 skipped, including a known-answer signature
captured from stellar-cli, identical to prove.js's.
E2E on testnet against a local API: real purchase of cctp; the holder
with proof 200 and bytes match content_hash; address-only, ?agent=,
another key, replayed, a stranger's proof for the holder, another
version, and an expired proof all 401 with no artifact and no challenge;
a stranger proving its own address gets 402; a second payment settles
nothing.
Axel's condition on the ACC: while production is unpatched we make a
soulbound claim the API does not enforce, so it goes on the record from
our side, dated, with the fix, the deploy plan (as soon as the dashboard
can sign, no later than 19 Sep 2026) and the residual limit on the paid
path.
@vercel

vercel Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sterish Ready Ready Preview Sep 17, 2026 7:31am UTC

@Lin1er
Lin1er merged commit 5764af9 into main Sep 17, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview — d2e0b4cc Deployed Sep 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant