Author: Brian Lockhart 2018-02-25 12:38:20
Published on: 2018-02-25T12:38:20+00:00
On February 24th, 2018, Laszlo Hanyecz attempted to make a real trade using the Bitcoin Lightning Network. Although he didn't know of any local pizza places near him that accepted bitcoin payments yet, his friend from London agreed to help him out by sub-contracting a local pizza shop for delivery. In this trade, his friend acted as a middleman that took on the risk of accepting lightning payments. Essentially, Laszlo paid bitcoin using the lightning network and his friend arranged for the pizza to be delivered to him. Laszlo wanted two pizzas and wanted to try to do it as close to atomically as possible. To avoid prepaying and ending up without pizza, they improvised and decided that Laszlo would need to provide the payment hash preimage to the delivery driver in order to claim his pizza. If he couldn't produce the preimage, proving that he paid, then the pizza would not be handed over and it would be destroyed.Laszlo agreed to open a channel and fund it with a sufficient amount for what they estimated the cost would end up being. After they agreed to these terms, his friend verified that he funded a channel on the blockchain, which shows that he at least has the money (bitcoin). He was given a bolt11 invoice which he decoded with the c-lightning cli to verify that everything was as agreed. When the pizza delivery arrived, Laszlo was asked "What is the preimage?" by the driver. At this point, he paid the invoice and received the preimage instantly in return. In the interest of keeping it simple, they agreed that the preimage would just be the first and last 4 characters of the hex string. Laszlo wrote this on a notepad and presented it to the driver who compared it to his own notepad, at which point he was given the pizza. It's probably not a good practice to share the preimage, but the delivery driver didn't have the full string, only enough to verify that he had it. Laszlo was able to retrieve the preimage for his invoice by using c-lightning.Laszlo concludes that for what he described here, there's probably no point in doing this instead of an on-chain transaction. The goal was just to play around with c-lightning and do something more than shuffling a few satoshi back and forth. Maybe eventually pizza shops will have their own lightning nodes and he can open channels to them directly.
Updated on: 2023-05-24T21:13:44.138610+00:00