Movatterモバイル変換


[0]ホーム

URL:


CN115277722B - An Improved DR-PBFT Method Based on Reputation Value Model - Google Patents

An Improved DR-PBFT Method Based on Reputation Value Model
Download PDF

Info

Publication number
CN115277722B
CN115277722BCN202210890349.1ACN202210890349ACN115277722BCN 115277722 BCN115277722 BCN 115277722BCN 202210890349 ACN202210890349 ACN 202210890349ACN 115277722 BCN115277722 BCN 115277722B
Authority
CN
China
Prior art keywords
node
consensus
nodes
online
request
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.)
Active
Application number
CN202210890349.1A
Other languages
Chinese (zh)
Other versions
CN115277722A (en
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.)
Changan University
Original Assignee
Changan 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 Changan UniversityfiledCriticalChangan University
Priority to CN202210890349.1ApriorityCriticalpatent/CN115277722B/en
Publication of CN115277722ApublicationCriticalpatent/CN115277722A/en
Application grantedgrantedCritical
Publication of CN115277722BpublicationCriticalpatent/CN115277722B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本发明提供一种基于信誉值模型的DR‑PBFT改进方法,涉及区块链技术领域,包括:联盟服务器接收到客户端请求时,向在线节点数据库的在线节点征集共识节点;联盟服务器从共识节点中选择主节点,并向共识节点广播参与共识的共识节点和需要打包的交易信息;主节点对联盟服务器的交易信息进行打包并向其他共识节点广播;共识节点接收到主节点的广播的交易信息后进行验证并将验证结果发送至其他共识节点;共识节点全部确认打包后,向联盟服务器发送区块验证结果,联盟服务器收到共识成功后将打包的区块上链;对在线节点数据库的节点进行信誉值更新。本发明对节点赋予信誉值,在不减少共识安全性的情况下,减少通信次数,提高通信效率。

The invention provides a DR-PBFT improvement method based on a reputation value model, which relates to the technical field of block chains, comprising: when the alliance server receives a request from a client, it collects consensus nodes from the online nodes of the online node database; the alliance server collects consensus nodes from the consensus nodes Select the master node in the network, and broadcast the consensus nodes participating in the consensus and the transaction information that needs to be packaged to the consensus node; the master node packages the transaction information of the alliance server and broadcasts it to other consensus nodes; the consensus node receives the broadcast transaction information of the master node Then verify and send the verification results to other consensus nodes; after the consensus nodes have all confirmed the packaging, they will send the block verification results to the alliance server, and the alliance server will upload the packaged blocks to the chain after receiving the consensus; the nodes in the online node database Update the reputation value. The invention assigns reputation values to nodes, reduces communication times and improves communication efficiency without reducing consensus security.

Description

Translated fromChinese
一种基于信誉值模型的DR-PBFT改进方法An Improved DR-PBFT Method Based on Reputation Value Model

技术领域technical field

本发明涉及区块链技术领域,具体涉及一种基于信誉值模型的DR-PBFT改进方法。The invention relates to the technical field of blockchain, in particular to an improved DR-PBFT method based on a reputation value model.

背景技术Background technique

区块链技术是一个去中心化、可验证的、不可篡改以及不可伪造的分布式数据库。它主要涉及到密码学、P2P网络、共识机制、智能合约以及数据存储五类支撑技术。区块链中的数据结构为链表结构,常见的区块结构由区块头和区块体两部分构成。其中区块头一般包括当前区块的版本号、当前区块的哈希值、创建区块的时间戳、随机数、MerkleTreeRoot值等参数;区块体一般包括该区块记录的交易和由每条交易信息的哈希值组成的Merkle二叉树,以便于验证区块头中的信息。Blockchain technology is a decentralized, verifiable, non-tamperable and non-forgeable distributed database. It mainly involves five types of supporting technologies: cryptography, P2P network, consensus mechanism, smart contract and data storage. The data structure in the blockchain is a linked list structure, and a common block structure consists of two parts: a block header and a block body. The block header generally includes parameters such as the version number of the current block, the hash value of the current block, the timestamp of creating the block, the random number, and the MerkleTreeRoot value; the block body generally includes the transactions recorded in the block and the The Merkle binary tree composed of the hash value of the transaction information is used to verify the information in the block header.

区块链形成的过程就是将交易打包成区块,并广播给其他节点得到认同,从而将该区块加入到区块链中。在整个过程中,共识机制起到了至关重要的作用,它是所有节点都必须遵守的一项规定,它保证各个区块链节点在去中心化的环境中达成共识,确定交易正确性并被允许加入区块链中,使各个节点在去中心的环境中共同维护一条区块链,因此共识效率决定了区块链系统的性能。同时系统中存在恶意节点伪造虚假区块或对正确区块不认同的问题,从而降低共识环境的安全性,因此共识机制也一定程度上决定了区块链系统的安全性。The process of blockchain formation is to package transactions into blocks and broadcast them to other nodes for approval, thereby adding the block to the blockchain. Throughout the process, the consensus mechanism played a vital role. It is a regulation that all nodes must abide by. It ensures that each blockchain node reaches a consensus in a decentralized environment, and determines the correctness of the transaction and is accepted. It is allowed to join the blockchain, so that each node can jointly maintain a blockchain in a decentralized environment, so the consensus efficiency determines the performance of the blockchain system. At the same time, there are problems in the system where malicious nodes forge false blocks or do not agree with correct blocks, thereby reducing the security of the consensus environment. Therefore, the consensus mechanism also determines the security of the blockchain system to a certain extent.

