In this talk, I'm presenting how to create a simple prototype of supply chain management system built on the blockchain to enable quick traceability.
We'll use a NodeMCU device (ESP8266), a MFRC522 RFID reader, MQTT protocol on Azure, BigchainDB (IPDB with websockets), and VueJS (with vuex, vue-router and elementUI) for the user interface.
2. I’m Johann
● Tech Evangelist @Stylight
● 7 years in San Francisco
● Since 3 years in Munich
● Organize many meetups..
● Organizer of DAHO.AM conference
● Twitter: @romefort
● johann.romefort@stylight.com
4. GOAL
Building a simple system capable
of tracking an asset on a supply
chain with immutable traceability
5. Why Blockchain for
Supply Chain
Management?
● Distributed Ledger
● Guarantees Immutability
● Publicly available
● Enable product traceability at each
step of the supply chain
● Tracking of important information:
○ Temperature
○ Quality of goods
○ Shipment and delivery dates
○ Safety certifications of facilities.
6. Application
examples
● Food supply chain : Fraud up to $40B / year, globally
○ Traceability at each step can allow fast tracking of food
poisoning
○ Walmart, Nestlé, Unliver...are deploying prototypes on
the blockchain (using Hyperledger)
● Traceability of luxury goods from one owner to the
next
● Container transportation management
● Traceability of diamonds
● Traceability in Pharma industry (10% to 30% of drugs
in dev. Countries are fake.
10. Caveats
● RFID can be cloned
● Prototype built in 48h with disregard for
security
● Some things are hardcoded ;-)
● Want industrial secure system?
○ https://www.riddleandcode.com/
11. ESP8266 / NodeMCU
● Cheap ($2)
● WIFI on board
● Low-power
● Programmable on Arduino
● On TECHFEST:
○ You need to register your mac address
to access the wifi network
○ Serial.println(WiFi.macAddress());
13. MFRC522
● Low Cost Scanner ($1)
● Tags are cheap and come in various
forms: Cards, fobs, stickers
● Stickers are small and can easily added
to any product
14. Using MFRC522 on NodeMCU
MFRC522 Pins NodeMCU pins
SDA D8
SCK D5
MOSI D7
MISO D6
IRQ -
GND GND
RST D3
3.3V 3.3V
● Connect pins =>
● Add the MFRC522
○ Sketch > Include Libraries > Manage Libraries
○ Search MFRC522
○ Install
● Verify working setup
○ File > Example > MFRC522 > DumpInfo
○ #define RST_PIN D3
#define SS_PIN D8
○ Scan a tag and verify you get its UID
21. Connecting to Azure IoT Hub
5/ Verify that messages are going through
$ iothub-explorer monitor-events *your_registered_device* --login "*your_connection_string"
22. What do we
have so far?
● An IoT device capable of scanning
code, connecting to WIFI and
communicating with the outside
world through MQTT
23. What are we
missing?
Receiving MQTT
messages
Creating
transactions on
BigchainDB
Seeing transaction
on a user-friendly UI