PBFT (proxy-based policy and authorization-based ft) trust certification block chain consensus algorithm

文档序号:7634 发布日期:2021-09-17 浏览:26次 中文

1. A PBFT-based delegation rights certification block chain consensus algorithm is characterized by comprising the following steps:

s1, taking one hour as the operation period in the operation process of the block chain system, initializing the credit rating and the credit coefficient of all nodes in the network and recording the block production turn before the system operates

S2, the nodes in the block chain network throw the positive tickets and the negative tickets according to the amount of the own rights and the credit rating of the candidate nodes, wherein the negative tickets can be thrown at most once in an election period; after the node voting is completed, selecting a representative node with changed network parameters, and performing statistical optimization work on voting results; selecting the previous node with the most effective votes, wherein the previous node isIndividual node as agent node setOf 1 atToAs a set of verification nodesOf 1 atToNode of (2) as a set of candidate agent nodes

S3, the agent nodes generate a sequence according to the shuffle algorithm, then the blocks are produced in turn according to the sequence, the generated blocks are verified by utilizing the PBFT algorithm, and corresponding processing measures are taken for the condition that the current agent nodes do not produce the blocks in the corresponding time slice until all the agent nodes of the sequence complete block production;

s4, when the node set of the agent is pressedAfter the random sequence finishes one round of block production, the agent node forms a new block outlet sequence through a shuffle algorithm, and the step S2 is continued; if the present operation cycle is ended, the process proceeds to step S1.

2. The PBFT-based delegation rights certification blockchain consensus algorithm of claim 1, wherein the step S1 comprises the following steps:

s11, the credit coefficient represents the credibility of the effective block produced by the nodes in the network, the higher the credit coefficient is, the more likely the nodes are selected into the agent node set, otherwise, the nodes are not easy to be trusted and voted by other nodes; the credit coefficient mainly functions through a credit consumption and credit reward mechanism, and in the block consensus process, the initial credit coefficient of the network node is set as a default value; the node has a plurality of credit ratings, different credit ratings marking the condition of the broker node production block and thus involving a translation of the credit rating of the node; in the initial state, the credit rating of the node selected as the agent is NORMAL grade, which represents that the node normally operates;

s12, block production roundThe initialization is 0.

3. The PBFT-based delegation rights certification blockchain consensus algorithm of claim 1, wherein the step S2 comprises the following steps:

s21, in the process of voting of the nodes, the ordinary nodes vote or vote inversely according to the credit rating of other nodes and the credit coefficient, and each node votes for or votes against at the timeAt most one rejection ticket can be thrown in the interval; the regular nodes tend to vote up on the nodes with credit rating GOOD and vote down on the nodes with credit rating EXCEPTION; after the voting is finished, calculating the effective vote number of each node according to the formula (1);

(1),

wherein the content of the first and second substances,representing the number of valid votes, for selecting the agent node set,representing the conversion of the candidate node credit coefficients into the conversion proportion of the vote,anddefining the value for the system, representing the respective weights of the positive ticket and the negative ticket, satisfyingCan be taken out generally

S22, selecting the front with the most effective votesA node, whereinIndividual node as agent node setOf 1 atToAs a set of verification nodesOf 1 atToNode of (2) as a set of candidate agent nodes(ii) a Number ofThe value of (a) is determined by considering the number to be sufficient to ensure the decentralization of the block chain system by at least 50% of the voting ordinary nodes; in addition, after the agent node set is obtained, credit reward is carried out according to the situation of voting for the objection, each node also calculates the respective credit consumption and carries out credit stabilization and voting timeIs reset.

4. The PBFT-based delegation rights certification blockchain consensus algorithm of claim 1, wherein the step S3 comprises the following steps:

s31, randomly ordering the agent node set through the shuffle algorithm to generate a random sequence

S32, according to the sequence, the agent nodeProducing blocks and verifying the packed blocks by a PBFT algorithm, wherein the specific process is described as follows:

s321, agent nodePackaging the transactions in the block chain network into a block, then sending the block to all verification nodes in a verification set by adopting a point-to-point protocol, and when the nodes existWhen a sufficient number of valid verification replies are received, the verification is passed, the block is added into the block chain, and the next node sequentially and alternately executes the current block production flow;