现有的共识机制主要存在性能上的不足以及共识效率过低问题,比如在比特币中成功应用的工作量证明(Proof of Work,PoW)共识机制,虽然保证了区块链系统的安全性,但浪费大量算力,极大地降低了区块链系统的性能,造成了资源消耗过大,交易时延高、吞吐量低等问题,同样使用领域较多的权益证明(Proof of Stake,PsS)共识机制也存在这样的问题。The existing consensus mechanism mainly has the problems of insufficient performance and low consensus efficiency. For example, the Proof of Work (PoW) consensus mechanism successfully applied in Bitcoin, although it guarantees the security of the blockchain system, However, a large amount of computing power is wasted, which greatly reduces the performance of the blockchain system, causing problems such as excessive resource consumption, high transaction delay, and low throughput. Proof of Stake (PsS) is also used in many fields. The consensus mechanism also has such problems.

和上述两种共识机制不同的是,使用拜占庭容错(Practice Byzantine faulttolerance,PBFT)共识机制在解决了节点间一致性问题的同时,具有高效性,因此适用于各种应用场景,但随着应用领域的不断扩大,应用场景逐渐复杂,参见图1,传统的使用拜占庭容错机制主要分为五个阶段:Different from the above two consensus mechanisms, the use of Byzantine fault tolerance (Practice Byzantine faulttolerance, PBFT) consensus mechanism is efficient while solving the problem of consistency between nodes, so it is suitable for various application scenarios, but with the application field With the continuous expansion, the application scenarios are becoming more and more complex. See Figure 1. The traditional Byzantine fault tolerance mechanism is mainly divided into five stages:

(1)REQUEST:客户端C向主节点P发送<REQUEST,o,t,c>请求。其中o代表请求的具体操作,t指请求时客户端追加的时间戳;c指客户端标识;REQUEST包含消息内容m,以及消息摘要d。客户端C发出请求的时间戳是顺序排列,后续发出的请求比早先发出的请求拥有更高的时间戳,主节点在收到客户端C的REQUEST请求后,需要验证其中的消息签名是否正确,若验证不通过,则丢弃,否则接受该消息。(1) REQUEST: Client C sends <REQUEST, o, t, c> request to master node P. Among them, o represents the specific operation of the request, t refers to the timestamp added by the client when requesting the request; c refers to the client ID; REQUEST includes message content m and message digest d. The timestamps of the requests sent by client C are arranged in order, and the subsequent requests have higher timestamps than the earlier requests. After receiving the REQUEST request from client C, the master node needs to verify whether the message signature is correct. If the verification fails, discard it, otherwise accept the message.

(2)PRE-PREPARE:主节点给收到的消息分配一个编号n,将交易信息打包成区块,接着广播一条<<PRE-PREPARE, v, n, d>,m>消息给其他副本节点,并将请求记录到本地历史(log)中。说明:n主要用于对所有客户端的请求进行排序;v指视图编号;m指消息内容;d指消息摘要。副本节点收到主节点PRE-PREPARE消息后,需要验证REQUEST和PREPARE中签名是否正确,若验证不通过则丢弃,否则接受该消息。(2) PRE-PREPARE: The master node assigns a number n to the received message, packs the transaction information into a block, and then broadcasts a <<PRE-PREPARE, v, n, d>,m> message to other copy nodes , and record the request to the local history (log). Note: n is mainly used to sort the requests of all clients; v refers to the view number; m refers to the message content; d refers to the message summary. After the replica node receives the PRE-PREPARE message from the master node, it needs to verify whether the signatures in REQUEST and PREPARE are correct. If the verification fails, it discards it, otherwise it accepts the message.

(3)PREPARE:当前副本节点验证区块,并广播一条<PREPARE, v, n, d, i>消息,并且将预准备消息和准备消息写入自己的消息日志。i是当前节点编号。主节点和副本节点收到PREPARE消息,验证消息签名是否正确,若验证不通过则丢弃,否则接受该消息,同时需要从2f个不同副本节点收到一致的准备消息时才可以进入下一阶段。(3) PREPARE: The current replica node verifies the block, broadcasts a <PREPARE, v, n, d, i> message, and writes the pre-preparation message and the preparation message into its own message log. i is the current node number. The master node and the replica node receive the PREPARE message, verify whether the signature of the message is correct, discard it if the verification fails, otherwise accept the message, and need to receive consistent prepare messages from 2f different replica nodes before entering the next stage.

(4)COMMIT:在该阶段中,各节点需要验证区块的正确性,若正确则广播一条<COMMIT,v,n,d,i>消息。主节点和其他副本节点收到COMMIT消息后,需要验证COMMIT的消息签名是否正确,若验证不通过则丢弃,否则接受该消息。该阶段完成的条件是接受到包括自身在内的2f+1个确认消息。(4) COMMIT: In this stage, each node needs to verify the correctness of the block, and broadcast a <COMMIT,v,n,d,i> message if it is correct. After the master node and other replica nodes receive the COMMIT message, they need to verify whether the message signature of the COMMIT is correct. If the verification fails, they will discard it, otherwise they will accept the message. The condition for the completion of this stage is to receive 2f+1 confirmation messages including itself.

(5)REPLY:满足上一阶段的节点返回<REPLY,v,t,c,i,r>给客户端,当客户端收到f+1个不同节点返回的相同REPLY消息时,则确认该消息达成了共识。(5) REPLY: Nodes satisfying the previous stage return <REPLY, v, t, c, i, r> to the client, and when the client receives the same REPLY message returned by f+1 different nodes, it will confirm the The message reached a consensus.

但是PBFT共识机制也暴露出一些缺陷,在节点数目增多的情况下,节点间的通信次数急剧增加,造成大量的通信浪费,同时对恶意节点的限制能力有限,导致共识效率以及安全性降低,PBFT共识机制存在一定的提升空间。因此PBFT的通信优化以及共识安全环境的构建对区块链系统性能的提升具有重大意义。However, the PBFT consensus mechanism also exposes some defects. When the number of nodes increases, the number of communications between nodes increases sharply, resulting in a large amount of communication waste. At the same time, the ability to restrict malicious nodes is limited, resulting in reduced consensus efficiency and security. PBFT There is room for improvement in the consensus mechanism. Therefore, the communication optimization of PBFT and the construction of a consensus security environment are of great significance to the improvement of the performance of the blockchain system.

