Non-permitted blockchain node detection and incentive method and system based on double-chain structure
The dual-chain structure in blockchains classifies node states and adjusts reputations and rewards to address silent nodes, improving consensus reliability and efficiency by using PBFT and HoneyBadgerBFT algorithms.
Patent Information
- Application Number
- CN202211125323.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-14
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2042-09-14
AI Technical Summary
In public chains, nodes may not participate in consensus in order to save resources or only send protocol messages to some nodes, which affects the availability of consensus. It is difficult for the prior art to effectively detect and incentivize nodes to participate in consensus.
Using a double-chain structure method, through transaction chain consensus and reputation chain consensus, the node status is detected and the reputation value and block reward are adjusted, the correct, wrong and silent nodes are distinguished, and the incentive mechanism is designed to promote node participation in consensus.
Effectively detect silent nodes, improve the reliability and accuracy of consensus algorithms, ensure that nodes participate in consensus according to the protocol, and improve the availability and fairness of the blockchain system.
Smart Images

Figure CN115664706B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of blockchain, and in particular to a method and system for detecting and incentivizing non-permissioned blockchain nodes based on a double-chain structure. Background Art
[0002] A blockchain is a decentralized network. Users participate in the processing of application data in the form of a network node through a formula algorithm. Each node has a complete backup of all application data in the blockchain, which can ensure that application data in a Byzantine environment will not be maliciously tampered with. Since the birth of Bitcoin and Ethereum, in order to establish a trust relationship among multiple institutions, the blockchain has been widely used currently.
[0003] One of the most important technologies in the blockchain is to ensure the consistency of data between node servers through a formula algorithm: Consortium blockchains generally adopt voting-based consensus algorithms. Most of these algorithms are based on the PBFT consensus algorithm, which can achieve a relatively high throughput, but the communication complexity between nodes is O(n 2 ). It can only be used in consortium networks with a small number of nodes and has poor performance when the number of nodes is large. Currently, many studies are dedicated to applying voting-based consensus in public blockchains with a large number of nodes. The ideas of these studies include electing a part of nodes from all nodes as a consensus group through VRF and then performing voting-based consensus through the elected consensus group, and also include randomly allocating nodes to multiple shards and using the nodes in the shards to perform voting-based consensus; both of these ideas can ensure that voting-based consensus is only carried out among a small number of nodes, so that the number of network nodes will not affect the consensus efficiency of voting-based consensus in the blockchain. The incentive problem of node participation in consensus in a non-permissioned environment is not considered in the current voting-based consensus algorithms of the blockchain. When traditional voting-based consensus is applied to a consortium blockchain, the access rights of nodes to the network are strictly controlled, and there is no block reward. Therefore, nodes generally do not maliciously damage the availability of the system. However, in a public blockchain, any node can access the network. The main purpose of node participation in consensus is to obtain a block reward. Generally, the block reward is evenly distributed among all nodes, but participating in consensus consumes the node's own resources. This may cause some nodes to save their own hardware resources, not participate in consensus or only send protocol messages to some nodes during consensus. However, if the entire round of consensus is successful, these nodes can still obtain the block reward, which may affect the availability of the consensus.
[0004] In the prior art, generally, a method of recording node reputation is used to incentivize nodes to participate in consensus. The calculation basis of the reputation value is adjusted according to different reputation value sources, and the corresponding block production rewards are allocated or the probabilities of selecting the primary node and the consensus group are adjusted according to the reputation value of each node. For example: in an application scenario based on crowdsourcing, multiple blockchain nodes calculate the results of the same question without a reference answer, and the reputation comes from the accuracy of its calculation results; such a reputation value calculation function can be set as: the initial reputation value is the average value, and the reputation value is adjusted according to the node consensus accuracy rate. And when the node consensus accuracy rates are the same, the reputation value of the node that has more recently exhibited Byzantine behavior is lower, and the reputation value of this node recovers more slowly after exhibiting Byzantine behavior; by designing an algorithm to detect the behavior of nodes sending inconsistent messages, the reputation comes from the detected situation of nodes sending inconsistent messages; such a reputation value calculation function can be set as: the reputation value of the Byzantine node detected to send inconsistent messages will be directly set to 0, and for the node whose vote is inconsistent with that of the majority of nodes, when the reputation value is high, both rewards and punishments are higher; based on the consensus algorithm for electing the consensus group, the consensus comes from the overall success or failure of each round of consensus, and such a reputation value will be adjusted according to the overall success or failure of each round of consensus. Nodes are more likely to increase when the reputation value is low and more likely to decrease when the reputation value is high. Currently, for the problem of detecting Byzantine behavior, due to the FLP impossibility principle, it is difficult for blockchain nodes to reach an agreement on whether other nodes participate in consensus, because selfish nodes can frame other nodes for not sending protocol messages, and other nodes cannot determine whether this node has not sent a message or the message sent has not been received yet. Therefore, the above incentive mechanism established using the reputation system can only adjust the reputation value for the inconsistent messages sent by nodes, but cannot determine whether the node has sent a message to participate in consensus, and thus cannot adjust the reputation value according to whether the node participates in consensus.
[0005] In the prior art, the method of using a failure detector can record the information received by the local node and its source, and a consensus algorithm is designed based on this. However, in traditional research, the purpose of detecting silent nodes is usually to ensure the availability of the consensus algorithm, rather than determining which specific blockchain nodes the silent nodes are. It can only be locally considered that other nodes have failed due to not sending messages, but a consensus cannot be reached among all nodes. Therefore, the technical problem addressed by the present invention is how to detect silent nodes during the public chain consensus process to avoid these nodes affecting the availability of the blockchain system. Summary of the Invention
[0006] In view of this, the embodiments of the present invention provide a method and system for detecting and incentivizing non-permissioned blockchain nodes based on a double-chain structure to eliminate or improve one or more defects existing in the prior art.
[0007] One aspect of the present invention provides a method for detecting non-permitted blockchain nodes based on a double-chain structure, which is characterized by including a transaction chain consensus step and a reputation chain consensus step;
[0008] The transaction chain consensus step includes: in the transaction chain, the blockchain nodes participating in the consensus send protocol messages to other nodes in the blockchain and accept the protocol messages from other nodes, thereby completing the corresponding transaction chain consensus and forming the local observation results of each blockchain node participating in the consensus and the corresponding proofs of the local observation results;
[0009] The reputation chain consensus step includes: after the completion of the current round of transaction chain consensus, broadcasting the local observation results generated by all blockchain nodes in the blockchain on the current round of reputation chain and forming a consensus in the current round of reputation chain to generate an observation result matrix of the blockchain. Each row in the observation result matrix represents the local observation results and the proofs of the local observation results of the corresponding blockchain node, and each column represents the observation results and the proofs of the observation results of the corresponding blockchain node at other nodes;
[0010] Classify the node states of each blockchain node in the current round of consensus process according to the observation result matrix.
[0011] In some embodiments of the present invention, the step of classifying the node states of each blockchain node in the current round of consensus process includes: classifying the node state of the blockchain node into a correct node, an incorrect node, a silent node on the transaction chain or a silent node on the reputation chain according to the local observation results in the corresponding row and the observation results of other nodes on the corresponding blockchain node in the corresponding column of the observation result matrix corresponding to each blockchain node.
[0012] In some embodiments of the present invention, the Practical Byzantine Fault Tolerance algorithm is selected for the transaction chain consensus to consensus on the protocol messages sent by each blockchain node in the blockchain.
[0013] In some embodiments of the present invention, the asynchronous consensus algorithm is selected for the reputation chain consensus to consensus on the local observation results generated by each blockchain node in the transaction chain; the asynchronous consensus algorithm includes a reliable broadcast protocol stage and a binary protocol stage; in the reliable broadcast protocol stage, the local observation results generated by each blockchain node in the transaction chain are broadcast for trading, so that each blockchain node reaches a consensus on the data information of the local observation results; and then through the binary protocol stage, the observation result matrix of the blockchain is formed according to the local observation results of each blockchain node.
[0014] Another aspect of the present invention provides a method for incentivizing non-permitted blockchain nodes based on a double-chain structure. Based on the classification results of the blockchain nodes formed by the above method, the reputation values of each type of blockchain node are adjusted and the block production rewards are allocated.
[0015] In some embodiments of the present invention, the adjustment of the credit value is based on:
[0016]
[0017] where represents the credit value of blockchain node i after the consensus of the r-th round of the transaction chain, α and β are the rate factors for increasing and decreasing the credit value, c i and f i are respectively the number of times that blockchain node i is determined to be correct and incorrect within the consensus rounds of the transaction chain, and false indicates the set of incorrect nodes.
[0018] In some embodiments of the present invention, the block reward includes a transaction chain reward and a credit chain reward. The transaction chain reward includes a basic reward and an additional reward; the basic reward is evenly distributed to the blockchain nodes participating in the transaction chain consensus, the additional reward is distributed according to the participation ratio of each blockchain node in the transaction chain consensus, and the credit chain reward is distributed according to the participation ratio of each blockchain node in the credit chain consensus.
[0019] In some embodiments of the present invention, the distribution principle of the block reward is:
[0020]
[0021] where represents the block reward obtained by blockchain node i in the r-th round of blockchain consensus, W r represents the total block reward of the r-th round of blockchain consensus, γ1 represents the proportion of the basic reward in the total block reward, γ2 represents the proportion of the additional reward in the total block reward, n 1i represents the number of copies of the additional reward that blockchain node i can obtain according to the observation results of other nodes on this blockchain node i in the i-th column of the observation result matrix M r , and n 2i represents the number of copies of the credit chain reward that blockchain node i can obtain according to the local observation results of blockchain node i in the i-th row of the observation result matrix M r ; correct indicates the set of correct nodes, false indicates the set of incorrect nodes, repMute indicates the set of silent nodes on the credit chain, and txMute indicates the set of silent nodes on the transaction chain; |correct| and |repMute| respectively represent the number of nodes in the two sets of correct nodes and silent nodes on the credit chain.
[0022] On the other hand, the present invention provides a non-permissioned blockchain node detection and incentive system based on a double-chain structure, including a processor and a memory. Computer instructions are stored in the memory, and the processor is configured to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the system implements the steps of the above method.
[0023] On the other hand, the present invention provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the steps of the above method are implemented.
[0024] The non-permissioned blockchain node detection and incentive method and system based on the double-chain structure according to the present invention maintain basic blockchain transactions through transaction chain consensus, and consensus on the situation of each blockchain node participating in the transaction chain consensus through a reputation chain. The detection problem of silent nodes is solved according to the consensus result of the blockchain. At the same time, a reputation system and an incentive mechanism are introduced for clear blockchain node classification. Through game theory analysis of the node status of each blockchain node, the observation result matrix of each blockchain node, and the benefits of the blockchain consensus strategy, a reputation adjustment strategy and an incentive mechanism are designed specifically to ensure that a sufficient number of nodes in the blockchain system finally converge to honestly record local observation results. In addition to being able to detect blockchain nodes that send incorrect messages, the present invention can also detect and punish silent nodes; at the same time, the reputation and incentives of each blockchain node are adjusted specifically, improving the way of synchronously adjusting the reputation values of all nodes in the consensus group and increasing the accuracy of rewards and punishments for blockchain nodes. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 Schematic diagram of the double-chain structure in the embodiment;
[0026] Figure 2 Blockchain consensus system architecture diagram based on the double-chain structure in the embodiment;
[0027] Figure 3 Flowchart of blockchain node detection and incentive in the embodiment;
[0028] Figure 4 Graph showing the relationship between whether a node sends a message to other nodes and the benefits obtained by the node;
[0029] Figure 5 Graph showing the relationship between whether a node sends a message to all other nodes and the benefits obtained by the node;
[0030] Figure 6 Graph showing the relationship between whether a node waits after completing the transaction chain consensus and the benefits obtained by the node;
[0031] Figure 7It is a comparison chart of the consensus time between the double-chain structure consensus algorithm and the original PBFT consensus algorithm in the present invention under different network scales and message sizes;
[0032] Figure 8 It is a comparison chart of the benefits between correct nodes and nodes that do not send messages to other nodes under different parameters;
[0033] Figure 9 It is a comparison chart of the benefits between correct nodes and nodes that send partial messages under different parameters;
[0034] Figure 10 It is a comparison chart of the benefits between correct nodes and nodes that do not wait for messages from other nodes after completing the consensus of the transaction chain under different parameters;
[0035] Figure 11 It is a comparison chart of the benefits between various incorrect nodes and correct nodes. Detailed implementation manners
[0036] To make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below in combination with the implementation manners and the drawings. Herein, the illustrative implementation manners of the present invention and their descriptions are used to explain the present invention, but do not limit the present invention.
[0037] Herein, it also needs to be noted that in order to avoid obscuring the present invention due to unnecessary details, only the structures and / or processing steps closely related to the solution of the present invention are shown in the drawings, while other details less related to the present invention are omitted.
[0038] It should be emphasized that the term "including / containing" when used herein refers to the existence of features, elements, steps or components, but does not exclude the existence or addition of one or more other features, elements, steps or components.
[0039] Herein, it also needs to be noted that if not specifically stated, the term "connection" in this article can not only refer to a direct connection, but also represent an indirect connection with an intermediate.
[0040] In the following, embodiments of the present invention will be described with reference to the drawings. In the drawings, the same reference numerals represent the same or similar components, or the same or similar steps.
[0041] Since the blockchain system distributes the block rewards equally to each node in the blockchain after successful consensus, this will make it unnecessary for blockchain nodes to participate in consensus, resulting in a reduction in the number of blockchain nodes participating in consensus and ultimately affecting the availability of blockchain consensus. To address this problem, in the prior art, a reputation system is introduced into blockchain nodes, and the distribution method of block rewards in the blockchain is adjusted according to the reputation values of each blockchain node. However, due to the FLP impossibility principle, it is difficult for blockchain nodes to reach an agreement on whether other nodes participate in consensus. Therefore, it is difficult to adjust the reputation value based on whether a certain blockchain node participates in consensus, and even less possible to achieve the adjustment of block rewards. In view of the above problems in the prior art, the present invention proposes a non-permissioned blockchain node detection and incentive method based on a double-chain structure, which conducts consensus on the message transmission process among blockchain nodes in the transaction chain and conducts consensus on the consensus result in the foregoing transaction chain through the reputation chain. Thus, according to the consensus result of the blockchain output by the reputation chain consensus, each blockchain node is detected and classified. In the present invention, corresponding block reward and reputation adjustment methods are also set for various different blockchain nodes, so that nodes that do not participate in consensus cannot obtain block rewards, and nodes that participate in consensus are also allocated block rewards according to the actual situation of participating in consensus, ensuring the reliability, fairness, and accuracy of the consensus algorithm.
[0042] The non-permissioned blockchain node detection method based on a double-chain structure according to the present invention first creates a consensus architecture for blockchain nodes as Figure 1 shown, including a transaction chain and a reputation chain, and correspondingly includes a transaction chain consensus step and a reputation chain consensus step.
[0043] The transaction chain consensus step includes: in the transaction chain, the blockchain nodes participating in consensus send protocol messages to other nodes in the blockchain and accept protocol messages from other nodes, thereby completing the transaction chain consensus and forming the local observation results of the blockchain nodes participating in consensus and the corresponding local observation result proofs.
[0044] In one embodiment, the consensus step of the transaction chain includes: in the transaction chain, the Practical Byzantine Fault Tolerance algorithm (PBFT consensus algorithm) is used to construct the transaction chain consensus for blockchain nodes. The blockchain node that receives the request sent by the client serves as the primary node in this round of consensus process. In the pre-prepare stage, the primary node sends the pre-prepare message corresponding to the request to other nodes in the blockchain, which serve as the secondary nodes in this round of consensus process. In the prepare stage, after each secondary node receives the pre-prepare message from the primary node, it sends the corresponding prepare message to other nodes in the blockchain. Finally, in the commit stage, each node in the blockchain broadcasts the corresponding commit message to other nodes, and each blockchain node generates the local observation result and the corresponding proof of the local observation result according to the received commit message. In the local observation result, the source node that receives the commit message is marked as "1", and the source node that does not receive the commit message is marked as "0". The proof of the local observation result is a protocol message with the signature of the source node; as Figure 2 shown.
[0045] The consensus step of the reputation chain includes: after the consensus of the transaction chain in this round is completed, the local observation results generated by all blockchain nodes in the blockchain are broadcast on the reputation chain in this round and form a consensus on the reputation chain in this round to generate the observation result matrix of the blockchain. Each row in the observation result matrix represents the local observation result and the proof of the local observation result of the corresponding blockchain node, and each column represents the observation result and the proof of the observation result of the corresponding blockchain node at other nodes.
[0046] In one embodiment, the consensus step of the reputation chain includes: in the reputation chain, the asynchronous consensus algorithm (HoneyBadgerBFT consensus algorithm) is used to construct the reputation chain consensus for the local observation results of blockchain nodes. In the reliable broadcast protocol (RBC) stage, the local observation results generated by each blockchain node in the transaction chain are broadcast through the broadcast stage (val), the echo stage, and the ready stage to enable each blockchain node to reach a consensus on the data information of the local observation results. Then, through the binary protocol (BA) stage, the binary broadcast stage (bval) and the confirmation stage (aux) are used to form the observation result matrix of the blockchain according to the local observation results of each blockchain node. Each row in the observation result matrix represents the local observation result and the proof of the local observation result of the corresponding blockchain node, and each column represents the observation result and the proof of the observation result of the corresponding blockchain node at other nodes, as Figure 2 shown.
[0047] Classify the node states of each blockchain node in the current round of consensus process according to the said observation result matrix.
[0048] In the embodiment, according to the local observation results in the corresponding row of the observation result matrix corresponding to each blockchain node and the observation results of other nodes on this blockchain node in the corresponding column, the node state of this blockchain node is classified into a correct node, an incorrect node, a silent node on the transaction chain or a silent node on the reputation chain. Among them, the classification principle of the node state of the blockchain node includes:
[0049] A correct node means that it participates in the consensus on both the transaction chain and the reputation chain; in the observation result matrix in the blockchain consensus result, if the number of commit messages received by the blockchain node from other blockchain nodes is greater than or equal to the minimum number required to reach a consensus, that is, the number of blockchain nodes recorded as "1" in the local observation result of this blockchain node in the observation result matrix ≥ n - f1, and the number of blockchain nodes that do not receive the commit message from this blockchain node in the observation results of other blockchain nodes is less than or equal to the threshold of the number of blockchain nodes whose determination result for this blockchain node is "0", and the number of blockchain nodes that receive the commit message from this blockchain node in the observation results of other blockchain nodes is greater than or equal to the threshold of the number of blockchain nodes whose determination result for this blockchain node is "1"; that is, the number of "0" occurrences in the observation results of other blockchain nodes on this column corresponding to this blockchain node in the observation result matrix ≤ t β And the number of "1" occurrences ≥ t α ; then this blockchain node is recorded as a correct i node; where n represents the total number of blockchain nodes, f1 represents the number of Byzantine nodes, t α represents the threshold of the number of blockchain nodes whose determination result for this blockchain node is in a non - silent state on the blockchain, and t β represents the threshold of the number of blockchain nodes whose determination result for this blockchain node is in a silent state on the blockchain;
[0050] An incorrect node means that an incorrect behavior occurs in the current round of consensus process; in the observation result matrix in the blockchain consensus result, on the one hand, if it is determined that the blockchain node receives a commit message from other blockchain nodes, that is, the blockchain nodes recorded as "1" in the local observation result of this blockchain node, there is no corresponding record in the corresponding local observation proof, which means that this blockchain node lies about receiving the commit message from other nodes, that is, set M r [j][k] = 1, and D rThe empty node [j][k] is denoted as an error node, and in the local observation result of the blockchain section Rj, the node k is denoted as "0", where M r [j][k]=1 means that in the local observation result of node j, node k is denoted as "1", D r [j][k] being empty means that in the proof of the local observation result of node j, there is no commit message proof from node k. On the other hand, if the number of commit messages received by a blockchain node from other blockchain nodes is less than the minimum number required to reach a consensus, that is, the number of blockchain nodes denoted as "1" in the local observation result of this blockchain node in the observation result matrix < n - f1, it means that this blockchain node must maliciously denote the source node of the received commit message as "0" in the local observation result, that is, this blockchain node is denoted as an error node.
[0051] A silent node on the transaction chain means that this blockchain node did not participate in the transaction chain consensus in this round of consensus, but the local observation result of this blockchain node is included in the observation result matrix in this round of consensus; in the observation result matrix of the blockchain consensus result, a row of local observation results corresponding to this blockchain node is included, but the number of "0" occurrences in the observation results of other nodes corresponding to this blockchain node in the column corresponding to this blockchain node > t β , which means that this blockchain node does not meet the requirements for completing the transaction chain consensus, and this blockchain node is denoted as a silent node on the transaction chain.
[0052] A silent node on the reputation chain means that this blockchain node participated in the transaction chain consensus in this round of consensus, but in the observation result matrix of this round of consensus, the local observation result of this blockchain node is not included; in the observation result matrix of the blockchain consensus result, the number of "0" occurrences in the observation results of other nodes corresponding to this blockchain node in the column corresponding to this blockchain node ≤ t β , but the row of local observation results corresponding to this blockchain node is empty, which means that this blockchain node did not participate in the reputation chain consensus in this round, that is, this blockchain node is denoted as a silent node on the reputation chain.
[0053] For the non-permission blockchain node incentive method based on the double-chain structure described in the present invention, based on the above classification results of blockchain nodes, the reputation values of various types of blockchain nodes are adjusted and the block production rewards are allocated.
[0054] Corresponding to the above embodiments, the steps of adjusting the reputation values of various types of blockchain nodes and allocating block production rewards include:
[0055] When adjusting the reputation values of blockchain nodes, only the error nodes in the current consensus need to be distinguished; the adjustment basis for the reputation values of the corresponding blockchain nodes is:
[0056]
[0057] Among them, represents the reputation value of blockchain node i after the consensus of the transaction chain in the r-th round. α and β are the rate factors for increasing and decreasing the reputation value, and f i and c i are respectively the number of times that blockchain node i is determined to be an incorrect node and a non-incorrect node within the consensus rounds of the transaction chain, and false indicates the set of incorrect nodes.
[0058] When allocating the block production rewards for blockchain nodes, first divide the block production rewards into the block production rewards of the transaction chain and the block production rewards of the reputation chain according to the consensus structure of the blockchain. The block production rewards of the transaction chain are further divided into basic rewards and additional rewards; among them, the basic rewards are evenly distributed to the blockchain nodes participating in the consensus of the transaction chain, and the additional rewards are distributed according to the participation ratio of each blockchain node in the consensus of the transaction chain, and the reputation chain rewards are distributed according to the participation ratio of each blockchain node in the consensus of the reputation chain. According to the node types of each blockchain node, the block production rewards of each type of blockchain node are as follows: The block production rewards of correct nodes include the basic rewards and additional rewards in the transaction chain, and also include the block production rewards of the reputation chain; incorrect nodes are not allocated any block production rewards; silent nodes on the transaction chain are not allocated transaction chain rewards; silent nodes on the reputation chain are not allocated reputation chain rewards. The corresponding distribution method of the block production rewards of blockchain nodes is:
[0059]
[0060] Among them represents the block production reward obtained by blockchain node i in the r-th round of blockchain consensus. W r represents the total block production reward in the r-th round of blockchain consensus. γ1 represents the proportion of the basic reward in the total block production reward, γ2 represents the proportion of the additional reward in the total block production reward, and n 1i represents the number of copies of the additional reward that blockchain node i can obtain according to the observation results of other nodes on the i-th column of the observation result matrix M r , that is, in the i-th column of the observation result matrix M r , the number of times the observation result "0" appears is less than t β ; n 2i represents the number of copies of the reputation chain reward that blockchain node i can obtain according to the local observation results of blockchain node i in the i-th row of the observation result matrix M r , that is, in the observation result matrix M rThe number by which the number of occurrences of the local observation result "1" in the i-th row is more than n - f1; correct represents the set of correct nodes, false represents the set of incorrect nodes, repMute represents the set of silent nodes on the reputation chain, and txMute represents the set of silent nodes on the transaction chain; |correct| and |repMute| respectively represent the number of nodes in the two sets of correct nodes and silent nodes on the reputation chain.
[0061] Based on the above specific method for allocating block production rewards for blockchain nodes, the transaction chain reward of a blockchain node is related to the proportion of "0" in the i-th column of the observation result matrix M r as Figure 3 shown.
[0062] In the above method for detecting and incentivizing blockchain nodes of a permissionless blockchain based on a double-chain structure, the type division and block production reward division for each blockchain node; in order to ensure that each blockchain node can be prompted to participate in blockchain consensus in accordance with the protocol requirements through this incentive method, it is necessary to make the income of correct nodes greater than that of incorrect nodes after the block production rewards are distributed through the above method. The higher the participation rate of a blockchain node in the transaction chain consensus, the higher the income. The more complete the commit messages received from other nodes in the transaction chain consensus, the higher the income. The higher the participation rate in the reputation chain consensus, the higher the income. Based on this, the classification and block production rewards of the above blockchain nodes are analyzed.
[0063] 1) The classification principle for blockchain nodes is as follows: It is necessary to ensure that a completely correct node, that is, a blockchain node that sends commit messages to all nodes, will definitely not be judged as a silent node. A completely incorrect node, that is, a blockchain node that does not send commit messages to any node or lies about receiving commit messages from other nodes, will definitely be judged as a silent node on the transaction chain. Based on this, the judgment threshold for silent nodes in blockchain nodes is analyzed:
[0064] In blockchain consensus, the number requirement for Byzantine nodes is If the number of incorrect nodes is f2, then in this blockchain, at least local observation results of blockchain nodes are credible. At this time, if it is necessary to ensure that a completely correct blockchain node will definitely not be judged as a silent node on the transaction chain, it is required to set the threshold for the number of "1" observations of this blockchain node by other nodes when the blockchain node is judged as a non-silent node To ensure that a completely incorrect node will definitely be judged as a silent node on the transaction chain. Even for a node marked as "1" in the incorrect nodes without corresponding observed result evidence, it will be modified to "0" in the local observed results of the incorrect node. And if the incorrect node maliciously marks the source node of the received commit message as "0", it will directly increase the number of "0"s in the observed results. Therefore, a threshold for the number of "0"s in the observed results of the blockchain node among other nodes is set when the blockchain node is judged as a silent node. To ensure that this blockchain node will not be judged as both a silent node and a non - silent node on the transaction chain, it is required to ensure that t α +t β >n, that is Therefore, the consensus algorithm of the above - mentioned blockchain can ensure reliability in the case of; and the conditions that the quantity threshold needs to meet are:
[0065] 2) In the transaction - chain consensus, a blockchain node may increase the number of "0"s in the local observed results of other nodes by not sending commit messages to other nodes or only sending commit messages to some nodes, thereby relatively increasing its own benefits.
[0066] To make the benefits of non - silent nodes on the transaction chain higher than those of silent nodes, analyze the benefits of each blockchain node in the blockchain where there are blockchain nodes that do not send commit messages according to the protocol requirements: Since in its own local observed results, it can still record itself as "1", each node that does not send commit messages will cause the number of "1"s in the observed result matrix M r to decrease by n - 1. If the proportion of non - silent nodes on the transaction chain in the blockchain is a, and the proportion of silent nodes on the transaction chain is 1 - a; then in the observed result matrix M r the total number of "1"s more than in each row is The number of "1"s more than in the local observed results of the nodes that do not send commit messages is Because the nodes that do not send commit messages are judged as silent nodes on the transaction chain and cannot obtain transaction - link rewards, so at this time, the benefits of the nodes that do not send commit messages are the reputation - chain benefits:
[0067]
[0068] The benefits of the blockchain nodes that send commit messages according to the protocol are:
[0069]
[0070] Based on the above analysis process, the change in the profit obtained by a node sending a commit message to other nodes is given under different proportions a of non-silent nodes on the transaction chain. As Figure 4 shown, the selected parameters are n = 30, γ1 = 0.4, γ2 = 0.4, and t β = 0.4. It can be seen that in most cases, the profit of honest nodes is higher than that of dishonest nodes. Among them, when α is close to 2 / 3, the profit of silent nodes on the transaction chain rises sharply. This is the worst-case scenario for silent nodes on the transaction chain to obtain the maximum profit, corresponding to exactly the situation where nodes choose not to send messages. At this time, if a certain node chooses not to send messages, it can obtain the most reputation chain profit. To avoid this situation, should be set to ensure that even in the worst-case scenario, the profit of silent nodes on the transaction chain is lower than that of non-silent nodes on the transaction chain. Therefore, the selection of γ1 and γ2 in the incentive mechanism needs to meet this condition.
[0071] To make the profit of blockchain nodes with a high transaction chain consensus participation rate higher than that of those with a lower transaction chain consensus participation rate, the profit of each blockchain node in a blockchain where there are blockchain nodes that only send commit messages to some nodes in the blockchain is analyzed: The proportion of nodes that do not send commit messages of this blockchain node is k, and not sending commit messages will not be judged as a silent node on the transaction chain. Then the profit of a node that only sends commit messages to some nodes in the blockchain is:
[0072]
[0073] The profit of a blockchain node that sends commit messages to all other nodes in the blockchain according to the protocol requirements is:
[0074]
[0075] Based on the above analysis process, the change in the profit obtained by a node sending commit messages only to some nodes in the blockchain is given under different proportions a of non-silent nodes on the transaction chain. As Figure 5 shown, the selected parameters are n = 30, γ1 = 0.4, γ2 = 0.4, and t β = 0.4, k = 0.2. In this case, the profit of a blockchain node that sends commit messages to all nodes must be greater than that of a blockchain node that only sends commit messages to some nodes in the blockchain. In fact, when γ2 > 0.05, it can be ensured that the profit of correct nodes is higher; for very small n, such as n ≤ 10, then γ2 needs to be adjusted to 0.1 to 0.2.
[0076] 3) In the reputation chain consensus, to ensure that the blockchain nodes that are completely correct in the reputation chain consensus, that is, the nodes that send their local observations to all other nodes and receive the local observations of all nodes have the highest rewards, analyze the behaviors of blockchain nodes that may not conform to the protocol:
[0077] For the behavior of a blockchain node not sending its own local observations in the reputation chain consensus, it will not obtain more transaction chain rewards and gives up the opportunity to obtain reputation chain rewards. Therefore, the benefits obtained from this behavior will necessarily be less than those of blockchain nodes that meet the protocol requirements.
[0078] For the behavior of sending local observations to the reputation chain consensus before completing the transaction chain consensus, since the number of "1"s in the local observations of this blockchain node is less than n - f1, this node will be judged as an incorrect node and will not obtain the block production reward. Therefore, the benefits obtained from this behavior will necessarily be less than those of blockchain nodes that meet the protocol requirements.
[0079] For a blockchain node that marks a node that has not received a protocol message as "1", since the commit message sent by this node cannot be received in the corresponding local observation proof, this blockchain node will be judged as an incorrect node and will not obtain the block production reward. Therefore, the benefits obtained from this behavior will necessarily be less than those of blockchain nodes that meet the protocol requirements.
[0080] For a blockchain node that waits for a period of time after completing the transaction chain consensus and marks the nodes that have received the protocol message as "0", since it is necessary to ensure that there are at least n - f1 "1"s in the local observations, it needs to wait for a longer period of time, and it also increases the possibility that its own local observations are not included in M r Therefore, the benefits obtained from this behavior will necessarily be less than those of blockchain nodes that meet the protocol requirements.
[0081] For a blockchain node that does not wait after completing the transaction chain consensus and only records the first 2 / 3 of the nodes that have received messages as "1" in the local observations, there are still commit messages sent by other nodes that have not been received at this time; for the behavior of directly performing reputation chain consensus by marking the node j that has not received the commit message as "0" in the local observations, three situations may occur:
[0082] The number of "0"s recorded by other nodes for the source node j of the commit message that this blockchain node has not received in the corresponding column of the observation result matrix exactly exceeds t β, the source node j will be judged as a silent node, and the total income of this blockchain node is:
[0083]
[0084] The number of observations of other nodes on the source node j of the commit message not received by this blockchain node in the corresponding column of the observation result matrix being recorded as "0" does not exceed t β , but since the number of observations recorded as "0" for it increases, the income of the source node j decreases, and then the income of this blockchain node relatively increases. The total income of this blockchain node is:
[0085]
[0086] If the number of observations of other nodes on the source node j of the commit message not received by this blockchain node in the corresponding column of the observation result matrix being recorded as "0" has exceeded t β , then the behavior of this blockchain node will not obtain more transaction chain income, and the total income is:
[0087]
[0088] Based on the income of this blockchain node in the above three cases, a proportion of nodes in this blockchain receive the commit message from the source node j, while the other 1 - a proportion of nodes do not receive the commit message from the source node because they choose not to wait after completing the PBFT consensus. Then, in the observations of other nodes on the source node j, 2 / 3 of them are "1" and 1 / 3 of them are "0". Then the probability that the source node j is recorded as "0" is Then M r The number of "0" in the j - th column of follows a binomial distribution, that is Therefore, if the probabilities of the three cases are respectively recorded as P1, P2, and P3, then Therefore, the income of this blockchain node is P1R1 + P2R2 + P3R3.
[0089] For a completely correct blockchain node, that is, a blockchain node that waits after the transaction chain consensus is completed to enable this blockchain node to receive as many commit messages sent by all nodes as possible, the income of this blockchain node is
[0090]
[0091] Under different proportions a given by the above analysis process, the change in whether a node waits to receive the commit message sent by other nodes to obtain benefits after the transaction chain consensus is completed is as follows Figure 6 As shown, the selected parameters are n = 30, γ1 = 0.4, γ2 = 0.4, t β = 0.4, k = 0.2. In this case, the benefits of completely correct blockchain nodes must be greater than those of blockchain nodes that do not wait for the commit message sent by other nodes after the transaction chain consensus is completed. According to the calculation, when γ1 + γ2 < 0.95, it can be ensured that the benefits of completely correct blockchain nodes are higher; for very small n, such as n ≤ 10, then γ1 + γ2 needs to be adjusted to 0.7 to 0.8.
[0092] 4) To prove that the waiting time t w in the blockchain consensus process will not cause this blockchain node to be unable to participate in the reputation chain consensus:
[0093] Assume that at the beginning of a certain round of transaction chain consensus, the nodes are synchronized, and the message transmission delay in a certain stage of the consensus is denoted as DELAY phase,i,j , which represents the delay of node i sending a message to node j, where phase represents the pre - prepare, prepare, commit, val, echo, ready, bval, or aux stage in the blockchain consensus process; assume that the network delay X follows a certain distribution f(x), and the time when a node completes the commit stage, that is, receives the messages of 2 / 3 of the other nodes, is denoted as TIME phase,i , then for adjacent consensus stages, TIME phase,i has a recurrence relationship, that is: TIME commit,i is equal to the value of the prepare,1 th node in the set {TIME commit,1,i +DELAY prepare,2 +DELAY commit,2,i ,...}. Then for the HoneyBadgerBFT consensus algorithm, after reaching a consensus on the local observation results of more than n - f1 nodes in the RBC stage and waiting for a certain period of time before proceeding to the BA stage, at this time, the maximum value that the waiting time t for node i can select is w MIN{TIME
[0094] , TIME aux,1 ,...}-TIME aux,2 . According to the above criteria, in the blockchain consensus process, blockchain node i waits for a period of time t ready,i after the transaction chain consensus is completed wReceived the commit message from node j, and the waiting time is t at this time w Satisfy: TIME prepare,j +DELAY commit,j,i -TIME commit,i <t w Then this waiting time t w will not cause the local observation results of node i not to be included in the reputation chain consensus.
[0095] In the embodiment, different f(x) are simulated, which proves that there is a waiting time t w that will not cause the node to be unable to participate in the reputation chain consensus, and can receive the commit messages of almost all correct nodes:
[0096] X Proportion of received commit messages Normal distribution, μ = 1, σ = 1 99.9% Normal distribution, μ = 1, σ = 0.5 100.0% Normal distribution, μ = 1, σ = 2 97.9% Weibull distribution, λ = 1, k = 1 95.8% Weibull distribution, λ = 1, k = 0.5 86.2% Weibull distribution, λ = 1, k = 2 100.0%
[0097] Performance tests are carried out on the consensus algorithm based on the double-chain structure and the original PBFT consensus algorithm by using three blockchain networks with 4 nodes, 7 nodes, and 10 nodes deployed separately. Among them, the four nodes of the 4-node network are deployed on 4 cloud servers respectively, 2 nodes are deployed on 2 cloud servers in the 7-node network, and 1 node is deployed on the other 3 cloud servers. 2 nodes are deployed on each of the 5 cloud servers in the 10-node network. As Figure 7 shown, it can be seen that since the HoneyBadgerBFT algorithm is additionally used to conduct consensus on silent nodes, it has a certain impact on performance. However, the consensus time occupied by HoneyBadgerBFT does not change with the message size. This is because the messages that need to be consensus in the reputation chain are only local observation results, and their size does not change with the size of the business messages in the transaction chain. Therefore, when the message size reaches 64KB, the impact of the HoneyBadgerBFT consensus algorithm on performance can be ignored.
[0098] Under different experimental conditions, 10 nodes are used to run 1000 rounds of consensus. Under different reward ratios of the transaction chain and the reputation chain, observe the revenue situations of the nodes that choose not to send protocol messages and the correct nodes, so as to complete the incentive mechanism test for the above-mentioned permissionless blockchain nodes based on the double-chain structure. As Figure 8 shown, among them, nodes 8 and 9 are the nodes that choose not to send protocol messages, and the other nodes are correct nodes. It can be seen that the revenue of the nodes that do not send protocol messages is much lower than that of the correct nodes. This is because according to the above conclusion, parameters that satisfy are selected, the reward of the reputation chain is relatively low, and the revenue of the nodes that do not send protocol messages is positively correlated with the reward ratio of the reputation chain. As Figure 9As shown, nodes 5, 6, 7, 8, and 9 are the nodes that selectively send some protocol messages. The proportion of these nodes sending protocol messages is 80%. The other nodes are correct nodes. It can be seen that the benefits of the nodes sending some protocol messages are slightly lower than those of the correct nodes because the proportion of these nodes sending protocol messages selected in the experiment is 80%, so these nodes will not be severely punished. At the same time, the benefits of the nodes sending some protocol messages are positively correlated with the basic rewards of the transaction chain because these nodes only lose some additional rewards of the transaction chain, but in the case of a relatively high proportion of sending protocol messages, they will not lose the basic rewards of the transaction chain. As Figure 10 shown, where nodes 5, 6, 7, 8, and 9 are the nodes that choose not to wait after completing PBFT, and the other nodes are correct nodes. It can be seen that the benefits of the nodes that do not wait after completing PBFT are slightly lower than those of the correct nodes. In the experiment, the parameters of the first group γ1 = 0.4, γ2 = 0.4, t β = 0.4 were used as the benchmark, and the threshold t β for judging silent nodes, the reward ratio γ1 + γ2 of the transaction chain and the reputation chain, and the ratio γ1, γ2 of the basic reward and the additional reward of the transaction chain were adjusted respectively. Among them, the parameter that mainly affects the benefits of dishonest nodes is the reward ratio of the transaction chain and the reputation chain. As Figure 11 shown, where nodes 4 and 5 are the nodes that choose not to send protocol messages, nodes 6 and 7 are the nodes that choose to send some protocol messages, and the proportion of these nodes sending protocol messages is 80%. Nodes 8 and 9 are the nodes that choose not to wait after completing PBFT, and the other nodes are correct nodes. It can be seen that the benefits of the nodes that do not send protocol messages are much lower than those of the correct nodes; while the benefits of the nodes that send some protocol messages are slightly lower than those of the correct nodes because the sending proportion is relatively high; the benefits of the nodes that do not wait after completing PBFT are close to those of the correct nodes. The reason is that in the settings of this experiment, nodes 4, 5, 6, and 7 may not send protocol messages, and the proportion is relatively high. Therefore, even if they choose to wait, the number of messages received is similar to that of not waiting.
[0099] From the above tests of the incentive mechanism, it can be seen that the benefits of non-fully correct nodes are always lower than those of fully correct nodes. Therefore, the incentive mechanism proposed by the present invention can promote blockchain nodes to complete the consensus process according to the protocol requirements by reducing the block production rewards of incorrect nodes.
[0100] The present invention also provides a permissionless blockchain node detection and incentive system based on a double-chain structure, which is deployed on five Alibaba Cloud servers (Intel(R) Xeon(R) Platinum 8269CY CPU @ 3.10GHz, 64GB RAM), including a processor and a memory. Computer instructions are stored in the memory, and the processor is configured to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the system implements the steps of the above-mentioned permissionless blockchain node detection and incentive method based on a double-chain structure.
[0101] In this embodiment, a computer-readable storage medium is also provided, on which a computer program is stored. When the program is executed by a processor, the steps of the above-mentioned permissionless blockchain node detection and incentive method based on a double-chain structure are implemented.
[0102] Corresponding to the above method, the present invention also provides a device / system, which includes a computer device. The computer device includes a processor and a memory. Computer instructions are stored in the memory, and the processor is configured to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the device / system implements the steps of the method described above.
[0103] The embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the aforementioned edge computing server deployment method are implemented. The computer-readable storage medium may be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the art.
[0104] Those of ordinary skill in the art should understand that the various exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Specifically, whether to implement in hardware or software depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a functional card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium or transmitted through a data signal carried in a carrier wave on a transmission medium or a communication link.
[0105] It should be clear that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications, and additions, or change the order between steps after understanding the spirit of the present invention.
[0106] In the present invention, the features described and / or illustrated for one embodiment can be used in the same or similar manner in one or more other embodiments, and / or combined with the features of other embodiments or replace the features of other embodiments.
[0107] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, various changes and modifications can be made to the embodiments of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A non-permitted blockchain node detection method based on a double-stranded structure, characterized in that, It includes a transaction chain consensus step and a reputation chain consensus step; The transaction chain consensus step includes: in the transaction chain, the blockchain nodes participating in the consensus send protocol messages to other nodes in the blockchain and accept protocol messages from other nodes, thereby completing the corresponding transaction chain consensus and forming the local observation results of each blockchain node participating in the consensus and the corresponding proofs of the local observation results; The reputation chain consensus step includes: after the current round of transaction chain consensus is completed, the local observation results generated by all blockchain nodes in the blockchain are broadcast on the current round of reputation chain and consensus is formed in the current round of reputation chain to generate an observation result matrix of the blockchain. Each row in the observation result matrix represents the local observation results and the proofs of the local observation results of the corresponding blockchain node, and each column represents the observation results and the proofs of the observation results of the corresponding blockchain node at other nodes; wherein, the reputation chain consensus selects an asynchronous consensus algorithm to perform consensus on the local observation results generated by each blockchain node in the transaction chain; Classify the node states of each blockchain node in the current round of consensus process according to the observation result matrix; Among them, the step of classifying the node states of each blockchain node in the current round of consensus process includes: according to the local observation results in the corresponding row and the observation results of other nodes on this blockchain node in the corresponding column in the observation result matrix corresponding to each blockchain node, classify the node state of this blockchain node into a correct node, an incorrect node, a silent node on the transaction chain or a silent node on the reputation chain.
2. The method according to claim 1, wherein The transaction chain consensus selects the Practical Byzantine Fault Tolerance algorithm to perform consensus on the protocol messages sent in the blockchain.
3. The method according to claim 1, wherein The asynchronous consensus algorithm includes a reliable broadcast protocol stage and a binary protocol stage; In the reliable broadcast protocol stage, broadcast the local observation results generated by each blockchain node in the transaction chain, so that each blockchain node reaches a consensus on the data information of the local observation results; Then, through the binary protocol stage, form the observation result matrix of the blockchain according to the local observation results of each blockchain node.
4. A non-permissioned blockchain node incentive method based on a double-chain structure, characterized in that, Based on the classification results of the blockchain nodes formed by the method according to any one of claims 1-3, adjust the reputation values and allocate block production rewards for each type of blockchain node.
5. The method according to claim 4, wherein The basis for adjusting the reputation value is: Among them, represents the blockchain node The credibility value after the consensus of the round of transaction chain, and is the rate factor for increasing or decreasing the credibility value, and are the number of times the blockchain node is determined to be correct and incorrect within the consensus round of the transaction chain respectively, indicates the set of faulty nodes.
6. The method according to claim 4, characterized in that, The block production rewards include transaction chain rewards and reputation chain rewards. The transaction chain rewards include basic rewards and additional rewards; the basic rewards are evenly distributed to the blockchain nodes participating in the transaction chain consensus, the additional rewards are distributed according to the participation ratio of each blockchain node in the transaction chain consensus, and the reputation chain rewards are distributed according to the participation ratio of each blockchain node in the reputation chain consensus.
7. The method according to claim 6, characterized in that, The principle for allocating the block production rewards is: Among them represents a blockchain node the block reward obtained from the round of blockchain consensus, represents the total block reward of the round of blockchain consensus, represents the proportion of the basic reward in the total block reward, represents the proportion of the additional reward in the total block reward, the column of the observation result matrix represents the observation results of other nodes on this blockchain node, and the number of additional rewards that this blockchain node can obtain, represents the local observation results of the blockchain node in the row of the observation result matrix and the number of reputation chain rewards that this blockchain node can obtain; represents the set of correct nodes, represents the set of incorrect nodes, represents the set of silent nodes on the reputation chain, represents the set of silent nodes on the transaction chain; and respectively represent the number of nodes in the two sets of correct nodes and silent nodes on the reputation chain.
8. A non-permissioned blockchain node detection and incentive system based on a double-chain structure, comprising a processor and a memory, characterized in that, The memory stores computer instructions, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the system implements the steps of the method according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 7.