From snigirev.stepan at gmail.com Tue Jun 11 07:58:43 2019 From: snigirev.stepan at gmail.com (Stepan Snigirev) Date: Tue, 11 Jun 2019 09:58:43 +0200 Subject: [Lightning-dev] ECDH for spontaneous payments and offline vending machines In-Reply-To: References: Message-ID: Hi ZmnSCPxj, > The online node in your proposal is unable to extract `K`, a the next-node-ID is never transmitted. Then currently for the vending machines we can use a pre-shared common secret set up at installation time (may be unique for every machine) and use it for preimage generation: preimage = hmac(common_secret, amount | nonce) We can pass this nonce as a channel id. This is exactly what we did for the hackathon project. Such invoice has to be paid with exact amount, there is no way to include a tip - otherwise preimage generation will fail. Alternatively, for donation payments we can drop amount from preimage generation. 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. A set of common secrets also helps to determine the source of the payment, in order to avoid bruteforce we can use first byte (or varint) of channel id as a secret id (as soon as we have enough space left for nonce) Stepan. -------------- next part -------------- An HTML attachment was scrubbed... URL: