Skip to content
WoompaLoompa edited this page Aug 10, 2026 · 9 revisions

lnbits-clink

A CLINK extension for LNbits — Nostr-native Lightning.

CLINK turns Lightning wallets into first-class Nostr citizens. With this extension your LNbits wallet speaks the CLINK protocol natively: it can publish offers and receive payments over Nostr, issue debit pointers for apps to charge it, pay offers (outgoing), and run recurring subscriptions against a payer's ndebit1... pointer — all over ordinary Nostr relays with NIP-44 encryption.

Status: v0.1.5 released — ClinkWallet is now a fully paying LNbits funding source. Invoices are requested from a remote Lightning.pub node's offer service (kind 21001) using the LNBITS_CLINK_FUNDING_NOFFER noffer; adding a Lightning.pub account connection string (LNBITS_CLINK_FUNDING_ACCOUNT, an nprofile1... string, optionally :token) enables outgoing payments (PayInvoice), real balance reporting (GetUserInfo), and invoice-status tracking (GetPaymentState) over the node's Nostr user API (kind 21000, NIP-44 v1 encryption). The core /admin → Funding Sources card renders noffer and account inputs for CLINK (applied at boot on the demo Fly machine via a durable boot-patch — see Installation#clink-as-the-lightning-backend). Earlier: v0.1.4 made CLINK a selectable (receive-first) backend; v0.1.3 swapped the event_repeat icon for event (the ligature splits into multiple glyphs in the Material Icons font); v0.1.2 fixed the frontend rendering (tabs/panels/dialogs collapsed because self-closing Quasar tags were mangled by the HTML parser) and added header nav links.

Features

Area What it does
Offers Create noffer1... pointers, share a public checkout page, create BOLT11 invoices on demand (fixed / variable / spontaneous prices).
Debits Mint ndebit1... pointers, enforce rules (allowed_pubkeys, min/max amounts), per-period budgets, and single-use session k1 — auto-settle direct payments and acknowledge budget requests.
Pay Offers Paste a noffer1..., parse it, and pay the resulting invoice with any LNbits wallet.
Subscriptions Define recurring plans and attach them to a payer's ndebit1... pointer. A poller bills each period via kind 21002 direct-payment requests, with retries and automatic cancellation.
Relays Manage the Nostr relays the node listens on; the listener reconnects with backoff.
Funding source Run this LNbits instance backed by CLINK: ClinkWallet is injected into lnbits.wallets at load, appears in /admin → Funding Sources (with noffer and account fields), and serves invoices from a remote Lightning.pub node configured via LNBITS_CLINK_FUNDING_NOFFER (receive) and LNBITS_CLINK_FUNDING_ACCOUNT (send + balance).

Pages

  • /clink — extension index: offers, debits, relays.
  • /clink/pay — pay an offer from a noffer1... string.
  • /clink/subscriptions — plans and subscriptions.
  • /clink/checkout/{offer_id} — public checkout page for a fixed offer.

Quick links

  • Installation — getting the extension into LNbits
  • Usage — offers, debits, pay, subscriptions walkthrough
  • Protocol — the CLINK protocol layer (NIP-44, noffer/ndebit, event kinds, GFY)
  • API — REST API reference
  • Architecture — how the extension is put together
  • Development — tests, linting, and the release pipeline

Repositories

Clone this wiki locally