Introduction
The rapid expansion of the Internet of Things (IoT) presents significant challenges for device monitoring. Traditional centralized architectures often suffer from security vulnerabilities, such as single points of failure, and privacy concerns regarding data ownership. While blockchain technology offers a decentralized alternative, its inherent "scalability trilemma"—the difficulty of balancing security, decentralization, and throughput—makes it unsuitable for direct interaction with resource-constrained IoT sensors. This paper proposes a decentralized, scalable architecture that integrates Ethereum, Fog computing, and the InterPlanetary File System (IPFS) to overcome these limitations.
The Four-Layered Architecture
To bridge the gap between tiny sensors and the blockchain, the proposed system utilizes a four-layered approach designed to offload heavy computation from the edge to more capable nodes:
- Physical Layer: Comprises the heterogeneous IoT devices and sensors.
- Gateway Layer: Handles initial data collection and preprocessing via local gateways.
- Service Management (Fog) Layer: Acts as the system's core, utilizing Aggregator nodes for data polling and Sink nodes for blockchain communication and data batching.
- Application Layer: Provides a web-based user interface (ReactJs/Metamask) for defining monitoring policies and visualizing device status.
Decentralized Data Management
A key innovation of this architecture is the "Hash-and-Batch" strategy. Storing massive amounts of IoT data directly on the Ethereum blockchain is cost-prohibitive and technically infeasible for high-frequency sensors. Instead, the system batches sensor readings (e.g., every hour) and uploads them to IPFS. Only the resulting cryptographic hash is recorded on the blockchain via smart contracts.
The system employs two primary smart contracts: the Monitoring Policies Contract (MPC), which stores user-defined thresholds (e.g., temperature limits), and the Device Profile Contract (DPC), which maintains device metadata and the history of IPFS hashes. This ensures an immutable audit trail while maintaining negligible operational costs.
Evaluation and Results
The architecture was evaluated using a proof-of-concept prototype with 200 virtual IoT devices on the Ropsten Ethereum Testnet. Key findings include:
- Scalability: Mathematical analysis of gas limits indicates the system can handle approximately 2,977 devices per single blockchain transaction per hour.
- Performance: Read operations remained stable between 1.5 and 2.2 seconds regardless of the number of active devices.
- Cost-Effectiveness: The cost of adding a device or policy was extremely low, ranging from $0.0018 to $0.0026 USD at the time of testing.
Conclusion
By offloading heavy computation to fog nodes and utilizing off-chain storage via IPFS, this architecture provides a secure and scalable solution for IoT monitoring. While the current one-hour batching interval may not suit real-time mission-critical applications, it offers a robust framework for general-purpose monitoring. Future work will explore optimizing batching intervals and evaluating performance under various security threat models, such as 51% attacks.
Summary updated