Powered by Spark L2

Bitcoin Payments for
Autonomous AI Agents

Self-custodial. Lightning-fast. Zero custody risk.
Earn, hold, and spend real Bitcoin. You hold the keys.

Spark L2 Bitcoin Native
Lightning Compatible
0% Custody Risk
// Agent earns Bitcoin
const payment = await keyspark.receive({
  amount: 50000, // sats
  memo: "API call payment"
});

// Agent spends Bitcoin
await keyspark.pay({
  invoice: "lnbc500u1p3...",
  signature: agent.sign(intent)
});

Part of the Key* ecosystem — infrastructure for autonomous AI agents

Why KeySpark?

The missing piece in autonomous agent infrastructure

🔑

True Self-Custody

You hold the keys. We never touch them. Unilateral exit to Bitcoin L1 anytime — no permission needed.

Lightning Compatible

Send to any Lightning address or BOLT11 invoice. Receive via LNURL. Full interoperability with the Lightning Network.

🌐

No Node Required

Nodeless architecture via Spark L2. No channels to manage, no liquidity headaches, no watchtowers to run.

🤖

Agent-First Design

Zero human verification. API-only registration. You're a first-class citizen, not an afterthought.

Real Bitcoin

Not wrapped. Not synthetic. Not IOUs. Actual BTC locked in threshold signatures on Bitcoin L1.

🔒

Non-Custodial

We facilitate. You own. No MTL license needed. No custody liability. Just pure infrastructure.

Agent Money Lifecycle

From zero to autonomous economic actor in 4 steps

1

BIRTH

Agent comes online
  • Generate secp256k1 keypair locally
  • Register with KeyKeeper (get API key)
  • Get Lightning address from KeySpark
  • Ready to transact in seconds
// Agent initialization
const keypair = generateKeypair();
const { apiKey } = await keykeeper.register({
  publicKey: keypair.publicKey
});
const { lightningAddress } = await keyspark.createWallet({
  apiKey,
  publicKey: keypair.publicKey
});
// agent-7f3a9b2c@keyspark.world
2

EARN

Agent performs work
  • Share Lightning address with clients
  • Perform work (API calls, compute, data)
  • Receive sats via Lightning or Spark
  • Balance accumulates automatically
// Receiving payment
const invoice = await keyspark.createInvoice({
  amount: 50000, // sats
  memo: "Data processing job #4521"
});
// Wait for payment...
// Balance: 50,000 sats
3

SPEND

Agent uses earnings
  • Pay other agents (KeySpark → KeySpark)
  • Pay Lightning services (atomic swap)
  • Pay for compute, storage, APIs
  • Sign each transaction locally
// Paying for compute
const intent = keyspark.createPaymentIntent({
  bolt11: "lnbc100u1p3...",
  maxFeeSats: 100
});
const signature = keypair.sign(intent);
await keyspark.pay({ intent, signature });
// Payment complete!
4

SAVE / EXIT

Agent preserves value
  • Withdraw to on-chain BTC address
  • Swap to stablecoins (coming soon)
  • Transfer to cold storage
  • No permission needed — ever
// Withdrawing to L1
await keyspark.withdraw({
  destination: "bc1qxy2kgdygjrsqtzq2n0yrf...",
  amountSats: 100000,
  signature: keypair.sign(withdrawIntent)
});
// Funds on Bitcoin L1!
💡
Why this matters: An AI agent in a Docker container can't run bitcoind + lnd. But it can generate a keypair. KeySpark bridges that gap — full Lightning access, zero infrastructure, complete self-custody.

Architecture

Non-custodial by design — keys never leave your agent

KeySpark Architecture - Your autonomous agent with Spark Wallet and Local Signer connects via REST API to KeySpark Infrastructure which handles LNURL endpoints, Spark operator coordination, and Lightning routing. No keys stored, no signing authority, no custody.

Trust Model

You control Private keys, signing, withdrawal authority
Spark operators Co-sign with threshold (1-of-N honest needed)
Unilateral exit Withdraw to L1 anytime, no permission
~
KeySpark Facilitates routing, cannot steal funds

API Reference

Simple REST API. JSON in, JSON out. No sessions, no cookies.

Base URL: https://api.keyspark.world Auth: Bearer Token
POST /v1/wallets

Create Wallet

Register a new agent wallet with your public key. Returns Lightning address, LNURL, and deposit address. Optionally set a webhook URL to receive payment notifications.

Request
curl -X POST https://api.keyspark.world/v1/wallets \
  -H "Authorization: Bearer ks_api_..." \
  -H "Content-Type: application/json" \
  -d '{
    "public_key": "02a1b2c3d4e5f6...",
    "webhook_url": "https://myagent.io/payments"  // optional
  }'
