Bitcoin (BCH) Vending machine

In this post, we look at what it would take to create a Bitcoin (BCH) Vending machine.

In order to create a Bitcoin vending machine, we need to think about risk. This is not a desire for perfect security, but “good enough”. To start, we allow 0-conf. This is not as risky as many falsely tout. A 0-conf transaction, that is a transaction that has not been included into a block and confirmed by a miner is secure enough for most purposes.

Vending Machine wallet function

We will start with defining the wallet. This is much simpler than many in the industry want you to believe. If it was not simple, then, there are many who would not be able to bamboozle people into thinking Bitcoin is hard and making money from this false idea.

The first thing is that it is the Vending machine that should issue the payment request. This is a new address that is not stored on the machine, but on a remote server. The Vending machine would issue a payment request to the person wanting to have some goods.

  1. The Machine will send a Request for the person wanting goods to pay the amount that includes a mining fee.
  2. The machine wallet can check the path and transactions for all outputs referenced in the received (but yet unconfirmed) transaction input list. This would take under a second.
  3. As it is doing this, it can also communicate with a remote server that polls the network more widely. The remote server could send a stop notice using an encrypted channel that only the remote controller and the vending machine can decrypt. The vending machine can have a key even if it is not acting as a wallet itself.
  4. Vending Machine checks with trusted nodes for SPV. Basically, the vending machine operator will have a set of full nodes as a contract with an operator of full nodes. The SPV function is sufficient to allow the machine to operate with an extremely low risk of any loss. That is, a risk lower than the loss of cash coinage.

General Machine Concept

The concept of a Bitcoin vending machine is not any different to any other system, it can deliver Goods (i.e. drink cans) on validation of a Bitcoin payment.

It could even use an “Anyone can pay‘’ transaction or an open address in cases of an automated restaurant. That is, a system where bills can be split and paid and where the food is delivered and billed without needing other parties. You could for example receive food and order from the table.

An Anyone can pay transaction would also be of use for high value items where a deposit is returned if not completed (nLockTime and/or CLTV used to expire the invoice).

A DFA can be linked to the Payment address — on receipt of the full amount, the machine releases the goods.

More, on a reset function, if the goods are not delivered yet or even as a specialised “returns” machine that allows returns of unopened packages, where some money have been sent to the vending machine, we do not validate funds before the amount is sufficient (i.e. paid too little or otherwise). We can have a return system that returns funds to an original to sending address, mapped to the item purchased.

The miners Fee is added to the payment. The payment address is issued by the machine, so there is no issue. It would be a single use address, so, again, there is no way for the system to be scammed with an “attack” based on knowing what the machine would likely present. If you do not pay the full amount, including the miner’s fee to ensure that it is accepted in the next block, then you simply do not get the item.

That is, if you do not send enough, you do not have the item delivered. The machine can watch and monitor the transaction and if the amount is not sufficient to pay for both the goods and the miners fee, then, the transaction is not sent. The time to send a transaction can be less than the time required to deliver the goods.

With an SPV wallet on the machine, this is even more secure. The attacker is always after the machine as the machine chooses when it sends. The vending machine can select when it sends a TX and it only needs to monitor the users address to see if these have been seen. It would know this in well under 2 seconds.

No system is perfect and this is not even a valid target, it just needs to be good enough and economically viable.

Never miss a story from Craig Wright (Bitcoin SV is the original Bitcoin)