3

Is there a way to pay one Bolt 11 Invoice in multiple payments with Lightning Network?

For instance this invoice total amount to pay is 5000 satoshi:

lnbc50u1pwsyhx9pp57ppqvzwex3qapu0wn63v06jzxqdtt46qypks4pnexwrr2ansz9msdqcgejhxctzd9kxjare23jhxap3cqzysxqy2ljqd47a9cdlnj84cy0a0zg7frd8jnera8fen2du6d2g500wzs7mpsmpqe0c3ddhrrxpehyhj4c9fwj3cfr5mvyxcyaaq98fw39jketl89cq0j9hy2

In this case can we pay 2 times 2500 satoshi and then get the secret (preimage) Only after the Full Payment is received?

I did notice that in LND client with lncli sendpayment and c-lightning client with lightning-cli pay commands there is an amount parameter in satoshi?

1 Answer 1

4

Currently, no. The receiver will reject an attempt for less than the requested amount and fail with incorrect_or_unknown_payment_details.

Each invoice has a payment_hash which a payment corresponds to, and the payment hash is generated from a random payment_preimage. This preimage must be unique for each payment, else it may be possible for any party along the route of a payment to take money without forwarding the payment on.

When the payee receives the full amount for a payment, they release the payment_preimage to the penultimate hop in the route, who then removes the HTLC from their channel and the payment completes. The penultimate hop then forwards the payment_preimage to the hop before them, and so on, until it reaches to payer.

You can see that, if only half of the payment was done, then every participant along the route would already have knowledge of the payment_preimage. If you attempted to pay again with the same payment_hash, then any hop in that route could instantly remove the HTLC and take the payment by using the payment_preimage they already know, without forwarding the payment to the next hop.

There is work in progress to allow payments to be broken up and send along multiple routes, with the payee only surrendering the payment_preimage if the full amount from all routes is received. This is known as AMP (Atomic Multi-path Payments). There are multiple proposals for this which have been discussed on the mailing list.

3
  • Added a clarification in the question. The idea is to send multiple payment until to total amount specified in the invoice is reach Then (only then) send back the preimage? Is there anything plan in the spec in this mater?
    – Hugo Doyon
    Commented Jun 13, 2019 at 15:30
  • Nothing currently in the spec regarding this. There are proposals to get AMP into the 1.1 spec. Start here for the original AMP proposal.
    – Mark H
    Commented Jun 13, 2019 at 15:43
  • 1
    This idea of delaying to send back the preimage is called BASE AMP IIRC and can already be done manually (there is nothing in the protocol to prevent it), but there is no UI support in any of the implementations AFAIK. LND might have some preliminary support in there, because they use the same technique in other use cases and call it HODL invoice. Note that Base AMP is really a misnomer because this isn't atomic anymore. Only part of the payment might succeed. Commented Jun 14, 2019 at 11:06

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.