2

I have heard that there are static AMP invoices that can be reused multiple times (at least in LND). But previously I understood that you should never reuse the same paymenthash, because you could loose funds.

So how does these static invoices get around that? I suppose you have to put some hash in the HTCL?

1 Answers1

1

AMP static invoices are a little different than normal payments. In typical lightning payments, the receiver generates the preimage which is hashed and sent to the sender via the invoice.

With Atomic Multi-Path Payments, the preimage must be a little more complicated to facilitate multiple payment routes, and therefore must be sender generated. Since the sender is in charge of generating the preimage, every payment to an AMP invoice can be unique.

A visual explanation on just how the base preimage is created and sharded can be found here

arshbot
  • 1,710
  • 14
  • 35
  • This answers the question. But now I am wondering: As per spec the invoice should still have a payment hash value in it. How is this value then generated in a AMP invoice, and is it used at all? And does this not technically violate the spec? – PyrolitePancake Feb 07 '22 at 08:27
  • Bolt11 is a specific kind of invoice. AMP doesn't comply because it's slated for a different Bolt (Bolt4). See https://github.com/lightning/bolts/pull/658 – arshbot Feb 23 '22 at 00:10