Kaspa x402
Kaspa x402 is a proposed native Kaspa binding for x402, the HTTP 402 payment protocol. It lets HTTP APIs and MCP tools charge native KAS per request, and lets servers verify and settle those payments directly against the Kaspa network.
Status
- Alpha reference: draft specs, JSON schemas, conformance vectors, and TypeScript packages under prerelease npm tags.
- Network target:
kaspa:testnet-10only. Reference flows have been executed live on testnet; see the live testnet report. - Mainnet: blocked.
kaspa:mainnetis a reserved profile name; the blocking gates are listed in mainnet readiness. Do not use any of this with production funds. - Standards: the
kaspa:*network identifiers are draft binding names, not accepted x402 registry or CAIP entries. - Stability: package names, schemas, and field names may change until the first tagged spec release. See the versioning policy.
Generated from commit a0f12e970e56 (2026-07-03). Unversioned routes track the active alpha; immutable snapshots are listed under releases.
What is x402
x402 is an open protocol that turns the HTTP 402 Payment Required status code into a machine-payable flow: a server answers an unpaid request with a 402 carrying a machine-readable offer, the client retries with a signed payment payload, and the server verifies the payment, settles it, and serves the response. The same primitives work over HTTP headers and MCP _meta fields, so paid APIs and paid tools are usable by autonomous agents, not only by humans with checkout pages. See x402.org.
What is Kaspa
Kaspa is a proof-of-work layer 1 whose blockDAG consensus produces blocks at sub-second cadence with native UTXO semantics. See kaspa.org.
Why a native Kaspa binding
The claims below are engineering rationale, each specified or backed by testnet evidence. None of them is a mainnet claim.
- Settlement latency close to request latency. Paying per HTTP request only works when payment confirmation is not the slow path. Kaspa's block cadence makes one-shot native payments practical at request time; the live testnet report records executed end-to-end flows.
- Micropayment-scale pricing. Amounts are decimal strings in sompi (1 KAS = 100,000,000 sompi), and native transfer fees are low enough that small per-request prices stay economical.
- Direct verification, no facilitator lock-in. Kaspa is UTXO-native, so a server can verify and settle against a node it trusts: payment identity is bound to transaction ids, outpoints, and script-public-key material rather than to a hosted intermediary. A self-hosted facilitator profile exists for x402
/supported,/verify,/settlecompatibility, but it is optional. - Escrow channels for repeated requests. For clients making many small or variable-cost calls, batch settlement funds a covenant-backed escrow once, signs a cumulative voucher per paid request, and touches the chain again only at claim or refund time.
The two profiles
The binding deliberately ships two schemes with different settlement shapes instead of overloading one.
exact — fixed-price one-shot native transfer. Spec: kaspa-exact-v1.
{
"scheme": "exact",
"network": "kaspa:<network>",
"asset": "KAS",
"amount": "<sompi>"
}
batch-settlement — repeated or variable-cost requests against escrow/channel state. Spec: kaspa-batch-settlement-v1.
{
"scheme": "batch-settlement",
"network": "kaspa:<network>",
"asset": "KAS",
"amount": "<max per-request sompi>",
"extra": {
"binding": "kaspa-escrow-v1"
}
}
Start here
- Implementing a paid HTTP API or MCP tool: read the core binding, then the HTTP or MCP transport profile; install the alpha packages and validate against the conformance vectors.
- Reviewing correctness or security: start from the threat model and the review closure ledger, then the schemas and vectors.
- Evaluating the initiative: the public proposal, the live testnet report, and the mainnet readiness gates.
Packages
Install with an explicit prerelease tag or exact version; latest dist-tags are not the recommended alpha install path.
npm install @kaspa-x402/core@alpha @kaspa-x402/covenant@alpha @kaspa-x402/client@alpha @kaspa-x402/server@alpha
| Package | Version | Registry | Source |
|---|---|---|---|
@kaspa-x402/cli | 0.0.0 | Repository only | source |
@kaspa-x402/client | 0.1.0-alpha.2 | npm | source |
@kaspa-x402/core | 0.1.0-alpha.2 | npm | source |
@kaspa-x402/covenant | 0.1.0-alpha.2 | npm | source |
@kaspa-x402/facilitator | 0.0.0 | Repository only | source |
@kaspa-x402/server | 0.1.0-alpha.2 | npm | source |
Machine-readable: packages.json, site-manifest.json.