With increasing socio-economic development,the public is demanding higher quality of agricultural products and is also increasingly concerned about various intellectual property rights and sources of information,and traceability is an effective way to address these issues.Traceability allows users to find out detailed information about products by scanning QR codes or logging onto traceability websites,among other things,and traceability technology is particularly important.However,the existing traceability technology system has problems such as opaque data,closed information and single traceability information,and the emergence of blockchain technology provides a solution to these problems.By using blockchain technology as the underlying foundation and building a decentralised traceability system architecture,the problem of data-centricity in the traditional traceability system can be effectively solved.Blockchain technology has characteristics such as non-tamperability and traceability,which can ensure the authenticity and validity of product traceability information in the process of circulation.In the process of applying blockchain to the field of traceability,the consensus mechanism and encryption algorithm in blockchain technology play an important role,and related research has received increasing attention.The main work of this paper is as follows:(1)Aiming at the problems that the PBFT algorithm has too high communication complexity and the master node election is too simple when it is applied in the traceability field,an improved Byzantine consensus algorithm P-V PBFT is proposed.First,based on aggregated signature technology,the consensus protocol process is improved to reduce the algorithm complexity exponentially.Secondly,the node reputation value is introduced to optimize the election of the master node.The reputation value of the node is used as the weight,and the verifiable random function cryptographic lottery algorithm is used to elect the master node,which improved the fairness and security of the master node election.(2)In response to the backdoor security problem of the ECDSA encryption algorithm used in the Hyperledger Fabric federated chain,a simplified algorithm based on the SM2 algorithm is proposed to replace the ECDSA algorithm.Firstly,the part of the SM2 algorithm process with inverse operations is optimized to reduce the inverse operations in the whole process.Experimental results show that the signature and verification efficiency of the simplified algorithm is improved by about 5.7%.Secondly,the porting of the SM2 algorithm was achieved by adding SM2 algorithm templates and interfaces to the BCCSP module of the Fabric platform.(3)Design and implement a traceability system for agricultural products based on blockchain technology.The system uses the improved PBFT consensus algorithm to provide more efficient and secure guarantees for the traceability system,and uses the improved SM2 algorithm to ensure the security of private data in the traceability system.This article first designs the overall system architecture and functional modules,then builds the Fabric blockchain network,develops each functional module of the system,and finally tests and demonstrates each functional module to achieve traceability of product information and ensure traceability information security. |