s322, if the agent node produces the invalid block, the credit rating of the invalid block is reduced from the Normal level to the EXCEPTION level; if the number of failed production blocks exceedsThe credit rating of the agent node is continuously reduced to ERROR level, which indicates that the node is a malicious node and needs to be usedReplacing the candidate agent nodes in the set; if nodeThe number of valid blocks of accumulated production exceeds a thresholdThen the credit rating of the node is converted to a GOOD level.

5. The PBFT-based delegation rights certification blockchain consensus algorithm of claim 1, wherein the step S4 comprises the following steps:

s41, agent node sequenceThe last node in (1) isWhen the blocks are packaged in the specified time slice, the first round of block production is finished, and the block production round is finishedAdding 1 and performing step S3;

s42, when the running period is finished, executing step S2.

Background

With the rapid rise of digital currencies such as Bizhou, more and more researchers and financial technology companies are beginning to invest in the research of the block chain, the underlying technology. The consensus mechanism is one of core technologies of the blockchain system, and directly determines various aspects of performance indexes and application-oriented scenes of the system.

The block chain platform can be divided into five layers of a network layer, a consensus layer, a data layer, an intelligent contract layer and an application layer on the whole. The great point of the block chain technology is the consensus mechanism thereof, and the mutual trust problem among the nodes is solved on the idea of decentralization. The block chain has a plurality of nodes, each node can not depend on centralized authority, and large-scale efficient cooperation can still be completed due to a consensus mechanism.

The consensus algorithm was originally used to solve the consistency problem of distributed systems, i.e. how to make local data of peer nodes in distributed systems perfectly consistent and achieve consensus on some common decision. The workload certification algorithm PoW is a consensus algorithm first applied to a block chain system, and the block accounting right is obtained by calculating the hash value of a new block by using mine digging nodes in a mutually competing manner so as to meet a certain difficulty value. PoW requires a high amount of computer effort to traverse the hash value, so there is a large waste of resources and transaction throughput is too low. PPcoin adopts the idea of PoS consensus algorithm to associate the difficulty of digging the ore with the age of the coin of the virtual currency held by the node, so that the larger the age of the coin submitted when one node digs the ore, the lower the difficulty of digging the ore. Although the right to compute hash values is still needed to obtain billing, the energy consumption has been greatly reduced relative to PoW. PoS has the disadvantage of being prone to the martensitic effect, resulting in the eventual concentration of digital currency in the hands of a small number of people. In order to solve the currency enrichment problem of PoS, Larimer proposes a delegation rights and interests certification algorithm DPoS on the basis of PoS, and realizes the delegation rights and interests certification algorithm DPoS in the BitShare project firstly. In the DPoS, not all nodes participate in the process of mining, and common nodes vote to select the trusted nodes as witness nodes to verify transactions and carry out accounting. The selected witness nodes do not need to compete but take turns to generate blocks. However, there are also many places that need to be improved for DPoS algorithms, such as: in the process of electing the agent node, a few nodes jointly cast votes to a certain candidate node, and other common nodes cast votes not actively, so that the decentralization characteristic of a block chain network is influenced, and a certain safety problem is caused; if the selected agent node set has a malicious node, the DPoS algorithm jumps to the next node to continue producing the block, and the malicious node either fails to produce the block or generates the blockA block chain fork is generated and cannot be processed in time, so that the packaging and verification of the block are influenced, the throughput of a block chain system for processing transaction data is reduced, and the safety problem occurs; in the process of producing blocks and verifying, after the agent nodes produce the blocks, the agent nodes are required to receive the verification of the subsequent agent nodes, and when the blocks are more than () After verification by the proportional broker node, the block can be added into the block chain and broadcast to other nodes. This results in that the block originally produced by one agent node needs to be verified by tens or even hundreds of agent nodes, which greatly prolongs the verification delay of the block and affects the transaction throughput of the system.

