Has anyone figured out subscriptions or pull-based payments on lightning/NWC yet?
Discussion
nostr:nprofile1qy2hwumn8ghj7un9d3shjtnyv9kh2uewd9hj7qghwaehxw309aex2mrp0yh8qunfd4skctnwv46z7qg6waehxw309ac8junpd45kgtnxd9shg6npvchxxmmd9uqs6amnwvaz7tmxxaazu6t09uqzp75cf0tahv5z7plpdeaws7ex52nmnwgtwfr2g3m37r844evqrr6j2vwkgf nostr:nprofile1qqs2hr9cpe0y9fwytl8s5mpf0e6ckyf6sld22q5tzzezhzkl2w2a2qsy0084g nostr:nprofile1qyghwumn8ghj7mn0wd68ytnhd9hx2tcppemhxue69uhkummn9ekx7mp0qywhwumn8ghj7mn0wd68ytnzd96xxmmfdejhytnnda3kjctv9uq3vamnwvaz7tm9v3jkutnwdaehgu3wd3skuep0qythwumn8ghj7un9d3shjtnswf5k6ctv9ehx2ap0qqsrxra3gv0lnkxz2pcxh0xuq9k4f9dr7azwq3aypqtnay4w0mjzmtqymgkge
Are there any implementations of this anywhere?
I think highlighter is using this.
NostrDVM implemented this for DVM subscriptions. Actually not running an instance as this was never considered by any client so far, but working implementation exists.
Highlighter was like six major product pivots ago. I still plan on releasing Honeypot wallet based on this idea as a central place to handle subscription payments (ie like the Apple Cloud Subscriptions app)
Alby Hub subscriptions work based on NWC. The client receives an NWC connection secret with a pay_invoice permission and sends a pay_invoice request to the wallet.
Nice, do you know of any services that use this functionality so I can try it out/look at code?
I don't know any public ones, but basically you'd save the NWC connection secret and pull the money according to your subscription terms (e.g. monthly) using the pay_invoice command:
You could look at ZapPlanner: https://github.com/getAlby/ZapPlanner
Hmmm. I could hack something together, like a subscription secret that only works to a certain amount or a certain number of times.
A lot of high quality components are needed to really solve this:
- A receiver side service that can create subscriptions and request invoices
- An always-on wallet that can pre-authorize recipients and pay invoices
Yeah, I built my own NWC server for my own service. I could see implementing this easily; the hard part is digging in to make sure the requirements are right. Iβll keep this on my list of todos. I see having a βrootβ secret that could add and delete subscriptions. Each subscription would have their own root and some sort of authorized declining balance.
what are you trying to do with it?
why not just ask the user to prepay and consume their credits as the time goes?
Do you think pull payments are necessary?
I was thinking about "payment requests" in the last couple of days. So you dont give "pull" rights to anyone. They just send you a request when renewing happens, and it basically contains an invoice, or expects a cashu token.
But nwc is basically "pull" rights though.
I think it's ok to have pre-authorized subscriptions, especially if it's all in one place on nostr and easy to revoke access.
yeah, user gives you a NWC with the permission to send a payment and a budget for the right amount.
then the service uses that to pull the payment. thatβs one case what it is for