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

Feature: allow generating invoice_requests without an offer #175

Open
AndySchroder opened this issue Sep 12, 2024 · 4 comments
Open

Feature: allow generating invoice_requests without an offer #175

AndySchroder opened this issue Sep 12, 2024 · 4 comments

Comments

@AndySchroder
Copy link

At

https://github.com/rustyrussell/lightning-rfc/blob/db73bbb64d2dfc07fbc9c1dc09259d827f703868/12-offer-encoding.md?plain=1#L367

we have

The second case is publishing an `invoice_request` without an offer,
such as via QR code.  It contains neither `offer_issuer_id` nor `offer_paths`, setting the
`invreq_payer_id` (and possibly `invreq_paths`) instead, as it in the one paying: the
other offer fields are filled by the creator of the `invoice_request`,
forming a kind of offer-to-send-money.

and I'd like to have this capability.

It would make sense to be able to be able to automatically wait for the invoice to be received and then show the invoice. In addition, it would also be nice to be able to wait for the invoice to be received and then automatically pay it if the invoice amount matches the invoice_request amount.

@AndySchroder
Copy link
Author

More context: https://github.com/rustyrussell/lightning-rfc/blob/db73bbb64d2dfc07fbc9c1dc09259d827f703868/12-offer-encoding.md?plain=1#L54

The merchant-pays-user flow (e.g. ATM or refund):
1. The merchant publishes an *invoice_request* which contains offer fields
   which refer to its attempt to send money, including an amount.
2. The user sends an *invoice* over the lightning network for the amount in the
   *invoice_request*, using a (possibly temporary) *invoice_node_id*.
3. The merchant confirms the *invoice_node_id* to ensure it's about to pay the correct
   person, and makes a payment to the invoice.

@orbitalturtle
Copy link
Collaborator

Agree, we should definitely add support for refunds at some point. Leaving this link here in case anyone is able to look into this: https://docs.rs/lightning/latest/lightning/offers/refund/struct.Refund.html

@AndySchroder
Copy link
Author

@AndySchroder
Copy link
Author

AndySchroder commented Sep 29, 2024

With #181, we should be able to receive the invoice back over a local physical link so that it can be paid with the existing pay-invoice. There would need to be some way to validate the invoice received is indeed in response to the invoice_request before using pay-invoice though.

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