From rusty at rustcorp.com.au Wed Nov 21 22:50:17 2018 From: rusty at rustcorp.com.au (Rusty Russell) Date: Thu, 22 Nov 2018 09:20:17 +1030 Subject: [Lightning-dev] Base AMP In-Reply-To: References: <87a7maf7jh.fsf@gmail.com> <2GH68_8IDCnzwQUhLoqLVrLZSXXP5jZYM5GLwEsV0CMVL_qvZQpliKI1ng0dmCPA-dlWnFRUuWJV7OQMsoFd-kwDzCGmk27H4dqYV1RPJhc=@protonmail.com> <20181116154527.25adgchhfsz7aa43@erisian.com.au> <87va4rp91k.fsf@rustcorp.com.au> Message-ID: <87pnuyniza.fsf@rustcorp.com.au> ZmnSCPxj writes: > Good morning Rusty, > >> And do not play with `amount_to_forward`, as it's an important >> signal to the final node that the previous node did not offer less value >> for the HTLC than it was supposed to. (You could steal the top bit to >> signal partial payment if you really want to). > > If `incomplete_payment` flag is set, then final nodes must claim HTLCs only if: > > sum(incoming_htlc_amt) >= amt_to_pay No, because now you've lost assurance that this *particular* HTLC hasn't been skimmed by the previous node. ie. if I suspect a payment is using Base-AMP (and that's pretty clear if I see two identical payment_hashes), I can reduce the amount I offer in the outgoing HTLC to 1 satoshi: if it doesn't fail immediately, the next hop is the final destination. > Where `sum(incoming_htlc_amt)` is the total `incoming_htlc_amt` for all incoming HTLCs terminating at this final node with the same `payment_hash`. But it's unnecessary for the recipient to know the total amount I meant to pay; they just need to return the receipt once it exceeds the amount they want. Cheers, Rusty.