0

I try to create a lightning invoice for donations. I want my donors to be able to determine the amount themselves.

For my question I have looked for an answere in the internet. Unfortunately, my search results didn't help me.

As background could helb my Lightning Full Node (Umbrel) and Blue Wallet App. Of course I'm open for other software too.

Do you know a good tutorial or can you explain, what I have to do?

Edit: thanks @Sachin Meier. With your help I have found a kind of BOLT11-How-to. I have to confess that neither your explanation nor the How-to helps me. Could anybody provide a noob secure introduction please?

1 Answer 1

2

Lightning Invoices (BOLT11) allows for invoices to have a zero amount. If you generate a zero amount invoice, the sender can use it to pay any amount.

When you use zero amount invoices, you have no control over how much you receive, and will need to make sure the sender sends the amount you expect.

Zero amount invoices do have a vulnerability:

Channels: A <-> B <-> C

If C attempts to pay a zero-amount invoice to A, say they pay 10,000 sats. B can receive the 10,000 sats and forward only 5,000 sats to A. Since A doesn't know how much C intended to send, they see this as a valid payment and return the preimage to B. Thus B can "steal" 5,000 sats.

2
  • 1
    In terms of generating zero-amount invoices, just enter zero as the amount. If the wallet throws an error, they don't support zero-amount invoices and you'll need to try another wallet. Commented Jan 10, 2022 at 18:38
  • thanks. I will figure it out
    – NewbieXXL
    Commented Jan 10, 2022 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.