블록체인으로 만드는 안전한 IoT
- * - Check existence and Register device
- Application - Upload firmware file, with device names to update2
- Server
- Write random file key in blockchain
- Save file ID, file key, file hash and download URL to DB
- Update document with transaction hash when the receipt returns
- Provide API with update status(with transaction hash and file ID) or emit some event to device
- Device - check for updates
- Use the transaction hash to get the file key from the blockchain
- Send found key with the file ID to server and receive the download URL
- Download the firmware from the recieved URL
- Device - validation of downloaded firmware
- Calculate the MD5 sum of the file and send validation request to server
- Server compares the hash and (if correct) mark the upload as complete, respond to client
- Device updates itself if the response is valid
{
"_id": "string",
"name": "string",
"wallet": "string",
"update": "string"
}
{
"_id": "string",
"route": "string",
"key": "string",
"hash": "string",
"txHash": "string"
}
{
"_id": "string",
"timestamp": 0,
"type": "string",
"json": {}
}