Pay-on-delivery for L402. The agent's payment is held, not taken. If the paid call succeeds, it settles. If it fails, the sats go back to the agent automatically. No custodian, no refund requests.
Built on L402 and Lightning hold invoices. The agent uses a normal L402 client. The seller's server settles or refunds based on one thing: whether the API delivered.
The API answers with HTTP 402 and a Lightning invoice. The agent pays it like any other L402 call. No accounts, no API keys.
The seller's Lightning node holds the payment while the API does the work. Nothing has settled yet, and nobody else holds the funds.
If the call succeeds, the payment settles and the agent gets its result plus a receipt it can verify. If the call fails or runs out of time, the payment is canceled and the sats return to the agent within seconds.
One paid call succeeds and is charged. One fails, and the agent's sats come back automatically. Real Lightning payments, recorded November 3, 2026.
27 seconds. Agent paying a 10-sat L402 API from a standard Lightning wallet.
A live pay-on-delivery API running on my own Lightning node. Each call costs 10 sats. Use any Lightning wallet and a terminal.
The API works. Your payment settles and you get the result plus a receipt you can check.
The API fails on purpose. Your payment is canceled and the sats go back to your wallet. You are not charged.
The server answers with HTTP 402, a 10‑sat Lightning invoice (payment_request) and a token (macaroon).
curl -s https://pod.btcaioracle.com/demo/okUse /demo/fail instead to see a refund.
Pay the payment_request from any Lightning wallet within 2 minutes. On /demo/ok the payment completes and your wallet shows a preimage. On /demo/fail your wallet briefly holds the sats, then reports the payment as failed (often incorrect_or_unknown_payment_details). That is the refund: nothing is charged.
After a successful payment, retry with the token and the preimage:
curl -s -H "Authorization: L402 MACAROON:PREIMAGE" https://pod.btcaioracle.com/demo/okTo check any call, including a refund, use the token alone:
curl -s -H "Authorization: L402 MACAROON" https://pod.btcaioracle.com/statusReplace MACAROON and PREIMAGE with your own values. Limited to a few open invoices per visitor.
Live tests on Bitcoin mainnet from my own Lightning node, October 2026. Every payment was real.
The Route.A weekly newsletter covering Bitcoin, Lightning, and the emerging agent economy. Honest perspective from someone building in the middle of it. No hype. No noise. Read The Route → |
|
I found Bitcoin the way most people do, curiosity first, then conviction. The deeper I went, the more I saw something that matched what I already believed. Honest money. A ledger nobody can quietly edit. A system that does not require you to trust the person running it. That is not just a financial idea. It is a moral one.
When AI agents started paying for APIs over Lightning, I saw a gap. An agent can pay in seconds, but if the service fails after taking payment, the money is simply gone. People have refunds and chargebacks. Agents have nothing.
Pay-on-delivery closes that gap with what Lightning already does well. The payment is held until the work is done, and it only settles if the agent got what it paid for. No custodian and no trust required, just the network doing what it was built to do.
Building in public on X. Following the Lightning and AI agent space closely. Always open to genuine conversations about what I'm building.