Abstract
Blockchain has the advantages of tamper proof, high reliability and traceability, so it can better support the agricultural product traceability system. However, the agricultural product supply chain has the characteristics of long chain and decentralized production, which makes the application of the combination of blockchain technology and agricultural product traceability have many nodes, large system overhead and other problems. In order to solve the above problems, this paper proposes a Practical Byzantine Fault Tolerance (PBFT) consensus mechanism based on trust value evaluation, and uses this optimization algorithm to propose an architecture model to meet the demand for trusted traceability of agricultural product supply chain, so as to realize the distributed storage and security protection of supply chain data. In order to ensure the effective operation of the blockchain system, this paper studies the consensus mechanism in the blockchain network, designs a trust value evaluation model to calculate the trust value of nodes, and selects trusted nodes to join the consensus group based on the trust value, which ensures the credibility of the consensus nodes. At the same time, the consistency protocol is optimized to reduce the communication overhead in the consensus process. The experimental results show that the consensus mechanism improved in this paper has certain advantages in communication overhead, transaction delay and throughput. Compared with the existing storage model, the model described in this paper has higher security and throughput efficiency, effectively ensures the reliable traceability of data, and can be better applied to the traceability scenario of agricultural product supply chain.
Keywords
Introduction
With the continuous improvement of living standards, the attention to the quality and safety of agricultural products is also rising. In recent years, the frequent occurrence of quality and safety incidents of agricultural products has not only triggered a crisis of trust among consumers, but also brought an impact on related industries. The traceability system of agricultural products can record the data information of various links such as planting, processing and transportation of agricultural products, realize the visualization of all links of the supply chain, and recall the products with quality problems in time. Therefore, establishing a trusted traceability system is an effective way to ensure the quality and safety of agricultural products [9]. However, the existing traceability platforms still have shortcomings in practical application [1], such as the centralized database makes the data easy to be tampered with, the relative independence between enterprises makes it difficult to share data, and the lack of transparency of traceability data makes it impossible to locate the responsible subject in time. Therefore, a more reliable traceability system is of great significance to ensure the reliability of traceability data, and the emergence of blockchain technology provides a new idea for establishing a trusted traceability system [13].
Blockchain has the characteristics of privacy protection, data tamper prevention, decentralization and traceability. It is usually described as a distributed ledger technology, which is jointly maintained by all nodes in the network, and blocks are connected through hash pointers to form a chained storage structure [23]. The consensus mechanism is an algorithm for establishing trust between different nodes in a blockchain system, and it is the core algorithm for blockchain technology to ensure data credibility, which directly affects the security and throughput efficiency of the entire system [17]. In order to improve the consensus efficiency of the agricultural product traceability system and the authenticity of the traceability data, it is particularly necessary to study a consensus mechanism suitable for reliable traceability in the supply chain. In the study by Ferrandez-Pastor et al. [7], an agricultural product traceability model based on blockchain combined with Internet of Things technology is constructed, which can automatically access the blockchain to provide traceability services, realize the reliability and credibility of agricultural product traceability data, and improve the security of the system, and the model adopts the distributed Raft consensus mechanism, which improves the throughput of the system to a certain extent. In previous studies [5,25], a trusted traceability model of the food supply chain was constructed on the basis of blockchain technology to solve the problems of serious centralization and low data security in the current traceability system, and the model adopts the PBFT consensus algorithm to make the traceability data more credible. In other studies [11,16], the supply chain traceability model described optimizes the PBFT algorithm, reduces the communication complexity between nodes, and improves the efficiency of block generation.
The above-described studies apply blockchain technology to the field of agricultural products supply chain, ensuring the security and traceability of data, and improving the consensus efficiency by optimizing the consensus mechanism. However, the credibility of the nodes in the consensus group is not considered too much. If a malicious node enters the consensus group to participate in the consensus, it will not only fail to ensure the credibility of the data, but also make the system vulnerable to attack. Based on this, in order to improve the consensus efficiency of the system and the credibility of the data, this paper improves the PBFT consensus mechanism based on the trust value evaluation mechanism, applies the improved consensus mechanism to the blockchain system, and proposes a trusted traceability model of agricultural supply chain. The model stores the data safely and effectively in the blockchain system, thus ensuring the authenticity and credibility of the data.
The remaining chapters of this paper are described as follows: Section 2 describes the consensus algorithm and proposes a PBFT consensus algorithm based on trust value evaluation. Section 3 introduces the traceability system model based on the improved PBFT consensus algorithm, and expounds the main components of the model in detail. In Section 4, the performance of the improved algorithm is evaluated and analyzed through simulation experiments. Finally, conclusions are made in Section 5.
The PBFT consensus mechanism and improvement
PBFT consensus mechanism
The PBFT [3] is mainly usually to solve the problem of how to make each node reach a consensus on transactions when there are Byzantine errors in the distributed system, and the complexity of the algorithm is reduced from exponential level to polynomial level
Consistency protocol
The consistency protocol is the core of the PBFT consensus mechanism, which is mainly used to ensure that the data information of each node is consistent. In the consistency protocol, the consensus group nodes are divided into the master node and the slave node. The master node is responsible for sorting the requests from the client and packaging them to generate blocks, and the slave nodes are mainly responsible for verifying the blocks and reaching a consensus. Additionally, each consensus of the algorithm occurs in a view v, which refers to the same configuration environment where the nodes are located, and each view corresponds to a unique master node. The execution process of the consensus protocol is shown in Fig. 1, which mainly includes the pre-prepare stage, the prepare stage and the commit stage.

