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.