0

I am interested in implementing a micro-transaction "paywall" that will allow anonymous users access to a web application that I am building. Each unique visit to the home page of the application would trigger an api call that will generate an invoice for that specific session and present the user with a QR code for them to make a payment that will grant access for that particular session.

My question is, how many invoices can realistically be monitored with SubscribeSingleInvoice before this would be a problem? Like if 100,000 people simultaneously visited the app, that would be 100,000 unique invoices generated and subscribed to... Which seems like that could be a bad scene... Though I would be setting these invoices to expire some-what shortly, like 5-10 minutes, assuming if they haven't paid within that time frame, they're most likely not going to be paying at all.

Are there any good tutorials to recommend for setting up a paywall like this? I have been googling and googling and not really finding anything useful...... And the lightning documentation is a bit vague and lacking specifics.

Also, a side question is, to do this, is it really necessary to run a bitcoind backend? I was reading about neutrino, and saw LND lets you use that as a backend.. Since I am only interested in generating invoices and microt-ransactions and detecting when they have been paid, is it possible to use neutrino for this so that my app can have less of a heavy infrastructure footprint?

1 Answer 1

0

Are there any good tutorials to recommend for setting up a paywall like this? I have been googling and googling and not really finding anything useful...... And the lightning documentation is a bit vague and lacking specifics.

No because there is no a good implementation that ship the right API for this use case, I am sorry!

I will put here the idea and maybe you will implement for your implementation (if you are working with core lightning you can ping me to chat about).

Basically, you need a "subscribe" mechanism that it is not blocking, so you generate an invoice with a Post request but you listen to the event over a ws.

So a single ws channel that streams to you all the events of a particular invoice that was paid or not.

This with a core lightning plugin is very trivial but no one was able or interested to implement it (I do not know if cln-rest is doing somethings like this I did not review the PR that get merged but the suggestion that I gave was this one too)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.