Cryptobartender is participant of EOSIO Virtual Hackathon: Coding for Change
During COVID-19 times social distancing became a very important part of life. The negative economical impact of the coronavirus period is especially faced by small businesses. The owners and personnel working in cafes, restaurants, shops, hotels, and related industries suffer losses, lose their jobs.
Even after the quarantine, social distancing will remain a practice many people will continue following. Taking to account all the social changes, with the help of EOS blockchain and eosio software, we would like to present a solution – Cryptobartender.
Cryptobartender is a device, which helps to buy wine (whiskey, water, any type of liquid is possible) by paying with EOS or EOS-based tokens, eliminating the need for personal contact.
In 2019 there was a crypto bar Knygarium in the center of Kyiv (Ukraine). Cryptobartender of the first version was installed there which served a homemade wine. Knygarium had its own currency KNYGA token (created on top of EOS blockchain) which was distributed as loyalty rewards and had a stable exchange rate to the national currency.
One of the goals of Knygarium was the popularization of cryptocurrencies in general and EOS in particular, so all interested frequent clients had an EOS mobile wallet installed and used the tokens for receiving rewards and paying for drinks, food, etc.
Cryptobartender accepted EOS and KNYGA tokens (as not everyone had used EOS before, using tokens was the easier way). Payment was usually sent via scanning QR-code and `Cryptobartender poured a glass of wine. Moreover, Cryptobartender distributed the profits among bar owners, wine producer, and wine distributor (as EOS transactions worked fast, the distribution happened instantly). Even though homemade wine served by Cryptobartender costed more than other wine, it was a very popular service of Knygarium visitors.
Especially for the EOS Hackathon, Cryptobartender was newly written taking to account all eosio updates, and deployed on Jungle testnet. The payments are accepted in EOS and EOS-based tokens. We think that business which might use Cryptobartender might want to create their own token so this model will work well, as it will be easy to set up additional token or a number of tokens, as well as prices, percentage of distribution. As the digital economy grows, this project might help to improve the supply chain and transaction process among all the participants involved.
This chart illustrates how the EOS smartcontract is used to run Cryptobartender with the help of Amazon Web Services. The heart of Cryptobartender is microprocessor ESP8266 developed by Espressif Systems. C programming language was used to program this microchip. It’s worth noting that such microchips are very low-cost (less than $1) which might be a strong point for potential mass-production in future. With the help of MQTT broker, Cryptobartender connects to the Pyhon module, which runs on AWS. Cryptobartender communicates with device manager, which via the Communicator exchanges data with EOS crypto module. The latter communicates via API Endpoint with EOS blockchain (eosio.token smartcontract).
Crytpobartender’s transactions details
The account of Cryptobartender is set up to be wealthysnake (https://jungle.bloks.io/account/wealthysnake)
The price of 1 portion of wine is designed to be 0.5639 EOS or 50 JUNGLE tokens. The process of income distribution is set up in the following way: 40% goes to wine producer (in our case it is account wealthytiger) 40% goes to bar owner (in our case it is account cryptotexty1) 20% goes to wine distributor (in our case it is account destitutecat)
The number of participants and their share in income can be shaped according to the needs. For example, in future wine producer and distributor might be one person, or the bar owners/managers can have several accounts. Also in future we can foresee more advanced payment management options (i.e. it will be possible to automatically convert EOS or EOS-based into another currency, tax management can also be applied, etc.)
The easiest way to send payment is via QR-code with the help of one of the available EOS wallets. When the payment of the amount 0.5639 EOS is sent to wealthysnake, we see that wealthytiger receives 0.2255 EOS (40% of total amount), cryptotexty1 receives 0.2255 EOS (40% of total amount), and destitutecat receives 0.1127 EOS (20% of total amount). Cryptobartender sends back 0.0001 EOS to customers with a memo (“Thank you! Have a nice day! :)”). We think that the memo field might become a powerful marketing tool for cafe owners or those who will use Cryptobartender. Also, it will be possible to setup cashback in native tokens of venue.
In case when a bigger amount than 0.5639 EOS is sent, Cryptobartender sends the rest to the customer indicating “Too much money sent. The price is 0.5639 EOS” (Of course the memo text can be changed). And if Cryptobarnder receives payment when it’s turned off – the full amount is returned to the customer.
Cryptobartender v. 0.0.2
Cryptobartender v. 0.0.2 was newly written according to all the changes in EOSIO 2.0 Old code is also available on github. The previous version was in C-style with 1 script, the new version is written in a block way, separated into 3 blocks, which makes scaling easy achievable. The new version deployed on AWS instance gives the possibility to control multiple physical devices with an unlimited number of accounts with different permissions and business agreements. The new version contains github docker-compose settings, which allows to setup and deploy numerous servers in a fast way.
For one month (till the end of June 2020), Cryptobartender will be running live and available for testing.
You can send transactions to wealthysnake account on the Jungle testnet and observe the transaction results on the blockchain (you can check this account https://jungle.bloks.io/account/wealthysnake or your account, or particular transaction IDs)
Also you will be able to see the video of Cryptobartender in live mode via this link http://korotach.com:8080
The vision of the future implementation perspectives
In the new version, there is an idea to rewrite microcontroller part, to allow turning off when there are no customers nearby, and therefore achieve better energy efficiency. Also, it is planned to make it possible to control several devices with 1 microcontroller.
The prototype of Cryptobartender can be used in multiple places: HORECA (hotels, restaurants, cafe) first of all, but also in public places, airports, bus and train stations, and just across the city. Tokenomics can be easily shaped to the benefit or certain conditions (i.e. in some places Cryptobartender can provide water for free, or even antiseptics). An interesting use-case might be when some individual or company wants to sponsor drinks event, in this case, it’s possible to send the amount to 1 account, and use it for payments. Cryptobartender provides full transparency, as all the transactions are visible on the blockchain, therefore all the parties involved can track their income in the real-time mode. Cryptobartender won’t put out the real bartenders from the job, as this job also includes social aspect like communication, it only will improve the process of drinks distribution. The project is an example of IoT and blockchain combination and it can grow as the whole EOS ecosystem grows.