3
2
If I wanted to build a vending machine where one could buy a cola paying with bitcoin, is the following scenario the typical way to do it?
- Customer approaches the machine, and selects the product (whatever the method - button by the product image, or typing a corresponding numeric ID on a keypad)
- Machine generates bitcoin address for this transaction and displays on a screen the address' QR code and alphanumeric representation, and the amount to be paid in bitcoins.
- Customer uses their smartphone (or whatever device with bitcoin client) to scan the code, enters the amount and submits the transaction.
- Vending machine waits for the expected amount to arrive in the account and
- delivers the product if the amount is what was expected
- sends the money back if the amount is not what was expected
- timeouts if nothing arrives within 2 minutes
- sends the money back if there were technical issues in delivering the product
- To avoid necessity to store the private keys for every successful transaction, the vending machine sends the just collected amount to aggregation address and forgets the temporary address.
These are some really good points, thank you. I guess there could always be some rare situations when coins are collected but the product not given and/or coins are not collected but the product is taken, that is technically unavoidable. The goal would be to push that probability as low as possible. After all, also cash-based vending machines sometimes screw up, and there is some human-handled fallback procedure to solve that. – Passiday – 2014-08-29T20:49:51.880
3
For the description of a complete vending machine we built for research you might want to see http://www.tik.ee.ethz.ch/file/848064fa2e80f88a57aef43d7d5956c6/P2P2013_093.pdf
– cdecker – 2014-08-31T09:59:50.117If you have a camera on your vending machine, it could request a refund address in the case of technical issues which the customer could provide by showing a QR code with his address. – Murch – 2014-09-07T08:18:23.017