CN116015672B - PBFT consensus mechanism based on reputation model - Google Patents

PBFT consensus mechanism based on reputation model Download PDF

Info

Publication number
CN116015672B
CN116015672B CN202211615029.1A CN202211615029A CN116015672B CN 116015672 B CN116015672 B CN 116015672B CN 202211615029 A CN202211615029 A CN 202211615029A CN 116015672 B CN116015672 B CN 116015672B
Authority
CN
China
Prior art keywords
node
reputation value
message
consensus
nodes
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
CN202211615029.1A
Other languages
Chinese (zh)
Other versions
CN116015672A (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.)
Shanxi University
Original Assignee
Shanxi 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 Shanxi University filed Critical Shanxi University
Priority to CN202211615029.1A priority Critical patent/CN116015672B/en
Publication of CN116015672A publication Critical patent/CN116015672A/en
Application granted granted Critical
Publication of CN116015672B publication Critical patent/CN116015672B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The invention relates to a PBFT consensus mechanism based on a reputation model, which comprises the following steps: calculating the reputation value of the node, and selecting the node with the reputation value of 10% in the blockchain network as a consensus node; the client sends a request to a master node in the blockchain network; the master node receives a request sent by a client and sends a PRE-PREPARE message to all other consensus nodes in the blockchain network; the consensus node sends a PREPARE message to other consensus nodes; the consensus node broadcasts COMMIT information to other consensus nodes, and returns a REPLY message to the main node after the consensus node receives 2f+1 COMMIT information; the client receives f+1 identical REPLY messages. According to the invention, the improved reputation model is applied to PBFT consensus algorithm, and the node with high reputation value is selected as the consensus node to carry out PBFT consensus process, so that the time complexity is reduced, and the performance and usability are improved.

Description

