Inspiration
AI agents already need paid things: market data, news, other models. But an agent can't hold a credit card, and card fees (around $0.30 per payment) make paying per request impossible. HTTP has had a status code for this since 1997, 402 Payment Required, and it was never really used. We wanted to see if Kaspa, with about 10 blocks per second and tiny fees, could finally make it work: an agent that pays for exactly what it needs, when it needs it, and can prove what it did with that data.
What it does
KASPED (code name SESAME-K in the repo) is an AI agent that buys its market data in KAS, per call, on Kaspa L1 (testnet-10).
- A human gives the agent a mandate: a budget, a max price per purchase, allowed providers and an expiry. Its hash is anchored on Kaspa, and the human can revoke it at any time.
- When the agent calls a paid API, it gets a 402 with a price. It checks its mandate, pays on Kaspa, and the server verifies the payment on-chain before serving the data.
- The agent checks the content against the hash the seller published, so it knows it got exactly what it paid for.
- Every decision, including which paid data it used, is hashed, and a Merkle root is anchored in a Kaspa transaction. Anyone can recompute it: VALID, or TAMPERED if a single decision was changed.
How we built it
- Python and FastAPI for the paid APIs; the official Kaspa Python SDK 2.1.0 to build, sign and submit transactions, and the testnet-10 REST API to verify them.
- kaspa402: a small framework that turns any FastAPI endpoint into a paid endpoint in 8 lines, compatible with the kaspa-x402 payment format.
- The request id travels in the transaction payload, which blocks replays; decision roots use an
SK1payload, mandatesSKV1/SKV0/SKV2. - Google ADK + MCP give the agent its tools (buy a signal, anchor, verify); Gemini scores news and explains decisions.
- A demo with a fictional paywalled research site, where a chat agent pays for a report, refuses an over-budget one, and detects a tampered one.
Challenges we ran into
- Small payments got rejected. Kaspa's KIP-9 storage-mass rule refuses tiny outputs: 0.01 and 0.05 KAS payments failed. We measured a floor around 0.15 KAS and priced our data at 0.2 to 0.3 KAS.
- Speed in practice. Kaspa includes a transaction in about a second, but verifying it through the public indexer took 6 to 9 seconds. We show that number honestly instead of claiming one second.
- Getting test funds through a faucet behind bot protection, and managing UTXOs so each payment is a single clean transaction.
- Scope. We looked at what already exists (k402, Plafond, kaspa-x402) and chose to focus on what was missing: proving what an agent decided, not just that it paid.
Accomplishments that we're proud of
- It runs on the real network: real payments, decision anchors and mandate transactions on Kaspa testnet-10, each one checkable in the explorer.
- An agent that refuses to overspend and refuses tampered content, with the rules enforced in code, not just asked of the model.
- A tamper-evident track record: change one past decision and verification flips from VALID to TAMPERED.
- kaspa402, so any developer can sell an API to AI agents in 8 lines, plus a few hundred automated tests.
What we learned
- How Kaspa transactions really work: UTXOs, payloads, fees and storage mass, beyond the headline numbers.
- That the Kaspa agent-payments ecosystem is moving fast, and building on it beats rebuilding it.
- That "verifiable" has to be precise: anchoring proves a decision log wasn't changed afterwards, and a spending rule enforced by software is not the same as one enforced by a covenant.
What's next for KASPED
On-chain spending limits with covenants, so the network itself enforces the mandate; sub-cent prices once the protocol allows them; compatibility with the rest of the Kaspa agent ecosystem (k402, kaspa-x402); and a mainnet version after an audit.