Tanstaafl – Pay-to-inbox email on Bitcoin Lightning
Bitcoin micropayments kill spam economics, but adoption depends on senders willing to pay.

L402 turns Lightning payments into stateless API auth for autonomous agents.
Developers, traders, and AI agents needing real-time Bitcoin data
CoinGecko API · Glassnode · The Graph (indexing)
The flow:
GET /v1/price → 402 + { invoice: "lnbc3n1p...", payment_hash: "abc123" } pay invoice (any Lightning wallet) GET /v1/price?payment_hash=abc123 → 200 + { price, rsi, macd, trend, ... }
8 endpoints covering price/technicals, mempool fees, on-chain metrics, derivatives, AI-generated signals and a full market summary. Costs range from 2 sats (~$0.001) to 200 sats (~$0.12).The main thing I wanted to test: can L402 work as a real auth mechanism for a production API? Turns out yes — it's been live for a week on mainnet and already receiving payments from what looks like bots or automated scripts hitting multiple endpoints in sequence.
A few things I learned building this:
- phoenixd makes the Lightning side trivial. The entire payment middleware is ~60 lines of Express code. - L402 is a genuinely better model than API keys for programmatic access. No credential to leak, natural rate limiting through economics, agents can pay autonomously. - Railway blocks exchange IPs so derivatives data is estimated from price momentum rather than real funding rates. Documented but worth knowing.
Stack: Node.js/Express on Railway, phoenixd 0.7.2 on DigitalOcean.
https://satsapi.dev/docs — full docs with JS/Python/cURL examples https://satsapi.dev/health — live node status https://github.com/Aperezvigoa/satsapi — source
Happy to answer questions about the L402 implementation or the phoenixd setup.
Bitcoin micropayments kill spam economics, but adoption depends on senders willing to pay.
Yet another Flask boilerplate, but the Strike API integration is a nice touch.
Zero-setup Lightning payment tester, but lacks depth beyond demo scenarios.
Agents finally have bank accounts: 402 interception + Lightning payments just works.
Macaroon-based budget enforcement for AI agents—fills a real economic governance gap.
TEE-based key protection solves the always-online self-custody tension nicely.