PBFT consensus mechanism based on reputation model
Technical Field
The invention belongs to the technical field of blockchains, and particularly relates to a PBFT consensus mechanism based on a reputation model.
Background
The blockchain has the characteristics of decentralization, non-tampering, traceability and the like, and because of the characteristics, the blockchain technology is widely applied to a plurality of fields such as digital economy, internet of things, medical treatment and the like. Consensus algorithms are core techniques in blockchain systems to achieve final consistency of data. PBFT (PRACTICAL BYZANTINE FAULT TOLERANCE Bayesian fault tolerance) consensus algorithm is common consensus algorithm of alliance chains, can tolerate Bayesian faults in distributed networks, aims to solve the problem that node data in the networks are inconsistent and incorrect due to malicious behaviors of malicious nodes in the networks, and when n nodes exist in the networks, if the malicious node ratio is not more than (n-1)/3, the PBFT algorithm can guarantee the reliability and the safety of the networks. However, in the consensus flow of the PBFT algorithm, the nodes executing the preparation stage and the submission stage need to send messages to all other nodes in the network, the communication time of the network increases in polynomial level with the increase of the nodes, and the execution efficiency of the PBFT algorithm is greatly reduced, so that the time consumed by the network to reach consensus is increased. The EigenTrust reputation model calculates the final reputation value of the node through the direct reputation value and the recommended reputation value obtained by evaluating transactions among the nodes, and the higher the reputation value is, the higher the node reliability is, but the model does not consider the influence of time on the reputation value and does not have a mechanism for punishing malicious nodes when calculating the reputation value. The good transaction evaluation and the bad transaction evaluation of the EigenTrust reputation model occupy the same proportion when calculating the reputation value, which can lead malicious nodes to carry out malicious actions after accumulating a certain reputation value, and the process is repeated, so that the network safety is endangered.
Disclosure of Invention
The invention aims to provide a PBFT consensus mechanism based on a reputation model, which is characterized in that an improved EigenTrust model is applied to a PBFT consensus algorithm, a node with a high reputation value is selected as a consensus node to conduct PBFT consensus flow, other nodes are slave nodes to receive the result of the consensus node, and the result of the consensus node is not participated in the consensus flow, so that the time complexity is reduced, and the performance and the usability are improved;
In order to achieve the above purpose, the invention adopts the following technical scheme:
a PBFT consensus mechanism based on a reputation model, comprising the steps of:
Calculating the reputation value of the node, and selecting the node with the reputation value of 10% in the blockchain network as a consensus node;
the client sends a REQUEST to a master node in the blockchain network, wherein the REQUEST comprises specific operation of the REQUEST, adding the client to a time stamp, a client identifier and a REQUEST message body when the REQUEST is sent, and the REQUEST message body comprises message content and a message abstract, wherein the client signs the REQUEST;
After the verification is passed, a number n is allocated, and a PRE-PREPARE message is sent to all other consensus nodes in the blockchain network, wherein the PRE-PREPARE message comprises a view number, a message content and a message abstract; after receiving the message, the consensus node verifies the message, and the signature, the view number and the message sequence number pass the verification;
The consensus node sends a PRE message to all other consensus nodes, and stores the PRE-PRE message and the PRE message in a message log of the consensus node; after receiving the PREPARE messages, other consensus nodes need to verify whether the signature, the view number, the message sequence number and the number of the received PREPARE messages accord with rules or not, and after the verification is passed;
The common node broadcasts the COMMIT message to other common nodes, the common node verifies the correctness of the signature, the view number and the message serial number after receiving the COMMIT message of other common nodes, and when the common node receives 2f+1 COMMIT messages, the common node returns a REPLY message to the main node;
When the client receives f+1 identical REPLY messages, it is stated that the REQUEST sent by the client has reached a consensus in the blockchain network.
Preferably, the reputation value of the node is composed of a local reputation value and a recommended reputation value.
Preferably, the local reputation value is:
sij=sat(i,j)-unsat(i,j) (1)
Where s ij in equation 1 is the local reputation value of node i's evaluation of node j, sat (i, j) is the number of satisfaction in the historical transactions of node i and node j, and unsat (i, j) is the number of dissatisfaction in the historical transactions of node i and node j.
Preferably, the satisfactory number of times is:
Wherein in formula 2 For any time period k, satisfying transaction times of node i to node j,/>Attenuation factor for satisfactory transactions.
Preferably, the number of unsatisfied times is:
wherein in formula 3 For any time period k, the unsatisfactory transaction times of the node i to the node j,/>, are shown asIs an attenuation factor for unsatisfactory transactions.
Preferably, the method further comprises the following steps: the local reputation value is normalized, and the normalized local reputation value is obtained as follows:
wherein, in equation 4, C ij is the normalized local reputation value of node i for node j.
Preferably, the recommendation reputation value is:
tik=∑jCij·Cjk (5)
Wherein, t ik in equation 5 is the recommended reputation value of node i to node k, and C jk is the normalized local reputation value of node j to node k.
Preferably, in the initial state, some nodes are selected as pre-trust nodes; the reputation value of the node is:
wherein, p is a pre-trust node in formula 6, and α is an influencing factor.
Preferably, if a node performs malicious behavior, the blockchain network penalizes the node, reduces the local reputation value of the malicious node, and the reputation value of the malicious node is:
s′ij=sij/Fk (7)
wherein s ij in equation 7 is the local reputation value before the node performs the malicious action, F k is the kth term of fibonacci sequence, when the node finishes the kth malicious action, the reputation value is updated to the original 1/F k, and F k honest transactions are required to be performed to finish punishment.
Compared with the prior art, the invention has the following advantages:
(1) The invention distributes and dynamically calculates the unique credit value of the node, selects the node with higher credit value to participate in consensus, and other nodes are used as slave nodes to receive the consensus result of the consensus node, thereby reducing the communication time in the blockchain network, and being applicable to the blockchain network with a large number of nodes;
(2) The improvement of the EigenTrust reputation model considers the time attenuation of the transaction, the influence of the transaction evaluation which is closer to the current moment on the reputation value is larger, the influence of the transaction evaluation which is farther away from the current moment on the reputation value is smaller, the change of the reputation degree along with the change of time is reflected, the rationality of the reputation value calculation is improved, and the method is suitable for distributed blockchain network consensus;
(3) The method provided by the invention can stimulate the nodes to conduct the faithful transaction, punishs the nodes conducting the malicious behaviors, effectively inhibits the malicious behaviors of the nodes, and improves the safety of the block chain network.
Drawings
FIG. 1 is a flowchart of the PBFT algorithm of the present invention;
FIG. 2 is a flow chart of an improved EigenTrust reputation model of the present invention.
Detailed Description
The invention is further described below with reference to the drawings and specific examples.
The invention discloses a PBFT consensus mechanism based on a reputation model, which comprises the following steps:
Calculating the reputation value of the node, and selecting the node with the reputation value of 10% in the blockchain network as a consensus node;
specifically, as shown in fig. 2, the first 10% of nodes with higher reputation values in the blockchain network are selected as consensus nodes, other nodes are slave nodes, wherein the consensus nodes are the master nodes and a part of the slave nodes, the nodes with higher reputation values are selected as the consensus nodes to participate in consensus, the other nodes are the slave nodes to receive the consensus result of the master nodes and do not participate in the consensus flow, the time complexity is reduced, the performance and the usability are improved,
Wherein the reputation value of the node is the global reputation value in fig. 2; the reputation value of the node is composed of a local reputation value and a recommended reputation value, the local reputation value is calculated by the node which has performed direct transaction according to the historical transaction evaluation, the recommended reputation value is obtained by the node which has not performed direct transaction by querying other nodes,
The node stores the historical transaction evaluation locally and calculates a local reputation value from the number of satisfactory transactions and the number of unsatisfactory transactions as follows:
sij=sat(i,j)-unsat(i,j) (1)
Where s ij in equation 1 is the local reputation value of node i's evaluation of node j, sat (i, j) is the number of satisfaction in the historical transactions of node i and node j, and unsat (i, j) is the number of dissatisfaction in the historical transactions of node i and node j.
If node i is satisfied with the transaction to node j, then the number of times that is satisfied is calculated as follows:
Wherein in formula 2 For any time period k, satisfying transaction times of node i to node j,/>Attenuation factor for satisfactory transactions.
If node i is not satisfied with the transactions of node j, then the number of unsatisfied times is calculated as follows:
wherein in formula 3 For any time period k, the unsatisfactory transaction times of the node i to the node j,/>, are shown asIs an attenuation factor for unsatisfactory transactions.
Wherein the EigenTrust reputation model added with the time attenuation factor enables the calculation result of the reputation value to be more in accordance with the real situation, the transaction evaluation closer to the current moment has larger influence on the reputation value, the transaction evaluation farther away from the current moment has smaller influence on the reputation value, the change of the reputation degree along with the change of time is reflected, the rationality of the reputation value calculation is improved,
The local reputation value is normalized, and the normalized local reputation value is obtained as follows:
wherein, in equation 4, C ij is the normalized local reputation value of node i for node j.
If no direct transaction is performed between the node i and the node k, when the reputation value of the node i to the node k is calculated, the evaluation of the node which performs the direct transaction with the node k to the node k is required to be inquired, and the local reputation value of the node i to the node j and the local reputation value of the node j to the node k are calculated by using the formula (4), so that the recommended reputation value is calculated, and the calculation method is as follows:
the recommendation reputation value is:
tik=∑jCij·Cjk (5)
Wherein, t ik in equation 5 is the recommended reputation value of node i to node k, and C jk is the normalized local reputation value of node j to node k.
In the initial state, some nodes are randomly selected as pre-trust nodes;
The obtained local reputation value and the pre-trust node are aggregated to obtain a global reputation value, and the calculation method is as follows:
the reputation value of the node is:
Wherein, p is a pre-trust node in the formula 6, and alpha is an influence factor, and the influence factor is used for distributing the weight of the pre-trust node and other nodes to the credit value calculation.
In this embodiment, if a node performs a malicious action, the blockchain network penalizes the node, reduces the reputation value of the malicious node, and the reputation value of the malicious node is:
s′ij=sij/Fk (7)
In formula 7, s ij is a local reputation value before the node performs malicious actions, F k is a kth item of a fibonacci sequence, after the node finishes the kth malicious action, the reputation value is updated to be 1/F k, F k honest transactions are required to be performed to finish punishment, the node is stimulated to perform honest transactions, the malicious actions of the node are restrained, and the safety of the block chain network is improved.
As shown in fig. 1, a client c sends a REQUEST to a master node in a blockchain network, the REQUEST including a specific operation o of the REQUEST, a client addition to a timestamp at the time of the REQUEST, a client identification, and a REQUEST message body containing a message content m and a message digest d, wherein the client signs the REQUEST;
A preparation stage: after the verification is passed, a number n is allocated, and a PRE-PREPARE message is sent to all other consensus nodes in the blockchain network, wherein the PRE-PREPARE message comprises a view number v, a message content m and a message abstract d; after receiving the message, the consensus node verifies the message, and if the signature, the view number and the message serial number pass verification, the consensus node enters a preparation stage;
The preparation stage: the consensus node sends a PRE message to all other consensus nodes, and stores the PRE-PREPARE message and the PREPARE message in a message log of the consensus node; after receiving the PREPARE messages, other consensus nodes need to verify whether the signature, the view number, the message sequence number and the number of the received PREPARE messages accord with rules, and if the verification is passed, the authentication stage is entered;
And (3) a confirmation stage: the common node broadcasts the COMMIT information to other common nodes, the common node verifies the correctness of the signature, the view number and the information sequence number after receiving the COMMIT information of other common nodes, and when the common node receives 2f+1 COMMIT information, a REPLY message is returned to the main node, wherein f is the number of the Bayesian nodes;
When the client receives f+1 identical REPLY messages, the client indicates that the REQUEST sent by the client has reached consensus in the blockchain network;
in fig. 1, "0" is a master node, "1" and "2" are common nodes, and "3" is a fault node in the common nodes.