发明内容Contents of the invention

为了克服上述现有PBFT共识机制的缺陷,本发明提供一种基于信誉值模型的DR-PBFT(Dynamic reputation-Practical Byzantine fault tolerance,动态信誉的实用拜占庭容错算法)改进算法,减少了通信浪费,提高通信效率。In order to overcome the defects of the above-mentioned existing PBFT consensus mechanism, the present invention provides an improved DR-PBFT (Dynamic reputation-Practical Byzantine fault tolerance, dynamic reputation practical Byzantine fault tolerance algorithm) algorithm based on the reputation value model, which reduces communication waste and improves communication efficiency.

本发明的技术方案是:Technical scheme of the present invention is:

一种基于信誉值模型的DR-PBFT改进方法,包括:A DR-PBFT improvement method based on reputation value model, including:

联盟服务器接收到客户端请求时,向在线节点数据库的在线节点征集共识节点;When the alliance server receives the request from the client, it collects consensus nodes from the online nodes in the online node database;

联盟服务器从共识节点中选择主节点,并向共识节点广播参与共识的共识节点和需要打包的交易信息;The alliance server selects the master node from the consensus nodes, and broadcasts the consensus nodes participating in the consensus and the transaction information to be packaged to the consensus nodes;

主节点对联盟服务器的交易信息进行打包并向其他共识节点广播;The master node packages the transaction information of the alliance server and broadcasts it to other consensus nodes;

共识节点接收到主节点的广播的交易信息后进行验证并将验证结果发送至其他共识节点;After the consensus node receives the broadcast transaction information from the master node, it will verify and send the verification result to other consensus nodes;

共识节点全部确认打包后,向联盟服务器发送区块验证结果,联盟服务器收到共识成功后将打包的区块上链;After all the consensus nodes have confirmed the packaging, they will send the block verification result to the alliance server, and the alliance server will upload the packaged block to the chain after receiving the consensus;

对在线节点数据库的节点根据信誉模型进行信誉值更新。Update the reputation value of the nodes in the online node database according to the reputation model.

作为本发明的进一步技术方案为,所述联盟服务器接收到客户端请求时,向在线节点数据库的在线节点征集共识节点;具体包括:As a further technical solution of the present invention, when the alliance server receives the request from the client, it collects consensus nodes from the online nodes in the online node database; specifically includes:

联盟服务器接收到客户端请求后,向在线节点数据库发送请求,查询在线节点,并向在线节点发送<PRE-ASK,O,T,S>请求,询问是否参与共识,其中O代表请求的具体操作,T代表联盟服务器,S请求时所追加的时间戳;After receiving the request from the client, the alliance server sends a request to the online node database, queries the online node, and sends a <PRE-ASK,O,T,S> request to the online node, asking whether to participate in the consensus, where O represents the specific operation of the request , T represents the federated server, and S is the timestamp appended when requesting;

在线节点收到联盟服务器S的PRE-ASK请求后,向S发送<PRE-ANSWER,O,T,P,F>消息,表明自己是否参与本次共识,其中O代表请求的具体操作,T代表联盟服务器,P代表自身节点的信息,F代表自身节点的意愿。After the online node receives the PRE-ASK request from the federation server S, it sends a <PRE-ANSWER,O,T,P,F> message to S to indicate whether it participates in this consensus, where O represents the specific operation requested, and T represents For the alliance server, P represents the information of its own node, and F represents the wishes of its own node.

进一步地,所述在线节点收到联盟服务器S的PRE-ASK请求后,还包括:在线节点需要验证联盟服务器发送的消息签名是否正确,若验证不通过,则丢弃,否则接收该消息。Further, after the online node receives the PRE-ASK request from the federation server S, it further includes: the online node needs to verify whether the signature of the message sent by the federation server is correct, and discard it if the verification fails, or receive the message.

作为本发明的进一步技术方案为,所述联盟服务器从共识节点中选择主节点,并向共识节点广播参与共识的共识节点信息;具体包括:As a further technical solution of the present invention, the alliance server selects the master node from the consensus nodes, and broadcasts the consensus node information participating in the consensus to the consensus nodes; specifically includes:

联盟服务器在收到各个节点回复的PRE-ANSWER后,分析各个参与节点的可信度,选取可信度前P个节点作为参与本次共识的节点,并选取可信度最高的节点作为本次共识过程的主节点;之后向参与本次共识过程的各个节点发送<ASK,O,T,S,TAB,MSG>请求,同步各个节点本次共识的相关信息;其中O、T、S含义不变,TAB表示参与本次共识的各个节点以及主节点的信息;MSG表示本次共识需要打包的交易信息。After receiving the PRE-ANSWER replies from each node, the alliance server analyzes the credibility of each participating node, selects the P nodes with the highest credibility as the nodes participating in this consensus, and selects the node with the highest credibility as the node for this consensus. The master node of the consensus process; then send <ASK, O, T, S, TAB, MSG> requests to each node participating in this consensus process, and synchronize the relevant information of each node for this consensus; where O, T, and S have different meanings. TAB represents the information of each node participating in this consensus and the master node; MSG represents the transaction information that needs to be packaged in this consensus.

作为本发明的进一步技术方案为,所述主节点对联盟服务器的交易信息进行打包并向其他共识节点广播;具体包括:主节点打包交易信息成块后,向其余参与的共识节点发送<ANSWER,O,T,P,B-MSG>请求,同步打包完成的区块信息,其中O代表请求的具体操作,T代表联盟服务器S请求时所追加的时间戳,B-MSG是本次共识交易打包成的区块。As a further technical solution of the present invention, the master node packs the transaction information of the alliance server and broadcasts it to other consensus nodes; specifically, it includes: after the master node packs the transaction information into blocks, it sends <ANSWER, O, T, P, B-MSG> request, synchronously packaged block information, where O represents the specific operation of the request, T represents the timestamp added when the alliance server S requests, and B-MSG is the consensus transaction packaging into blocks.

