Asking again as undecided.

I need a lightning based payment API, and virtual account (or credits per pubkey) service.

Users can deposit into a pubkey’s virtual wallet/account. User withdrawal isn’t required. They top up when out of credits by depositing again.

When a user makes a request (e.g. for POW, or to publish an event), I can use an API to check and deduct/hold an amount/fee - or basically transfer it into an primary owner account (atomic db update is ideal).

Once successful, users account has fee removed. Primary owner account has the fee added. Refunds are possible for failures post-payment.

Suggestions welcome - but seeking exact API or service that’s ideally used in production by someone, not just “use LNbits or BTCPAY”. Thanks for feedback!

Reply to this note

Please Login to reply.

Discussion

You mean for credits associated with a nostr pubkey?

Basically to start I feel it’s easier to pre-paid for credits (just lightning sats). But I would need a way to deduct from the total paid for a specific pubkey.. as a pubkey is effectively the payer.

For example:

I pre-pay 5000 sats (linked to my pubkey)

I then pay 10/sat to publish my event to a relay - which is not an invoice, just a draw down from that pubkeys 5000 - so they now have 4990 sats pre-paid credits.

Account keeping should be virtual and not full wallets or anything complex.

lnbc49900n1pjq8rstpp5y4csx2ww64c3va7tcs2pxp9zhc6sessjs7leh2829943dhuzn93qdqu2askcmr9wssx7e3q2dshgmmndp5scqzpgxqyz5vqsp54khfc2xkve7qfu8t9qy4m3tsqdxr0fe8jxyvsuteeyjt5zs68sns9qyyssqvlpw42sla5x6zjz3hqvdgxygwvaqjf4aenvx9uflh9ezmln5qztkljn5hve8ffvm292s6xnvyj8xjfc6u795pyj9d54fjgehtrkueegqn5cnzj

I think you're going to need a custom solution. It's easy enough to set up an LN invoicing system e.g. btcpayserver, but you will need a web interface for users to input their pubkey, validation, check whether invoice is paid, and keep a simple database of pubkey-balance records that you update as the balance is used.

I can't imagine this exists out of the box anywhere, yet...

But nostream relay must have something similar since they do tie invoices to pubkeys. I don't think they keep tabs on balances per pubkey, and they use ZBD (KYC service IIUC) instead of self hosted btcpayserver.

Thanks. I’m still hoping.

If I build custom, then I need more code and to maintain custom, etc. I was hoping it could be an easier setup for other users too.