-
Notifications
You must be signed in to change notification settings - Fork 169
Support 0 value invoices by letting users edit the amount #991
Comments
I'm trying to fund a Tippin.me account and the request they provide has amount set as "any amount", which is interpreted as zero in the Lightning App request and is then un-editable. Looks like this is a known thing, but i'm curious if there are any easy to use LN request editors out there to help serve as a work around in the meantime? I'm thinking of something like lndecode.com but with some editing functionality. |
Aren't zero sat amount invoice not safe? See this: https://github.com/ottosuess/ottosuess.github.io/blob/master/zero-amount-payments.md |
In the spirit of scratching my own itches (and this seems like a somewhat contained change) I have started an attempt at this in PR #1327 I am new to this code base but I am trying to follow the existing UI/code styles a good as I can. |
Update: I am making progress, basic functionality is there but still needs some polishing. |
The PR is IMHO ready 😃 It of course needs review and there needs to be a decision on how to handle the security implications. My two cents is that this is an extremely important feature for new users that want to "give lightning a try". In my case the second thing I tried to pay for with lightning was a zero value invoice and the experience was that of a broken system. That is not the image of the ecosystem we want to give new users. Concerning the security aspects IMHO there are three alternatives:
I can make the necessary work for any solution. If (3) we can keep the payment PR and adapt it for keysend when that is properly supported by lnd. |
GIF of proposed solution to this issue in PR: #1327 |
Seems people are into sending tips over LN these days. They usually do so by giving out a "zero valued" input which looks like this when decoded:
So one the decoder side, we can detect this at it has no true value:
When we try to pay an invoice like this into the UI atm we see something like this

When the user clicks to pay, then it gets rejected as
lnd
detects there's no value attached to the send request.If we wan to support this use case, we'll need to:
SendRequest
proto along side the invoice. Here's an example of how we do it in lnd/Go: https://github.com/lightningnetwork/lnd/blob/master/cmd/lncli/commands.go#L2255. Notice that we set both the invoice and the amount. If the amount is zero, then lnd will just use the invoice. But if it's set, then lnd knows what do to with it all.The text was updated successfully, but these errors were encountered: