CN111865968A - Optimized Byzantine fault-tolerant algorithm applied to block chain - Google Patents

Optimized Byzantine fault-tolerant algorithm applied to block chain Download PDF

Info

Publication number
CN111865968A
CN111865968A CN202010688967.9A CN202010688967A CN111865968A CN 111865968 A CN111865968 A CN 111865968A CN 202010688967 A CN202010688967 A CN 202010688967A CN 111865968 A CN111865968 A CN 111865968A
Authority
CN
China
Prior art keywords
node
nodes
message
entering
steps
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
CN202010688967.9A
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 Tech University
Original Assignee
Nanjing Tech 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 Tech University filed Critical Nanjing Tech University
Priority to CN202010688967.9A priority Critical patent/CN111865968A/en
Publication of CN111865968A publication Critical patent/CN111865968A/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/08Network architectures or network communication protocols for network security for authentication of entities
    • 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/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3297Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving time stamps, e.g. generation of time stamps
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/46Secure multiparty computation, e.g. millionaire problem
    • H04L2209/463Electronic voting

Abstract

The invention designs an optimized Byzantine surface toleronce applied to a block chain, and the optimized Byzantine surface with block chain is applied to the block chain. The method is used for solving the problems that the traditional Byzantine algorithm cannot dynamically sense the number of nodes and is low in efficiency when a malicious node is elected. In order to solve the problem of node adding, the method introduces a node dynamic adding and quitting mechanism, the node adding and quitting need to pass through the mutual confirmation among all nodes, and the confirmation process is divided into four stages, namely request, confirmation, reply and completion. In order to solve the random problem of the selection of the main node, a scoring and voting cooperative mechanism is introduced, the scoring mechanism follows the longest chain principle of a block chain, and the voting scoring mechanism is performed cooperatively. The node adding and exiting mechanism in the method enables the number of the consensus nodes to be variable, and greatly improves the practicability of the consensus algorithm. And a scoring and voting cooperative mechanism greatly ensures the correctness of the selected main node and improves the safety of the system.

Description

