LNBits as Nostr-native UI layer over Lightning.Pub #22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fork LNBits to use Lightning.Pub as its backend, making LNBits a pure UI layer for extensions while Lightning.Pub handles accounts and payments.
Key Insight
LNBits already has NIP-98 authentication built in (migration m022 added
pubkeyfield). The architecture supports:POST /api/v1/auth/nostr- Authenticate with signed Nostr eventget_account_by_pubkey()- Query users by npubProposed Architecture
Implementation Strategy (Option C)
No table migration needed. Replace LNBits' CRUD layer with adapters that call Lightning.Pub.
LightningPubWalletfunding source - Translates LNBits wallet operations to CLINKKey Design Principle
LNBits never holds nsec. For payments:
Files to Modify
lnbits/wallets/lightningpub.pylnbits/core/crud/users.pylnbits/core/crud/wallets.pylnbits/core/crud/payments.pylnbits/static/js/nostr-signer.jsBenefits
Prerequisites
References
~/dev/repos/lnbits.git(also mirrored at aiolabs/lnbits)lnbits/core/views/auth_api.py(lines 579-626)lnbits/utils/nostr.pyDirection inversion — this issue is superseded by the LNbits-as-backend migration
This issue proposed "LNbits as a Nostr-native UI layer over Lightning.Pub" — LNbits acting as a thin UI/wallet shell that calls LP's nostr RPC for actual Lightning operations.
Since then we've moved in the opposite direction: a
nostr-native-transportbranch onaiolabs/lnbitsexposes LNbits itself as the backend, accessed by HTTP-allergic clients (e.g. this ATM) over kind-21000 NIP-44-encrypted RPC events. That's the inverse of what this issue describes.Concretely, the LNbits transport now provides:
create_invoice,pay_invoice,get_payment,list_payments,get_wallet,list_wallets,create_wallet,decode_paymentlnurlw_create_link,lnurlw_get_link,lnurlw_update_link,lnurlw_delete_link,lnurlw_list_links,lnurlw_unique_hasheslnurlp_create,lnurlp_get,lnurlp_list,lnurlp_update,lnurlp_deletesubscribe_payments({wallet_id?, payment_hash?, tag?, link_id?})+unsubscribeAll NIP-44-encrypted over kind-21000 on whatever relay you configure (in dev: the in-process
nostrrelayextension). For the ATM the data flow is now:with
subscribe_paymentsproviding real-time settlement push (replaces the LP-onlyGetLiveUserOperationssubscription that lamassu-next'sclient.tsconsumed forwithdraw.*link claims and ndebit success).The CLINK-side of LP (ndebit/noffer, kinds 21001-21003) is not mirrored on LNbits — it remains a Lightning.Pub-only protocol. ATM flows that need CLINK still talk to LP for those; everything else can move to LNbits.
Suggested action: close this issue, or rescope it to "LP-only CLINK flows continue to live on LP; LNbits handles invoice/withdraw/wallet plumbing via the nostr transport." The current title is misleading vs the actual architecture.
References:
nostr-native-transport~/dev/lnbits/nostr-transport/misc-aio/transport_driver.py