CN112532581A - Improved PBFT consensus method based on consensus participation and transaction activity - Google Patents

Improved PBFT consensus method based on consensus participation and transaction activity Download PDF

Info

Publication number
CN112532581A
CN112532581A CN202011152332.3A CN202011152332A CN112532581A CN 112532581 A CN112532581 A CN 112532581A CN 202011152332 A CN202011152332 A CN 202011152332A CN 112532581 A CN112532581 A CN 112532581A
Authority
CN
China
Prior art keywords
consensus
node
nodes
master node
message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011152332.3A
Other languages
Chinese (zh)
Inventor
毛志来
孙惠平
傅玉峰
陈钟
虞丽
朱俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Chenkuo Network Technology Co ltd
Peking University
Original Assignee
Nanjing Chenkuo Network Technology Co ltd
Peking University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Chenkuo Network Technology Co ltd, Peking University filed Critical Nanjing Chenkuo Network Technology Co ltd
Priority to CN202011152332.3A priority Critical patent/CN112532581A/en
Publication of CN112532581A publication Critical patent/CN112532581A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Business, Economics & Management (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Accounting & Taxation (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明属于区块链、共识机制、PBFT应用技术领域,具体公开了一种基于共识参与度和交易活跃度的改进PBFT共识方法,包括以下步骤,步骤1、进行节点的初始化工作,给节点编号并设置节点的可信度初始值为0;步骤2、客户端向主节点发送交易请求,直到到达第一次的主节点切换;步骤3、运行优化的视图切换协议选举出主节点;步骤4、基于优化的视图切换协议和优化的一致性共识协议处理客户端请求。本发明的有益效果在于:增强了主节点选举的随机性和安全性,有效抵御恶意节点攻击;根据主节点的可信度来简化节点通信的复杂度;设置窗口期,提高了诚实节点参与共识过程的公平性;将节点交易活跃度作为节点权益,激励活跃节点维护区块链网络安全稳定。

Figure 202011152332

The invention belongs to the technical fields of blockchain, consensus mechanism and PBFT application technology, and specifically discloses an improved PBFT consensus method based on consensus participation and transaction activity, comprising the following steps. Step 1: Perform node initialization, and number the nodes And set the initial value of the node's credibility to 0; step 2, the client sends a transaction request to the master node until the first master node switch is reached; step 3, run the optimized view switching protocol to elect the master node; step 4 , Process client requests based on an optimized view switching protocol and an optimized consensus consensus protocol. The beneficial effects of the invention are as follows: the randomness and security of the main node election are enhanced, and the attack of malicious nodes is effectively resisted; the complexity of node communication is simplified according to the credibility of the main node; the window period is set to improve the participation of honest nodes in consensus The fairness of the process; the node transaction activity is regarded as the node's rights and interests, and the active nodes are encouraged to maintain the security and stability of the blockchain network.

Figure 202011152332

Description

Improved PBFT consensus method based on consensus participation and transaction activity
Technical Field
The invention belongs to the technical field of block chains, consensus mechanisms and PBFT (basic packet data transfer) application, and particularly relates to an improved PBFT consensus method based on consensus participation and transaction activity.
Background
The block chain technology concept is put forward for the first time in 2008, the block chain adopts various technologies in the fields of cryptography, computers and communication, and asymmetric encryption, time stamps, a common recognition mechanism and point-to-point communication are used, so that the problems of low efficiency, high cost and monopoly of data ownership of the existing centralized credit organization are solved, and the block chain is essentially a distributed system and has the characteristics of decentralization and safe credibility. The blockchain technology is considered as a new information technology development direction after the mobile internet, and the establishment of a credit society is promoted, so that the current information internet is converted into a value internet.
As blockchain technology continues to develop, consensus algorithms are also increasingly highlighted by researchers, where how to select consensus algorithms is a core part of blockchain design. The consensus algorithm is the most core technology of the block chain, which affects the performance of the block chain system, and the current consensus algorithm can be divided into three categories, namely public chain consensus, private chain consensus and alliance chain consensus according to the type of the block chain. Research on consensus algorithms has been started for a long time, such as Proof of Work (POW), Proof of rights of interest (POS), the practical byzantine fault-tolerant algorithm PBFT, which is the most widely applied league chain consensus mechanism, and the Raft algorithm.
The PBFT algorithm aims at solving the problem of how to ensure the consistency and the correctness of final decision under the condition that malicious nodes exist in the whole system, the algorithm is based on state machine copy replication, each state machine copy can store service states, legal requests of users are met, not only can transactions be completed, but also different types of operations can be realized, and the algorithm can carry out consensus on transmitted messages to obtain a global sequence. In the case that the malicious nodes are not higher than the total number 1/3, the algorithm can simultaneously guarantee the safety and the activity, and the algorithm reduces the complexity of the Byzantine fault-tolerant algorithm from an exponential level to a polynomial level O (N) for the first time2). All nodes in the PBFT algorithm are divided into three types, namely a client, a main node and a replica node, the process is divided into a consistency protocol, a view change protocol and a checkpoint protocol, wherein the consistency protocol is divided into three stages: a PRE-preparation phase (PRE-PREPARE), a preparation phase (PREPARE), and an acknowledgement phase (COMMIT).
The election mode of the main nodes in the PBFT algorithm is that the main nodes are sequentially taken as the main nodes in turn according to numbers, the election mode of the main nodes is random, the authenticity of the main nodes is not verified after the main nodes are successfully elected, the elected main nodes are probably malicious nodes and have certain potential safety hazards, although the maliciousness of the main nodes is possibly identified by the slave nodes and overturned through view change in the subsequent consensus process, certain loss can still be caused, if the continuously selected main nodes are all malicious nodes, frequent view change can also increase system overhead, system efficiency is reduced, and great waste of system resources can be caused and system safety is reduced. The PBFT has no penalty mechanism for the malicious master node, only the view is switched to change the master node, and the Byzantine node still stays in the network, so the improvement is needed in the practical application of the block chain, and in addition, the high-intensity network communication and network transmission overhead in the three-stage negotiation of the PBFT consistency protocol also needs to be further improved and optimized.
Accordingly, in view of the above problems, the present invention provides an improved PBFT consensus method based on consensus participation and transaction liveness.
Disclosure of Invention
The purpose of the invention is as follows: the invention aims to provide an improved PBFT consensus method based on consensus participation and transaction activity, which optimizes a view switching mechanism of a PBFT algorithm and enhances the randomness and the safety of master node election so as to enhance the capability of resisting malicious node attacks, and optimizes message transmission in the running process of a consistency protocol based on the credibility value of the master node election so as to reduce message complexity and network overhead.
The technical scheme is as follows: the invention provides an improved PBFT consensus method based on consensus participation and transaction activity, which comprises the following steps of 1, initializing nodes, numbering the nodes in a network by N integers of { 0, 1, 2, …, | N | -1}, and initializing the credibility values of the nodes to 0 point. And 2, the client sends a transaction request to the main node, the main node numbers the request message after receiving the request, and the traditional PBFT protocol is operated at the starting stage of the block chain network until the main node is switched for the first time. And 3, running the optimized view switching protocol to select the main node. And 4, processing the client request based on the optimized view switching protocol and the optimized consistency consensus protocol.
In the technical scheme, the step 3 includes a view switching time point, a view switching reference window W and a master node selection mechanism, wherein an algorithm of the view switching time point triggers view switching except for exception of the master node, and in the context of application that a node can dynamically join a quitted block chain, in order to avoid excessive centralization of blocks and maintain certain random security, an attempt switching protocol is run once every time period T; the method comprises the steps that a reference window W is switched in a view, the reliability value is a result obtained by accumulation after a plurality of rounds of consensus processes, in order to give consideration to new nodes, fairness is enhanced, meanwhile, the node reliability should reflect the latest state of the nodes, the influence of historical liveness on the current state is reduced, a window period W is set, W = nT, n is an integer, and the reliability is calculated according to the behavior of the nodes in the window period W; the main node selection mechanism has the advantages that the credibility is an important index for measuring the integrity of the nodes, when the view switching and the main node selection are carried out, a cryptographic lottery algorithm with weighted probability is adopted, the rights and interests of the nodes are the credibility of the nodes, the higher the credibility is, the higher the probability of selection is, so that the occurrence of malicious nodes and fault nodes selection can be reduced, and the occurrence of failure in the consensus process is reduced.
In the technical scheme, the consensus participation degree, the transaction activity, the reliability of the nodes and the two-layer block link structure in the step 3 are calculated by the following method, wherein the duplicate nodes participate in the primary block in the system to generate the consensus plus 1 point, and when the duplicate nodes generate the byzantine errors such as downtime and inconsistency with the final consensus result, the missed-recording blocks, the voting errors, the abnormal-recording blocks and the like, the total mark participation value is 1 point; the node serving as a main node successfully packs the blocks and completes one-time block generation consensus, and the consensus takes part in the score of 3; when the block cannot be generated successfully, if the copied node suspects to be a malicious node, the view conversion is triggered to be deducted for 5 points, and other situations, such as node downtime, communication unsmooth, long delay, block failure and the like, are deducted for 3 points; transaction activity, wherein the transaction activity value A is the number of transactions participated by the node; the credibility value R is obtained by weighted addition calculation according to the consensus participation value and the transaction active value, and the calculation method of the credibility value R is as follows: r = k a + (1-k) P (0< k < 1); the PBFT three-stage communication consensus process is required to be executed to ensure that the block chain network forms a consistent result when the credibility calculation is executed each time; the main Block (Key Block) is used for recording the identity and the credibility value of the nodes participating in consensus, and the result of the nodes trying to switch protocols when the consensus nodes operate to obtain the main node, and the Micro Block (Micro Block) is a Block for recording the consensus nodes operating the consensus protocol packaging transaction.
In step 4, the optimized consistency protocol execution process is as follows: (1) client send request (request): the customer service end sends a REQUEST message to the main node in the format of REQUEST, o, t, c, as in the REQUEST phase of the PBFT algorithm, wherein o is a REQUEST execution state machine, t is a time stamp, and c represents the number of the client; (2) a PRE-preparation stage (PRE-preparation) of an optimized consistency protocol, wherein a main node generates a PRE-preparation message after receiving a request sent by a client and broadcasts the PRE-preparation message to all consensus nodes, and the message format is as follows < < PRE-PREPARE, v, n, d, g, >, r, m >, wherein r is the credibility value of the nodes and g is the result of hash calculation performed on r; (3) optimized coherence protocol preparation phase (prepare): the replica node will generate a preparation message for the feedback, and sends the message to the master node, the message format is < PREPARE, v, n, d, i >, i is the node number, meanwhile, the nodes write the pre-preparation message and the preparation message into the log file, the main node receives the messages of all the replica nodes, and finds out the PRE-preparation message < < PRE-PREPARE, v, n, d, g >, r, m > stored locally according to the v and n values of the prefix message for comparison, judges whether the values corresponding to the field d are the same or not, once the transaction information is tampered, if the Hash value d of the node is changed, the master node ends the execution of the consensus and sends a termination message to each node, wherein the message comprises the inconsistent node number of the message, and a PBFT traditional consistency protocol is restarted once to finish the consensus; (4) and a consistency protocol optimization confirmation phase (COMMIT), wherein the master node receives feedback information of the preparation phase sent by all the consensus copy nodes, and under the condition that all the feedback information are completely the same, the master node generates a confirmation message and broadcasts the confirmation message to all nodes in the network, the message format is < COMMIT, v, n, d, a >, wherein a is determined addition information and indicates that the master node confirms addition, after all the nodes receive the confirmation message, the secondary transaction information is added into a local memory, the messages of all the copy nodes receive submission (COMMIT) information of the master node, and find out locally stored PRE-preparation messages < < PRE-PARE, v, n, d, g >, r, m > according to the v and n values of the COMMIT message, compare, judge whether the value corresponding to the field d is the same, and once the transaction information is tampered, its Hash value d must change, the replica node will attempt to initiate a view switch.
In the technical scheme, after a new master node election protocol is executed in the step 4, the running consensus protocol is determined according to the reliability value of the master node in election, a threshold value TV is preset by the system, and if the master node reliability value R > = TV, the optimized consistency consensus protocol is run; if the master node trustworthiness value R < TV, the conventional three-stage PBFT consensus process is still running.
In the technical solution, the consistency protocol of the consensus algorithm in step 4 needs to complete two times of node communication with complexity o (n) in the operation process.
Compared with the prior art, the improved PBFT consensus method based on the consensus participation degree and the transaction activity degree has the beneficial effects that: 1. the randomness safety of the master node election is enhanced, and the attack of malicious nodes is effectively resisted; 2. the complexity of node communication is simplified according to the credibility of the main node, and the communication responsibility is simplified; 3. the window period is set, so that the fairness of the honest nodes participating in the consensus process is improved; 4. and taking the node transaction activity as the node rights and interests, and exciting the active nodes to maintain the safety and stability of the block chain network.
Drawings
FIG. 1 is a schematic diagram of a workflow structure of an improved PBFT consensus method based on consensus participation and transaction activity according to the present invention;
FIG. 2 is a block chain structure diagram of an improved PBFT consensus method based on consensus participation and transaction activity according to the present invention;
FIG. 3 is a schematic diagram of an optimized consensus protocol execution process for an improved PBFT consensus method based on consensus participation and transaction activity.
Detailed Description
The invention is further elucidated with reference to the drawings and the embodiments.
Examples
The improved PBFT consensus method based on the consensus participation degree and the transaction activity degree as shown in the figure 1, the figure 2 and the figure 3 comprises the following steps of 1, carrying out initialization work on nodes, numbering the nodes in the network by N integers of { 0, 1, 2, …, | N | -1}, and initializing the credibility value of the nodes to 0 point. And 2, the client sends a transaction request to the main node, the main node numbers the request message after receiving the request, and the traditional PBFT protocol is operated at the starting stage of the block chain network until the main node is switched for the first time. And 3, running the optimized view switching protocol to select the main node. And 4, processing the client request based on the optimized view switching protocol and the optimized consistency consensus protocol.
Further preferably, the step 3 includes a view switching time point, a view switching reference window W, and a master node selection mechanism, where an algorithm of the view switching time point triggers view switching except that the master node is abnormal, and in the context of a blockchain application that a node may dynamically join in to exit, in order to avoid generating excessive centralization of a block and maintaining a certain random security, a protocol trying to switch is run once every time period T; the method comprises the steps that a reference window W is switched in a view, the reliability value is a result obtained by accumulation after a plurality of rounds of consensus processes, in order to give consideration to new nodes, fairness is enhanced, meanwhile, the node reliability should reflect the latest state of the nodes, the influence of historical liveness on the current state is reduced, a window period W is set, W = nT, n is an integer, and the reliability is calculated according to the behavior of the nodes in the window period W; the main node selection mechanism has the advantages that the credibility is an important index for measuring the integrity of the nodes, when the view switching and the main node selection are carried out, a cryptographic lottery algorithm with weighted probability is adopted, the rights and interests of the nodes are the credibility of the nodes, the higher the credibility is, the higher the probability of selection is, so that the occurrence of malicious nodes and fault nodes selection can be reduced, and the occurrence of failure in the consensus process is reduced.
Further preferably, in the step 3, the common recognition participation, the transaction activity, the credibility, and the block chain structure of two layers are: the method for calculating the consensus participation value P comprises the following steps that the copy node participates in a primary block in the system to generate consensus plus 1 point, and when a Byzantine error such as downtime occurs in the copy node and is inconsistent with a final consensus result, the 1 point is deducted by a missed-recording block, a voting error, an abnormal-recording block and the like; the node serving as a main node successfully packs the blocks and completes one-time block generation consensus, and the activity integral is added for 3 minutes in the cycle of consensus; when the block cannot be generated successfully, if the copied node suspects to be a malicious node, the view conversion is triggered to be deducted for 5 points, and other situations, such as node downtime, communication unsmooth, long delay, block failure and the like, are deducted for 3 points; transaction activity, wherein the transaction activity value A is the number of transactions participated by the node; the credibility of the node is calculated by weighted addition of the consensus participation value and the transaction active value, and the calculation method of the credibility value R is as follows: r = k a + (1-k) P (0< k < 1); the PBFT three-stage communication consensus process is required to be executed to ensure that the block chain network forms a consistent result when the credibility calculation is executed each time; as shown in fig. 2, a new Block chain structure is shown, where a main Block (Key Block) is used to record identities and reliability values of nodes participating in consensus, results of nodes trying to switch protocols when the consensus nodes operate to obtain the main node, and a Micro Block (Micro Block) is used to record a Block where the consensus nodes operate a consensus protocol packed transaction.
Further preferably, in step 4, the optimized consistency protocol is executed as follows: (1) client send request (request): the customer service end sends a REQUEST message to the main node in the format of REQUEST, o, t, c, as in the REQUEST phase of the PBFT algorithm, wherein o is a REQUEST execution state machine, t is a time stamp, and c represents the number of the client; (2) a PRE-preparation stage (PRE-preparation) of an optimized consistency protocol, wherein a main node generates a PRE-preparation message after receiving a request sent by a client and broadcasts the PRE-preparation message to all consensus nodes, and the message format is as follows < < PRE-PREPARE, v, n, d, g, >, r, m >, wherein r is the credibility value of the nodes and g is the result of hash calculation performed on r; (3) optimized coherence protocol preparation phase (prepare): the replica node will generate a preparation message for the feedback, and sends the message to the master node, the message format is < PREPARE, v, n, d, i >, i is the node number, meanwhile, the nodes write the pre-preparation message and the preparation message into the log file, the main node receives the messages of all the replica nodes, and finds out the PRE-preparation message < < PRE-PREPARE, v, n, d, g >, r, m > stored locally according to the v and n values of the prefix message for comparison, judges whether the values corresponding to the field d are the same or not, once the transaction information is tampered, if the Hash value d of the node is changed, the master node ends the execution of the consensus and sends a termination message to each node, wherein the message comprises the inconsistent node number of the message, and a PBFT traditional consistency protocol is restarted once to finish the consensus; (4) and a consistency protocol optimization confirmation phase (COMMIT), wherein the master node receives feedback information of the preparation phase sent by all the consensus copy nodes, and under the condition that all the feedback information are completely the same, the master node generates a confirmation message and broadcasts the confirmation message to all nodes in the network, the message format is < COMMIT, v, n, d, a >, wherein a is determined addition information and indicates that the master node confirms addition, after all the nodes receive the confirmation message, the secondary transaction information is added into a local memory, the messages of all the copy nodes receive submission (COMMIT) information of the master node, and find out locally stored PRE-preparation messages < < PRE-PARE, v, n, d, g >, r, m > according to the v and n values of the COMMIT message, compare, judge whether the value corresponding to the field d is the same, and once the transaction information is tampered, its Hash value d must change, the replica node will attempt to initiate a view switch.
Further preferably, in step 4, after the new master node election protocol is executed, the operated consensus protocol is determined according to the reliability value of the master node in the election, the system presets a threshold value TV, and if the master node reliability value R > = TV, the optimized consensus protocol is operated; if the master node trustworthiness value R < TV, the conventional three-stage PBFT consensus process is still running.
Further preferably, the consistency protocol of the consensus algorithm in step 4 needs to complete two times of node communication with complexity o (n) during the operation process. The design of the algorithm ensures that the algorithm can still finish consensus under the condition that Byzantine nodes exist in the network; the reliability of the nodes is quantized and applied to view switching, if the reliability of the nodes selected to be the main node in the view switching is high, the copy nodes do not need to broadcast messages to other copy nodes in the period of prefix and commit, a PBFT consistency protocol is optimized, and an algorithm can achieve consensus after the communication of the nodes with the complexity of O (n) is completed.
The invention discloses an improved PBFT consensus method based on consensus participation and transaction activity, which applies credibility to a view switching process as a method for randomly generating a main node by node interest weighting, and selects different consistency protocols to operate according to the credibility of the main node, thereby further reducing the message complexity of the consensus process.
The invention discloses an improved PBFT consensus method based on consensus participation and transaction activity, which is an open PBFT consensus protocol based on which nodes can join and quit.
The difference between the improved PBFT consensus method based on the consensus participation degree and the transaction activity degree and the traditional technology is as follows: 1. adding the transaction activity of the node into the evaluation of the node credit, and further exciting the node to improve the stability to participate in the block chain consensus process in an honest way; 2. the grouping method according to the node credibility value or the credibility value is not adopted, so that the complicated operation of the grouping method is avoided, the nodes can participate in the processes of main node election and consensus, and certain node participation and decentralization are ensured; 3. the probability of the node becoming a main node is determined according to the reliability of the node, so that the node with high honesty and reliability can be ensured to play a larger role in consensus to maintain the stability of the block chain network; 4. and the consistency process is optimized according to the credibility value of the main node, so that the safety is ensured, and the network overhead and pressure are reduced.
The foregoing is only a preferred embodiment of this invention and it should be noted that modifications can be made by those skilled in the art without departing from the principle of the invention and these modifications should also be considered as the protection scope of the invention.

Claims (6)

1.一种基于共识参与度和交易活跃度的改进PBFT共识方法,其特征在于:包括以下步骤,1. An improved PBFT consensus method based on consensus participation and transaction activity, characterized in that it comprises the following steps, 步骤1、进行节点的初始化工作,用 { 0,1,2,…,| N |-1} 共 N 个整数对网络中的节点进行编号,将节点的可信度值初始化为0分;Step 1. Carry out the initialization of the nodes, number the nodes in the network with a total of N integers { 0, 1, 2, ..., | N |-1}, and initialize the reliability value of the nodes to 0 points; 步骤2、客户端向主节点发送交易请求,主节点接收请求后对请求消息进行编号,在区块链网络的启动阶段运行传统的PBFT协议,直至第一次的主节点切换;Step 2, the client sends a transaction request to the master node, the master node numbers the request message after receiving the request, and runs the traditional PBFT protocol in the startup phase of the blockchain network until the first master node switch; 步骤3、运行优化的视图切换协议选举出主节点;Step 3. Run the optimized view switching protocol to elect the master node; 步骤4、基于优化的视图切换协议和优化的一致性共识协议处理客户端请求。Step 4: Process client requests based on the optimized view switching protocol and the optimized consensus consensus protocol. 2.根据权利要求1所述的一种基于共识参与度和交易活跃度的改进PBFT共识方法,其特征在于,所述步骤3中包括视图切换的时间点、视图切换参考窗口W、主节点选举机制,其中,视图切换的时间点的算法除了主节点异常触发视图切换外,在节点可以动态加入退出的区块链应用背景下,为了避免产生区块过度的中心化和维护一定的随机安全性,每隔时间周期T会运行一次试图切换协议;视图切换参考窗口W,可信度值是经过数轮共识流程后累加得到的结果,为了兼顾新加入节点,增强公平性,同时节点可信度应该反映节点的最新状态,减轻历史活跃度对当前状态的影响,设置窗口期W,W=nT,n为整数,以窗口期W内节点的行为计算可信度;主节点选取机制,可信度是衡量节点诚实性的重要指标,在进行视图切换选举主节点时,采取加权的概率密码学抽签算法,节点的权益是节点的可信度,可信度越高,被选中的概率越大,这样可以降低恶意节点和故障节点被选中的发生,减少共识过程失败的发生。2. a kind of improved PBFT consensus method based on consensus participation and transaction activity according to claim 1, is characterized in that, in described step 3, comprises the time point of view switching, view switching reference window W, master node election Mechanism, in which the algorithm of the time point of view switching, in addition to the abnormal triggering of view switching by the master node, in the context of blockchain applications where nodes can dynamically join and exit, in order to avoid excessive centralization of blocks and maintain a certain random security , every time period T will run an attempt to switch the protocol; the view switching reference window W, the credibility value is the accumulated result after several rounds of consensus process, in order to take into account the newly added nodes, enhance the fairness, and at the same time the node credibility It should reflect the latest state of the node, reduce the impact of historical activity on the current state, set the window period W, W=nT, n is an integer, and calculate the credibility based on the behavior of the nodes in the window period W; the main node selection mechanism, credibility Degree is an important indicator to measure the honesty of a node. When switching views to elect a master node, a weighted probabilistic cryptography lottery algorithm is adopted. The rights and interests of a node are the credibility of the node. The higher the credibility, the greater the probability of being selected. , which can reduce the occurrence of malicious nodes and faulty nodes being selected, and reduce the occurrence of consensus process failures. 3.根据权利要求2所述的一种基于共识参与度和交易活跃度的改进PBFT共识方法,其特征在于,所述步骤3中共识参与度、交易活跃度、节点的可信度、双层区块链结构,共识参与值P的计算方法如下,副本节点在系统中参与一次区块生成共识加 1 分,当副本节点发生拜占庭错误如宕机、与最终共识结果不一致时、漏记区块、投票错误、记录异常区块等会扣1分;节点作为主节点成功打包区块并完成一次区块生成共识,该轮共识参与值积分3分;未能成功生成区块时,如果被副本节点怀疑是恶意节点从而触发视图转换扣 5分,其余情形,比如节点宕机、通信不畅导致时延过长从而出块失败等,则扣3分;交易活跃度,交易活跃值A为节点参与的交易的数量;节点的可信度,可信度值R根据共识参与值和交易活跃值加权相加得到,可信值R计算方法如下:R = k * A + (1-k)*P(0<k<1);在每次执行可信度计算时也需要执行PBFT三阶段的通信共识过程来确保区块链网络形成一致性结果;主块(Key Block)用来记录参与共识的节点身份、可信度值、共识节点运行试图切换协议得到主节点的结果,微块(Micro Block)是记录共识节点运行共识协议打包交易的区块。3. a kind of improvement PBFT consensus method based on consensus participation degree and transaction activity degree according to claim 2, is characterized in that, in described step 3, consensus participation degree, transaction activity degree, the credibility of node, double-layer. Blockchain structure, the calculation method of the consensus participation value P is as follows. The replica node participates in a block generation consensus in the system and adds 1 point. When the replica node has a Byzantine error such as downtime, when it is inconsistent with the final consensus result, the block is omitted. 1 point will be deducted for wrong voting, abnormal block recording, etc.; the node as the master node successfully packs the block and completes a block generation consensus, and the consensus participation value for this round is 3 points; if the block is not successfully generated, if it is copied If the node suspects that it is a malicious node and thus triggers the view transition, 5 points will be deducted, and in other cases, such as node downtime, poor communication resulting in too long delay and block generation failure, 3 points will be deducted; transaction activity, transaction activity value A is the node The number of transactions involved; the credibility of the node, the credibility value R is obtained by the weighted addition of the consensus participation value and the transaction activity value. The calculation method of the credibility value R is as follows: R = k * A + (1-k)* P(0<k<1); the three-phase communication consensus process of PBFT needs to be performed every time the credibility calculation is performed to ensure that the blockchain network forms a consistent result; the main block (Key Block) is used to record participation in the consensus The node identity, credibility value, and consensus node operation try to switch the protocol to get the result of the master node. Micro block is the block that records the consensus node running the consensus protocol package transaction. 4.根据权利要求1所述的一种基于共识参与度和交易活跃度的改进PBFT共识方法,其特征在于:所述步骤4中,优化的一致性协议执行过程如下:4. a kind of improved PBFT consensus method based on consensus participation degree and transaction activity degree according to claim 1, is characterized in that: in described step 4, optimized consensus protocol execution process is as follows: (1)客户端发送请求(request):同PBFT算法的请求阶段一样,客服端向主节点发送请求消息,消息格式为 <REQUEST,o ,t,c > ,o 其中为请求执行状态机,t 为时间戳,c 表示客户端编号;(1) The client sends a request (request): the same as the request phase of the PBFT algorithm, the client sends a request message to the master node, the message format is <REQUEST, o , t, c > , o is the request execution state machine, t is the timestamp, c represents the client number; (2)优化一致性协议预准备阶段( pre-prepare):主节点接收客户端发送的请求后会生成预准备消息,并将预准备消息广播到所有共识节点,消息格式如下 <<PRE-PREPARE,v,n,d,g,>,r,m>,其中r为节点的可信度值,g为r进行哈希计算的结果;(2) Optimize the pre-prepare phase of the consensus protocol: After the master node receives the request sent by the client, it will generate a pre-preparation message and broadcast the pre-preparation message to all consensus nodes. The message format is as follows << PRE-PREPARE , v, n, d, g, >, r, m>, where r is the reliability value of the node, and g is the result of the hash calculation performed by r; (3)优化一致性协议准备阶段( prepare):副本节点会生成反馈的准备消息,并将消息发送给主节点,消息格式为<PREPARE,v,n,d,i>,i为节点编号,同时节点会将预准备消息和准备消息写进日志文件,主节点会接收所有副本节点的消息,并根据prepare消息的v、n 值找到本地保存的预准备消息<<PRE-PREPARE,v,n,d,g>,r,m> 进行对比,判断字段 d 对应的值是否相同的,一旦交易信息被篡改,其 Hash 值d一定会改变,则主节点会结束本次共识的执行,并向各节点发送终止消息,消息中包含此次消息不一致的节点编号,并重新发起一次PBFT传统一致性协议来完成共识;(3) Optimize the preparation phase of the consistency protocol (prepare): the replica node will generate a feedback preparation message and send the message to the master node. The message format is <PREPARE, v, n, d, i>, i is the node number, At the same time, the node will write the pre-preparation message and the prepare message to the log file, and the master node will receive the messages of all replica nodes, and find the locally saved pre-preparation message according to the v and n values of the prepare message << PRE-PREPARE, v, n , d, g>, r, m> for comparison, to determine whether the corresponding value of field d is the same, once the transaction information is tampered, its Hash value d will definitely change, then the master node will end the execution of this consensus and send Each node sends a termination message, the message contains the node number of the inconsistent message, and re-initiates the PBFT traditional consensus protocol to complete the consensus; (4)优化一致性协议确认阶段(commit):主节点会接收到所有共识副本节点发送的准备阶段的反馈信息,并且在所有反馈信息完全相同的情况下,主节点会生成确认消息并广播到网络中的所有节点,消息格式为 < COMMIT,v,n,d,a >,其中 a 为确定添加信息,表示主节点已经确认添加,所有的节点接收到确认消息后,将次交易信息添加都本地内存中,所有副本节点会接收主节点的提交(commit)信息,并根据commit消息的v、n 值找到本地保存的预准备消息<<PRE-PREPARE,v,n,d,g> ,r,m> 进行对比,判断字段d 对应的值是否相同的,一旦交易信息被篡改,其 Hash 值d一定会改变,则副本节点会尝试发起视图切换。(4) Optimize the confirmation phase of the consensus protocol (commit): The master node will receive the feedback information of the preparation phase sent by all consensus replica nodes, and when all the feedback information is exactly the same, the master node will generate a confirmation message and broadcast it to For all nodes in the network, the message format is <COMMIT, v, n, d, a>, where a is the confirmation addition information, indicating that the master node has confirmed the addition, and all nodes will add the secondary transaction information after receiving the confirmation message. In the local memory, all replica nodes will receive the commit information of the master node, and find the locally saved pre-preparation message <<PRE-PREPARE, v, n, d, g>, r according to the v, n values of the commit message , m> for comparison, to determine whether the corresponding values of field d are the same, once the transaction information is tampered with, its Hash value d will definitely change, and the replica node will try to initiate a view switch. 5.根据权利要求1所述的一种基于共识参与度和交易活跃度的改进PBFT共识方法,其特征在于:所述步骤4中在执行完成新的主节点选举协议之后,根据选举中主节点的可信度值来决定所运行的共识协议,系统预先设定阈值TV,若主节点可信度值R>=TV,则运行优化的一致性共识协议;若主节点可信度值R<TV,仍然运行传统的三阶段的PBFT共识过程。5. a kind of improved PBFT consensus method based on consensus participation and transaction activity according to claim 1, is characterized in that: in described step 4, after executing and completing the new master node election agreement, according to the master node in the election. The trustworthiness value of the master node determines the consensus protocol to be run. The system pre-sets the threshold TV. If the master node trustworthiness value R>=TV, the optimized consensus consensus protocol is run; if the master node trustworthiness value R< TV, still running the traditional three-phase PBFT consensus process. 6.根据权利要求5所述的一种基于共识参与度和交易活跃度的改进PBFT共识方法,其特征在于:所述步骤4中共识算法的一致性协议在运行过程中需要完成两次复杂度为 O(n)的节点通信。6. An improved PBFT consensus method based on consensus participation and transaction activity according to claim 5, characterized in that: the consensus protocol of the consensus algorithm in the step 4 needs to complete the complexity twice during operation Node communication is O(n).
CN202011152332.3A 2020-10-26 2020-10-26 Improved PBFT consensus method based on consensus participation and transaction activity Pending CN112532581A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011152332.3A CN112532581A (en) 2020-10-26 2020-10-26 Improved PBFT consensus method based on consensus participation and transaction activity

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011152332.3A CN112532581A (en) 2020-10-26 2020-10-26 Improved PBFT consensus method based on consensus participation and transaction activity

Publications (1)

Publication Number Publication Date
CN112532581A true CN112532581A (en) 2021-03-19

Family

ID=74980415

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011152332.3A Pending CN112532581A (en) 2020-10-26 2020-10-26 Improved PBFT consensus method based on consensus participation and transaction activity

Country Status (1)

Country Link
CN (1) CN112532581A (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113127267A (en) * 2021-04-30 2021-07-16 郑州师范学院 Strong-consistency multi-copy data access response method in distributed storage environment
CN113141414A (en) * 2021-05-07 2021-07-20 大连理工大学 Grouped multi-chain asynchronous consensus method for block chain nodes in CNFS protocol
CN113259179A (en) * 2021-06-18 2021-08-13 杭州云智声智能科技有限公司 Byzantine fault-tolerant consensus method and system based on node scoring
CN113283892A (en) * 2021-05-26 2021-08-20 北京航空航天大学 PoSearch and PBFT fusion consensus algorithm based on voting mechanism
CN113313378A (en) * 2021-05-27 2021-08-27 北京航空航天大学 Credibility model-based block chain consensus mechanism
CN113676541A (en) * 2021-08-23 2021-11-19 南昌航空大学 An Improved PBFT Consensus Method
CN113781218A (en) * 2021-09-03 2021-12-10 桂林电子科技大学 Feature Trust-Based Group PBFT Consensus Algorithm
CN114157672A (en) * 2021-11-29 2022-03-08 北京航空航天大学 S-PBFT simplified consensus protocol operation and parallel optimization method based on PBFT
CN114374520A (en) * 2022-01-06 2022-04-19 上海交通大学宁波人工智能研究院 Trusted and safe lightweight block chain implementation system and method
CN114448997A (en) * 2022-01-04 2022-05-06 中国人民武装警察部队工程大学 Equipment quality information management node consensus method based on PBFT
CN114463009A (en) * 2022-04-13 2022-05-10 成都理工大学 A method for improving the security of large-scale energy node transactions
CN115361196A (en) * 2022-08-17 2022-11-18 杭州煋辰数智科技有限公司 Service interaction method based on block chain network
CN115811525A (en) * 2023-02-09 2023-03-17 杭州合众数据技术有限公司 Data exchange and processing method based on distributed architecture
CN116050725A (en) * 2022-11-08 2023-05-02 华北电力大学 Block chain consensus mechanism construction method for comprehensive energy system operation scheduling
CN117527834A (en) * 2024-01-04 2024-02-06 成都理工大学 Improved PBFT consensus method based on reputation scoring mechanism
CN117978547A (en) * 2024-03-29 2024-05-03 华东交通大学 TRP-PBFT consensus method, system, storage medium and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105718805A (en) * 2016-01-25 2016-06-29 福建北卡科技有限公司 Cloud-computing trust management method based on evaluation confidence degree
CN109767199A (en) * 2018-12-10 2019-05-17 西安电子科技大学 Reputation-based PBFT consensus system and method, blockchain data processing system
CN111355810A (en) * 2020-03-17 2020-06-30 重庆邮电大学 Improved PBFT consensus method based on credit and voting mechanism
CN111414420A (en) * 2020-03-17 2020-07-14 重庆邮电大学 Improved PBFT block chain consensus method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105718805A (en) * 2016-01-25 2016-06-29 福建北卡科技有限公司 Cloud-computing trust management method based on evaluation confidence degree
CN109767199A (en) * 2018-12-10 2019-05-17 西安电子科技大学 Reputation-based PBFT consensus system and method, blockchain data processing system
CN111355810A (en) * 2020-03-17 2020-06-30 重庆邮电大学 Improved PBFT consensus method based on credit and voting mechanism
CN111414420A (en) * 2020-03-17 2020-07-14 重庆邮电大学 Improved PBFT block chain consensus method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
KAI LEI等: "Reputation-based Byzantine Fault-Tolerance for Consortium Blockchain", 《2018 IEEE 24TH INTERNATIONAL CONFERENCE ON PARALLEL AND DISTRIBUTED SYSTEMS (ICPADS)》, 28 February 2019 (2019-02-28), pages 604 - 611 *
徐治理 等: "一种基于信用的改进PBFT高效共识机制", 《计算机应用研究》 *
徐治理 等: "一种基于信用的改进PBFT高效共识机制", 《计算机应用研究》, vol. 36, no. 9, 30 September 2019 (2019-09-30), pages 2788 - 2791 *

Cited By (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113127267A (en) * 2021-04-30 2021-07-16 郑州师范学院 Strong-consistency multi-copy data access response method in distributed storage environment
CN113127267B (en) * 2021-04-30 2023-02-17 郑州师范学院 A strongly consistent multi-copy data access response method in a distributed storage environment
CN113141414A (en) * 2021-05-07 2021-07-20 大连理工大学 Grouped multi-chain asynchronous consensus method for block chain nodes in CNFS protocol
CN113141414B (en) * 2021-05-07 2022-04-12 大连理工大学 Grouped multi-chain asynchronous consensus method for block chain nodes in CNFS protocol
CN113283892A (en) * 2021-05-26 2021-08-20 北京航空航天大学 PoSearch and PBFT fusion consensus algorithm based on voting mechanism
CN113313378B (en) * 2021-05-27 2023-01-13 北京航空航天大学 A Blockchain Consensus Method Based on Reputation Model
CN113313378A (en) * 2021-05-27 2021-08-27 北京航空航天大学 Credibility model-based block chain consensus mechanism
CN113259179A (en) * 2021-06-18 2021-08-13 杭州云智声智能科技有限公司 Byzantine fault-tolerant consensus method and system based on node scoring
CN113676541A (en) * 2021-08-23 2021-11-19 南昌航空大学 An Improved PBFT Consensus Method
CN113676541B (en) * 2021-08-23 2023-06-27 南昌航空大学 Improved PBFT consensus method
CN113781218A (en) * 2021-09-03 2021-12-10 桂林电子科技大学 Feature Trust-Based Group PBFT Consensus Algorithm
CN114157672A (en) * 2021-11-29 2022-03-08 北京航空航天大学 S-PBFT simplified consensus protocol operation and parallel optimization method based on PBFT
CN114448997B (en) * 2022-01-04 2023-11-03 中国人民武装警察部队工程大学 A consensus method for equipment quality information management nodes based on PBFT
CN114448997A (en) * 2022-01-04 2022-05-06 中国人民武装警察部队工程大学 Equipment quality information management node consensus method based on PBFT
CN114374520B (en) * 2022-01-06 2023-11-03 上海交通大学宁波人工智能研究院 Trusted and safe lightweight block chain implementation system and method
CN114374520A (en) * 2022-01-06 2022-04-19 上海交通大学宁波人工智能研究院 Trusted and safe lightweight block chain implementation system and method
CN114463009A (en) * 2022-04-13 2022-05-10 成都理工大学 A method for improving the security of large-scale energy node transactions
CN115361196A (en) * 2022-08-17 2022-11-18 杭州煋辰数智科技有限公司 Service interaction method based on block chain network
CN116050725A (en) * 2022-11-08 2023-05-02 华北电力大学 Block chain consensus mechanism construction method for comprehensive energy system operation scheduling
CN115811525A (en) * 2023-02-09 2023-03-17 杭州合众数据技术有限公司 Data exchange and processing method based on distributed architecture
CN115811525B (en) * 2023-02-09 2023-06-16 杭州合众数据技术有限公司 Data exchange and processing method based on distributed architecture
CN117527834A (en) * 2024-01-04 2024-02-06 成都理工大学 Improved PBFT consensus method based on reputation scoring mechanism
CN117527834B (en) * 2024-01-04 2024-03-26 成都理工大学 An improved PBFT consensus method based on reputation scoring mechanism
CN117978547A (en) * 2024-03-29 2024-05-03 华东交通大学 TRP-PBFT consensus method, system, storage medium and device
CN117978547B (en) * 2024-03-29 2024-06-07 华东交通大学 TRP-PBFT consensus method, system, storage medium and equipment

Similar Documents

Publication Publication Date Title
CN112532581A (en) Improved PBFT consensus method based on consensus participation and transaction activity
CN111355810B (en) An Improved PBFT Consensus Method Based on Reputation and Voting Mechanism
CN110784346B (en) Reputation value-based PBFT consensus system and method
US11018980B2 (en) Data-interoperability-oriented trusted processing method and system
Camenisch et al. Internet computer consensus
Castro et al. Proactive recovery in a {Byzantine-Fault-Tolerant} system
CN111131209B (en) An improved and efficient consensus method, system, computer equipment and storage medium
Duan et al. Fin: Practical signature-free asynchronous common subset in constant time
CN114048517B (en) Dual channel consensus system and method for blockchains, computer readable storage medium
CN110730204A (en) Method for deleting nodes in block chain network and block chain system
CN110727731A (en) Method for adding node in block chain network and block chain system
CN113141414B (en) Grouped multi-chain asynchronous consensus method for block chain nodes in CNFS protocol
CN113570357B (en) A Dynamically Hierarchical Efficient PBFT Algorithm
Jalalzai et al. Window based BFT blockchain consensus
Wang et al. Byzantine fault tolerant algorithm based on vote
WO2023056967A1 (en) Consensus method, blockchain system and consensus nodes
He et al. An improvement of consensus fault tolerant algorithm applied to alliance chain
Li et al. Gosig: Scalable byzantine consensus on adversarial wide area network for blockchains
Tang et al. Excellent practical byzantine fault tolerance
CN116546499B (en) A mobile terminal identity authentication method based on lightweight Byzantine fault tolerance
CN116170155B (en) Improved alliance blockchain consensus method based on PBFT
Jovanovic et al. Mahi-mahi: Low-latency asynchronous bft dag-based consensus
CN115276999B (en) An efficient fault-tolerant consensus method for adaptive switching based on trust model
CN116962426A (en) Block chain consensus mechanism performance optimization method based on CPE-BFT algorithm
CN116260826A (en) Bayesian-busy fault tolerance consensus method and system in supply chain tracing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20210319

WD01 Invention patent application deemed withdrawn after publication