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.
_______________________________________________
Lightning-dev mailing list
Lightning-dev@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev

Reply via email to