I'm considering building a Lightning Network vending machine that is offline but has the capability to create LN invoices and verify payments.

As an example the scheme has:

  • One offline vending machine.
  • One online node to validate payments.
  • One user (online with a cellphone).

For that there must be:

  • A way for the vending machine to provide valid invoices that can be paid to the online node.
  • A way for the user to communicate a prof-of-payment to the vending machine.

Is this currently viable? Is this something that can/should be standardized so every wallet can implement it?

1 Answer 1


Stepan Snigirev had basically provided an explanation how to do the tricky part described at https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-June/002009.html

The idea is that the vending machine creates an invoice with a routing hint that goes through the online node and the online node can construct the preimage from the onion that will be send.

Another way would be to have a deterministic way of preimage generation as explained in this video: https://youtu.be/bihYeAeNi0g - which was already inspired by Stepan but is not as elegant as his solution.

Regarding the proof of payment the phone would just display a qr code of the preimage which a vending machine could scan

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.