| Literature DB >> 35591077 |
Qi Yao1, Huajun Zhang1.
Abstract
Most traditional agricultural traceability systems are centralized, which could result in the low reliability of traceability results, enterprise privacy data leakage vulnerabilities, and the generation of information islands. To solve the above problems, we propose a trusted agricultural product traceability system based on the Ethereum blockchain in this paper. We designed a dual storage model of "Blockchain+IPFS (InterPlanetary File System)" to reduce the storage pressure of the blockchain and realize efficient information queries. Additionally, we propose a data privacy protection solution based on some cryptographic primitives and the Merkle Tree that can avoid enterprise privacy and sensitive data leakage. Furthermore, we implemented the proposed system using the Ethereum blockchain platform and provided the cost, performance, and security analysis, as well as compared it with the existing solutions. The results showed that the proposed system is both efficient and feasible and can meet the practical application requirements.Entities:
Keywords: Ethereum; IPFS; agricultural products; blockchain; smart contract; traceability
Mesh:
Year: 2022 PMID: 35591077 PMCID: PMC9103666 DOI: 10.3390/s22093388
Source DB: PubMed Journal: Sensors (Basel) ISSN: 1424-8220 Impact factor: 3.576
Critical analysis of the existing works in the literature.
| Author | Year | Objective | Technologies | Merits | Demerits |
|---|---|---|---|---|---|
| Tian [ | 2016 | To use blockchain combined with RFID for building the agri-food supply chain traceability system. | RFID, Blockchain | Enhance the reliability of the agri-food traceability information. | High cost for using RFID; data privacy leakage; Poor system storage capacity issue |
| Liu et al. [ | 2018 | Proposed a Security Provenance Model for RFID Big Data Based on Blockchain | Blockchain, RFID big data | Applying blockchain technology in the process of tracking and tracing IoT big data. | No detailed experimental process and analysis process. |
| Lin et al. [ | 2019 | Proposed a food safety traceability system based on blockchain and EPCIS | Ethereum, EPCIS and Smart Contract | Collaborative management model of on-chain and off-chain data | System performance is limited by the amount of data. |
| Baralla et al. [ | 2019 | Proposed a generic agri-food supply chain traceability system based on blockchain technology. | Hyperledger Sawtooth, Smart contract | Eliminate the centralization of information in the supply chain. | The issue of enterprise data privacy leakage; Low maturity of the Sawtooth platform. |
| Chen et al. [ | 2021 | Designed a food traceability system based on blockchain | Ethereum, Smart Contract | Detailed system design and traceability process | No traceability information privacy protection |
| Dey et al. [ | 2021 | Proposed a Blockchain and QR-code-based framework to digitize food production information and retrieval. | Blockchain, QR Code, and Cloud computing | Offer flexible scalability and improve the storage capacity. | The framework need more computationally powerful cloud server as the number of products grows. |
| Dey et al. [ | 2022 | Proposed a blockchain-based framework to reduce food waste in a Web 3.0-enabled smart city. | Machine Learning, Blockchain, Cloud Computing, and QR Code | Use several cut-ting-edge technologies in conjunction to reduce food waste efficiently. | Lacks in showing the specific implementation details |
Figure 1The flow of research stages.
Figure 2A high-level architecture for the proposed blockchain-based agricultural traceability system.
Figure 3The agricultural supply chain process.
Figure 4Dual storage model for traceability information.
Figure 5Merkle Tree for traceability information.
On-chain storage format.
| Key | Value |
|---|---|
| ID | The unique identification of agricultural product |
| ProductionAddr | The Production Enterprise Ethereum Address |
| ProductionHash | The Merkle Tree root at production link |
| ProcessingAddr | The Processing Enterprise Ethereum Address |
| ProcessingHash | The Merkle Tree root at processing link |
| LogisticsAddr | The Logistics Enterprise Ethereum Address |
| LogisticsHash | The Merkle Tree root at logistics link |
| SalesAddr | The Sales Enterprise Ethereum Address |
| SalesHash | The Merkle Tree root at sales link |
| ProductionState | The current state of agricultural product |
Off-chain storage and results.
| Content | Results |
|---|---|
| ipfs_hash_1 | |
| ipfs_hash_2 | |
| ipfs_hash_3 | |
| ipfs_hash_4 |
Figure 6Sequence diagram showing interactions among the stakeholders with the Management smart contract.
Figure 7Sequence diagram showing interactions among the production enterprise with the Production smart contract.
Figure 8Sequence diagram showing interactions among the customers with the smart contracts and IPFS.
The main functions of smart contracts.
| Function Name | Function Description |
|---|---|
| UserRegister | Agricultural products supply chain enterprise registration |
| UserExists | Check whether the enterprise is registered |
| UserForbidden | Government regulator block the enterprise’s account |
| CreateNewProduction | Production enterprise create a new agricultural product structure. |
| UploadProductionStageInfo | Production enterprise store the Merkle Tree root at the production link |
| GetProductionStageInfo | Query the Merkle Tree root at the production link |
| ProductionToLogistic | Production enterprise hand over the products to logistics enterprise |
| UploadLogisticsStageInfo | Logistics enterprise store the Merkle Tree root at the logistics link |
| GetLogisticsStageInfo | Query the Merkle Tree root at the logistics link |
| LogisticToProcess | Logistics enterprise hand over the products to processing enterprise |
| LogisticToSales | Logistics enterprise hand over the products to sales enterprise |
| UploadProcessStageInfo | Processing enterprise store the Merkle Tree root at the process link |
| GetProcessStageInfo | Query the Merkle Tree root at the process link |
| ProcessToLogistic | Processing enterprise hand over the products to logistics enterprise |
| UploadSalesStageInfo | Sales enterprise store the Merkle Tree root at the process link |
| GetSaleStageInfo | Query the Merkle Tree root at the process link |
| SaleToConsumer | Sales enterprise hand over the products to consumer |
The Ethereum address of each stakeholder.
| Stakeholder | Ethereum Address |
|---|---|
| Government Regulator | 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4 |
| Production Enterprise | 0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2 |
| Processing Enterprise | 0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db |
| Logistic Enterprise | 0x78731D3Ca6b7E34aC0F824c42a7cC18A495cabaB |
| Sales Enterprise | 0x617F2E2fD72FD9D5503197092aC168c91465E7f2 |
| Consumer | 0x17F6AD8Ef982297579C203069C1DbfFE4348c372 |
Figure A1Successful execution of UserRegister Function.
Figure A2Successful execution of UserExists Function.
Figure A3Successful execution of UserForbidden Function.
Figure A4Successful execution of UploadProductionStageInfo Function.
Figure A5Successful execution of GetProductionStageInfo Function.
Gas cost of Ethereum functions in USD.
| Function Name | Gas Cost | Slow Execution | Avg. Execution | Fast Execution |
|---|---|---|---|---|
| UserRegister | 55,089 | 0.226 | 0.269 | 0.354 |
| UserExists | 24,864 | 0.102 | 0.121 | 0.160 |
| UserForbidden | 26,220 | 0.108 | 0.128 | 0.168 |
| CreateNewProduction | 69,844 | 0.287 | 0.341 | 0.448 |
| UploadProductionStageInfo | 50,463 | 0.207 | 0.246 | 0.324 |
| GetProductionStageInfo | 25,027 | 0.103 | 0.122 | 0.161 |
| ProductionToLogistic | 50,010 | 0.205 | 0.244 | 0.321 |
| UploadLogisticsStageInfo | 50,233 | 0.206 | 0.245 | 0.322 |
| GetLogisticsStageInfo | 24,274 | 0.100 | 0.118 | 0.156 |
| LogisticToProcess | 48,746 | 0.200 | 0.238 | 0.313 |
| LogisticToSales | 50,175 | 0.206 | 0.245 | 0.322 |
| UploadProcessStageInfo | 50,143 | 0.203 | 0.238 | 0.309 |
| GetProcessStageInfo | 25,427 | 0.104 | 0.124 | 0.163 |
| ProcessToLogistic | 50,412 | 0.207 | 0.246 | 0.324 |
| UploadSalesStageInfo | 50,658 | 0.208 | 0.247 | 0.325 |
| GetSaleStageInfo | 24,765 | 0.102 | 0.121 | 0.159 |
| SaleToConsumer | 50,376 | 0.207 | 0.246 | 0.323 |
Experiment Environment.
| Type | Description |
|---|---|
| CPU | AMD Ryzen 7 4800H |
| GPU | RTX 2060 |
| RAM | 16 GB |
| SSD | 512 GB |
| Operating System | Windows 10 |
Hash Performance.
| Date Size (kb) | Time (ms) |
|---|---|
| 1 | 13 |
| 10 | 14 |
| 100 | 17 |
| 1000 | 25 |
| 10,000 | 57 |
| 100,000 | 282 |
| 1,000,000 | 2037 |
The Performance of Constructing Merkle Tree.
| Number of Leaf Nodes | Time (ms) |
|---|---|
| 10 | 99 |
| 100 | 193 |
| 1000 | 1045 |
| 10,000 | 8963 |
| 100,000 | 931,263 |
Figure 9The relation between file size and upload time.
Figure 10The relation between file size and query time.
Comparison with Traditional Agricultural Traceability System.
| Features | Traditional System | Our System |
|---|---|---|
| System Management | Centralization | Decentralization |
| Data Storage | Local Database | Blockchian + IPFS |
| Reliability of Traceability Results | Low | High |
| Auditability | Low | High |
Comparison of the proposed system to related works.
| Research | Traceability | Blockchain Platform | Off-Chain Storage | Privacy Protection | Implementation | Performance Evaluation |
|---|---|---|---|---|---|---|
| [ | ✓ | / | 🗴 | 🗴 | 🗴 | 🗴 |
| [ | 🗴 | / | 🗴 | 🗴 | 🗴 | 🗴 |
| [ | ✓ | Ethereum | ✓ | 🗴 | ✓ | ✓ |
| [ | ✓ | Sawtooth | ✓ | 🗴 | ✓ | 🗴 |
| [ | ✓ | Ethereum | ✓ | 🗴 | ✓ | 🗴 |
| [ | ✓ | / | 🗴 | 🗴 | ✓ | ✓ |
| [ | ✓ | / | 🗴 | ✓ | ✓ | ✓ |
| This paper | ✓ | Ethereum | ✓ | ✓ | ✓ | ✓ |