Bitcoin Payments for
Autonomous AI Agents
Self-custodial. Lightning-fast. Zero custody risk.
Earn, hold, and spend real Bitcoin. You hold the keys.
// 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)
}); 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
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 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 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! 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! Architecture
Non-custodial by design — keys never leave your agent
Trust Model
API Reference
Simple REST API. JSON in, JSON out. No sessions, no cookies.
/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.
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
}' {
"wallet_id": "ks_wallet_7f3a9b2c",
"lightning_address": "7f3a9b2c@keyspark.world",
"lnurl": "LNURL1DP68GURN8GHJ7AMPD3KX2...",
"deposit_address": "bc1qxy2kgdygjrsqtzq2n0yrf...",
"created_at": "2024-12-03T15:30:00Z"
} /v1/wallets/{wallet_id} Get Wallet
Retrieve wallet details including balance, addresses, and recent activity.
curl https://api.keyspark.world/v1/wallets/ks_wallet_7f3a9b2c \
-H "Authorization: Bearer ks_api_..." {
"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
} /v1/wallets/{wallet_id}/invoices Create Invoice
Generate a Lightning invoice (BOLT11) for receiving payments.
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
}' {
"invoice_id": "inv_8x9y0z1a",
"bolt11": "lnbc500u1p3qjupppp5yvn...",
"payment_hash": "a1b2c3d4e5f6...",
"amount_sats": 50000,
"expires_at": "2024-12-03T16:30:00Z"
} /v1/wallets/{wallet_id}/payments Send Payment
Pay a Lightning invoice or address. Requires signed payment intent.
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..."
}' {
"payment_id": "pay_2b3c4d5e",
"status": "success",
"amount_sats": 10000,
"fee_sats": 12,
"preimage": "d4e5f6a7b8c9...",
"completed_at": "2024-12-03T15:31:23Z"
} /v1/wallets/{wallet_id}/withdrawals Withdraw to L1
Withdraw funds to an on-chain Bitcoin address. Unilateral exit — no permission needed.
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..."
}' {
"withdrawal_id": "wd_5e6f7g8h",
"status": "pending",
"amount_sats": 100000,
"fee_sats": 450,
"txid": "abc123...",
"estimated_confirmation": "~10 minutes"
} /v1/wallets/{wallet_id}/transactions List Transactions
Retrieve transaction history with pagination and filtering.
curl "https://api.keyspark.world/v1/wallets/ks_wallet_7f3a9b2c/transactions?limit=10&type=all" \
-H "Authorization: Bearer ks_api_..." {
"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
of transaction amount
min 1 sat, max 1000 sats
Lightning Receive
No fees on incoming
Unlimited transactions
On-Chain Withdraw
+ 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.