Claims (1)

1. A reputation model-based PBFT consensus mechanism comprising the steps of:
Calculating the reputation value of the node, and selecting the node with the reputation value of 10% in the blockchain network as a consensus node;
the client sends a REQUEST to a master node in the blockchain network, wherein the REQUEST comprises specific operation of the REQUEST, adding the client to a time stamp, a client identifier and a REQUEST message body when the REQUEST is sent, and the REQUEST message body comprises message content and a message abstract, wherein the client signs the REQUEST;
After the verification is passed, a number n is allocated, and a PRE-PREPARE message is sent to all other consensus nodes in the blockchain network, wherein the PRE-PREPARE message comprises a view number, a message content and a message abstract; all other consensus nodes which do not include the master node verify the message after receiving the message, and the signature, the view number and the message sequence number pass the verification;
The consensus node which does not comprise the master node sends a PRE message to all other consensus nodes, and stores the PRE-PREPARE message and the PREPARE message into a message log of the consensus node; after all other consensus nodes receive the PREPARE message, whether the signature, the view number, the message sequence number and the number of the received PREPARE messages accord with rules or not needs to be verified, and after verification is passed;
the common node broadcasts the COMMIT information to all other common nodes, the common node verifies the correctness of the signature, the view number and the information sequence number after receiving the COMMIT information of all other common nodes, and when the common node receives 2f+1 COMMIT information, the common node returns an REPLY message to the main node, wherein f is the number of the Bayesian nodes;
When the client receives f+1 identical REPLY messages, the client indicates that the REQUEST sent by the client has reached consensus in the blockchain network;
the reputation value of the node consists of a local reputation value and a recommended reputation value;
The local reputation value is:
sij=sat(i,j)-unsat(i,j) (1)
Wherein s ij in equation 1 is the local reputation value of node i for node j, sat (i, j) is the number of times satisfied in the historical transactions of node i and node j, unsat (i, j) is the number of times unsatisfied in the historical transactions of node i and node j;
the satisfactory number of times is:
Wherein in formula 2 For any time period k, satisfying transaction times of node i to node j,/>Attenuation factors for satisfactory transactions;
The number of unsatisfied times is:
wherein in formula 3 For any time period k, the unsatisfactory transaction times of the node i to the node j,/>, are shown asAttenuation factors for unsatisfactory transactions;
the local reputation value is normalized, and the normalized local reputation value is obtained as follows:
wherein, in formula 4, C ij is the normalized local reputation value of node i to node j;
the recommendation reputation value is:
tik=∑jCij·Cjk (5)
Wherein, t ik in formula 5 is the recommended reputation value of node i to node k, and C jk is the normalized local reputation value of node j to node k;
In the initial state, some nodes are selected as pre-trust nodes; the reputation value of the node is:
Wherein, p is a pre-trust node in the formula 6, and alpha is an influence factor;
If the node performs malicious behavior, the blockchain network penalizes the node, reduces the local reputation value of the malicious node, and the reputation value of the malicious node is as follows:
s′ij=sij/Fk (7)
wherein s ij in equation 7 is the local reputation value before the node performs the malicious action, F k is the kth term of fibonacci sequence, when the node finishes the kth malicious action, the reputation value is updated to the original 1/F k, and F k honest transactions are required to be performed to finish punishment.
CN202211615029.1A 2022-12-15 2022-12-15 PBFT consensus mechanism based on reputation model Active CN116015672B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211615029.1A CN116015672B (en) 2022-12-15 2022-12-15 PBFT consensus mechanism based on reputation model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211615029.1A CN116015672B (en) 2022-12-15 2022-12-15 PBFT consensus mechanism based on reputation model