作为本发明的进一步技术方案为,所述共识节点接收到主节点的广播的交易信息后进行验证并将验证结果发送至其他共识节点;具体包括:As a further technical solution of the present invention, the consensus node performs verification after receiving the broadcast transaction information of the master node and sends the verification result to other consensus nodes; specifically includes:

共识节点收到主节点的ANSWER请求后,通过验证区块以及交易信息,得到验证结果,并向其余共识节点发送<COMMIT,O,T,P,C>请求,其中C代表本次验证的结果,每个共识节点只有收到2f个其他节点发来的正确摘要,才可确定区块的正确性,其中f为可容忍的拜占庭节点数。After receiving the ANSWER request from the master node, the consensus node obtains the verification result by verifying the block and transaction information, and sends a <COMMIT, O, T, P, C> request to the rest of the consensus nodes, where C represents the result of this verification , each consensus node can only determine the correctness of the block if it receives correct summaries from 2f other nodes, where f is the number of Byzantine nodes that can be tolerated.

作为本发明的进一步技术方案为,共识节点全部确认打包后,向联盟服务器发送区块验证结果,联盟服务器收到共识成功后将打包的区块上链;具体包括:As a further technical solution of the present invention, after the consensus nodes have all confirmed the packaging, they send the block verification result to the alliance server, and the alliance server uploads the packaged block to the chain after receiving the consensus successfully; specifically includes:

所述参与在线节点确定打包后,向联盟服务器发送发送<REPLY,O,T,P,R>消息,其中R代表本次区块验证结果,确定共识成功,并将打包的区块上链,当联盟服务器S接收收到2f+1个消息,证明本次共识成功,最后将打包的区块上链。After the participating online nodes determine the packaging, they send a <REPLY, O, T, P, R> message to the alliance server, where R represents the result of this block verification, confirm that the consensus is successful, and upload the packaged block to the chain. When the alliance server S receives 2f+1 messages, it proves that the consensus is successful, and finally the packaged block will be uploaded to the chain.

作为本发明的进一步技术方案为,所述根据信誉模型对各个节点的信誉值进行更新,具体为:As a further technical solution of the present invention, the updating of the reputation value of each node according to the reputation model is specifically:

根据以下信誉模型各个节点的信誉值更新,DR-PBFT提供的信誉更新模型不仅考虑节点行为正常、节点行为异常、节点离线这三种情况,同时还加入了新加入节点积极参与以及新加入节点不参与或异常的情况;According to the reputation value update of each node in the following reputation model, the reputation update model provided by DR-PBFT not only considers the three situations of normal node behavior, abnormal node behavior, and node offline, but also includes the active participation of new nodes and the failure of new nodes. Participation or unusual circumstances;

其中R代表信誉值,第t+1轮信誉值由t轮递推而来,下标i用来区别节点,、/>和/>分别决定信誉值的增减速度;Among them, R represents the reputation value, the reputation value of the t+1 round is recursively obtained from the t round, and the subscript i is used to distinguish the nodes, , /> and /> Determine the speed of increase or decrease of reputation value respectively;

在节点行为正常的情况下,根据需求控制信誉值增长的速度;In the case of normal node behavior, Control the growth rate of reputation value according to demand;

在节点行为异常情况下,,根据需求控制异常节点信誉值的衰减速度;In case of abnormal behavior of nodes, , according to the demand to control the decay speed of the reputation value of abnormal nodes;

对于新加入的节点情况,属于根据需求对于行为相应的信誉值更新速度。For newly added nodes, It belongs to the update speed of the reputation value corresponding to the behavior according to the demand.

本发明的有益效果为:The beneficial effects of the present invention are:

1、本发明是在传统的PBFT机制上,对每个节点赋予信誉值,并在每次共识后根据节点的表现更新信誉值,形成基于动态信誉的实用拜占庭容错共识机制。每次共识根据信誉值选取部分节点参与该次共识,在不减少共识安全性的情况下,优化传统的PBFT共识机制的共识过程,减少了通信次数,提高了通信效率。1. The present invention assigns a reputation value to each node based on the traditional PBFT mechanism, and updates the reputation value according to the performance of the node after each consensus, forming a practical Byzantine fault-tolerant consensus mechanism based on dynamic reputation. Each consensus selects some nodes to participate in the consensus according to the reputation value. Without reducing the security of the consensus, the consensus process of the traditional PBFT consensus mechanism is optimized, the number of communications is reduced, and the communication efficiency is improved.

附图说明Description of drawings

图1为本发明提供的传统的使用拜占庭容错机制图;Fig. 1 is the traditional use Byzantine Fault Tolerant Mechanism diagram that the present invention provides;

图2为本发明提出的一种基于信誉值模型的DR-PBFT改进方法流程图;Fig. 2 is a kind of flow chart of DR-PBFT improvement method based on reputation value model proposed by the present invention;

图3为本发明提出的基于动态信誉的实用拜占庭容错共识机制图;FIG. 3 is a diagram of a practical Byzantine fault-tolerant consensus mechanism based on dynamic reputation proposed by the present invention;

图4为本发明提出的节点行为正常的情况下信誉更新曲线图;Fig. 4 is the reputation update curve under the normal situation of the node behavior that the present invention proposes;

图5为本发明提出的节点行为异常情况下信誉更新曲线图;Fig. 5 is the reputation update curve diagram under the abnormal situation of node behavior proposed by the present invention;