Implementation flowchart of conformance agreement [3].
The specific workflow of each stage is as follows:
1) Pre-prepare stage: After receiving the request from the client, the master node generates a pre-prepare message and broadcasts it to the slave node in the cluster.
2) Prepare stage: After receiving the request from the master node, the slave node first verifies the message, and if the verification passes, it generates a preparation message and broadcasts it to other nodes in the cluster.
3) Commit stage: The node counts the received prepare messages. If the node receives more than or equal to
View switching protocol
The view switching mechanism is a mechanism that can still ensure the availability of the cluster when the master node goes down or Byzantine errors occur. If the slave node does not receive the request from the master node within the limited time, that is, the master node fails, then the slave node triggers the view switching protocol and switches the view to the next master node.
First, the view switching protocol is triggered from the slave node, and the view switching message is generated and broadcast to other nodes in the network. Simultaneously, calculate the master node in the next view through equation (1), where P represents the master node, v is the view number and R is the number of nodes in the consensus group.
After the master node P in the next view receives
Checkpoint protocol
During the operation of the PBFT consensus mechanism, nodes will continuously accumulate message logs. If the logs are not removed regularly in time, nodes will store large amounts of information, which will not only occupy a lot of disk storage space, but also increase the resource consumption required to synchronize logs after new nodes join the consensus group. Therefore, PBFT provides a checkpoint mechanism. The execution mechanism of the checkpoint protocol is the periodic execution. This mechanism reduces the memory occupation of the system by periodically releasing the message log after consensus authentication is reached, thereby ensuring the stable operation of the system.
According to the above, in the PBFT consensus algorithm, the master node is usually elected in the order of number, so it is impossible to ensure whether the elected node is honest. If the elected master node does evil, the view switching protocol will be triggered to elect the next master node in order. If the master node elected multiple times are malicious nodes, it will cause additional system resource consumption, and reduce the security and consensus efficiency of the system. The consistency protocol of the algorithm requires a three-stage communication interaction process, and the communication overhead is high, which will affect the consensus performance of the algorithm to a certain extent.
In order to guarantee the credibility of the elected nodes, this article introduces a trust value evaluation mechanism to improve the PBFT algorithm, and takes the trust value as the weight to elect nodes to join the consensus group. The trust level is differentiated based on the size of the trust value. The node with the highest trust value is preferentially elected as the master node first, and then the slave nodes are selected in turn according to the order, so as to guarantee the honesty and credibility of the nodes in the consensus group to the greatest extent. And the consistency protocol is optimized to further improve the consensus efficiency of the algorithm.
Node trust value evaluation mechanism
The trust degree of the blockchain network consensus node is mainly evaluated according to the behavior of the node in the consensus stage. The behavior of the node mainly includes honesty, non-response and doing evil [8]. Different behaviors of nodes in the consensus stage will lead to varying degrees of changes in trust value. If nodes actively participate in and complete the consensus in this round of consensus stage, the trust value will be increased accordingly; If the node does not respond, reduce the trust value; If a node has malicious behavior in this round of consensus, its trust value will be directly reduced to the minimum, so that it unable to participate in the consensus stage again in a short time.
In this paper, the parameter R is defined to represent the trust value of the node, and the value range of the trust value R is specified as
1) If the node honestly and successfully completes the consensus process, the trust value
Among them,
Where, s represents the number of times that the node has successfully completed the consensus, and z represents the total times that the node participated in the consensus, and the larger the value of ρ, the higher the frequency of the node completing the consensus.
2) If the node fails to respond due to network delay or downtime during the consensus process, reduce its trust value according to equation (4).
Where, the value of γ determines the rate at which the trust value of the node decreases, and its value can be preset according to the system requirements.
3) If the master node maliciously tampers the message sent by the client or the consensus node broadcasts inconsistent messages, the node is regarded as an untrusted node, and the trust value of the node is reduced to a minimum, as shown in equation (5) shown.
When Byzantine behavior occurs in the master node, that is, malicious tampering with messages, it is necessary to trigger the view switching protocol to replace the master node. According to the trust value of the node, the node with the highest trust value is first elected from the trusted nodes as the master node, which is responsible for packaging and generating blocks. When the set of trusted nodes is empty, the master node needs to be selected from the ordinary nodes. The abnormal node may not respond due to downtime, so it is not suitable to generate blocks as the master node, but it can participate in the consensus as a node in the consensus group. Untrusted nodes may attack the blockchain network, thereby reducing the security of the system [21]. Therefore, it is stipulated that untrusted nodes cannot enter the consensus group to prevent them from attacking the network, but they can update the contents of the node’s ledger as accounting nodes. The relationship between node trust value and authority is shown in Table 1.
Relationship between node trust level and authority
Relationship between node trust level and authority
If the nodes participating in the consensus actively participate in the consensus within a certain period of time, there may be a situation that the trust value of the consensus node is the same. If the master node needs to be replaced, it cannot be selected according to the trust value, then it is necessary to randomly select nodes from the set of trusted and ordinary nodes as leaders. Therefore, this paper combines the current block height parameter H when electing the master node P, which improves the randomness of the election and makes the algorithm better support the dynamics of the node, as shown in equation (6).
Where H represents the height of the current block in the blockchain network, v is the number of the current view, and
Considering that in the actual application scenario, if the enterprise has malicious motives, the subsequent management may be strengthened and the operation mode may be improved. Therefore, when the trust value of a node is reduced to the minimum due to malicious behavior, the trust value should be gradually restored after a certain period of time T each time, and specify that T is consistent with the period of the checkpoint protocol, and it is specified that T is consistent with the cycle of the checkpoint protocol. The specific calculation is shown in equation (7). And when the trust value is restored to close to the lower limit of 0.2 of the abnormal node, the node is given the opportunity to join the consensus group. If the consensus is successfully completed, the next round of trust value will continue to be calculated according to equation (2).
Where parameters θ is used to adjust the recovery speed of the trust value of the untrusted node. The parameter t represents the total time since the node last participated in the consensus.
In the consensus protocol of the PBFT consensus mechanism, the three-stage consensus process ensures the smooth conclusion of the consensus and consistency of the ledger content maintained by each node. The pre-prepare and prepare stages mainly guarantee that the honest nodes under the same view configuration correctly sort the requests from the clients. The prepare and commit phase aims to guarantee that the order of message requests is correct in the case of view switching. However, the consistency protocol needs to complete twice node interaction processes with

