October 4, 20184min508

Hacker Zaps Coca-Cola VM to Accept Bitcoin via Lightning Network

A Brazillian computer programmer built a Coca-Cola vending machine that accepts bitcoin payments over the Lightning Network (LN).

Bitcoin-Powered Coke Vending Machine

Ricardo Reis described his feat in a Medium post on Oct. 2, in which he also mentioned the accessories that were employed to create the bitcoin-enabled Coke portal. In addition to applied programming techniques and vending machine hardware that could take instructions from the user-interface, Reis also used the Lightning Network to enable faster and cheaper bitcoin transactions.

Unlike a normal bitcoin transaction, which gets recorded and verified on a public blockchain, the LN adds a secondary layer to create a payment channel that does not require transactions to be confirmed by the main blockchain until the users close the channel. Thus, users can make a series of the transactions without needing miners’ confirmation. Once they close the payment channel on the Lightning network, its cumulative output gets recorded and verified on the main bitcoin ledger.

Cryptocurrency developers Joseph Poon and Thaddeus Dryja had introduced Lightning Network as a solution to bitcoin’s slow on-chain transactions that were supposedly hampering its growth among merchants. Reis’ efforts simply illustrated the process with a real-world example as simple as a Coca-Cola vending machine.

How the Coke Vending Machine Works

Reis makes a communicative bridge between the Coke machine’s hardware and software tools. On the hardware side, there is a Raspberry Pi 3 Model B, a Display 7″ Official Touch Screen Para Raspberry Pi, a Water pump RS 385, and a Bridge H L298N. On the software and web solutions’ side, Reis employs Linux Raspbian in Raspberry Pi, Apache Server + PHP in Raspberry Pi, Wiring Pi (interface GPIO), BTCPAY as checkout solution, PUSHER as a web-socket solution, and HTML, PHP, Javascript e jQuery as applied programming languages.

A simpler front-end makes up for a complex backend. The Coke vending machine features a simple interface, with a bitcoin wallet QR code of the receiver. People looking to purchase a beverage must scan the QR via their bitcoin wallet apps, enter the amount, and send it. The machine sends the payment confirmation upon receiving the funds, which should not take more than a minute, and Coke starts to pour in the glass underneath the device.

“In BTCPAY I create the invoice (payment button), so it generates a Lightning Network QR code for payment,” Reis wrote. “I also set up a return URL (notification.php), which is the destination BTCPAY will inform when a purchase order has any changes, such as payment receipt.”


About us

We are the new economy news hub. 2100NEWS is the professional index, data, and tools provider in the digital asset space, offering Crypto Market Intelligence, providing the perspective you can trust and equipping you with information edge you need to stay ahead. (Real-time data of token issuers and news, analysis and commentary from community.) We are very excited to contribute to the evolution of the industry and build an ecosystem around our offering (the institutional-grade data infrastructure required to enable institutional investments in digital assets). We want our contributions (Contents and Tools on 2100NEWS.com) to be useful for helping investors.


CONTACT US

CALL US ANYTIME



Latest posts



Newsletter


    • ethereumEthereum (ETH) $ 3,575.66 2.06%
    • litecoinLitecoin (LTC) $ 94.46 0.07%