Optimized Byzantine fault-tolerant algorithm applied to block chain
Technical Field
The invention relates to the field of Byzantine consensus algorithm of block chain technology in a distributed system, in particular to an optimized Byzantine fault-tolerant algorithm which is applied to a block chain.
Background
The block chain is a decentralized protocol and comprises technologies of distributed symmetric networks, data encryption, consensus algorithm and the like. Wherein, the selection of the consensus algorithm is the core part of the block chain design. The practical Byzantine fault-tolerant algorithm PBFT (practical Byzantine surface tolerance) is improved from a Byzantine consensus algorithm BFT (Byzantine surface tolerance), the advantage of BFT is inherited, the expense of a Byzantine protocol is reduced on a large scale, and therefore the Byzantine algorithm can be applied to a block chain system. The PBFT algorithm is an algorithm based on state machine copy replication, each state machine copy can store a service state, legal requests of users are met, transactions can be completed, and different types of operations can be realized. At most, the system can satisfy f ═ 1/3 (N is the total number of nodes) of the rogue nodes, so that the safety and the activity of the system can be still maintained, and finally, a consistent distributed consensus is achieved.
Although the PBFT algorithm is a well-established algorithm, it also has disadvantages. Firstly, the PBFT algorithm adopts a C/S architecture, cannot dynamically sense the change of the number of nodes, and cannot be applied to a P2P network model. There is no flexible mechanism for joining and exiting the consensus node, and if the nodes need to be added, the system must be restarted, which causes system resource waste and greatly reduces the availability of the system. Secondly, the selection mode of the main node is random, the authenticity of the main node is not verified, and the correctness of the main node cannot be guaranteed, so that a malicious node is possibly selected and has high risk. Finally, the last two full-node broadcasts in the three-stage broadcasting process consume very much network bandwidth, the nodes need to transmit messages to each other for Byzantine fault tolerance, and the communication cost is increased along with the increase of the number of the nodes and the increase of polynomial level.
In recent years, the PBFT algorithm is a research hotspot in the block chain technology, and researchers have proposed many schemes for improving the performance of the consensus algorithm on the basis of the conventional PBFT algorithm.
Disclosure of Invention
The invention designs an optimized Byzantine surface toleronce applied to a block chain, and the optimized Byzantine surface with block chain is applied to the block chain. The method is used for solving the problems that the traditional Byzantine algorithm cannot dynamically sense the number of nodes and is low in efficiency when a malicious node is elected. In order to solve the problem of node adding, the method introduces a node dynamic adding and quitting mechanism, the node adding and quitting need to pass through the mutual confirmation among all nodes, and the confirmation process is divided into four stages, namely request, confirmation, reply and completion. In order to solve the random problem of the selection of the main node, a scoring and voting cooperative mechanism is introduced, the scoring mechanism follows the longest chain principle of a block chain, and one point is added once the nodes are successfully identified; the node is not a malicious node, but does not successfully execute consensus, and does not add or subtract scores; the node is a malicious node, minus one. And selecting the node with the highest score as the main node, if the scores are the same, removing the node with the same score, then selecting the node set with the lower score to execute a node voting mechanism, selecting the node with the highest vote number as the main node by one vote for each node, and if the scores are the same, selecting a small serial number according to the node number. If there is only one node in the voting node set, the node to which the vote is cast is the master node.
Different from the existing treatment method, the invention has the beneficial effects that: in the traditional Byzantine fault-tolerant algorithm, a flexible consensus node adding and quitting mechanism does not exist, and particularly under the condition that more nodes exist in a cluster or the nodes are changed frequently, a system is difficult to deal with, so that the availability of the system is greatly reduced. The node adding and exiting mechanism in the method enables the number of the consensus nodes to be variable, and greatly improves the practicability of the consensus algorithm. In the traditional Byzantine fault-tolerant algorithm, the selection mode of the main node is random, the correctness of the main node cannot be guaranteed, if a malicious node is selected continuously, system resources can be wasted, and the safety of the system can be greatly reduced. The scoring and voting cooperation mechanism in the method greatly ensures the correctness of the selected main node and improves the safety of the system.
Drawings
FIG. 1 is a schematic diagram of node joining; FIG. 2 is a schematic diagram of a node exit; fig. 3 is a flow chart of master node selection.
Detailed Description
Please refer to fig. 1, fig. 2, and fig. 3:
1. an optimized block chain practicability Byzantine fault-tolerant algorithm, nodes are added and quitted, and a main node selection mechanism is triggered, and the method is characterized by comprising the following steps:
The method comprises the following steps: the node adding process comprises four stages of requesting, confirming, replying and finishing, and a main node selecting mechanism is triggered after the node is added. Entering the step two;
step two: and (4) selecting the main nodes, namely selecting the main nodes with high correctness through a scoring and voting cooperative mechanism to prepare for the consensus of the system. If the node wants to exit, entering a step three;
step three: the node quits, the process is similar to the process of joining, and the process comprises four stages of requesting, confirming, replying and completing. And when the node exits, the master node selection mechanism is triggered again to prepare for the next consensus.
2. The optimized byzantine fault tolerance algorithm for blockchains according to claim 1, wherein the node joining procedure of step one comprises the steps of:
the method comprises the following steps: and in the request stage, the node i sends a message requesting to join to all other nodes. The format of the message is < REQUEST-JOIN, t, IP >, t represents a time stamp, and IP represents the IP address of the node to be added. Entering the step two;
step two: and then, in a confirmation stage, all the slave nodes receiving the information respectively send messages to other slave nodes to ensure that the other nodes also receive the message applying for joining, wherein the format of the message is < JOIN, j, IP >, j is the node number of the message, and IP is the IP address of the node to be joined. And after the message is sent, when each node receives at least 2f +1 messages, entering a reply stage. Entering a third step;
Step three: at the moment, each slave node replies to the master node and indicates whether to approve the addition of the i node, the message format is < REPLY, aggregate/replay, ip >, and the master node finally approves the addition only when more than half of the slave nodes approve the addition. If the master node does not receive messages from certain nodes, the non-replying node is considered to be abandoned.
3. The optimized byzantine fault tolerance algorithm for blockchains according to claim 1, wherein the selection of the master node in the second step comprises the following steps:
the method comprises the following steps: entering a system to search for a main node, firstly entering a node scoring mechanism, directly selecting the main node if the unique highest score is selected, and entering a view conversion process; if the unique highest score is not selected, entering the step two;
step two: entering a voting mechanism, and if the only highest vote number is obtained, entering an attempt conversion process; and if the node with the highest unique ticket number cannot be selected, selecting the node from small to large according to the node number, and then entering an trying process.
4. The optimized byzantine fault tolerance algorithm for blockchains according to claim 3, wherein the unknown node location coordinate calculation of step one comprises the steps of:
The method comprises the following steps: the node adds one to every successful consensus.
Step two: the node is not a malicious node, but does not successfully execute consensus, add score and subtract score.
Step three: the node is a malicious node, minus one. And selecting the node with the highest score as a main node, and if the scores are the same, removing the node with the same score, and then selecting the node set with the lower score to execute a node voting mechanism.
5. The optimized byzantine fault-tolerant algorithm for blockchains according to claim 3, wherein the unknown node location coordinate calculation in step two comprises the following steps:
the method comprises the following steps: and each node has a ticket, and the node with the largest number of tickets is selected to serve as the main node.
Step two: if the number of tickets is the same, a smaller number is selected according to the node number.
6. The optimized byzantine fault-tolerant algorithm for blockchains according to claim 1, wherein the node exit procedure in step three comprises the following steps:
the method comprises the following steps: the node m is a node to be quitted, and in the REQUEST stage, a message for applying for quitting is sent to the main node, the format of the message is < REQUEST-REQUEST, m, b, t >, b is a block number, and t is a timestamp, which means that the main node is informed of the release time and position. Since it cannot exit during the transaction, it exits at time t +1 after the transaction time t. Entering the step two;
Step two: in the confirmation stage, the master node sends a message to all slave nodes, the message format is < QUIT, m, t >, the number and the time of the node to be quitted are informed, and the message is sent out and then the step three is carried out;
step three: at this time, each slave node sends a message to all other nodes to confirm that all other nodes also receive the message for quitting, wherein the format of the message is < QUIT, aggregate/return >, and only when the master node receives more than half of quitting agrees, the m nodes are replied to agree to quitting.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent structures or flow transformations made by using the contents of the specification and the drawings, or directly or indirectly applied to the related art, are included in the scope of the present invention.