Improved consensus stage process.
The specific implementation process is as follows:
1) Request stage: The client sends a request to the master node
2) Pre-prepare stage: After the master node master the request from the client, it immediately assigns a unique incremental sequence number n to the request, and constructs the pre-prepare message structure
3) Prepare stage: After the slave node receives the request sent by the master node, it first checks the message, and if the verification passes, it enters the prepare state, generates the prepare message structure
4) Commit stage: If the node receives more than or equal to
5) Reply stage: When the master node receives
This paper elects nodes to enter the consensus group through credibility evaluation, and believes that the nodes with higher trust value have higher credibility, which further ensures the credibility of the master node, minimizes the possibility of nodes doing evil, and avoids consensus errors due to inconsistent message order that may result from view switching. In such a trusted environment, the commit stage of the consensus process is optimized, The original process of two-way interaction in the commit stage is simplified as sending commit messages from the node to the master node, and the complexity of the commit stage is decreased from
According to the node trust value evaluation model described, combined with the method of optimizing the consistency protocol stage, as shown in Fig. 3, the overall process of PBFT consensus mechanism based on trust value evaluation is given. The specific implementation process is as follows:
Step 1: First, according to the level of the enterprise’s comprehensive strength corresponding to the node as the evaluation index of the initial trust value, the trust value of each node in the network is initialized, and the W nodes in the network are numbered with
Step 2: According to the trust value of the node as the weight, the i-th consensus group is elected, and the node with the highest trust value acts as the master node. Nodes selected as members of the consensus group are responsible for packaging blocks and consensus tasks. Nodes not selected as members of the consensus group are only responsible for updating the local blockchain according to the consensus results. Using the trust value of the node as the weight can better ensure the integrity of the consensus group.
Step 3: The client sends a proposal request to the master node of the i-th session, and determines whether the master node responds within the specified time. If the master node responds overtime, go to step 4. If the response does not timeout, the request will proceed normally and go to step 5.
Step 4: If the master node fails to respond after timeout, the node will be punished according to the trust value evaluation model described in Section 2.2.1 of this article, and its trust value will be reduced linearly. Meanwhile, the consensus group node triggers the view switching protocol, selects the node with the second highest trust value as the master node, and continues to lead the next round of consensus.
Step 5: If the response of the master node does not time out, the received transaction information Trans will be sorted and combined with the timestamp, block height and other information to assemble a new block Blocknew, and the block will be proposed to the consensus node. After that, the consensus node will reach a consensus on the block proposed by the master node, and the consensus process will be implemented according to the improved consistency protocol in Section 2.2.2 of this article.
Step 6: If consensus group nodes reach consensus successfully, the trust value of each node will be dynamically updated according to the trust value evaluation model, and each node in the network will write the blocks that have reached consensus to the local blockchain.
In order to prevent each node from forging the trust value, so as to ensure the authenticity of the node’s trust value, the trust value information of the consensus group members is also packaged into the block, and the trust value of the consensus group node needs to be verified when the mechanism performs the consensus process. In addition, set the cycle of updating the consensus group nodes in the blockchain network as

