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] 1 invoice for 2 (or more) #3219

Open
patrickReiis opened this issue Aug 2, 2024 · 7 comments
Open

[Feature] 1 invoice for 2 (or more) #3219

patrickReiis opened this issue Aug 2, 2024 · 7 comments
Labels
idea A feature idea that needs to be more specification

Comments

@patrickReiis
Copy link

Feature description

An invoice is attached to a single person, so if I want to pay A and B, first A creates an invoice and sends to me and B does the same thing (then I pay).

This has this problem:

  • I can't guarantee that either both will receive or none will receive, paying A could be successful but paying B could fail, forcing me to do a pay retry with B

This could be understood as a database transaction feature, where everything works thus is saved in the database or nothing works thus is not saved into the database.

Describe the solution

A solution to this would be to make an invoice based in 2 or even more lightning addresses, that when paid, calculates the percentage for each one and attempts to pay both.

So when you decode the invoice, A gets 20% of the total amount and B 80% of the total amount.

Describe alternatives

Currently I need to do it manually but it's not elegant.

Additional context

No response

Are you working on this?

None

@patrickReiis patrickReiis added the idea A feature idea that needs to be more specification label Aug 2, 2024
@patrickReiis patrickReiis changed the title [Feature] 1 invoice for 2 [Feature] 1 invoice for 2 (or more) Aug 2, 2024
@reneaaron
Copy link
Contributor

There is no way you can span a transaction across multiple LN payments to different receivers.

Do you mind to explain the exact use case you are trying to solve here?

@patrickReiis
Copy link
Author

Zap split

@reneaaron
Copy link
Contributor

Yeah, I don't think that's possible since you can't know beforehand which payment succeeds and which does not. (and obviously you can't "call back" your transactions for good)

Even with with HOLD invoices you'll have the same problem at the "settle" step of the process.

@bumi
Copy link
Collaborator

bumi commented Aug 5, 2024

@rolznz had something there. but it is discontinued: https://github.com/getAlby/ZapSplitter

@rolznz
Copy link
Contributor

rolznz commented Aug 5, 2024

This app could be more simply implemented now with NWC. Another idea for an Alby Hub plugin 🚀

@alexgleason
Copy link

I think what we're looking for is not one invoice for multiple people, but one QR code / bech32 entity that encodes multiple invoices, so that the Lightning wallet handles the UX of zap splits. Basically so that the Alby window does not have to pop up for confirmation multiple times, and it handles errors for failed payments within its own UI.

Also, I don't understand what ZapSplitter does. 🤔

@rolznz
Copy link
Contributor

rolznz commented Aug 6, 2024

@alexgleason this is probably not possible, at least not in a standard QR code (There's too much information)

ZapSplitter is a lightning prism. When the user receives a payment, it will be forwarded to N other lightning addresses (each recipient getting a configured % of the payment, which is configured by the user).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea A feature idea that needs to be more specification
Projects
None yet
Development

No branches or pull requests

5 participants