图6为本发明提出的在节点离线情况下信誉更新曲线图;Fig. 6 is the reputation update curve diagram under the node offline situation that the present invention proposes;

图7为本发明提出的对于新加入的节点情况下信誉更新曲线图。Fig. 7 is a reputation update curve diagram for newly added nodes proposed by the present invention.

实施方式Implementation

以下将结合实施例和附图对本发明的构思、具体结构及产生的技术效果进行清楚、完整地描述,以充分地理解本发明的目的、特征和效果。显然,所描述的实施例只是本发明的一部分实施例,而不是全部实施例,基于本发明的实施例,本领域的技术人员在不付出创造性劳动的前提下所获得的其他实施例,均属于本发明保护的范围。The idea, specific structure and technical effects of the present invention will be clearly and completely described below in conjunction with the embodiments and accompanying drawings, so as to fully understand the purpose, features and effects of the present invention. Apparently, the described embodiments are only some of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, other embodiments obtained by those skilled in the art without creative efforts belong to The protection scope of the present invention.

本发明涉及的技术术语如下:The technical term that the present invention relates to is as follows:

1、节点行为正常:主要包括主节点正确打包区块和其余共识节点正确验证信息的过程;主节点未篡改交易信息和通过正确计算方式获得区块信息并广播给其他共识节点属于正常的节点行为;其余共识节点在收到主节点广播的区块信息后,验证区块信息和传递正确的验证结果属于正常的节点行为。1. Node behavior is normal: it mainly includes the process of the master node correctly packaging blocks and other consensus nodes correctly verifying information; the master node has not tampered with transaction information and obtained block information through correct calculation methods and broadcasted to other consensus nodes are normal node behaviors ; After the rest of the consensus nodes receive the block information broadcast by the master node, it is normal node behavior to verify the block information and deliver the correct verification result.

2、节点行为异常:主要涉及主节点打包交易和共识节点验证区块信息的过程;主节点篡改交易信息和通过错误计算方式获得区块信息并广播给其他共识节点属于异常的节点行为;其余共识节点在收到主节点广播的区块信息后,错误验证区块信息和传递错误的验证结果属于异常的节点行为。2. Abnormal node behavior: It mainly involves the process of master node packaging transactions and consensus nodes verifying block information; master node tampering with transaction information and obtaining block information through wrong calculations and broadcasting to other consensus nodes are abnormal node behaviors; the rest of the consensus After the node receives the block information broadcast by the master node, it is an abnormal node behavior to incorrectly verify the block information and transmit the wrong verification result.

3、节点离线行为:主要包括节点在线不参与以及节点不在线两种情况;联盟服务器寻找共识节点时,在线节点不积极响应联盟服务器,属于节点离线行为;联盟服务器寻找共识节点时,不在线的节点属于离线节点行为。3. Offline behavior of nodes: mainly includes two situations where nodes do not participate online and nodes are not online; when the alliance server is looking for consensus nodes, online nodes do not actively respond to the alliance server, which belongs to node offline behavior; when the alliance server is looking for consensus nodes, offline The node belongs to offline node behavior.

4、新加入节点的行为:包括积极参与共识和异常两种情况;新加入节点积极响应联盟服务器请求属于新节点积极参与行为;新加入节点选择离线、在线不参与或者异常,属于新节点异常行为。4. Behavior of newly joined nodes: including actively participating in consensus and abnormal situations; actively responding to alliance server requests by newly joined nodes belongs to the active participation behavior of new nodes; choosing offline, online non-participation or abnormal behavior of newly joined nodes belongs to abnormal behavior of new nodes .

5、验证区块:通过计算交易值的HASH值验证区块头的MERKLEROOT,相同则验证成功,否则失败。5. Verify the block: Verify the MERKLEROOT of the block header by calculating the HASH value of the transaction value. If they are the same, the verification succeeds, otherwise it fails.

6、共识时长:从客户端请求到区块验证成功之间消耗的时长。6. Consensus duration: the duration from client request to successful block verification.

7、MerkleTree:一种二叉树结构,将该区块保存的交易存放在二叉树的叶子节点,叶子节点的父节点通过两个叶子节点字符串连接哈希计算得到,若节点数为单数,则和自身连接计算哈希值,继续向上哈希计算,知道计算出根节点的哈希值。7. MerkleTree: A binary tree structure, which stores the transactions saved in the block in the leaf nodes of the binary tree. The parent node of the leaf node is calculated by concatenating the hash of the two leaf node strings. If the number of nodes is an odd number, then The connection calculates the hash value, and continues the upward hash calculation until the hash value of the root node is calculated.

8、MerkleTreeRoot:通过将区块体中的MerkleTree中的叶子结点两两计算哈希值,最终得到根节点的哈希值,即为MerkleTreeRoot保存在区块头中,若将区块体中的交易发生任意改动,则MerkleTreeRoot值会发生变化,因此保证了区块的防篡改。8. MerkleTreeRoot: By calculating the hash value of the leaf nodes in the MerkleTree in the block body, the hash value of the root node is finally obtained, that is, the MerkleTreeRoot is stored in the block header. If the transaction in the block body If any change occurs, the MerkleTreeRoot value will change, thus ensuring the tamper-proof of the block.

参见图2,一种基于信誉值模型的DR-PBFT改进方法,包括:See Figure 2, an improved DR-PBFT method based on the reputation value model, including:

步骤S1,联盟服务器接收到客户端请求时,向在线节点数据库的在线节点征集共识节点;Step S1, when the alliance server receives the request from the client, it collects consensus nodes from the online nodes in the online node database;

步骤S2,联盟服务器从共识节点中选择主节点,并向共识节点广播参与共识的共识节点信息;Step S2, the alliance server selects the master node from the consensus nodes, and broadcasts the consensus node information participating in the consensus to the consensus nodes;