The PBFT algorithm was used as a fault-tolerant technique in the field of distributed computing in the early days, mainly for solving the problem of distributed network consistency, and also can be used in a block chain system, but is limited only in private chains and alliance chains, while in public chain systems, the main consensus algorithms are POW, POS and DPoS. The three recognition mechanisms have advantages and disadvantages respectively, for example, POW has complete mathematical proofs, theoretically, the most safe and relatively simple realization are realized, but the POW has great defects in energy consumption, block-out time and transaction capacity, while POS has problems of greater safety risk, great network flow pressure when electing nodes, rich and poor, and the like, while DPOS reduces the number of electing nodes to reduce the network pressure, but has the influence of controlling the network by nodes with more tokens and the inconvenience that malicious nodes need to be voted and rejected again.

The entrusting interest proves that the consensus algorithm is relatively balanced in performance in all aspects, but the consensus algorithm needs to be improved in the aspects of safety, high efficiency, verification time delay and the like to meet the application requirements of the continuous development of the public chain. Therefore, there is a need to introduce and create a variety of mechanisms to design a PBFT-based delegation rights certification algorithm to solve these problems.

Disclosure of Invention

The invention aims to solve the technical problems that voting of common nodes in a block chain network is not positive, votes are easily cast to a certain candidate node by a small number of nodes in a combined mode, malicious nodes cannot timely process and influence packing and verification of a block, certain potential safety hazards are caused, block verification time delay is too long, and the like.

To solve the above technical problem, an embodiment of the present invention provides a PBFT-based delegation rights certification block chain consensus algorithm, including the following steps:

s1, taking one hour as the operation period in the operation process of the block chain system, initializing the credit rating and the credit coefficient of all nodes in the network and recording the block production turn before the system operates

S2, the nodes in the block chain network throw the positive tickets and the negative tickets according to the amount of the own rights and the credit rating of the candidate nodes, wherein the negative tickets can be thrown at most once in an election period; after the node voting is completed, selecting a representative node with changed network parameters, and performing statistical optimization work on voting results; selecting the previous node with the most effective votes, wherein the previous node isIndividual node as agent node setOf 1 atToAs a set of verification nodesOf 1 atToNode of (2) as a set of candidate agent nodes

S3, the agent nodes generate a sequence according to the shuffle algorithm, then the blocks are produced in turn according to the sequence, the generated blocks are verified by utilizing the PBFT algorithm, and corresponding processing measures are taken for the condition that the current agent nodes do not produce the blocks in the corresponding time slice until all the agent nodes of the sequence complete block production;

s4, when the node set of the agent is pressedAfter the random sequence finishes one round of block production, the agent node forms a new block outlet sequence through a shuffle algorithm, and the step S2 is continued; if the present operation cycle is ended, the process proceeds to step S1.

Wherein, step S1 includes the following specific steps:

s11, the credit coefficient represents the credibility of the effective block produced by the nodes in the network, the higher the credit coefficient is, the more likely the nodes are selected into the agent node set, otherwise, the nodes are not easy to be trusted and voted by other nodes; the credit coefficient mainly functions through a credit consumption and credit reward mechanism, and in the block consensus process, the initial credit coefficient of the network node is set to a default value, for example 60; the node has a plurality of credit ratings, different credit ratings marking the condition of the broker node production block and thus involving a translation of the credit rating of the node; in the initial state, the credit rating of the node selected as the agent is NORMAL grade, which represents that the node normally operates;

s12, block production roundThe initialization is 0.

Wherein, step S2 includes the following specific steps:

s21, in the process of voting of the nodes, the ordinary nodes vote or vote inversely according to the credit rating of other nodes and the credit coefficient, and each node votes for or votes against at the timeAt most one rejection ticket can be thrown in the interval; the regular nodes tend to vote up on the nodes with credit rating GOOD and vote down on the nodes with credit rating EXCEPTION; after the voting is completed, the effective votes obtained by each node are calculated according to the formula (1).

(1),

Wherein the content of the first and second substances,representing the number of valid votes, for selecting the agent node set,representing the conversion of the candidate node credit coefficients into the conversion proportion of the vote,anddefining the value for the system, representing the respective weights of the positive ticket and the negative ticket, satisfyingCan be taken out generally