Publications (2)

Publication Number Publication Date
CN116015672A CN116015672A (en) 2023-04-25
CN116015672B true CN116015672B (en) 2024-05-28

Family

ID=86022476

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211615029.1A Active CN116015672B (en) 2022-12-15 2022-12-15 PBFT consensus mechanism based on reputation model

Country Status (1)

Country Link
CN (1) CN116015672B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117408718B (en) * 2023-12-14 2024-03-08 南京邮电大学 PBFT optimization method for large-scale medicine traceability
CN117952582A (en) * 2024-01-29 2024-04-30 北京中科航天人才服务有限公司 Human resource data processing method and system based on recursive blockchain

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109767199A (en) * 2018-12-10 2019-05-17 西安电子科技大学 PBFT common recognition system and method, block chain data processing system based on prestige
CN111756546A (en) * 2020-06-15 2020-10-09 杭州电子科技大学 Block chain consensus method based on dynamic credit mechanism in Internet of vehicles environment
CN112818388A (en) * 2021-01-25 2021-05-18 北方工业大学 Cloud service privacy protection credit system based on block chain
WO2021196350A1 (en) * 2020-03-30 2021-10-07 南京中诚区块链研究院有限公司 Blockchain raft + pbft hybrid consensus network algorithm and system
CN113781218A (en) * 2021-09-03 2021-12-10 桂林电子科技大学 Grouping PBFT consensus algorithm based on feature trust
CN115277722A (en) * 2022-07-27 2022-11-01 长安大学 DR-PBFT improved algorithm based on credit value model

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109767199A (en) * 2018-12-10 2019-05-17 西安电子科技大学 PBFT common recognition system and method, block chain data processing system based on prestige
WO2021196350A1 (en) * 2020-03-30 2021-10-07 南京中诚区块链研究院有限公司 Blockchain raft + pbft hybrid consensus network algorithm and system
CN111756546A (en) * 2020-06-15 2020-10-09 杭州电子科技大学 Block chain consensus method based on dynamic credit mechanism in Internet of vehicles environment
CN112818388A (en) * 2021-01-25 2021-05-18 北方工业大学 Cloud service privacy protection credit system based on block chain
CN113781218A (en) * 2021-09-03 2021-12-10 桂林电子科技大学 Grouping PBFT consensus algorithm based on feature trust
CN115277722A (en) * 2022-07-27 2022-11-01 长安大学 DR-PBFT improved algorithm based on credit value model

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
Blockchain-based Authentication and Proof-of-Reputation Mechanism for Trust Data Sharing in Internet of Vehicles;Xiao Bai;《Ad Hoc & Sensor Wireless Networks》;20220430;全文 *
T-PBFT: An EigenTrust-based practical Byzantine fault tolerance consensus algorithm;Sheng Gao;《China Communications》;20191231;全文 *
基于区块链技术信誉评价机制的研究与应用;余珺瑞;《中国优秀硕士学位论文全文数据库 信息科技辑》;20210215;全文 *
基于改进PBFT算法防御区块链中sybil攻击的研究;赖英旭;薄尊旭;刘静;;通信学报;20200925(09);全文 *
实用拜占庭容错算法的改进研究;唐宏;《计算机工程与应用》;20210928;全文 *

