# A Survey of Blockchain Applications for Management in Agriculture and Livestock Internet of Things
## 4 Applications of Blockchain in Agricultural and Animal Husbandry IoT
### Data Management
#### 4.1.2 Data Sharing and Security
These cleansed data are then committed to the blockchain as a transaction, including elements such as TransHash, the record number, the transaction hash, and key data from the preceding step, signaling the imminent consolidation of data. Following each submission, the system assesses the completion of the prior process. If the transaction is deemed complete, a TransHash operation related to the preceding step is executed at the point of data submission; otherwise, further submissions are barred. The final step entails the linking of data, at which point the data from process 1 becomes immutable and non-erasable. By embedding transaction data from process 1 into the transaction initiated in process 2, it becomes feasible to swiftly identify preceding transaction data during searches without the necessity of scanning all network nodes. Additionally, in the event of data deletion, restoration is achievable via a data rollback process. This framework significantly bolsters the reliability and efficiency of information sharing within the tea supply chain, thereby furnishing robust technological support for the tea industry's sustainable growth. As the IoT network expands, issues such as security and integrity arise due to the increase in data, along with the complexity brought by different parameters and data formats tracked by IoT devices, affecting data quality. Problems such as data loss, inconsistency, accuracy issues, and ambiguity in large volumes of data are prevalent. Despite IoT's crucial role in enhancing agricultural efficiency, ensuring the secure processing and reliability of data remains a primary concern. To mitigate these issues, paper [91] introduced an innovative strategy, namely the integration of Ethereum-based blockchain technology with IoT sensor data. Utilizing a private blockchain network coupled with a PoW consensus algorithm, this technique guarantees the integrity and protection of irrigation data. Blockchain, as a distributed ledger technology, confers benefits, including data transparency, permanence, and decentralization, thus significantly enhancing the security and dependability of data handling, particularly in the context of irrigation data management within precision agriculture. This fusion of IoT and blockchain not only addresses prevailing issues but also charts a novel course for the advancement of smart agriculture. The environmental parameters of high-value crops in smart farms are usually very sensitive, and the transmission and processing of these data in existing systems are often only protected by simple passwords, making them susceptible to hacking and tampering by cyber attackers. Data security is an urgent issue, especially when central control processing units use remote login monitoring. To tackle this problem, paper [92] proposes a solution based on blockchain to enhance security for IoT data transfer. This system transmits data through a wireless sensor network to an integrated microcontroller at the farm for fusion processing, then encapsulates the data using blockchain algorithms and finally stores them in a cloud database. Thismethod leverages blockchain's decentralized and tamper-proof characteristics to secure and establish trust in data, offering an innovative and secure solution for IoT data management. Similarly, in smart agriculture, IoT technology primarily facilitates the accurate collection and processing of crop and environmental data, aiming to elevate agricultural productivity and quality. Nonetheless, the evolution of these technologies has brought forth various security and privacy concerns. Devices in the IoT, including sensors, encounter various security challenges due to their limited processing capabilities and battery duration. These challenges encompass risks of data tampering and the fraudulent representation of devices. Addressing these challenges, paper [93] introduces an innovative framework that combines the IoT with blockchain to enhance data security and reliability within smart farming.