S22, selecting the front with the most effective votesA node, whereinIndividual node as agent node setOf 1 atToAs a set of verification nodesOf 1 atToNode of (2) as a set of candidate agent nodes(ii) a Number ofThe value of (a) is determined by considering the number to be sufficient to ensure the decentralization of the block chain system by at least 50% of the voting ordinary nodes; in addition, after the agent node set is obtained, credit reward is carried out according to the situation of voting for the objection, each node also calculates the respective credit consumption and carries out credit stabilization and voting timeIs reset.

Wherein, step S3 includes the following specific steps:

s31, randomly ordering the agent node set through the shuffle algorithm to generate a single agent node setRandom sequence

S32, according to the sequence, the agent nodeProducing blocks and verifying the packed blocks by a PBFT algorithm, wherein the specific process is described as follows:

s321, agent nodePackaging the transactions in the block chain network into a block, then sending the block to all verification nodes in a verification set by adopting a point-to-point protocol, and when the nodes existWhen a sufficient number of valid verification replies are received, the verification is passed, the block is added into the block chain, and the next node sequentially and alternately executes the current block production flow;

s322, if the agent node produces the invalid block, the credit rating of the invalid block is reduced from the Normal level to the EXCEPTION level; if the number of failed production blocks exceedsThe credit rating of the agent node is continuously reduced to ERROR level, which indicates that the node is a malicious node and needs to be usedReplacing the candidate agent nodes in the set; if nodeThe number of valid blocks of accumulated production exceeds a thresholdThen the credit rating of the node is converted to a GOOD level.

Wherein, step S4 includes the following specific steps:

s41, agent node sequenceThe last node in (1) isWhen the blocks are packaged in the specified time slice, the first round of block production is finished, and the block production round is finishedAdding 1 and performing step S3;

s42, when the running period is finished, executing step S2.

The technical scheme of the invention has the following beneficial effects:

1. the invention defines core elements such as relevant credit rating, credit coefficient and the like of an agent, and introduces the agent node election model based on credit reward and punishment, aiming at the problems that the DPoS consensus algorithm node voting is not positive and malicious nodes are still likely to elected to the agent node. Under the election model, the network nodes greatly reduce the proportion of abnormal nodes becoming agents by casting negative votes. Meanwhile, due to a credit stabilization and time resetting mechanism, the common nodes need to participate in election voting as much as possible, and the enthusiasm of election is effectively improved.

2. In the invention, aiming at the problem that a DPoS consensus algorithm cannot process malicious nodes in one election period, the alternative agent node replacement mechanism selects agent nodes and an alternative agent node set, wherein the alternative agent node set is used for replacing nodes which are changed into an ERROR state due to multiple block-out failures in the agent node set, so that the malicious nodes are effectively processed.

3. The block verification scheme based on the PBFT algorithm aims at the problem that the DPoS algorithm verification time delay is far larger than the block production time delay and the block output efficiency is influenced. And similarly, selecting a verification agent node set according to the election model, and then running a PBFT algorithm on the set to achieve the purpose of verifying the block in time. If the view is replaced due to the fact that the main node of the verification agent node set breaks down, the normal node in the alternative agent node set needs to be used for replacing the view, so that the fact that the view is frequently replaced by the verification agent node set is avoided, and safety of an algorithm is improved.

Drawings

FIG. 1 is a schematic diagram of the node rating conversion of the present invention.

Fig. 2 is a reward and punishment scheme flow chart of the present invention.

Fig. 3 is a credit reward and punishment architecture diagram of the present invention.

FIG. 4 is a diagram of a PBFT algorithm validation architecture of the present invention.

FIG. 5 is a block verification process diagram according to the present invention.

Fig. 6 is an alternate node alternate architecture diagram of the present invention.

Detailed Description

In order to make the technical problems, technical solutions and advantages of the present invention more apparent, the following detailed description is given with reference to the accompanying drawings and specific embodiments.