Claims (6)

1. An optimized block chain practicability Byzantine fault-tolerant algorithm, nodes are added and quitted, and a main node selection mechanism is triggered, and the method is characterized by comprising the following steps:
the method comprises the following steps: the node adding process comprises four stages of requesting, confirming, replying and finishing, and a main node selecting mechanism is triggered after the node is added. Entering the step two;
Step two: and (4) selecting the main nodes, namely selecting the main nodes with high correctness through a scoring and voting cooperative mechanism to prepare for the consensus of the system. If the node wants to exit, entering a step three;
step three: the node quits, the process is similar to the process of joining, and the process comprises four stages of requesting, confirming, replying and completing. And when the node exits, the master node selection mechanism is triggered again to prepare for the next consensus.
2. The optimized byzantine fault tolerance algorithm for blockchains according to claim 1, wherein the node joining procedure of step one comprises the steps of:
the method comprises the following steps: and in the request stage, the node i sends a message requesting to join to all other nodes. The format of the message is < REQUEST-JOIN, t, IP >, t represents a time stamp, and IP represents the IP address of the node to be added. Entering the step two;
step two: and then, in a confirmation stage, all the slave nodes receiving the information respectively send messages to other slave nodes to ensure that the other nodes also receive the message applying for joining, wherein the format of the message is < JOIN, j, IP >, j is the node number of the message, and IP is the IP address of the node to be joined. And after the message is sent, when each node receives at least 2f +1 messages, entering a reply stage. Entering a third step;
Step three: at the moment, each slave node replies to the master node and indicates whether to approve the addition of the i node, the message format is < REPLY, aggregate/replay, ip >, and the master node finally approves the addition only when more than half of the slave nodes approve the addition. If the master node does not receive messages from certain nodes, the non-replying node is considered to be abandoned.
3. The optimized byzantine fault tolerance algorithm for blockchains according to claim 1, wherein the selection of the master node in the second step comprises the following steps:
the method comprises the following steps: entering a system to search for a main node, firstly entering a node scoring mechanism, directly selecting the main node if the unique highest score is selected, and entering a view conversion process; if the unique highest score is not selected, entering the step two;
step two: entering a voting mechanism, and if the only highest vote number is obtained, entering an attempt conversion process; and if the node with the highest unique ticket number cannot be selected, selecting the node from small to large according to the node number, and then entering an trying process.
4. The optimized byzantine fault tolerance algorithm for blockchains according to claim 3, wherein the unknown node location coordinate calculation of step one comprises the steps of:
The method comprises the following steps: the node adds one to every successful consensus.
Step two: the node is not a malicious node, but does not successfully execute consensus, add score and subtract score.
Step three: the node is a malicious node, minus one. And selecting the node with the highest score as a main node, and if the scores are the same, removing the node with the same score, and then selecting the node set with the lower score to execute a node voting mechanism.
5. The optimized byzantine fault-tolerant algorithm for blockchains according to claim 3, wherein the unknown node location coordinate calculation in step two comprises the following steps:
the method comprises the following steps: and each node has a ticket, and the node with the largest number of tickets is selected to serve as the main node.
Step two: if the number of tickets is the same, a smaller number is selected according to the node number.
6. The optimized byzantine fault-tolerant algorithm for blockchains according to claim 1, wherein the node exit procedure in step three comprises the following steps:
the method comprises the following steps: the node m is a node to be quitted, and in the REQUEST stage, a message for applying for quitting is sent to the main node, the format of the message is < REQUEST-REQUEST, m, b, t >, b is a block number, and t is a timestamp, which means that the main node is informed of the release time and position. Since it cannot exit during the transaction, it exits at time t +1 after the transaction time t. Entering the step two;
Step two: in the confirmation stage, the master node sends a message to all slave nodes, the message format is < QUIT, m, t >, the number and the time of the node to be quitted are informed, and the message is sent out and then the step three is carried out;
step three: at this time, each slave node sends a message to all other nodes to confirm that all other nodes also receive the message for quitting, wherein the format of the message is < QUIT, aggregate/return >, and only when the master node receives more than half of quitting agrees, the m nodes are replied to agree to quitting.
CN202010688967.9A 2020-07-16 2020-07-16 Optimized Byzantine fault-tolerant algorithm applied to block chain Pending CN111865968A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010688967.9A CN111865968A (en) 2020-07-16 2020-07-16 Optimized Byzantine fault-tolerant algorithm applied to block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010688967.9A CN111865968A (en) 2020-07-16 2020-07-16 Optimized Byzantine fault-tolerant algorithm applied to block chain

