Pizza for (lightning) bitcoins? [combined summary]



Individual post summaries: Click here to read the original discussion on the lightning-dev mailing list

Published on: 2018-02-25T23:27:14+00:00


Summary:

A Lightning Network user named Laszlo Hanyecz successfully purchased two pizzas using Bitcoin's second layer scaling solution. He paid using the Lightning network and had the pizza delivered to him by a local shop after sub-contracting it out from a friend in London who acted as an intermediary. In order to claim his pizza, he provided the payment hash preimage to the delivery driver. The preimage was agreed upon beforehand to be the first and last four characters of the hex string. The payment was made with a direct channel with the pizza provider, with the hop from the provider to the buyer being the 546 satoshi (so that the provider received the total price of the pizza as the "routing fee"). The buyer informed the pizza provider of the hash of the preimage which the provider could check with their node exists as an incoming HTLC and an outgoing HTLC, with the difference being the pizza price. Furthermore, the buyer set things up so that the HTLC to them expired within 3 blocks, meaning that the pizza provider had to provide the pizza within three blocks or it was free.Another user named Robert Olsson had suggested adding an escrow functionality to a Lightning Network payment. In response, ZmnSCPxj laid out a method involving a direct channel with the pizza provider and routing the pizza price plus 546 satoshi to the pizza provider, with a hop of 546 satoshi back to the user as a "routing fee". The user then informs the pizza provider of the hash of the preimage, which the provider can check with their node. The user then sets up the payment so that it expires in three blocks, meaning the pizza must be delivered within that time frame or it is free. When the pizza is delivered, the user provides the preimage to the provider via standard LN protocol, and when the provider confirms payment, the pizza is released.Laszlo Hanyecz successfully completed a Lightning Network trade using bitcoin to purchase pizza, demonstrating how everyday transactions could work on the network. He improvised by agreeing with his friend in London that he would need to provide the payment hash preimage to the delivery driver to claim his pizza. To do this, he opened a channel and funded it with a sufficient amount for what they estimated the cost would end up being. After verifying that he funded the channel on the blockchain, he received a bolt11 invoice which he decoded with the c-lightning cli. When the pizza delivery arrived, Laszlo paid the invoice and instantly received the preimage in return. He presented the first and last 4 characters of the hex string to the driver, who compared it to his own notepad before handing over the pizza. Laszlo admits that there may not be much point to using the Lightning Network for such a small purchase instead of an on-chain transaction, but he wanted to play around with c-lightning and demonstrate its capabilities.On February 25, 2018, Laszlo Hanyecz, famous for purchasing two pizzas with Bitcoin back in 2010, tested the Lightning Network by ordering pizza from a London-based friend and arranging for it to be delivered. In order to execute the trade as close to atomically as possible, they improvised by having Hanyecz produce 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 would instead be destroyed. The preimage was provided only after Hanyecz paid the invoice, at which point he instantly received the preimage in return. They agreed that the preimage would just be the first and last four characters of the hex string. To receive the preimage, Hanyecz opened a channel and funded it with a sufficient amount for what they estimated the cost would end up being. After this point, Hanyecz had committed his bitcoins to the channel but had not yet risked them. It is important to note that the pizza was scheduled to be destroyed if not paid by Hanyecz, which made him sad. Instead, he believed that the pizza should have been delivered to his friend. He noted that though his friend acted as a middleman, taking on some entrepreneurial risk and prepaying his sub-contractor to prepare and deliver the pizza, it demonstrated the basic premise of how this works for everyday transactions. It could just as well have been the pizza shop accepting payment directly with their own Lightning node. Hanyecz wanted to see if there was a point to using the Lightning Network instead of an on-chain transaction, and while there wasn't much difference for what he described here, he enjoyed playing around with c-lightning and doing something more than shuffling a few satoshi back and forth.Laszlo Hanyecz attempted to make a real trade using the Bitcoin Lightning Network.


Updated on: 2023-07-31T19:48:03.809810+00:00