The invention provides a PBFT (proxy rights and interests) -based delegation rights and interests demonstration block chain consensus algorithm, namely a PDPoS (public data processing system) algorithm, which defines the concepts of credit rating, credit coefficient and the like and introduces a credit reward and punishment-based agent node election model aiming at the problems that the DPoS node voting is not positive and malicious nodes are still likely to be elected to agent nodes. Under the election model, the network nodes greatly reduce the proportion of abnormal nodes becoming agents by casting negative votes. Meanwhile, due to a credit stabilization and time resetting mechanism, common nodes need to participate in election voting as much as possible, and the enthusiasm of election is effectively improved; aiming at the problem that a DPoS consensus algorithm cannot process malicious nodes in time in one round of election period, an agent and a candidate agent node set are elected, wherein the candidate agent node set is used for replacing nodes which fail to go out of blocks for many times in the agent node set in time, and therefore the malicious nodes are effectively processed. On the other hand, aiming at the problem that the DPoS algorithm verification delay is far larger than the block production delay, and further the block generation efficiency is influenced, a verification node set is selected by the algorithm, and then the PBFT algorithm is introduced to quickly verify the block.

The invention specifically comprises the following steps:

step 1: at the initial stage of each operation period, acquiring the credit coefficient and credit rating of each node in the block chain network and initializing the round of the agent node in the current operation period to produce the block

During each run cycle, the node has multiple credit ratings, with different credit ratings marking the instances of the broker node production blocks, and thus involving a translation of the node's credit rating. In the initial state, the credit rating of the node selected as the agent is in a NORMAL level, which indicates that the node operates normally. According to the principle of time slice rotation, when the node is rotated to produce the block, if the node generates an invalid block, the credit rating of the node is changed into an EXCEPTION state, otherwise, the NORMAL state is continuously kept. And when the credit rating of the node is changed into GOOD along with the multi-round block production and the plurality of blocks are continuously produced by the agent node and exceed the threshold value M, the agent node at the GOOD credit rating is preferentially voted by the common node when the next node is elected. Likewise, an agent node at an EXCEPTION credit rating may be penalized or even deprecated for a next voting election. If the number of times of production failure of the agent node block in the evaluation credit rating reaches m, the number of times of production failure of the agent node block is reduced to an ERROR level, and the ERROR node is replaced by an alternative node replacement mechanism in order to maintain a certain number of agent nodes and ensure the safety of the system. FIG. 1 is a diagram illustrating the conversion between credit ratings.

Step 2: node elections are carried out before the first round of production blocks in each operation cycle by the agent node set, the verification node set and the alternative replacement node set, and election rules of the nodes are as follows: in the process of voting by the node, the common node is based on the credit of other nodesThe rating and how many credits factor vote or vote against, each node can only vote one vote against at most during the time interval T. Generally, a normal node tends to vote up for a node with a credit rating of GOOD, and vote down for a node with a credit rating of egress. After the node voting is completed, a representative node with changed network parameters is selected, and the statistical optimization work of the voting result is carried out. Calculating the effective number of votes obtained by each candidate node by using the formula (1), sorting the effective number of votes obtained by each candidate node, and selecting the top node with the most effective number of votes obtained by each candidate nodeA node, whereinIndividual node as agent node setOf 1 atToAs a set of verification nodesOf 1 atToNode of (2) as a set of candidate agent nodes. Number ofThe value of (A) is considered to be the number by a common node which votes at least 50%In an amount sufficient to ensure that the blockchain system is decentralized. In addition, after the agent node set is obtained, credit reward is carried out according to the situation of voting for the objection, each node also calculates the respective credit consumption and carries out credit stabilization and voting timeIs reset.

In the original trust authority proving algorithm, a common node can only vote for a trusted node in a mode of voting for vote, but cannot vote for an untrusted network node to further reduce the probability of being selected as an agent node, so that the invention sets a vote casting mechanism. In addition, the enthusiasm of voting of the network nodes is further improved by credit reward and consumption, and the efficient and safe operation of the system is maintained, so that various reward and punishment measures are set. The two cooperate with each other in the voting stage, and the operation flow is shown in fig. 2.

