# 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  
In this subsection, we thoroughly investigate the fundamental importance of data sharing and security within IoT applications, with a particular emphasis on their role in agricultural and livestock IoT. By integrating blockchain into IoT frameworks, we anticipate a substantial enhancement in aspects of data sharing and security, which are crucial for bolstering the dependability and operational efficiency of IoT implementations in the agricultural and livestock domains. The use of blockchain is expected to revolutionize these sectors, offering a more secure and efficient means of handling and processing critical data. Paper [88] highlights the escalating issues of information silos and data exchange within the IoT domain, emphasizing the need for improved privacy and security. Current centralized data management and authentication approaches show clear limitations in addressing these challenges. Consequently, paper [89] introduces a novel solution integrating blockchain with edge computing within an authentication system. This solution utilizes an optimized Practical Byzantine Fault Tolerance (PBFT) algorithm, enhancing data storage security and traceability for end-user activities. It incorporates dynamic name resolution strategies and Elliptic Curve Cryptography (ECC) to establish a distributed authentication mechanism, improving communication security and data synchronization efficiency. Additionally, the paper introduces algorithms for dynamic cache space optimization through smart contracts, improving hit rates and reducing latency. Simulation results indicate improvements in latency and hit rates, advancing IoT framework efficiency, data stewardship practices, and security verification. Currently, the application of blockchain technology in data storage encounters several challenges. The inherent chain-like structure of blockchain, characterized by its time irreversibility and immutability, leads to continuous data accumulation. This accumulation necessitates extensive resources for data entry and storage, thus hindering the blockchain system's operational efficiency. Furthermore, within the blockchain, data are presented solely in a chain structure. Internal transactions are bundled and stored collectively without revealing any interrelations among them. Paper [90] introduces a collaborative management model designed to alleviate the storage burden on blockchain systems by storing all traceable data on cloud servers, as depicted in Figure 6. When new data are added, the system identifies and incorporates this hash into the new block. This process facilitates the swift identification of the parent transaction hash, enabling the timely assembly of the full traceability chain. Such a mechanism significantly reduces the storage demands on the blockchain infrastructure. Figure 6: Data storage design for the tea traceability system in [90]. While two-layer or multi-layer frameworks in blockchain systems primarily address the engagement of regulatory bodies and the privacy of sensitive information across nodes, focusing on business-level data storage, they do not alter the blockchain's internal storage architecture. The framework proposed by paper [90] diverges from these conventional multi-layer designs. As illustrated in Figure 6, this study employs the tea supply chain as a case study, where the processes numbered 1, 2, 3, and beyond sequentially represent tea harvesting, processing, and packaging, among other activities. Users sequentially record each step of the tea process in the database. A local server logs data from tea process 1 in the initial stage. These data are then entered into the blockchain system unconsolidated. Subsequently, through the application of machine learning techniques, anomalous data points within the traceability data are filtered out.