PBFT consensus mechanism based on trust value evaluation.
This paper adopts Hyperledger Fabric as the underlying blockchain development platform, and applies an improved consensus mechanism to the blockchain system to promote the throughput and security of the system. Meanwhile, based on the consensus algorithm, a system model for the traceability of agricultural product supply chain is proposed. The model mainly includes seven parts: Internet of Things (IoT), IoT cloud platform, InterPlanetary File System (IPFS) [2], supply chain participants, blockchain, web client and consumers. The model of the traceability system is shown in Fig. 4. The main functions of each part will be described in detail below:

The structure of the system.
1) IoT: IoT collects the environmental information of the location of agricultural products in real time by deploying various types of sensors, such as temperature and humidity sensors, light sensors and other sensing terminals, so as to ensure the integrity of the traceability data of agricultural products. And through the access of various network protocols, such as HTTP, MQTT or TCP, the data information sensed by the sensor is transmitted and managed.
2) IoT cloud platform: The network node uploads the data collected by the sensor to the IoT cloud platform to realize the dynamic visual display of data and realize the storage of data in the cloud. Enterprises and regulatory departments can monitor the environmental information of agricultural products in real time, and the cloud can give corresponding suggestions to enterprises according to the collected environmental information, timely adjust the environmental conditions of agricultural products, and ensure that agricultural products are in a suitable environment.
3) IPFS: IPFS is a distributed file system composed of all participating nodes. IPFS will generate a unique storage address Addr for each uploaded file, and the location of the file can be indexed through Addr. Considering that multiple links of the supply chain are involved in the actual application process, so there is too much traceability data information of agricultural products. In order to reduce the storage pressure of the blockchain system and improve the query efficiency, this paper combines blockchain with IPFS to store the traceability data ciphertext in IPFS.
4) All participants in the supply chain: Providers of traceability data of agricultural products, including enterprises in all links of the supply chain, and they all correspond to the corresponding nodes of the blockchain. It is mainly responsible for entering data into the system. After collecting the traceability data, each enterprise first encrypts the traceability data with the public key
5) Blockchain: Blockchain is mainly responsible for the safe storage of the data on the chain. All participating enterprises in the supply chain calculate the Hash summary of the key traceability information of each link and sign the summary, then package the Hash summary and the file storage address Addr returned by IPFS into the transaction information frame trans, and adopt the system public key PK to encrypt the trans and upload it to the blockchain for storage. The data entry process is assisted by smart contract [4]. After the data on the chain reaches a consensus through the improved PBFT consensus algorithm, a new block is generated, and the ledger maintained by each node is updated. The transaction information that fails to pass the consensus will not be written into the block. Therefore, the use of the improved consensus algorithm in this study can effectively ensure the honesty and credibility of the consensus nodes, and can improve the consensus efficiency and the performance of the traceability system. And once the data is uploaded to the blockchain, it cannot be tampered with, which ensures the reliability of the traceability data.
6) Web client: The web client is the visual operation interface presented to the user [18], which realizes the functions of user registration and login, enterprise input information, information traceability query and so on.
7) Consumer: The user of the traceability system. After obtaining the transaction information Trans in the blockchain, the consumer first decrypts the Trans with the system private key SK to obtain the storage address Addr of the data, then obtains the traceability data ciphertext from IPFS according to the Addr, and detects whether its Hash summary is consistent with the Hash summary stored in the blockchain network. If it is consistent, it indicates that the content in IPFS has not been tampered with and the ciphertext information is successfully returned. Then the private key
The experimental environment is based on windows 10 system, which is configured as Intel® Core™ i7-10700F and 8G memory. In addition, PBFT and the improved PBFT algorithm are implemented based on Go language respectively. The above algorithms are analyzed from four aspects: node trust value, communication overhead, throughput and transaction delay to verify the effectiveness of the improved algorithm.
Analysis of node trust value
In order to verify the effectiveness of the trust value model, the changes in the trust value of nodes are analyzed through simulation experiments. Suppose that the number of consensus nodes in the blockchain network is 6, and the trust value is initialized based on the comprehensive strength of the agricultural product supply chain enterprises corresponding to this node. Because the comprehensive strength of enterprises is different, in order to make the experimental results more universal, in the experiment, the trust values of the six nodes are assigned as 0.85, 0.78, 0.64, 0.53, 0.41 and 0.32 respectively, and the variation curve of the node trust value is obtained through the simulation experiment, as shown in Fig. 5.