步骤S3,主节点对联盟服务器的交易信息进行打包并向其他共识节点广播;Step S3, the master node packages the transaction information of the alliance server and broadcasts it to other consensus nodes;

步骤S4,共识节点接收到主节点的广播的交易信息后进行验证并将验证结果发送至其他共识节点;Step S4, after the consensus node receives the broadcast transaction information from the master node, it performs verification and sends the verification result to other consensus nodes;

步骤S5,共识节点全部确认打包后,向联盟服务器发送区块验证结果,联盟服务器收到共识成功后将打包的区块上链;Step S5, after all the consensus nodes confirm the packaging, send the block verification result to the alliance server, and the alliance server will upload the packaged block to the chain after receiving the consensus;

步骤S6,对在线节点数据库的节点根据信誉模型进行信誉值更新。Step S6, update the reputation value of the nodes in the online node database according to the reputation model.

参见图3,本发明是在传统的PBFT机制上,对每个节点赋予信誉值,并在每次共识后根据节点的表现更新信誉值,形成基于动态信誉的实用拜占庭容错共识机制。每次共识根据信誉值选取部分节点参与该次共识,在不减少共识安全性的情况下,优化传统的PBFT共识机制的共识过程,减少了通信次数,提高了通信效率。Referring to Figure 3, the present invention assigns a reputation value to each node based on the traditional PBFT mechanism, and updates the reputation value according to the performance of the node after each consensus, forming a practical Byzantine fault-tolerant consensus mechanism based on dynamic reputation. Each consensus selects some nodes to participate in the consensus according to the reputation value. Without reducing the security of the consensus, the consensus process of the traditional PBFT consensus mechanism is optimized, the number of communications is reduced, and the communication efficiency is improved.

本发明以0-5个在线节点为例,联盟服务器S在收到一个客户端请求后,向在线节点数据库发送请求,查询在线节点,随后向在线节点0、1、2、3、4、5发送<PRE-ASK,O,T,S>请求,询问是否要参与此次共识,其中O代表请求的具体操作,T代表联盟服务器S请求时所追加的时间戳,之后发出的请求都比此次请求的时间戳更靠后。节点需要验证其中的消息签名是否正确,若验证不通过,则丢弃,否则接受该消息。根据图可以看出,本次在线节点一共有五个分别是0、1、2、3、4、5。The present invention takes 0-5 online nodes as an example. After receiving a client request, the alliance server S sends a request to the online node database, queries the online nodes, and then sends the online nodes 0, 1, 2, 3, 4, 5 Send a <PRE-ASK,O,T,S> request to ask whether you want to participate in this consensus, where O represents the specific operation of the request, and T represents the timestamp appended by the federation server S when requesting, and all subsequent requests will be older than this The timestamp of the second request is later. The node needs to verify whether the message signature is correct, if the verification fails, it will discard it, otherwise it will accept the message. According to the figure, it can be seen that there are five online nodes this time, namely 0, 1, 2, 3, 4, and 5.

在线节点0、1、2、3、4、5收到联盟服务器S的PRE-ASK请求后,向S发送<PRE-ANSWER,O,T,P,F>消息,表明自己是否参与本次共识。其中O、T所代表的含义不变,P代表自身节点的信息,F代表自身节点的意愿。 通过观察图中的ANSWER过程可以看出5号区块链节点不参与本次共识过程。After online nodes 0, 1, 2, 3, 4, and 5 receive the PRE-ASK request from the alliance server S, they send a <PRE-ANSWER, O, T, P, F> message to S to indicate whether they participate in this consensus . Among them, the meanings represented by O and T remain unchanged, P represents the information of its own node, and F represents the will of its own node. By observing the ANSWER process in the figure, it can be seen that the No. 5 blockchain node does not participate in this consensus process.

联盟服务器S在收到各个节点回复的PRE-ANSWER后,分析各个参与节点的可信度,选取可信度前P个节点作为参与本次共识的节点,并选取可信度最高的节点作为本次共识过程的主节点。之后向参与本次共识过程的各个节点即0、1、2、3发送<ASK,O,T,S,TAB,MSG>请求,同步各个节点本次共识的相关信息。其中O、T、S含义不变,TAB表示参与本次共识的各个节点以及主节点的信息;MSG表示本次共识需要打包的交易信息。本次过程选取0号节点为主节点。After receiving the PRE-ANSWER replies from each node, the alliance server S analyzes the credibility of each participating node, selects the P nodes with the highest credibility as the nodes participating in this consensus, and selects the node with the highest credibility as the current consensus node. The master node of the secondary consensus process. Then send <ASK, O, T, S, TAB, MSG> requests to each node participating in this consensus process, ie, 0, 1, 2, and 3, to synchronize the relevant information of each node this consensus. Among them, the meanings of O, T, and S remain unchanged, TAB indicates the information of each node participating in this consensus and the master node; MSG indicates the transaction information that needs to be packaged in this consensus. In this process, node 0 is selected as the master node.

0号节点打包交易信息成块后,向其余参与的共识节点即1、2、3号节点发送<ANSWER,O,T,P,B-MSG>请求,同步打包完成的区块信息。其中O、T、P含义不变,B-MSG是本次共识交易打包成的区块。After node 0 packs the transaction information into blocks, it sends <ANSWER, O, T, P, B-MSG> requests to the remaining participating consensus nodes, namely nodes 1, 2, and 3, to synchronize the packaged block information. Among them, the meanings of O, T, and P remain unchanged, and B-MSG is the block packaged by this consensus transaction.

共识节点1、2、3收到主节点的ANSWER请求后,通过验证区块以及交易信息,得到验证结果,并向其余共识节点发送<COMMIT,O,T,P,C>请求,其中C代表本次验证的结果,每个节点只有收到2f(f为可容忍的拜占庭节点数)个其他节点发来的正确摘要,才可确定区块的正确性。After receiving the ANSWER request from the master node, consensus nodes 1, 2, and 3 obtain verification results by verifying blocks and transaction information, and send <COMMIT, O, T, P, C> requests to other consensus nodes, where C stands for As a result of this verification, each node can only determine the correctness of the block if it receives correct summaries from 2f (f is the number of tolerable Byzantine nodes) other nodes.

