I have a question regarding LN which may deserve an own thread, but first (to avoid cluttering the Development forum) I ask it here.
Is it possible to use LN for offline payments?
The goal is to find a way for "pre-arranged" offline transactions in regions where internet connection is unstable/unreliable (people have asked me in the Spanish subforum with Venezuela in mind).
I had the following scheme in mind:
The situationAlice wants to sell Bob a good, or sell BTC for fiat, but the trade will be carried out in an area without or with unreliable internet access. With on-chain transactions, there is a possible technique using timelocks and a secret to release the amount in question, but it requires a confirmed transaction on the blockchain (see
here and for a similar example in another context,
this proposal for payments of digital goods). This is not ideal because transaction fees would be paid even if the trade isn't carried out.
LN-based solution?In a payment channel, we could arrange a "conditional payment" in the following way:
- Bob and Alice are connected by a payment channel.
- Bob (the buyer) sends Alice a signed commitment transaction, with a penalty like in a standard LN transaction, but a difference: the amount of the trade made conditional, requiring a secret to be spent (like in atomic swaps or the technique I just outlined). The transaction includes the hash of the secret.
- Bob and Alice meet in the place without Internet access.
-- If the trade takes place, Alice receives the secret from Bob, and she can verify it using the hash, with a simple electronic device not requiring internet access. She can now in theory release the funds including the amount of the trade with an on-chain transaction closing the channel. But instead, she tells the LN software the secret, and her balance is updated.
-- If the trade does not take place, Alice doesn't know the secret and thus cannot release the funds reserved for the trade, and thus she must use the last commitment transaction to close the channel, with the state of the channel before the trade.
I think with a simple payment channel this setup could work, if I've not overseen something. But is it also possible to route it via additional LN nodes? I don't know if the requirement of an additional secret would be possible to be "included" in the HTLCs necessary to route the payment through other LN nodes.
The solution would have a crucial advantage to the on-chain solution: it would not require any spendings of transaction fees, and in the case it's not carried out, not even LN fees would have to be paid.