Has anyone figured out subscriptions or pull-based payments on lightning/NWC yet?

Reply to this note

Please Login to reply.

Discussion

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:

https://nips.nostr.com/47#pay_invoice

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