Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HODL invoice support #219

Open
PatrickGeyer opened this issue May 3, 2023 · 3 comments
Open

HODL invoice support #219

PatrickGeyer opened this issue May 3, 2023 · 3 comments

Comments

@PatrickGeyer
Copy link

Suggest adding optional extra parameters to LUD-06 callback endpoint: cltv_expiry and expiry.

With the rise of serverless Nostr apps, we may want hodl invoice functionality to allow trustless escrows to operate over lightning.

E.g. I launch a NIP-15 marketplace, and would like a 3rd party escrow to manage payments from buyers.
I don't want the escrow to custody the funds, so I need to generate an invoice myself and give the escrow just the hash.
When the buyer sends me a checkout message over nostr, the seller can trigger the escrow service, which looks up the seller's nostr profile, finds the lightning address, pings the lnurl address with some extra parameters to return an invoice that has a long enough timeout for the transaction.
E.g. 1 week until product is definitely shipped.
The escrow could also include json of the nostr event in question so that the lightning node can't be spammed by long-timeout-invoice creation requests that don't correspond to a real order.

@PatrickGeyer
Copy link
Author

I'm imagining that the way to get escrows into nostr apps is to have escrow broadcast their service availability via Nostr messages. That way, nostr clients don't have to hard-code escrow services, but can search them in real time.

See draft spec here: https://github.com/PatrickGeyer/nips/blob/master/XX.md

If anyone knows of a better way to do non-custodial escrow system over lightning, all ears!

@fiatjaf
Copy link
Collaborator

fiatjaf commented May 3, 2023

I agree this would have been a nice thing to have.

@PatrickGeyer
Copy link
Author

@fiatjaf Looks like plenty of wallets implemented Zap addition to LNURL endpoints.
Do you think if HODL invoices become the way to do trust-minimized transactions for nostr apps, wallets would be able to implement these extra two parameters?
Would only need one wallet to support for a proof of concept.
If I'm running a nostr marketplace I may not mind setting up a new wallet which supports hodl invoices. Maybe after proof of concept the idea would become more refined and lightning network more resilient to HODL type transactions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants