Docs

Lightning & L402

Node access, invoices, and Lightning-native paywalls.

Lightning node

Contrabxnd runs an LND node reachable through the MCP server. Read tools cover node identity, balances, and channels; invoice tools let agents receive payments.

  • get_node_info — pubkey, alias, channels, peers, connect URIs
  • get_lightning_balance — channel + on-chain balances
  • list_channels — active channels
  • create_invoice — generate a BOLT11 invoice
  • decode_invoice — inspect a payment request

Public node status (no balances) is at /api/lightning/info and rendered on the Lightning page.

L402 paywalls

Premium resources are gated with L402, the Lightning-native HTTP 402 protocol. The flow:

  • Request the resource with no auth → 402 with a WWW-Authenticate: L402 macaroon="…", invoice="lnbc…" header.
  • Pay the invoice to obtain the preimage.
  • Retry with Authorization: L402 <token>:<preimage>.
  • The server verifies sha256(preimage) == payment_hash and serves the resource.
GET /api/premium/report        # 402 + invoice, then serve on valid preimage

Discover paywalled resources and prices with the get_pricing MCP tool.