pull down to refresh

Problem There are excellent JS libraries for working with NWC, like the getAlby/js-sdk. The problem is that they're only suitable for working with the site user's wallet. But what if I want to generate Lightning invoices on my site, for example, to collect donations? This requires a service layer on the backend, because if you simply generate invoices via NWC on the frontend, you'd have to expose your NWC secret.
Solution Therefore, I created a simple microservice where you can insert your NWC secret and get a unique endpoint for generating invoices on demand! To generate invoices, you just need to add a simple JS script to your static site that will call the received API method.
Instructions
  1. Visit the website
  2. Insert your NWC secret (you can limit NWC to only invoice creation rights or set a minimum budget for security)
  3. Get example code and a URL that when called generates a Lightning invoice for the specified amount
  4. Insert the script into your site
  5. Enjoy
The integration example provided is very simple, so you may need to enhance it slightly to achieve the necessary functionality. Any AI can easily handle this, but feel free to contact me if you need help with installation!
The service doesn't charge any fees — all invoices are generated directly by your Lightning wallet.
By the way, you can even deploy this service on your own server — it only requires Node.js. Here's the GitHub repo.
You can see an example of the script working on @bitcal's website. Just click on the “zap” button.
Nostr static payment codes
reply
If I understand correctly, these static payment codes requires specific configuration of Lightning Node and requires the user to have a specific wallet to support payments via this protocol. It seems to be quite experimental at the moment.
reply
Any website can display the invoices, there's a sdk for fetching them making it wallet agnostic for paying, but a wallet could implement the sdk to also use the codes directly (enables for webserver-less or trustless lightning addresses with nip05)
The node server has to support it just as it would NWC, but no extra middleware beyond that
Also does debits and remote offer management without preshared secrets
Much more comprehensive and interactive than NWC, which is just a hackathonized version of what Lightning.Pub has been doing much longer (before nostr actually, nostr sprouted from GUN)
There's also no easier nor more powerful node to setup that Lightning.Pub, the nostr offers even have callback triggers
Your NWC-bridge should use it as an interface to enable lightning addresses via NWC so we can add it to the list of tools on the site
Installer v.2 #1196941
Completely jacked to the NIPs
reply
0 sats \ 1 reply \ @Scoresby 9h
Woah! This seems pretty handy! Bookmarking this to play around with later.
reply
Woah! This seems pretty handy! Bookmarking this to play around with later.
Thanks! If you have anything to say, please give me feedback.
I think there's potential to build this out into something more powerful. Maybe something like a service for collecting donations or something along those lines.
reply