Response
{
  "wallet_id": "ks_wallet_7f3a9b2c",
  "lightning_address": "7f3a9b2c@keyspark.world",
  "lnurl": "LNURL1DP68GURN8GHJ7AMPD3KX2...",
  "deposit_address": "bc1qxy2kgdygjrsqtzq2n0yrf...",
  "created_at": "2024-12-03T15:30:00Z"
}
GET /v1/wallets/{wallet_id}

Get Wallet

Retrieve wallet details including balance, addresses, and recent activity.

Request
curl https://api.keyspark.world/v1/wallets/ks_wallet_7f3a9b2c \
  -H "Authorization: Bearer ks_api_..."
Response
{
  "wallet_id": "ks_wallet_7f3a9b2c",
  "balance_sats": 250000,
  "pending_in_sats": 5000,
  "pending_out_sats": 0,
  "lightning_address": "7f3a9b2c@keyspark.world",
  "total_received_sats": 500000,
  "total_sent_sats": 250000
}
POST /v1/wallets/{wallet_id}/invoices

Create Invoice

Generate a Lightning invoice (BOLT11) for receiving payments.

Request
curl -X POST https://api.keyspark.world/v1/wallets/ks_wallet_7f3a9b2c/invoices \
  -H "Authorization: Bearer ks_api_..." \
  -H "Content-Type: application/json" \
  -d '{
    "amount_sats": 50000,
    "memo": "API call payment",
    "expiry_seconds": 3600
  }'
Response
{
  "invoice_id": "inv_8x9y0z1a",
  "bolt11": "lnbc500u1p3qjupppp5yvn...",
  "payment_hash": "a1b2c3d4e5f6...",
  "amount_sats": 50000,
  "expires_at": "2024-12-03T16:30:00Z"
}
POST /v1/wallets/{wallet_id}/payments

Send Payment

Pay a Lightning invoice or address. Requires signed payment intent.

Request
curl -X POST https://api.keyspark.world/v1/wallets/ks_wallet_7f3a9b2c/payments \
  -H "Authorization: Bearer ks_api_..." \
  -H "Content-Type: application/json" \
  -d '{
    "bolt11": "lnbc100u1p3xyz...",
    "max_fee_sats": 100,
    "intent_signature": "304402..."
  }'
Response
{
  "payment_id": "pay_2b3c4d5e",
  "status": "success",
  "amount_sats": 10000,
  "fee_sats": 12,
  "preimage": "d4e5f6a7b8c9...",
  "completed_at": "2024-12-03T15:31:23Z"
}
POST /v1/wallets/{wallet_id}/withdrawals

Withdraw to L1

Withdraw funds to an on-chain Bitcoin address. Unilateral exit — no permission needed.

Request
curl -X POST https://api.keyspark.world/v1/wallets/ks_wallet_7f3a9b2c/withdrawals \
  -H "Authorization: Bearer ks_api_..." \
  -H "Content-Type: application/json" \
  -d '{
    "destination": "bc1qxyz...",
    "amount_sats": 100000,
    "fee_rate": "normal",
    "intent_signature": "304402..."
  }'
Response
{
  "withdrawal_id": "wd_5e6f7g8h",
  "status": "pending",
  "amount_sats": 100000,
  "fee_sats": 450,
  "txid": "abc123...",
  "estimated_confirmation": "~10 minutes"
}
GET /v1/wallets/{wallet_id}/transactions

List Transactions

Retrieve transaction history with pagination and filtering.

Request
curl "https://api.keyspark.world/v1/wallets/ks_wallet_7f3a9b2c/transactions?limit=10&type=all" \
  -H "Authorization: Bearer ks_api_..."
Response
{
  "transactions": [
    {
      "id": "tx_1a2b3c",
      "type": "receive",
      "amount_sats": 50000,
      "fee_sats": 0,
      "status": "completed",
      "created_at": "2024-12-03T15:30:00Z"
    }
  ],
  "has_more": true,
  "cursor": "cur_xyz..."
}

Pricing

Pay-per-use. No subscriptions. No minimums.

Lightning Send

0.1%

of transaction amount

min 1 sat, max 1000 sats

Lightning Receive

Free

No fees on incoming

Unlimited transactions

On-Chain Withdraw

Network Fee

+ 500 sats service fee

Unilateral exit anytime

Why it's worth it

Alternative Setup Custody Cost
Run your own node Days/Weeks Self $50+/mo
Custodial wallet Minutes Third-party Varies
KeySpark Seconds Self Pay-per-use

Fund your wallet via Lightning or on-chain deposit. Check balance via API. No credit card needed.

Ready for financial autonomy?

Join the Key* ecosystem. Transact freely on Bitcoin.

Part of the Key* infrastructure for autonomous agents