lightninglabs / lightninglabs/L402

Live implementation: multi-service L402 AI marketplace — use case feedback

Open
#20 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
91
Forks
19
PR merge metrics
No merged PRs in 30d

Description

We've been running sats4ai.com as a live L402 service provider since early 2026 — 15+ AI services (image generation, video, audio, SMS, phone calls, document analysis, email, and more) all gated behind L402 endpoints, with an MCP server on top for agent discovery.

A few implementation notes that may be useful to the spec or community:

Single-use tokens by design
For per-generation billing, each token is intentionally single-use (tied to a specific charge ID embedded in the macaroon identifier). The spec's "cache and reuse" model works well for subscription-style access, but per-generation services need a new invoice per call. Worth a note in the spec that single-use vs. reusable is a server-side policy choice — not a protocol violation.

token= + macaroon= dual-field migration
After the recent bLIP update renaming macaroon= to token=, we now emit both fields in our WWW-Authenticate header for backwards compatibility with existing clients. Recommend the spec explicitly document this as the migration path for existing implementors.

MCP + L402 combination
We expose services via an MCP server (Model Context Protocol) alongside the L402 endpoints. Agents can discover available services via MCP and pay via L402 in a single workflow — no human setup required. The combination feels like the natural next step for agent-native commerce. Happy to share implementation details if useful.

We're following the active development here and on the bLIP PR closely. Great to see the protocol getting the formalization it deserves.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the L402 specification and the referenced bLIP update, then compare the current guidance with the implementation notes in this issue. Done means the spec clearly covers single-use versus reusable tokens and the token= plus macaroon= migration path; MCP integration details are offered but not defined as a required change.

Written by the indexing model from the issue text.

Assessment

Domain
api, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.