This document discusses using AWS IoT services like Lambda and SQS to power a blockchain project that generates digital certificates of attendance.
The project involves using an AWS IoT button to scan tickets, pressing the button as input, and generating immutable certificates on the blockchain. AWS IoT, Lambda, and SQS are used to connect the button press to writing on the blockchain.
The document provides an overview of blockchain technology and describes how AWS IoT, MQTT, Lambda, SQS, and IoT rules can be configured to connect an IoT button press to writing a transaction on the blockchain to generate certificates.
WordPress Websites for Engineers: Elevate Your Brand
AWS IoT+ Lambda to power a blockchain project
1. June 2016
AWS IoT+ Lambda to
power a blockchain project
by Johann Romefort
2. About Johann
• Tech Evangelist @Stylight
• 15+ years in tech
• In Germany for 2 years
• 7 years in San Francisco
doing startups
• Organizer of many meetups
2
3. Agenda
3
• Overview of the project & constraints
• Configure your AWS IoT Button
• Introduction to AWS IoT
• The MQTT Client
• Connecting it to Lambda
5. Overview of the project
5
• Creation of a digital certificate of attendance on the
blockchain
• Minimal UI and input mechanism
• Scan ticket, Press button and done!
8. Project Constraints
8
• Should run on local computer with no access possible from
outside
• No access to keyboard or touch screen
• Certificate should be easy to verify, impossible to fake,
permanent
• Serverless
9. The Live Setup
• MacBook Pro running
local blockchain node
• AWS IoT button for user
input
10. What is Blockchain?
• Blockchain is the technology behind Bitcoin
• Bitcoin was created in 2008 by Satoshi Nakamoto
• Blockchain is literally a chain of blocks.
• A blockchain is immutable – no one can change
the data once it’s been written on the chain.
12. What can I do with an immutable
distributed ledger?
• Cryptocurrencies
• Property titles
• Notarised acts
• Digital Certificates
• And more…
13. Why AWS IoT, Button and Lambda +
SQS?
13
• Simpler input command / device one can think about
• Very simple setup
• Communication with SQS allows for a simple client
running inside a firewall and subscribing to a queue
topic in the cloud
14. AWS IoT Button
• Programmable version of the
Dash Button
• Easy Wifi configuration
• Connect directly to AWS IoT
• Interactions:
• Normal press
• Long press
• Double press
14
17. Introduction to AWS IoT
17
• Serverless way to connect your IoT devices and start
processing data
• Supports MQTT, HTTP
• Secure - communication through use of X.509 Certificates
• Can connect huge amount of sensors, store and process the
data in real-time
20. What’s a Thing?
20
• An IoT Device
• Eg: Intel Edison, Arduino Yun + sensors / actuators
• In our case an AWS IoT button
21. What’s the Message Broker?
21
• Used to securely exchange messages following the publish-
subscribe pattern, between IoT applications and Things.
• MQTT to publish/subscribe
• HTTP to publish
22. What’s the Rule Engine?
22
• Used to process messages and talk to other
AWS components like Lambda, DynamoDB,
etc
• SQL-Based language to select specific
messages to be passed along.
23. What are Thing Shadows?
23
• Devices sometimes go offline
• A Thing Shadow provide a persistent
representation of a Thing
• A Thing can sync its state to its Thing
Shadow
25. Let’s look at the MQTT Client
25
• Message Queue Telemetry
Transport
• A lightweight publish-subscribe
messaging protocol for small
sensors and mobile devices,
optimized for high-latency or
unreliable networks
26. MQTT Client
26
• Generate ClientID
• Subscribe to topic iotbutton/+
• Press the button
• Watch event flowing
27. Don’t have a AWS IoT Button?
27
• Just use the MQTT Client to simulate a
payload
28. What do we want to do?
28
• Use the button as input device to validate the transaction
on the blockchain - Writing the transaction is a permanent
operation, certificate will be available forever.
• Send a SQS message to a topic our client is listening to.