Meet VendEth — The world’s first blockchain-powered vending machine.
Who built it, how they did it, and why it is way more than just a vending machine that accepts crypto.
At first blush, you might not think it’s much to look at. You might even think that it’s a trivial or silly thing, a la “we were promised flying cars but got 140 characters.”
Though if that is your thinking, prepare to be wrong.
Alexandre Trottier, Luis Dominguez, and Clément Lakhal — a trio of formidable, brilliant warrior-poets.
On the surface, VendEth enables users to order an item from a vending machine using a dapp. As described on the hack team’s devpost:
VendETH is pretty simple; just go up to the machine, select your product, pay for it with a mobile wallet, trustwallet, torus, or squarelink, the machine dispenses it, and boom, you have your food.
Under the hood, there are four facets to VendEth’s architecture.
As described by the team:
The smart contracts are written in Solidity, written in a Golang environment for testing and deployment.
React is used to power the UI for sending transactions and purchasing products. Using this, users can select products, scan their mobile wallets, and enjoy an overall smooth experience.
The vending machine’s coils are powered by servo engines, connected to a servo drive (more specifically, the Adafruit 16-Channel 12-bit PWM/Servo Driver — I2C interface — PCA9685). The board itself is connected to an Arduino Mega board, which is in turn controlled by a Raspberry Pi 4 running a Node script.
Coinbase Commerce Server
In order to integrate Coinbase Commerce, we have the front-end generating “Charge” API calls to actually charge the user, and allow them to pay via all of the cryptocurrency payment methods the service provides. Since the service communicates events by sending data to a public endpoint (e.g. a server owned by us), we set up an Express server on a VPS. SSL is required for this endpoint, so we purchased a domain (cryptovendingmachine.xyz) and added an SSL certificate via Let’s Encrypt and their helpful tool, certbot. On a successful charge event, the server communicates with the Vending Machine smart contract and confirms the purchase.
Soldering in the dark? Check.
This is truly where the hack went from good to great. No doubt more than one great adventurer has extolled the virtue of courage. My favorite happens to be from an animated film about rodents — you know the one I’m talking about. (If not, Google rat and cook . Yes— that one.)
You must be imaginative, strong-hearted. You must try things that may not work, and you must not let anyone define your limits because of where you come from. Your only limit is your soul. What I say is true—anyone can cook… but only the fearless can be great.
Try to envision a hypothetical spectrum of fearful to fearless —imagine you encounter someone soldering together components, in the middle of the night, in a dark parking lot. Fearful? Or fearless?
This quote from our stalwart hackers is telling:
It turns out that soldering inside a building is actually not such a good idea, due to smoke alarms. It also turns out that soldering outside in a shady corner in windy weather conditions and light drizzling is also not such a good idea. Weighing the options, we thought that the best way to legally challenge our sense of adventure was through the second one. We ended up needing to use tall cardboard as a windshield, a loosely put-together cardboard box to serve as a table for soldering the servo drive’s pins, and smart phone lighting to prevent our brave soldier from burning himself and all of us in the process.
If that’s not fearless, I don’t know what is.
What makes this idea special isn’t the fact that it worked as described. Nor was it the fact that it took such a gargantuan effort — not just in creativity but in logistics to accomplish — there were many hack projects (most, if not all in fact) that fit that description.
What’s really special about this project is that it is capable of being adapted to do so much more — because at its core, what this project does is trigger machines to interact with the real world based on events that occur on the blockchain. If you think about it for more than a few minutes you can come up with a vast array of possibilities — and never come close to listing all the possibilities exhaustively.
That is the power of the technology underlying VendEth. A decentralized interface to the internet of things. Deployable to mainnet today on Ethereum.