What is Nostr?
josh
npub1pc5…dmza
2025-02-20 21:19:02
in reply to nevent1q…720h

josh on Nostr: Not my ln node, but my ln server. I’ve had to draw out the process many times to ...

Not my ln node, but my ln server. I’ve had to draw out the process many times to not forget how it works. Basically:


1.
Sender requests LUD16 from my ln server (https://westernbtc.com/.well-known/lnurlp/josh)

2.
Sender gets callback and requests (https://westernbtc.com/api/v1/payreq/josh?amount&nostr=%5Bnostr event])

3.
I check (ln server) if username is taken / associated with a white listed pubkey in my db.

Get wallet information from 10019 event.

Get mint quote request from top mint (maybe will try multiple later if top fails).

Send a queue message to a listener with the mint quote info.

Send bolt 11 invoice back for associated quote id


4.
Listener polls mint with quote id to see if it got paid or expired.

If it gets paid, call back to ln server (aka my api) at admin endpoint (https://westernbtc.com/api/v1/admin/mint-tokens). Don’t worry it has an api key.

5.
LN server (my api) then takes the fulfilled quote id, the receivers p2pk key, and mints the tokens.

Create the 9321 event with all the tokens and send to relays.

I’m sure all of this stuff is very familiar to you, so sorry if it was fluff 😂.
Author Public Key
npub1pc57ls4rad5kvsp733suhzl2d4u9y7h4upt952a2pucnalc59teq33dmza