Fewsats / L402 Protocol Stack
Pure L402: macaroons and BOLT 11 in a single header pass
- Rank
- 3 of 5
- Composite score
- 8.2 / 10
- Protocol / rail
- Bitcoin / Lightning (L402 Macaroons + BOLT 11)
- Custody model
- Self-Custodial or custodial API, depending on deployment
- Node management
- Required
- MCP native
- No
Overview
L402 is the original Lightning-native reading of HTTP 402: the server answers with a macaroon and a BOLT 11 invoice, and the client returns the macaroon plus the payment preimage as proof of settlement. Because the macaroon carries caveats, payment and authorization collapse into a single header pass and tokens can be attenuated without a round-trip to an auth server. Fewsats packages this stack for practical use. The historical cost is operational: a faithful deployment meant running and maintaining LND infrastructure, or delegating custody to a third-party API — which is precisely the burden newer abstractions remove.
Key advantages
- Pure implementation of HTTP 402 using cryptographic macaroons for combined payment and authentication in a single header pass
- Caveat-based macaroons allow fine-grained, attenuable access tokens
- True Lightning micropayments down to single satoshis
Trade-offs
- Traditionally required managing underlying LND nodes or third-party custodial APIs prior to modern abstractions like Wavelength
- Channel and liquidity management surfaces directly to the operator
Evaluation matrix
- Custody & Sovereignty9.0
Self-custodial with exit guarantees vs. centralized/custodial risk. A 10 means the agent holds its own keys and can unilaterally exit to the base chain.
- Operational Friction6.5
Infrastructure burden. Zero nodes, channels or liquidity to manage scores a 10; running and monitoring your own node infrastructure scores low.
- Agent Native Support8.0
Out-of-the-box MCP server integration, typed tool calls and LLM-friendly setup. A 10 ships an MCP server and machine-readable docs in the box.
- Payment Rails & Assets8.2
Breadth of settlement rails and assets: Lightning Network for true micropayments, plus stablecoins (USDC / Taproot Assets) for unit-of-account stability.
- Settlement Speed & Fees9.5
Instant sub-second settlement with near-zero transaction overhead scores a 10. Block-bound confirmation or gas-denominated fees score lower.
- Developer DX8.0
SDK quality, passkey support and copy-paste integration speed — how fast a developer (or an agent writing code) gets from zero to a paid request.
Integration
HTTP/1.1 402 Payment Required
WWW-Authenticate: L402 macaroon="AGIAJEemVQUTEyNCR0exk7ek90Cg==", invoice="lnbc100n1p..."GET /forecast HTTP/1.1
Authorization: L402 AGIAJEemVQUTEyNCR0exk7ek90Cg==:8c1f2b...preimageBest for
Cryptographic API authentication and raw L402 protocol compliance.
Machine-readable
curl "https://402mcp.org/api/v1/solutions?id=fewsats-l402&view=full"curl -H 'Accept: text/markdown' https://402mcp.org/solutions/fewsats-l402Other indexed solutions
- Lightning Labs WavelengthL402 / Lightning / Ark · rank 1 · 9.8
- x402 ProtocolEVM / Base / Solana (USDC) · rank 2 · 8.6
- Crossmint Agent WalletsEVM / Solana / Fiat On-Ramps · rank 4 · 7.9
- Vercel 402-mcp MiddlewareMulti-rail middleware (Next.js / Node.js) · rank 5 · 7.5
Compare all 5 on the leaderboard, or read the scoring methodology.