Variation curve of node trust value.
It can be seen from Fig. 5 that node 1, node 2, node 3 and node 5 have successfully participated in the consensus. According to the model described in this article, if the node is a trusted node, the trust value gradually increases after each round of successful participation in the consensus. And from equation (2), it can be seen that in the early stage of blockchain network establishment, in order to encourage nodes with low trust value to actively participate in the consensus, the trust value increases steadily, and the growth of trust value gradually slows down in the later stage. It shows that if the node still wants to maintain a high trust value, it will continue to successfully participate in the consensus process to maintain high reliability, which can effectively prevent malicious nodes from obtaining a high trust value. Node 4 successfully participated in five rounds of consensus, and did not respond in the 6-th round, resulting in a linear decline in its trust value. However, in the 8-th round, the node continued to successfully participate in the consensus, and the trust value gradually recovered. Node 6 successfully participated in the three rounds of consensus. In the 4-th round, it did evil and sent inconsistent messages to the node, so its trust value was minimized. Then, in order to encourage the enterprise corresponding to the node to make improvements, according to equation (7), its trust value was gradually restored every certain period, making it possible to enter the consensus group again.
Communication overhead refers to the traffic generated by the consensus node participating in a consensus process. From the theoretical introduction of PBFT algorithm in Section 2.1, it can be seen that nodes will communicate in the view switching and three-stage consensus process. Assuming that the total number of nodes in the network is N, the number of communications in the pre-prepare phase is N, the number of communications in the prepare phase is
The improved algorithm in this paper optimizes the commit phase of the consistency protocol. The communication times in the commit phase are
In order to compare and analyze the communication overhead before and after the improvement of the algorithm, the communication overhead ratio W of the two algorithms can be obtained from equation (8) and equation (9), as shown in equation (10).
Let the value range of the total number of nodes N be 4 to 37, and the value range of the view switching probability

