As smart devices proliferate, they need a way to conduct low-cost, low-latency, and ubiquitous transactions without human intervention. Just as the smart phone of 10 years ago laid the foundation for major shifts like the gig economy and omnipresent social sharing, a service that allows smart devices to conduct such transactions will engender innovations in a few years that are impossible to predict today.
What it does
idIOT demonstrates an embodiment of the transaction concept. We chose to demonstrate a smart plug and smart outlet that can transact automatically and charge milli-cents for power delivered all logged to our own blockchain. Two Raspberry Pi's serve as the plug and outlet. They use bluetooth to identify the other device's proximity to initiate a transaction. Transactions are sent to the idIOT service (running on a notebook) to save on the associated wallets connected to the IBM supplied blockchain we're running.
There is an associated iOS app that allows one to add devices to their wallet. This is done by scanning for the device's bluetooth beacon, and when very close, allowing you to see info about the device and adding it to your wallet if you desire. The app shows devices you own, and you can select one to review its ledger of charges or credits saved on our blockchain.
How we built it
We set up 2 Raspberry Pi's from scratch and added code to implement the bluetooth and beacon services, as well as transaction negotiation and saving to the backend. We added an LED circuit to each Pi to demonstrate that the device has recognized a connection request.
We wrote an iOS app in Swift to implement the ability to scan devices, get info about them, and add them to our account. The app talks to the backend to get transaction information for your devices from the ledger.
The backend is written in Python on a notebook and integrates IBM's Hyperledger Fabric to implement our blockchain. There is also a Python server to implement our APIs.
Challenges we ran into
Getting the blockchain set up on the notebook and connecting it to our API took the entire hackathon duration. It was very hard to debug issues with very little visibility or feedback. Integrating it with Python was also hard as there were very few code examples.
Setting up all the bluetooth connectivity was also very time consuming and hard to debug, again because of little visibility into issues.
Accomplishments that we're proud of
Getting a full demo working!! As primarily a backend service, building enough to make a viable demo and adding an app and real devices was a lot to take on for 2 people.
What we learned
There's a lot of complexity and rough edges in getting your own blockchain running. We learned a lot about setting up bluetooth services on a Raspberry Pi, and we learned how to light an LED as well :-).
What's next for idIOT
A lot of ideation and investigation needs to go into what are the right market opportunities to bring this technology forward. Working with a large telecom organization would give us insights and access to resources to make idIOT a reality.