Nostr: npub1mgvlrnf5hm9yf0n5mf9nqmvarhvxkc6remu5ec3vf8r0txqkuk7su0e7q2
Use Phoenixd as the Lightning backend for Aperture — no LND required.
Implements Aperture's mint.Challenger and auth.InvoiceChecker interfaces against Phoenixd's REST API. Drop-in replacement for LND with strictVerify=false (Aperture's default).
go get github.com/forgesworn/aperture-phoenixdimport "github.com/forgesworn/aperture-phoenixd"
challenger := phoenixd.NewChallenger("http://localhost:9740", "your-phoenixd-password")
// challenger.NewChallenge(priceSats) — creates a Lightning invoice via Phoenixd
// challenger.VerifyInvoiceStatus(...) — no-op for strictVerify=false
// challenger.Stop() — no-op (stateless HTTP client)See testdata/aperture-patch.diff for the ~20-line diff to wire this into Aperture's aperture.go. Adds PhoenixdURL and PhoenixdPassword config fields alongside the existing LndHost and Passphrase options.
The included echo server provides a minimal API to proxy through Aperture:
go run ./cmd/echo-server
# Listens on :8080, returns request body at /v1/echo- Aperture receives an HTTP request and needs to create an L402 challenge
PhoenixdChallenger.NewChallenge(price)calls Phoenixd'sPOST /createinvoice- Phoenixd creates a Lightning invoice and returns the BOLT11 string + payment hash
- Aperture wraps this in a macaroon and returns it as the L402 challenge
- The client pays the invoice and presents the macaroon + preimage
- Aperture verifies the preimage against the payment hash — access granted
strictVerify=trueis not supported. Phoenixd's WebSocket does not emit invoice cancellation events required for full invoice status tracking. WithstrictVerify=false(the default), macaroon + preimage verification is the security model.
| Project | Role |
|---|---|
| aperture | L402 reverse proxy (what this adapter plugs into) |
| aperture-announce | Announces Aperture services on Nostr for discovery |
| 402-mcp | MCP client that discovers and pays for L402 APIs |