Also Published As

Publication number Publication date
CN116015672A (en) 2023-04-25

Similar Documents

Publication Publication Date Title
CN116015672B (en) PBFT consensus mechanism based on reputation model
CN109767199B (en) PBFT consensus system and method based on reputation and blockchain data processing system
CN113347164B (en) Block chain-based distributed consensus system, method, device and storage medium
CN114003584B (en) Bayesian-preemption fault-tolerant consensus method based on evolution game
CN112163856A (en) Consensus method and system for block chain and Internet of things fusion scene
CN111026578A (en) Intelligent contract security detection method based on prediction machine
CN110287205A (en) A kind of across the fragment transaction data processing method of block chain and device
CN113645278B (en) Cross-chain message transmission method, device and storage medium of block chain
CN113014635A (en) Node type division method and device of block chain system and block chain system
CN114938292B (en) Multi-level optimization PBFT consensus method based on node credibility
CN113660125B (en) Consensus method and device based on random trusted committee
CN111414420A (en) Improved PBFT block chain consensus method
CN110298657A (en) A kind of block chain common recognition method, relevant apparatus and system
CN111130790A (en) Block co-recognition method based on block chain node network
CN116614516A (en) PBFT consensus method based on reputation improvement
CN115499129A (en) Multimode trust cross-chain consensus method, system, medium, equipment and terminal
WO2020032824A1 (en) Method for consensus decision making in a distributed computer system
CN112398949A (en) Transaction confirmation method, system, device and computer equipment
CN116366669A (en) Consensus method based on reputation value weight balance suitable for crowdsourcing system
EP3503495A1 (en) Method for accumulating and co-assembling uniform data
CN115049071A (en) Federal learning method based on DAG block chain
CN113420323B (en) Data sharing method and terminal equipment
CN113222601A (en) System and method for permitting block chain anonymous transaction endorsement
CN116389040A (en) Reputation-based blockchain consensus method, device and computer equipment
CN116546499A (en) Mobile terminal identity authentication method based on lightweight Bayesian fault tolerance

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
GR01 Patent grant
GR01 Patent grant