ECDH for spontaneous payments and offline vending machines



Summary:

In a conversation between Stepan and ZmnSCPxj, the issue of tips not being included in preimage generation is discussed. ZmnSCPxj suggests using a pre-shared common secret at installation time for preimage generation and passing a nonce as a channel ID. However, this method doesn't allow for tips above the invoice face value to be included. To accept tips up to 25% above the invoice face value, the iteration from `amount_to_forward` down to `0.8 * amount_to_forward` can be used to yield a preimage that matches the payment hash. This may require some grinding but can be computed within several blocks. The discussion also mentions how older versions of C-lightning implemented value randomization but newer versions have removed it. Finally, ZmnSCPxj suggests that an online node can try to generate the preimage for every HTLC offer with all known common secrets and the channel ID, and if it fails, try to route the payment as usual.


Updated on: 2023-06-02T18:39:44.849565+00:00