共识节点0、1、2、3确认打包后,向联盟服务器S发送<REPLY,O,T,P,R>消息,其中R代表本次区块验证结果,当联盟S收到2f+1个消息,才可证明本次共识成功,最后将打包的区块上链。Consensus nodes 0, 1, 2, and 3 send <REPLY, O, T, P, R> messages to alliance server S after confirming the packaging, where R represents the result of this block verification. When alliance S receives 2f+1 The message can prove the success of this consensus, and finally the packaged block will be uploaded to the chain.

在一轮共识结束后,需要根据以下信誉模型各个节点的信誉值更新,DR-PBFT提供的信誉更新模型不仅考虑节点行为正常、节点行为异常、节点离线这三种情况,同时还加入了新加入节点积极参与以及新加入节点不参与或异常的情况。After a round of consensus is over, the reputation value of each node needs to be updated according to the following reputation model. The reputation update model provided by DR-PBFT not only considers the three situations of normal node behavior, abnormal node behavior, and node offline, but also adds new Active participation of nodes and non-participation or abnormality of newly joined nodes.

其中R代表信誉值,第t+1轮信誉值由t轮递推而来,下标i用来区别节点,、/>和/>分别决定信誉值的增减速度。Among them,R represents the reputation value, the reputation value of thet+1 round is recursively obtained fromthe t round, and the subscripti is used to distinguish the nodes, , /> and /> Determine the speed of increase or decrease of reputation value respectively.

在节点行为正常的情况下,其中根据需求控制信誉值增长的速度,如图4所示为/>时节点的正常行为信誉增长曲线,随着正确的共识次数增加,信誉增长逐渐缓慢直至趋近于一。In the case of normal node behavior, where Control the growth rate of reputation value according to demand, as shown in Figure 4 /> The normal behavior reputation growth curve of the time node, as the number of correct consensuses increases, the reputation growth gradually slows down until it approaches one.

在节点行为异常情况下,其中,根据需求控制异常节点信誉值的衰减速度,如图5所示为/>时节点的异常行为信誉减少曲线,随着异常的共识次数增加,信誉减少逐渐缓慢最后趋近于零。In case of abnormal behavior of nodes, where , according to the demand to control the decay speed of the reputation value of abnormal nodes, as shown in Figure 5 When the node's abnormal behavior reputation decreases curve, as the number of abnormal consensus increases, the reputation decreases slowly and finally approaches zero.

参见图6,在节点离线情况下,高信誉值节点不参与会损失更多的信誉值,调动了高信誉值节点参与的积极性。Referring to Figure 6, when the node is offline, if the node with high reputation value does not participate, it will lose more reputation value, which mobilizes the enthusiasm of nodes with high reputation value to participate.

对于新加入的节点情况,其中属于根据需求对于行为相应的信誉值更新速度。如图7所示为/>的新节点信誉值更新情况。可以得到新节点在加入联盟后,积极参与和不参与对信誉值的更新影响较小,提高系统稳定性。For newly added nodes, where It belongs to the update speed of the reputation value corresponding to the behavior according to the demand. Shown in Figure 7 as /> The update status of the new node reputation value of . It can be obtained that after the new node joins the alliance, active participation or non-participation has little impact on the update of the reputation value, which improves the stability of the system.

本发明选择以太坊中的3000笔交易,分别选取4、7、10、13、16个节点参与共识,每次做十次实验求得平均值,传统的PBFT共识机制达成共识的时长分别为0.306202210s、0.310701900s、0.317938510s、0.327075580s以及0.336941550s。DR-PBFT共识机制达成共识的时长分别为0.281680560s、0.285399339s、0.291028820s、0.308588390s以及0.318692540s。The present invention selects 3,000 transactions in Ethereum, selects 4, 7, 10, 13, and 16 nodes to participate in the consensus, and performs ten experiments each time to obtain the average value. The time for the traditional PBFT consensus mechanism to reach consensus is 0.306202210 s, 0.310701900s, 0.317938510s, 0.327075580s, and 0.336941550s. The time for the DR-PBFT consensus mechanism to reach consensus is 0.281680560s, 0.285399339s, 0.291028820s, 0.308588390s and 0.318692540s respectively.

本发明提出的共识过程则是在共识过程前,联盟服务器需要对在线且愿意参加的共识节点进行信誉值排名,选取靠前的节点参与本次共识,属于选取部分节点参与。对每个节点赋予信誉值,并在每次共识后根据节点的表现更新信誉值。每次共识根据信誉值选取部分节点参与该次共识,在不减少共识安全性的情况下,优化传统的PBFT共识机制的共识过程,减少了通信次数,提高了通信效率。The consensus process proposed by the present invention is that before the consensus process, the alliance server needs to rank the consensus nodes that are online and willing to participate in the reputation value, and select the top nodes to participate in this consensus, which belongs to the selection of some nodes to participate. Assign a reputation value to each node, and update the reputation value according to the performance of the node after each consensus. Each consensus selects some nodes to participate in the consensus according to the reputation value. Without reducing the security of the consensus, the consensus process of the traditional PBFT consensus mechanism is optimized, the number of communications is reduced, and the communication efficiency is improved.

以上对本发明进行了详细介绍,但是本发明不限于上述实施方式,在本领域普通技术人员所具备的知识范围内,还可以在不脱离本发明宗旨的前提下做出各种变化。不脱离本发明的构思和范围可以做出许多其他改变和改型。应当理解,本发明不限于特定的实施方式,本发明的范围由所附权利要求限定。The present invention has been described in detail above, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of those skilled in the art without departing from the gist of the present invention. Many other changes and modifications can be made without departing from the spirit and scope of the present invention. It should be understood that the invention is not limited to the particular embodiments, but that the scope of the invention is defined by the appended claims.

