Been working on ln.bot, a Lightning API for apps and agents. Just shipped the part I care about most: L402 middleware that actually makes the protocol usable without deploying Aperture or writing macaroon code.
Server side:
app.use("/api/premium", l402.paywall(ln, { price: 10 }));Client side wraps fetch, handles 402 automatically, pays, caches token, retries:
const response = await client.fetch("https://api.example.com/data");All the macaroon/preimage/signature stuff happens in ln.bot's API. Your code is just glue. No crypto imports, no Aperture, no reverse proxy config.
The thing that always bothered me about L402 is the gap between how clean the protocol is and how annoying it is to actually implement. Aperture is a whole deployment. On the client side there's basically nothing. So the protocol sits there being theoretically great while nobody ships it.
Wrote up everything here including .NET examples, dynamic pricing, and an honest L402 vs x402 comparison: https://ln.bot/guides/pay-per-api-call
SDKs: TypeScript / Python / Go / Rust / C#
Curious if anyone here has tried implementing L402 before and what sucked about it.
Very cool. Just sent a PR to integrate satring.com into the platform to enable service discovery.