<p>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.</p>
<p>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.</p>
<p>Zero amount invoices do have a vulnerability:</p>
<p>Channels:
A &lt;-&gt; B &lt;-&gt; C</p>
<p>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 &quot;steal&quot; 5,000 sats.</p>

CC BY-SA 4.0
2022-01-10T18:38:28.953Z
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.
Sachin Meier
CC BY-SA 4.0
2022-01-10T19:07:46.800Z
thanks. I will figure it out
NewbieXXL
CC BY-SA 4.0
2022-01-10T18:37:08.333Z
2022-01-10T18:37:08.333Z
Sachin Meier
<p>I try to create a lightning invoice for donations. I want my donors to be able to determine the amount themselves.</p>
<p>For my question I have looked for an answere in the internet. Unfortunately, my search results didn't help me.</p>
<p>As background could helb my Lightning Full Node (Umbrel) and Blue Wallet App. Of course I'm open for other software too.</p>
<p>Do you know a good tutorial or can you explain, what I have to do?</p>
<p>Edit: thanks @Sachin Meier. With your help I have found a kind of <a href="https://github.com/lightning/bolts/blob/master/11-payment-encoding.md" rel="nofollow noreferrer">BOLT11-How-to</a>. I have to confess that neither your explanation nor the How-to helps me. Could anybody provide a noob secure introduction please?</p>

<lightning-network><invoices>
How to generate an invoice with flexible amounts for Lightning Network
NewbieXXL
# How to generate an invoice with flexible amounts for Lightning Network

(Asked by: username_0 on 2022-01-10)

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 @username_1. With your help I have found a kind of [BOLT11-How-to](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md). I have to confess that neither your explanation nor the How-to helps me. Could anybody provide a noob secure introduction please?

**Tags:** lightning-network, invoices


---

## 1 answers

### Answer by username_1 on 2022-01-10. Score: 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.

> **Comments:**
> **username_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.  
> **username_0**: thanks. I will figure it out  

---

