Back to Home

Yes, Your Pi Coding Agent Now Has a Bitcoin Wallet

On November 12, Lightning Labs shipped pi402, an extension that lets the Pi coding agent buy model inference with bitcoin over the Lightning Network. The pitch from Olaoluwa Osuntokun is blunt: no sign-up, no API key, no card on file, no human approving anything. Install one npm package, run a /fund command, and the agent pays for tokens by the millisatoshi. It is interesting engineering wrapped around a weaker argument than its authors seem to think.

The Mechanics Are Clean

L402 revives HTTP's long-dormant 402 status code. A server answers with a Lightning invoice plus a macaroon, the client pays, and the revealed preimage becomes the credential. pi402 wires that into Pi's model provider system as a custom provider with an embedded Wavelength wallet, enforcing a per-request ceiling and a daily budget on the client side. The numbers in the announcement are precise, which is refreshing:

  • 1 msat per input token and 2 msat per output token, roughly $0.80 and $1.61 per million tokens at a BTC/USD rate near $80,500
  • a millisatoshi lands around $0.0000008, so billing a single token is technically possible
  • /fund prints a Lightning invoice, /deposit returns an on-chain address that gets swept into the wallet
  • sellers front their API with Aperture v0.6.0, a meterd price server, and Lightmeter for pricing and SQLite-backed accounting

What the Announcement Skips

The strongest justification offered is a screenshot. Osuntokun cites OpenCode's CEO Dax, who posted a Stripe dashboard showing $323 million in blocked fraud over a few days. Blocked volume is not loss. It lumps in false positives and stolen cards, and a single merchant's dashboard is not an audited figure.

Even granting the number, the conclusion does not follow. Prepaid credits already exist at every major inference provider, and prepaid credits already strip out chargeback exposure. "No accounts" is also doing a lot of work, because the prerequisites did not vanish. They moved. You now need bitcoin, a funded wallet, a route to top it up, and tolerance for the exchange rate.

The launch maths assumes BTC at $80,500. At roughly $64,800 on November 15, the same satoshi budget buys about a fifth fewer dollars of inference than the post promised. A daily cap written in sats is a moving target in the only unit that matters. Four questions go unanswered:

  • who audits the token count when buyer and seller disagree at millisatoshi granularity
  • what happens when a cached L402 credential expires mid-session and the wallet is empty
  • which side eats the loss when a seller overcharges an agent that has no dispute process
  • how a client-side daily budget survives prompt injection that points the agent at a new paid endpoint

The Wallet Is the New Attack Surface

Irreversibility cuts both ways. Chargebacks protect sellers from fraudulent buyers, but they also protect buyers from fraudulent sellers, and pi402 deletes both halves at once. An agent holding a funded wallet and a spending policy is a fresh target, and the attack does not require breaking Lightning. A prompt that persuades the harness to call an expensive endpoint is enough.

Macaroon caveats that cap spend per sub-agent are good design, but a cap is not a review. None of this makes pi402 a bad protocol. It is a real milestone for machine-to-machine payments, and inference is a sensible first market because agents cannot function without it. But paying per token means trusting the seller's meter, and the seller's meter is the one component nobody in this stack has an incentive to audit.

Bitcoin solves a provider's fraud problem and hands the buyer custody, volatility, and dispute risk in exchange. For a company selling inference to agents at eight ten-thousandths of a cent per call, that trade is easy. For a developer who wants a coding agent that works on a Tuesday afternoon, pi402 offers a wallet nobody asked for, a new balance to monitor, and one more thing that can be empty at the worst possible moment.

Comments

No comments yet. Be the first to share your thoughts!