Author: ZmnSCPxj 2019-06-10 06:04:08
Published on: 2019-06-10T06:04:08+00:00
The vending machine generates an ephemeral key 'k' and a corresponding ephemeral node id 'K', which is used to create an invoice signed with the key. The routing information in the payment goes through their online node 'N'. For preimage, the machine uses hmac-sha256(x, amount), where x is a secret key from ECDH(K, N) - (x-coordinate of k * N). To ensure the node can calculate the preimage even if the user pays a tip increasing the amount of the htlc, the amount is put into the 8-byte short channel id in the routing information. The vending machine generates a new ephemeral key 'k' each time it needs a new invoice.
Updated on: 2023-06-02T18:39:10.489608+00:00