Gating APIs with Lightning: A Hands-On L402 Workshop Using Aperture
summary
Workshop builds an L402-gated API from scratch using Aperture in a Docker regtest: backend runs on port 9000, Aperture listens on port 8700 and stores grants in SQLite. Requests to /post list freely but GET /post/{id} returns 402 with a Lightning invoice and a macaroon; paying the invoice from a separate node yields a preimage which, combined with the macaroon as LSAT macaroon:preimage, unlocks the protected endpoint. Demo covers aperture config, invoice generation, macaroon caveats, dynamic pricing and rate limits.
AI-written summary · about
chapters (8)
- 0:00Gating APIs with Lightning
- 7:37Lightning Network setup with Polar
- 19:31Apache reverse proxy for L402
- 28:37L402 payment gating demo
- 33:15Q&A: Macaroon validation
- 47:09Silent payments overview
- 1:04:13Sending silent payments demo
- 1:11:37Q&A: Silent payments wallets
related talks
29mBitcoin On The Web
30mChallenges of Building a Non Custodial Lightning App
46mLightning Security Panel
20mBuilding the data layer for AI
26mPerpetual Storage and building token gated applications
31mLightning Talks, Day 2
33mLaunching a Public GraphQL API and Client for Open Source Lightning Web Components
24mWhat if the network was the sandbox?
