Edge Computing Integrated with Blockchain
The exponential growth of IoT devices is giving rise to newer and more complex applications that require real-time results. Traditional cloud architecture involves IoT devices sending data to sometimes distant servers in a central repository, introducing latency and sometimes not meeting these applications’ quality-of-service requirements. Edge computing helps solve this issue by bringing compute, storage and analytics closer to users and the devices that generate the data. As a result, data travels over shorter distances, which can result in lower latency and faster response times.
However, the large global footprint of edge servers raises security concerns such as access control, privacy, authentication and intrusion detection among others, which must be addressed. Blockchain, with its distributed, decentralized, immutable, shared ledger of transactions has the potential to solve the security and privacy issues associated with edge computing.
IoT devices are also vulnerable to cyberattacks. Millions of connected devices generate massive amounts of data, which are then transmitted over the internet. Blockchain’s consensus algorithms validate every transaction, ensure that the data transmitted by IoT devices is verified and valid, and has not been tampered with during transit.
However, the mining and consensus process is resource-intensive, and IoT devices, being resource-constrained, are ill-equipped to handle this computational overload. Handing over processing to the cloud is not an option — latency is an obvious reason. Edge computing is one solution for offloading computationally intensive tasks from IoT nodes.
Together with blockchain, edge computing looks to be part of a perfect combination for building a secure, scalable and distributed platform for IoT.
While blockchain helps solve security issues inherent with edge computing and IoT, edge computing provides the low-latency, distributed, scalable network that IoT applications rely on.
A Closer Look at Blockchain
In a blockchain, data is stored in groups or chunks called blocks. When a block becomes filled, it is appended to the previous block. Blockchain is an immutable database and makes an irreversible timeline of data. Data written to a block becomes part of this timeline and cannot be modified. Each node has a full record of the data stored on the blockchain since its inception. All blocks store their own hash, the hash of the preceding block and its timestamp. If an attacker were to tamper with the blockchain in some way or try to alter the information in his own node, its hash changes, which results in marking the attacker’s node as illegitimate.
For the attacker to succeed, he would need to alter the information on 51% of the nodes such that the information on them matched his. Considering the ever-growing size of blockchain networks, this would be an impossible task.
Consensus protocols like proof of work (POW) validate every transaction. In POW, miners compete to solve an arbitrary mathematical puzzle that involves computing hash functions, and the one who wins is allowed to add a new block to the chain. POW is computationally expensive and consumes large amounts of electricity as more miners join the network. Hashing together with asymmetric-key cryptography and smart contracts ensures the reliability and immutability of data stored on the blockchain. A smart contract is a piece of code that runs on a blockchain when certain conditions are met. It is used to carry out an agreement without the use of an intermediary or the loss of time.
A smart contract in IoT, for example, could be used to distribute secure software updates to IoT devices. With that background in place, let’s take a look at how blockchain and edge computing can be integrated for real-world applications.
IoT architecture can be divided into three layers: an IoT device layer, edge layer and a cloud layer. Blockchain can be integrated at each of these layers.
The IoT Device Layer
Each edge server at this layer, together with the devices connected to it, form their own local network. The local edge server manages and registers an IoT device after the device trusts the CA (certificate authority) certificate presented to it. Communication between IoT devices, between devices and the edge server, or between edge servers are recorded as transactions and stored on the edge server blockchain. Each edge server is a blockchain manager responsible for the creation, verification and storage of transactions.
Interdevice communication at this layer can be divided into two categories. Device-to-device communication in the same local network and device-to-device communication in different local networks. In the first case, IoT devices forward source requests to their manager, the edge server. The manager authenticates the request, then broadcasts it to the whole network. In the second case, transactions between IoT devices are authenticated by their respective edge manager.
All transactions are mined and stored in blocks on the edge servers. Edge servers process real-time requests and store data in their blockchain. Data that is not time-sensitive and that needs further aggregation or analysis is sent to the cloud layer.
The Edge Layer
Edge servers that maintain the edge blockchain reside at this layer. IoT devices lack the computational power, memory and storage required for the mining and consensus process. The edge layer offloads this computational overhead from IoT devices and stores all transactions between IoT devices, and between IoT devices and the edge servers on the blockchain.
Blockchain’s cryptography services secure the transactions made by IoT devices by encrypting them and attaching their digital signatures to each transaction. Edge servers working as blockchain managers use consensus algorithms like proof of work or proof of storage to validate and write transactions into a block, after which they broadcast the block to other edge servers for verification.
The Cloud Layer
The layer consists of cloud servers that have their own decentralized blockchain. It stores data that is not latency-sensitive and that might require further in-depth analysis. For example, sensor data can be combined with data from other sources for more detailed insights.
A Real-Life Application of Blockchain and Edge Computing
Though blockchain is most commonly associated with Bitcoin and Ethereum, it can be used for much more than cryptocurrency applications. Other industries that benefit from blockchain’s security features and decentralized nature include healthcare, industrial IoT, smart cities and smart home automation.
Let’s take a quick look at how edge computing and blockchain enhance the security of patient medical records in a hospital setting. Wearables retrieve health data from a patient and store it in an electronic medical card. This data can then be encrypted and sent to edge servers. Edge servers store this data on the edge blockchain for improved data security and confidentiality.
Patients and authorized hospital staff can access the data from the edge much faster than if they were to access the data from the cloud. Edge servers send any data that is not required for real-time analysis to the cloud.
Edge computing, integrated with blockchain, helps allow us to build a distributed and secure edge computing architecture that can promote the safety and integrity of IoT data throughout its lifetime. As the number of applications and their need for secure, real-time data access grows, so will the adoption of blockchain-based edge computing use cases.