ECDH for spontaneous payments and offline vending machines



Summary:

Two interesting ideas have been presented in the lightning network community recently. The first idea involves being able to make spontaneous lightning payments only with the knowledge of a node id, similar to a bitcoin address for lightning. This is accomplished by calculating a common secret with ECDH and using it as a payment hash for the htlc. Christian Decker has implemented this feature as a plugin for c-lightning. The second idea involves generating invoices for offline vending machines with arbitrary amounts without exposing node secrets to it. This is done by having the vending machine generate an ephemeral key and corresponding ephemeral node id and then generating an invoice signed with this key. The preimage is calculated from the amount encoded in the short channel id and the secret x. This construction allows for generating invoices on a vending machine or web server without ever talking to the node itself. It is suggested that a plugin/add-on with such functionality could be interesting.


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