Kaspa x402

Testnet Gateway

Status: paid-canary-proven alpha.8 deployment on kaspa:testnet-10.

The hosted gateway is a public integration target for implementers exercising the Kaspa x402 wire flow against a real server. It is not a wallet, custodian, mainnet service, or availability commitment.

The current Worker uses kaspa-exact-v2 with the default standard-native profile and also supports batch-settlement. The optional additive exact profile is implemented but is advertised only when a current KIP-10 head is available.

Historical gateway evidence remains available in the immutable release snapshots. This page describes only the active alpha.

Base URL

https://demo.kaspa-x402.org

Endpoints

MethodPathPurpose
GET/JSON endpoint index.
GET/healthConfiguration health and current TN10 chain evidence.
GET/canaryEnabled state and latest scheduled canary report.
GET/supportedSupported x402 schemes and profiles.
GET/exact, /exact/reportProtected exact-payment resources.
GET/batch, /batch/reportProtected batch-settlement resources.
GET/metricsCoarse operational counters.

HEAD follows the same payment behavior as GET without a response body. OPTIONS returns the CORS preflight response.

Additive-head administration is operator-only:

MethodPathPurpose
GET/admin/exact-headsReturn head statistics and records.
POST/admin/exact-heads/registerRegister funded KIP-10 head terms.
POST/admin/exact-heads/reconcileProve accepted successor lineage and restore the current head.

These routes require a bearer token stored as a Worker secret.

Current Payment Terms

The gateway uses:

Kaspa has no universal 10000000 sompi consensus dust floor. KIP-9 storage mass depends on the complete transaction shape. The reference Worker uses 10000000 sompi as a conservative application policy for on-chain outputs.

Batch offers carry extra.binding: "kaspa-escrow-v1". Exact offers carry extra.binding: "kaspa-exact-v2" and an explicit profile:

An unpaid additive offer reads the current head but does not reserve, retire, or consume it. A successful settlement atomically claims the advertised outpoint and advances the durable lineage. Stale competing clients receive a fresh 402 for the current head.

Additive Head Operations

Register head records with:

KASPA_X402_DEMO_ADMIN_TOKEN=<token> \
  npm run demo:exact-heads -- register --file heads.json

Check availability with:

KASPA_X402_DEMO_ADMIN_TOKEN=<token> npm run demo:exact-heads -- stats

If a known external transaction advanced a head, reconcile it with the complete ordered accepted lineage:

KASPA_X402_DEMO_ADMIN_TOKEN=<token> \
  npm run demo:exact-heads -- reconcile \
  --head-id <head-id> \
  --transactions <first-txid>,<next-txid>

Each transaction must spend the preceding outpoint, preserve the same script and output index, satisfy the KIP-10 threshold, and end at the current unspent head. A same-address output without that lineage is never adopted.

Verification And Chain Evidence

The Worker uses https://api-tn10.kaspa.org for read-side evidence:

Exact transaction artifacts are submitted through configured public TN10 PNN/WSS endpoints. The REST submit fallback must not be cited as KIP-10 broadcast evidence because it does not preserve the v1 compute-budget field.

The gateway fails closed when it cannot establish chain health, transaction validity, accepted finality, or required durable state. Protected content is not produced for unsupported schemes or unverifiable payments.

Durable State

Gateway state is held in a SQLite-backed Cloudflare Durable Object. It records:

No private keys or wallet seeds are stored. This is a demo deployment pattern, not a production sharding or custody recommendation.

Browser And CORS Use

The public deployment allows browser calls from https://kaspa-x402.org and exposes PAYMENT-REQUIRED and PAYMENT-RESPONSE. Paid retries may send PAYMENT-SIGNATURE.

PAYMENT-SIGNATURE is bearer settlement evidence for this trust domain. Send it only over TLS to the intended gateway and do not publish or log unused payment headers or transaction material.

Current Alpha.8 Evidence

The 2026-07-15 deployment completed a funded standard-native exact run:

The first cutover attempt found two adapter compatibility gaps before payment acceptance: missing contextual KIP-9 storage mass and rejection of the Rusty Kaspa SDK's explicit zero v0 compute budget. Commit 37a4704 fixed both and added regression coverage. The transaction above is from the corrected deployment.

Testnet Funding

Testers need their own kaspa:testnet-10 wallet or SDK flow. The public faucet is:

https://faucet-tn10.kaspanet.io/

Deployment, rollback, disable, canary, and incident procedures are in the demo operations runbook. Full transaction evidence is in the live testnet report.

Source: /docs/testnet-gateway.md