Publications (1)

Publication Number Publication Date
CN111865968A true CN111865968A (en) 2020-10-30

Family

ID=72984793

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010688967.9A Pending CN111865968A (en) 2020-07-16 2020-07-16 Optimized Byzantine fault-tolerant algorithm applied to block chain

Country Status (1)

Country Link
CN (1) CN111865968A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112910982A (en) * 2021-01-27 2021-06-04 网易(杭州)网络有限公司 Node access method and device of alliance chain, electronic equipment and storage medium
CN112953955A (en) * 2021-03-03 2021-06-11 南京航空航天大学 Multi-party quantum Byzantine consensus optimization protocol
CN113783899A (en) * 2021-11-12 2021-12-10 中国信息通信研究院 Node exit method and blockchain
CN114157672A (en) * 2021-11-29 2022-03-08 北京航空航天大学 S-PBFT simplified consensus protocol operation and parallel optimization method based on PBFT
CN115002120A (en) * 2022-08-02 2022-09-02 蒲惠智造科技股份有限公司 Method for determining main node in cluster network based on data synchronization

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112910982A (en) * 2021-01-27 2021-06-04 网易(杭州)网络有限公司 Node access method and device of alliance chain, electronic equipment and storage medium
CN112953955A (en) * 2021-03-03 2021-06-11 南京航空航天大学 Multi-party quantum Byzantine consensus optimization protocol
CN113783899A (en) * 2021-11-12 2021-12-10 中国信息通信研究院 Node exit method and blockchain
CN113783899B (en) * 2021-11-12 2022-03-08 中国信息通信研究院 Node exit method and blockchain system
CN114157672A (en) * 2021-11-29 2022-03-08 北京航空航天大学 S-PBFT simplified consensus protocol operation and parallel optimization method based on PBFT
CN115002120A (en) * 2022-08-02 2022-09-02 蒲惠智造科技股份有限公司 Method for determining main node in cluster network based on data synchronization

Similar Documents

Publication Publication Date Title
CN111865968A (en) Optimized Byzantine fault-tolerant algorithm applied to block chain
CN103473318B (en) A kind of distributed transaction support method towards memory data grid
CN110727731A (en) Method for adding node in block chain network and block chain system
CN110868308A (en) Block chain network access method and system
WO2023045620A1 (en) Transaction data processing method and apparatus, computer device and storage medium
CN112907252B (en) Block chain transaction method and system based on multi-person chain lower channel
CN114218612B (en) Consensus method suitable for alliance chain high-frequency transaction scene
CN111338906B (en) Terminal equipment, edge node and block chain-based application supervision method and system
CN108846745B (en) Block chain transaction processing auxiliary system, block chain data processing system and method
CN111798234B (en) Lightweight block chain system and construction method
JP4459999B2 (en) Non-stop service system using voting and information updating and providing method in the system
CN112187866A (en) Novel block chain consensus method based on shared storage
CN108390919A (en) A kind of message synchronization system and method for highly reliable two-node cluster hot backup
CN114449476A (en) Block link point consensus method for safety communication in Internet of vehicles
CN112801791B (en) Block chain consensus method and system based on authorization
CN112866025B (en) Intelligent contract fragmentation processing method
CN113609229B (en) Method and device for fast log replication in Fabric block chain
CN116232893A (en) Consensus method and device of distributed system, electronic equipment and storage medium
CN112925946B (en) Service data storage method and device and electronic equipment
CN114499874A (en) Byzantine fault-tolerant consensus optimization method applied to industrial internet
CN116126480A (en) Cross-region block chain processing method and device for transaction, intelligent equipment, medium and product
CN116846888A (en) Consensus processing method, device, equipment and storage medium of block chain network
Huang et al. Design and analysis of a distributed consensus protocol for real-time blockchain systems
CN113760519A (en) Distributed transaction processing method, device and system and electronic equipment
WO2024007663A1 (en) Blockchain consensus method and apparatus, computer readable medium, and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20201030

WD01 Invention patent application deemed withdrawn after publication