Claims (7)

CN202210890349.1A2022-07-272022-07-27 An Improved DR-PBFT Method Based on Reputation Value ModelActiveCN115277722B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202210890349.1ACN115277722B (en)2022-07-272022-07-27 An Improved DR-PBFT Method Based on Reputation Value Model

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202210890349.1ACN115277722B (en)2022-07-272022-07-27 An Improved DR-PBFT Method Based on Reputation Value Model

Publications (2)

Publication NumberPublication Date
CN115277722A CN115277722A (en)2022-11-01
CN115277722Btrue CN115277722B (en)2023-08-22

Family

ID=83770611

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202210890349.1AActiveCN115277722B (en)2022-07-272022-07-27 An Improved DR-PBFT Method Based on Reputation Value Model

Country Status (1)

CountryLink
CN (1)CN115277722B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN116015672B (en)*2022-12-152024-05-28山西大学 A PBFT consensus mechanism based on reputation model
CN116192865A (en)*2022-12-152023-05-30山西大学 A weakly centralized distributed environment consensus mechanism based on sorting and grouping
CN116132140B (en)*2022-12-302024-10-29北京邮电大学Deployment method and device of block chain consensus mechanism, electronic equipment and storage medium
CN116170155B (en)*2023-02-212025-02-11西安理工大学 Improved alliance blockchain consensus method based on PBFT
CN116707759B (en)*2023-06-202024-02-20南京理工大学 A lightweight consortium chain consensus method for high-concurrency data circulation scenarios
CN117745433B (en)*2024-02-192024-05-28成都理工大学 Energy blockchain node consensus method based on improved PBFT consensus mechanism
CN119583565B (en)*2024-12-112025-09-30福建福链科技有限公司 An improved PBFT method and terminal
CN120338832B (en)*2025-06-182025-09-26杭州易知微科技有限公司Supply chain full-flow traceability system based on digital twin and block chain

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN108492103A (en)*2018-02-072018-09-04北京大学深圳研究生院A kind of alliance's block chain common recognition method
CN109767199A (en)*2018-12-102019-05-17西安电子科技大学 Reputation-based PBFT consensus system and method, blockchain data processing system
CN110493198A (en)*2019-07-262019-11-22北京工业大学A method of it is attacked based on Sybil in PBFT algorithm defence block chain is improved
CN111756546A (en)*2020-06-152020-10-09杭州电子科技大学 A blockchain consensus method based on dynamic reputation mechanism in the Internet of Vehicles environment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US10986079B2 (en)*2018-12-062021-04-20Bank Of America CorporationSystem and method for hierarchical decisioning within a hybrid blockchain

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN108492103A (en)*2018-02-072018-09-04北京大学深圳研究生院A kind of alliance's block chain common recognition method
CN109767199A (en)*2018-12-102019-05-17西安电子科技大学 Reputation-based PBFT consensus system and method, blockchain data processing system
CN110493198A (en)*2019-07-262019-11-22北京工业大学A method of it is attacked based on Sybil in PBFT algorithm defence block chain is improved
CN111756546A (en)*2020-06-152020-10-09杭州电子科技大学 A blockchain consensus method based on dynamic reputation mechanism in the Internet of Vehicles environment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Dynamic reputation-based consensus mechanism:real-time transactions for energy blockchain;wenjun cai、等;《Energy Spectrum Ffficient Communication for Smart city Iot-Rearch Article》;全文*

Also Published As

Publication numberPublication date
CN115277722A (en)2022-11-01

Similar Documents

PublicationPublication DateTitle
CN115277722B (en) An Improved DR-PBFT Method Based on Reputation Value Model
US10666778B1 (en)System and method for ending view change protocol
US20230092484A1 (en)Block chain-based block consensus method and related device
CN110754070B (en) Rapid propagation of recent transactions on the blockchain network
US20200125556A1 (en)Consensus system and method
CN112541758A (en)Multi-round voting type fault-tolerant sequencing consensus mechanism and method based on block chain
CN110399424B (en)Block generation method, block generation device, block chain node and storage medium
US20200310901A1 (en)System and method for ending view change protocol
CN113141414B (en)Grouped multi-chain asynchronous consensus method for block chain nodes in CNFS protocol
CN110796547A (en)Improved practical Byzantine fault-tolerant system based on alliance block chain
CN114218612B (en)Consensus method suitable for alliance chain high-frequency transaction scene
CN114938292B (en)Multi-level optimization PBFT consensus method based on node credibility
CN117527834B (en) An improved PBFT consensus method based on reputation scoring mechanism
CN113660125A (en)Consensus method and device based on random credible committee
CN111414420A (en)Improved PBFT block chain consensus method
CN113179166B (en)High-robustness Byzantine fault-tolerant-based alliance chain data safe real-time uplink method
CN115189871A (en) A Byzantine Fault Tolerant Consensus Algorithm Based on Verifiable Random Function and Threshold Signature
CN116846888A (en) Consensus processing methods, devices, equipment and storage media for blockchain networks
ChenScaling byzantine fault-tolerant consensus with optimized shading scheme
CN115664724A (en)Consensus method in block chain system, block chain system and consensus node
CN118869184A (en) A PBFT consensus method based on reputation value and sharding technology
CN118677906A (en)Grouping Bayesian fault-tolerant consensus method based on aggregated signature
CN118540046A (en)High-performance alliance chain consensus protocol and system based on dynamic committee
WO2024007663A1 (en)Blockchain consensus method and apparatus, computer readable medium, and electronic device
CN116566622A (en) A dynamic transaction sharding protocol method for consortium chains

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp