# Blockchain-Based Cloud-Enabled Security Monitoring Using Internet of Things in Smart Agriculture
###### Abstract
Although communication to the cloud provides data analytics and storage capabilities, a smart device's internet connectivity introduces security and privacy issues. These issues in smart agriculture are not well addressed in the literature [8; 9]. The existing security solutions proposed in smart farming and agriculture mostly cover food-supply-chain management [9] and the monitoring of various activities [10] using cloud technologies, ML- and AI-based data-analytic techniques [11], and authentication and authorization solutions for constrained IoT devices [12; 13]. Cloud-based monitoring smart agriculture solutions can still have security consequences, if the secured code procedures are not considered during the development and IoT security best practices are not followed. To support the previous statement, we have historically seen that IoT devices exposed to the Internet have been compromised and used as a weapon to perform large-scale denial-of-service attacks or other malicious activities such as manipulating the sensor values to data exposure [14; 15]. Therefore, the existing cloud-based solutions or gateway-based security solutions for monitoring smart agriculture applications are not sufficient for providing the full pledged security. Decentralized applications and storage have security advantages compared to traditional applications and storage in terms of secured events storage, traceability, immutability, and improved security and privacy. Blockchain technology is known to be used for decentralized application development. Apart from blockchain-based digital currency, smart-contract-based applications are popular and used for many applications, including digital identities, financial security, secured storage, and supply chain management [16]. Researchers explored blockchain technology opportunities in resolving IoT security and privacy problems [17], including smart agriculture security. Some of the blockchain applications in smart agriculture are food-production supply-chain management, and secured transaction storage [8; 18]. Blockchain enables keeping track of the sequence of events to maintain transparency and, in the end, farmers are fairly treated and gain profits. Considering the blockchain technology advantages in smart agriculture, we were inspired to utilize blockchain technology for implementing a smart farming-security-monitoring solution. The current security monitoring solutions in smart agriculture either focus on cloud-based options or blockchain technology [10; 19]. Furthermore, as discussed earlier, most of the cloud- or blockchain-based solutions mainly address supply-chain issues. The advantages of cloud and blockchain technology can be considered to propose optimal security solutions in smart agriculture. Overall, to overcome the limitations of the existing cloud-based solutions [10] and improve security using blockchain applications, we leveraged a cloud and blockchain solution to constantly process the sensing data in the cloud and store anomalies in blockchain transactions. Additionally, none of the existing solutions provided an end-to-end solution using cloud and blockchain implementation for smart agriculture and evaluating the network latency performance. Therefore, we implemented an end-to-end solution using an Arduino sensor kit with a Wi-Fi module, AWS cloud, and Ethereum smart-contract network for testing real-time application, and evaluated their performance in terms of security, usability, and performance. Ultimately, our contributions to this paper are as follows:  
* We implemented an end-to-end smart agriculture security-monitoring prototype using Arduino sensor kit, AWS cloud components, web graphical user interface, and Ethereum smart-contract network. * We monitored and processed various sensor-type data suitable to generate in a smart-agriculture environment and store the essential monitoring digital data in Ethereum smart contract transactions.