Blockchain is a new application mode combining consensus algorithm,encryption algorithm,distributed data storage,point-to-point transmission and other computer technologies.Because blockchain is decentralized,data cannot be tampered with,data can be traced and other characteristics,the industry uses it in anti-counterfeiting traceability system.The anti-counterfeiting traceability system based on blockchain can identify fake and shoddy goods and quickly locate the problematic link when the traceability fails.While blockchain brings security to anti-counterfeiting traceability systems,the Practical Byzantine Fault Tolerance(PBFT)consensus algorithm it uses limits the scalability of anti-counterfeiting traceability systems.PBFT has some problems,such as arbitrary primary node election,high complexity of three-stage consensus process communication and high cost of view change.Especially with the increase of the number of nodes in the network,the performance of PBFT will gradually decrease.This thesis studies and analyzes the existing PBFT consensus algorithms,and proposes a scalability optimization algorithm of PBFT for the existing problems of PBFT.The main research contents of this thesis are as follows:(1)Aiming at the problem of high complexity of consensus process communication and high cost of view change,this thesis proposed PBFT scalability optimization algorithm TBFT based on threshold signature.Firstly,the communication cost between nodes is reduced by threshold signature technology,and the backup node only needs to send messages to the primary node instead of broadcasting to the whole network node.Then,the client communication is reduced from f+1 to1 by merkle tree technique.Finally,the efficiency of view change is improved by threshold signature technology and erasure code technology.The algorithm analysis of TBFT shows that TBFT has lower communication cost and higher scalability.Simulation results show that TBFT has higher throughput and lower request delay.(2)In order to solve the problem that PBFT master nodes are randomly selected and scalability is low,this thesis proposes PBFT scalability optimization algorithm VBFT based on verifiable random function.Firstly,the leader of RandHound protocol is selected through the verifiable random function.VBFT generates random numbers through RandHound,and nodes are sharded according to the random numbers.PBFT algorithm is run inside the sharding.In order to solve the random election problem of PBFT primary nodes,VBFT designed an encryption lottery algorithm based on verifiable random function,which can randomly elect primary nodes.Finally,a verifiable random function is used to select the final consensus committee,which is responsible for reaching the final consensus on the client’s request.Through the analysis of VBFT algorithm,it can be seen that VBFT can improve scalability while ensuring the security of fragments.Simulation results show that VBFT can effectively improve the scalability of PBFT and can be applied to large-scale nodes.(3)Design and implement an anti-counterfeiting traceability system based on the blockchain PBFT consensus algorithm.The system is mainly for manufacturers,transporters and consumers,and is suitable for the anti-counterfeiting traceability of goods.In the production,processing,warehousing and transportation of commodities,the system handles the requests of manufacturers and transporters through TBFT;in the sales of commodities,the system handles consumer requests through VBFT. |