The credit reward and punishment measure in the step mainly comprises four modules of credit consumption, credit stabilization, voting time reset and credit reward. The first three modules are used for carrying out passive credit punishment aiming at the node voting condition and mainly used for improving the enthusiasm of node voting, and the credit reward module is mainly used for rewarding and objecting votes so as to actively reduce the probability of the abnormal nodes electing the agent nodes. The overall mechanism is based on the node confidence factor, which represents the confidence level of the normal production block of the node. The credit reward and punishment architecture of the node is shown in fig. 3.

The credit consumption module indicates that the credit coefficient will decrease slowly with the voting time, and the rule satisfied is defined as:

(2);

wherein the content of the first and second substances,representing individual nodes in a distributed networkThe number of credits of (a) to (b),representing the actual time interval between two votes,representing a fixed custom time interval, defined in this example as 1 hour. If the actual interval of time that the node participated in the voteExceedIt indicates that the node votes less aggressively and therefore the credit coefficientWill slowly fall otherwiseAnd is not changed.The credit consumption rate is expressed and can be adjusted according to the actual application requirement.

Credit stabilization and vote time reset module: after each round of voting, the node calculates its current credit value according to equation (2). If the node votes successfully, the accumulated time of the votingIs changed to 0, otherwiseWill continue to increase until a fixed time interval is exceededResulting in a reduction of the credit factor. Therefore, the effective node can actively participate in the voting link to maintain creditAnd (4) stabilizing.

A credit reward module: the credit reward here is primarily a reward for a node to vote on and succeed. At intervals T, the regular nodes can only cast one negative vote to prevent the election process from being deliberately violated. Generally, the ordinary node may vote against the abnormal node, and if the abnormal node does not select the agent node, a certain credit reward is obtained, as shown in equation (3):

(3)。

after the node voting is completed, statistical sequencing needs to be performed according to the vote obtaining condition of each node. Each node dynamically maintains a node information table, as shown in table 1.

TABLE 1

Node public key Credit rating Credit coefficient (C) Zan Ticket (V) Anti-ticket (NV)
NORMAL 60 10 1

And calculating the effective votes according to the credit coefficient, the votes approved and the votes disapproved of the nodes. The related calculation formula is shown as formula (1).

And step 3: the agent node block production obtains an agent node set through the step 2, blocks are produced in turn through the agent nodes in a time slice rotation mode, in the embodiment, one block is produced every 3 seconds, and then the blocks are sequentially verified by the subsequent agent nodes. If a certain agent node is in correspondenceIf the production block fails within the time slice, the node is skipped and the next agent node produces the block. The delegation interest attestation algorithm does not immediately address the behavior of the node, but instead hopes to cast the node that failed the production block out of the agent node set in the next voting election. Nodes that fail to produce blocks may still produce invalid blocks during the current round of election, thereby affecting block generation efficiency and system security. Therefore, the present embodiment introduces a reward and punishment mechanism on the basis of the delegation rights and interests proving algorithm. If the agent node produces an invalid block, the credit rating of the agent node is reduced from the Normal level to the EXCEPTION level; if the number of times of the failure of the production block exceeds m, the credit rating of the agent node is continuously reduced to ERROR level, which indicates that the node is a malicious node and needs to be usedThe candidate agent nodes in the set are replaced. The pseudo code of the specific steps of the blocking algorithm of the agent node is shown in table 2:

TABLE 2

Algorithm: GenerateBlock()

Input: R1={x[0],x[1],…x[n-1]},Transactions

Output: block

1R 1 shuffle (R1)// shuffle order

2 slot = global_time_offset/block_time

3 pos = slot mod | R1 |// choosing initial billing agent node location

4 WHILE true:

5 (block, error) PackagingBlock (R1[ pos ], Transactions)// Packed Block

6 IF error.flag = false THEN

7 verify (block, R2)// verify block

8 IF R1[pos].num >= M THEN R1[pos].CreditRating = GOOD

9 ELSE// Block production failure

10 IF error.num < m THEN

11 R1[pos].CreditRating = EXCEPTION

12 ELSE

13 R1[pos].CreditRating = ERROR

14R 1[ pos ] substitete (R1[ pos ], R3)// alternative node replacement