Surface plot of communication overhead ratio.
According to Fig. 6, if the number of nodes N in the fixed blockchain network, with the continuous increase of the view switching probability p, the communication overhead ratio W also gradually increases; If the value of the view switching probability p is constant, the communication overhead gradually decreases with the increase of the number of nodes, that is, the number of communications required after the improvement is lower than the original algorithm. Therefore, within a given range, regardless of the value of N and p, the ratio W is constant less than 1, which shows that even under the conditions of a large number of nodes and a high probability of view switching, the communication overhead of the improved algorithm in this article is always lower than the original algorithm. In addition, the trust value evaluation model can greatly reduce the probability of view switching, so the communication overhead required to complete consensus is further reduced. Therefore, it is verified that the improved consensus mechanism reduces the communication overhead in the multi-node environment, and is suitable for the traceability field of agricultural product supply chain with multi-nodes.
Throughput is a measure of the system’s ability to process transactions in a unit time, that is, the number of transactions processed within the block out interval. In addition, TPS (transaction per second) represents the throughput, and the calculation of throughput is shown in equation (11). Where, Sumtransaction is the amount of transaction information contained in a single block,
In order to verify the throughput efficiency of the algorithm, different node numbers are taken for throughput experiments. In the experiment, the client sent 800 transaction requests. In order to make the experimental results more universal, the average value of 20 experiments is taken as the test result. The experimental results are shown in Fig. 7, in which the abscissa is the number of nodes set in the network and the ordinate is the throughput of the system. It can be seen from Fig. 7 that with the increasing number of nodes in the network, the throughput of the two consensus algorithms shows a downward trend, but on the whole, the throughput of the improved algorithm in this paper is always higher than the original algorithm, and the average throughput is increased from 205 to 347. And with the stable operation of the system, through the evaluation of the trust value of the node, the credibility of the node continues to rise, and the probability of doing evil decreases, so the throughput of the system will be further improved, providing a good transaction throughput performance for the traceability model of agricultural supply chain.

Throughput comparison experiment.
Transaction delay refers to the time required from the client initiating the transaction proposal to reaching a consensus. The level of transaction delay is related to the efficiency of the consensus mechanism. The calculation of transaction delay

