ECDH for spontaneous payments and offline vending machines



Summary:

The proposal for online node faced issues with the inability to extract `K` as the next-node-ID was never transmitted. For vending machines, a pre-shared common secret can be used at installation time and can be unique to every machine. This common secret can be used for preimage generation where the nonce can be passed as a channel ID. Such an invoice has to be paid with an exact amount and does not allow tipping, otherwise, preimage generation will fail. For donation payments, the amount can be dropped from the preimage generation process. To route payment as usual, the online node can try to generate the preimage for every htlc offer using all known common secrets and the channel ID. If it fails, the payment can still be routed normally. A set of common secrets can also help determine the source of payment. To avoid brute force, the first byte or varint of the channel ID can be used as a secret ID, provided there is enough space left for the nonce.


Updated on: 2023-06-02T18:40:27.226329+00:00