15 END IF

16 END IF

17 pos pos+1

18 IF isElectrionBegin () = true// IF new election period starts, the current round of block production is ended

19 Break;

20 END IF

21 END WHILE

And 4, step 4: block verification and malicious node replacement

As shown in FIG. 4, the agent node 1 collects transactions in the network and packages them into block 1, which is then sent to the master node in the authentication set using a point-to-point protocol. The format of the transmission isWhereinA block of the package is represented as,a time stamp is represented which is a time stamp,a proxy node serial number is represented,representing a blockThe summary of (a) is provided,representing the signature of the agent node. After the agent node 1 has produced the block within the prescribed time slice, it will be delivered to the agent node 2 for the next block production and wait for receivingThe reply with valid signature of each block, and the number of malicious nodes in the verification set is assumed to beThe total node number isThus there are. The format of the reply is typicallyWhereinRepresents the current view number of the view,a time stamp representing the time of the corresponding request,to produce the agent node number for the block,is composed ofThe sequence numbers of the verification nodes in the set,representsThe signature of the node on the reply,representing a summary of the block.

Master nodeThe pre-prepare (pre-prepare) phase is entered after the block message is received, while the block is encapsulated as a pre-prepare message and saved on a local log, which is then broadcast to the remaining authentication broker nodes. Since the blocks are produced in the order of the proxy nodes, there is no concern about block ordering and no need to assign a sequence number to the block. The pre-prepared message format after the signature is packaged is-WhereinRepresenting the location of the message when it was sentThe number of the view of (a),representing an abstract of a blockThe signature of the message on behalf of the master node. The selection of the master node is the same as the selection mode of the PBFT algorithm:

(4)。

before each verification node receives the pre-preparation message sent by the master node, the following conditions need to be checked:

the signature in the message is correct and(ii) a The view number of the verification node is the same as the view number in the message; has not accepted the past viewLower abstractThe same pre-prepared message, i.e. no duplicate acceptance message.

If the verification node accepts the prepare message-The prepare phase is entered and a prepare message is broadcast to other authentication nodes (including the master node) in the format ofWhereinTo verify the signature of the node. The verifying node will keep both messages in the local log for examination. Other verification nodes (including the main node) can still check whether the signature is correct or not after receiving the preparation message, whether the view number is consistent or not, whether the condition of repeatedly accepting the message exists or not and the like, and if the condition is passed, the received preparation message is kept on a local log.

When 1 pre-prepared message passing the verification is stored in the local log of the verification node andwhen corresponding preparation messages come from different verification nodes, the verification nodes enter a commit (commit) stage and broadcast a commit message to other verification nodes in a format of. Other verification nodes also perform validity check according to the above condition before accepting the commit message, and then store the commit message on a local log. When the verification node receivesA aboutAfter the message has been validly submitted,then each sends a reply message to agent node 1. The agent node being in block 1Upon a valid reply from a different verification node, the block is added into the block chain, while the verified block is broadcast to other nodes.

If the agent node does not receive a reply message for the tile in time, it broadcasts the tile verification request to all verification nodes. The verifying node that has processed the tile simply replies back with a message, otherwise forwards the tile request to the master node. If the master node does not respond to this chunk request, it is suspected of being sufficiently authenticated to cause the view to change, replacing the new master node. The block verification process under normal conditions is shown in fig. 5.

And if the agent node does not pack the block in the corresponding time slice or the verification of the block packed by the agent node is wrong, indicating that the agent node fails to produce the block. The credit rating of the node is adjusted according to the broker node blocking algorithm.

As shown in fig. 6, when the agent node 1 produces the tile 1, the tile verification may be invalid, which may result in the tile production failing, or the master node may intentionally delay to cause the agent node not to receive the tile in timeAnd (4) a valid reply. At this time, the agent node 1 continues the block packing work by the node 2 because the block is not produced in the set time slice, and the agent node is replaced by a good candidate agent node; in another aspect, a set of verification nodesA view change is made to create a new master node that is also replaced by a candidate proxy node.

While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the appended claims.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:一种分布式数据源异构同步的方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!