| With the continuous development of social economy and the improvement of people’s consumption level,consumers’ demand for material living standard is no longer only reflected in quantity,but also has higher requirements for the quality of commodities.Supply chain traceability technology is the primary solution to ensure the quality of commodities,but there are problems in the traditional centralized storage supply chain traceability system,such as information island,malicious enterprises’ modification of traceability information is not easy to be detected and traceability is difficult.Blockchain technology has the characteristics of decentralization,immutability and traceability,which make it irreplaceable in the traceability of commodities.However,due to the large number of participants in supply chain traceability management and the large amount of storage information,if the supply chain traceability platform is directly implemented using blockchain technology,the defects of consensus algorithm itself and the large pressure of blockchain network data storage will become the main bottleneck of the combination of the two.Therefore,this paper optimizes and improves the two problems respectively to improve the usability of blockchain technology in supply chain traceability.The main research work of this paper is as follows:(1)For the Delegated Proof of Stake consensus algorithm,the election of accounting nodes is greatly affected by nodes with a large number of digital currencies,the block verification time is long,and the malicious nodes selected as accounting nodes cannot be dealt with in time.This paper proposes a Delegated Proof of Stake consensus algorithm based on Proof of Work and Reputation.The algorithm first elects the consensus nodes of the current round by introducing proof of work,and then non-consensus nodes can only vote for consensus nodes to elect accounting nodes to improve the decentralization of the blockchain network.In the voting stage,each non-consensus node needs to complete two votes.The first vote is to vote for the consensus node to elect the accounting node,and the second vote is to vote for the non-consensus node to elect the verification node.The final election result will also take into account the reputation value of the node to ensure the reliability of the accounting node and the verification node.Finally,in the consensus stage,the verification node verifies the generated block to reduce the transaction delay.At the same time,the account node replacement mechanism is introduced to improve the processing speed of the blockchain network against malicious nodes and ensure the robustness of the blockchain network.The experimental results show that,compared with the original algorithm,the consensus algorithm proposed in this paper has a certain improvement in the distribution rate of accounting nodes,transaction delay and system throughput.(2)In order to reduce the storage pressure of the blockchain network,an off-chain expansion storage scheme for blockchain traceability is proposed.In this scheme,the immutability of data is guaranteed by the irreversible derivation of the hash function and the immutability of the blockchain,and the validity of the data is guaranteed by the SM2 signature algorithm.The enterprise uploads the data hash and signature result on the chain by deploying the smart contract,and the data plaintext is stored in the off-chain database.Each database record of this enterprise contains the data plaintext,the address where the data on the chain is stored on the blockchain,the database index corresponding to the relevant data of the upstream enterprise and the storage address of the data on the chain,so as to realize traceability.Finally,based on the scheme,the Ethereum network is used to implement the traceability system through the SSM(Spring+Spring MVC+Mybatis)development framework.The system designs detailed database tables and smart contracts,which provides an idea for a more effective combination of blockchain technology and supply chain traceability. |