What It Does
The API serves Web of Trust scoring for Nostr — you give it a pubkey, it gives you PageRank scores, sybil detection, trust paths, anomaly analysis, and 49 total endpoints covering NIP-85 trust assertions.
The first 50 requests per day are free. After that, every request returns a 402 with a Lightning invoice. Pay the invoice, retry with the payment hash, get your data. No accounts, no API keys, no signups.
The Stack
- Go binary on a home server (old Mac Mini)
- LNbits for Lightning invoicing (self-hosted)
- Cloudflare Tunnel for public access
- Total cost: $0/month (hardware I already had)
The L402 middleware is ~100 lines of Go. On every request past the free tier:
- Check if the request has a payment hash header
- If not, create a Lightning invoice via LNbits API, return 402 with the invoice
- If yes, verify the payment hash against LNbits, serve the response
That's it. No OAuth, no Stripe, no payment processor taking 3%. Just an invoice and a hash.
What I Learned About Distribution
Building the API was the easy part. Getting anyone to use it was the hard part.
The single thing that worked: getting listed on the Lightning Faucet L402 registry (lightningfaucet.com). It's an index of L402 APIs that MCP-compatible AI agents can discover automatically. Once listed, I started getting paid requests per day from AI agents querying my API. Completely automated — no human involved on either end.
What didn't work:
- Nostr posts announcing the API: 0 engagement across 49 posts
- Blog posts with tutorials: useful for SEO long-term, but 0 direct revenue
- DMs to developers: ignored
The takeaway: machines are better customers than humans right now. If your API is machine-readable and listed where agents can find it, the revenue finds you.
The Numbers
- Total earned: 62 sats from L402 payments (small but automated and growing)
- Revenue per day: ~41 sats from AI agent queries
- Free tier usage: ~30 requests/day (some bots, some humans on the demo dashboard)
- Cost: $0
62 sats isn't much. But it's real, automatic, and zero-marginal-cost. The L402 registry is young — as more AI agents get Lightning wallets and discover these registries, every listed API benefits.
How to Build Your Own
If you have any API that provides useful data, you can add an L402 paywall in an afternoon:
- Set up LNbits (free, self-hostable, or use a hosted instance)
- Add middleware that returns 402 + invoice for unauthenticated requests
- Accept payment hashes as proof of payment
- Get listed on L402 registries so agents can find you
The barrier to entry is absurdly low. The only question is whether you have data worth paying for.
Try It
- Live demo — search any Nostr pubkey
- OpenAPI spec — machine-readable API docs
- Example L402 endpoint — free tier, then L402