Transaction delay comparison experiment.
In this experiment, the number of nodes is used as a variable for experimental testing. In order to make the experimental data more universal, take the average delay of 100 transaction proposals as the result, and the number of nodes is changed for multiple experiments to obtain the transaction delay comparison diagram shown in Fig. 8. It can be seen from Fig. 8 that with the increase of the number of nodes, the transaction delay of both consensus mechanisms shows an upward trend, but the delay rise rate of the original PBFT algorithm is larger, because a larger number of nodes will generate more communication overhead, resulting in a higher consensus delay. In contrast, this article ensures that all participants in the consensus are trusted nodes, and optimizes the consistency protocol to reduce the communication overhead. Therefore, the transaction delay of the improved algorithm in this paper is more stable. When there are many nodes, the delay rise rate is still relatively flat, and the average delay is reduced from 1203 ms to 749 ms, which reduces the consensus delay and improves the consensus efficiency, it is applicable to the traceability application scenario of agricultural products supply chain with a large number of nodes.
As shown in Table 2, the consensus mechanism described in this article is compared with algorithms such as PoW, PoS, DPoS and Raft. It can be seen that the PBFT consensus mechanism based on trust value evaluation designed in this paper is compared with PoW, PoS and DPoS, does not need to rely on computing power, and is suitable for application scenarios of alliance chains; Compared with Raft, it can tolerate a certain number of malicious nodes in the blockchain network. In terms of node credibility, the algorithm adopts a trust value evaluation mechanism to ensure that trusted nodes are added to the consensus group, which greatly reduces the probability of view switching and effectively improves the efficiency of nodes in consensus. Therefore, the improved PBFT consensus mechanism is more suitable than other algorithms to be applied to the trusted traceability model of agricultural product supply chain with multiple nodes.
Using the method of comparative analysis, the blockchain-based agricultural product supply chain trusted traceability model was compared with the models described in other research results, and the overall performance of the model was compared from the aspects of consensus algorithm, data privacy, and whether it was combined with IPFS. As can be seen from Table 3, compared with the models described in other models, this model combines the improved PBFT consensus mechanism, making the consensus nodes in the blockchain network more credible, and this model uses asymmetric encryption algorithm to store the traceability data in the form of ciphertext, which effectively ensuring the privacy of data [20], and preventing the traceability information from being tampered with. At the same time, this model combines the distributed file system IPFS, which reduces the storage pressure of blockchain, and has better applicability in the supply chain traceability scenario with a large amount of data. Therefore, the model proposed in this paper has certain advantages in the above aspects.
Comparison of consensus algorithms
Comparison of consensus algorithms
Comparison of different schemes
In order to improve the problem of low data reliability in the traditional agricultural product supply chain traceability system, this paper proposes a trusted traceability model of agricultural product sup- ply chain based on trust value evaluation PBFT combined with blockchain technology. This model integrates blockchain technology into the supply chain traceability system, and improves the PBFT consensus mechanism. It proposes and applies the PBFT algorithm based on trust value evaluation as the consensus mechanism of the alliance blockchain system. By evaluating the credibility of each node in the blockchain network, using the trust value of the node as the weight to select the trusted node to enter the consensus group, and select the node with the highest trust value as the master node, which effectively reduces the frequency of view switching and ensures the reliability of the consensus. In addition, this paper optimizes the consensus protocol of the PBFT consensus algorithm, which reduces the communication overhead and algorithm complexity in the consensus process, and effectively improves the efficiency of block generation. At the same time, by combining IPFS technology, asymmetric encryption algorithms and smart contract, it realizes the distributed storage of data and the encryption of transaction data on the chain, reducing the storage pressure on the main chain. By comparing this model with existing schemes, the results show that the model in this article has certain advantages in data encryption protection, throughput efficiency and ensuring node credibility. It not only ensures the reliable traceability of data, but also solves the problems of low consensus efficiency and data security in the traditional traceability system.
Conflict of interest
None to report.
