Streamline BFT consensus algorithm based on graphical structure

By dividing proposer nodes and voter nodes in the blockchain and processing transaction information and block sorting in parallel, the complexity and low performance problems of the existing BFT consensus algorithm are solved, and an efficient and stable blockchain consensus algorithm is achieved. .

CN118740852APending Publication Date: 2024-10-01HENAN UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410746515.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

The existing BFT-type consensus algorithm is complicated to run during the block processing process, resulting in long time, low throughput and transaction delay, and cannot effectively tolerate arbitrary errors such as node evildoing.

Method used

The pipeline BFT consensus algorithm based on the graph structure is used to divide the nodes into proposer nodes and voter nodes. By executing the transaction information receiving, packaging, voting and sorting process in parallel, block dependencies are generated to ensure the unified ordering of legal blocks. and storage.

Benefits of technology

It improves the overall efficiency and scalability of the blockchain system, ensures the consistency and stability of the blockchain, improves transaction processing throughput and reduces latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118740852A_ABST
    Figure CN118740852A_ABST
Patent Text Reader

Abstract

A flow line BFT consensus algorithm based on a graph structure is characterized by comprising the following steps: dividing nodes in a block chain into proposal nodes and voter nodes; the proposal node continuously receives the transaction information from the client, packages the transaction information into blocks and submits the blocks to the voter node; voting the block by the voter node, and feeding back a voting result to the proposal node; when the voting result of the block is that the legitimate proportion reaches a preset first threshold value, the proposal node confirms that the block is a legitimate block; when the number of the legal blocks held by the proposal node reaches a preset second threshold value, sorting all the legal blocks through Hash operation to generate a block dependency relationship, and broadcasting the block dependency relationship; all proposal nodes reorder legal blocks based on block dependencies and store block information. The invention provides an assembly line BFT consensus algorithm based on a graphical structure, which is higher in efficiency and strong in consistency and stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a pipeline BFT consensus algorithm based on a graph structure. Background Art

[0002] As the core technology of blockchain, consensus mechanism plays a key role in ensuring the consistency and reliability of blockchain system. From the perspective of fault tolerance, consensus mechanism can be divided into Crash Fault Tolerance (CFT) consensus algorithm and Byzantine Fault Tolerance (BFT) consensus algorithm. As a decentralized and open system environment, traditional CFT consensus algorithms are difficult to apply because they cannot tolerate arbitrary errors such as malicious nodes. BFT consensus algorithms have become the focus of blockchain systems. However, the existing BFT consensus algorithms have complex block processing processes during runtime, require a large amount of communication between different nodes, and consume a long time, resulting in low performance indicators such as overall throughput and transaction delay. Summary of the invention

[0003] In order to solve the deficiencies in the prior art, the present invention provides a pipeline BFT consensus algorithm based on a graph structure, which is more efficient and has strong consistency and stability.

[0004] In order to achieve the above object, the specific scheme adopted by the present invention is: a pipeline BFT consensus algorithm based on a graph structure, characterized in that it includes the following steps: Divide the nodes in the blockchain into proposer nodes and voter nodes; The proposer node continuously receives transaction information from the client, packages the transaction information into blocks and submits them to the voter node; the voter node votes on the blocks and feeds back the voting results to the proposer node; When the proportion of legal voting results of a block reaches a preset first threshold, the proposer node confirms the block as a legal block; when the number of legal blocks held by the proposer node reaches a preset second threshold, all legal blocks are sorted by hash operation to generate block dependencies, and the block dependencies are broadcast; All proposer nodes reorder the legal blocks based on block dependencies and store block information.

[0005] As a further optimization of the above-mentioned pipeline BFT consensus algorithm based on a graph structure: the processes of the proposer node receiving transaction information, the proposer node packaging the transaction information into blocks, the proposer node submitting blocks, and the voter node voting on blocks are all executed in parallel.

[0006] As a further optimization of the above-mentioned pipeline BFT consensus algorithm based on graph structure: when the client sends transaction information, it can send transaction information to all proposer nodes at the same time, and the transaction information sent to different proposer nodes is different; After receiving the transaction information, the proposer node stores the transaction information in the transaction list maintained by itself; After receiving the block, the proposer node stores the block in the event list maintained by itself.

[0007] As a further optimization of the above-mentioned pipeline BFT consensus algorithm based on a graph structure: when the number of legal blocks held by the proposer node reaches a preset second threshold, the proposer node performs a hash calculation based on the transaction content and transaction summary in the transaction information to generate a hash value corresponding to the legal block, and sorts all legal blocks based on the hash value to generate block dependencies.

[0008] As a further optimization of the above-mentioned pipeline BFT consensus algorithm based on graph structure: after the proposer node packages the transaction information into a block, the proposer signs the block; after the voter node votes on the block, the voter signs the voting result.

[0009] As a further optimization of the above-mentioned pipeline BFT consensus algorithm based on graph structure: after all proposer nodes have reordered the legal blocks, a directed acyclic graph with the legal blocks as vertices is generated based on all the reordered legal blocks.

[0010] As a further optimization of the above-mentioned pipeline BFT consensus algorithm based on a graph structure: the first threshold is set based on the number of all the voter nodes.

[0011] As a further optimization of the above-mentioned pipeline BFT consensus algorithm based on graph structure: when a new node is added to the blockchain, the newly added node is divided into a proposer node or a voter node based on the number of existing proposer nodes and voter nodes.

[0012] Beneficial effects:

[0013] The present invention divides the nodes in the blockchain into proposer nodes and voter nodes. The nodes only need to perform specific tasks according to their own division results, which is more efficient overall and easy to expand. After receiving the legal blocks confirmed by the voters, all proposer nodes in the present invention can generate and broadcast the dependency relationship between the legal blocks, so as to realize the reordering of the legal blocks by all proposer nodes, and ensure that the legal blocks in all nodes can have the same order, thereby ensuring the consistency and stability of the blockchain; In the present invention, the processes of the proposer node receiving transaction information, the proposer node packaging the transaction information into blocks, the proposer node submitting blocks, and the voter node voting on blocks are all executed in parallel, which can effectively improve efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 It is a schematic diagram of the overall process of the present invention; Figure 2 It is a schematic diagram of the parallel execution process of the proposer node and the voter node; Figure 3 This is a schematic diagram of the ordering of legal blocks; Figure 4 This is a schematic diagram of the sorting results of legal blocks after reordering. DETAILED DESCRIPTION

[0015] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0016] See also Figures 1 to 4 , a pipeline BFT consensus algorithm based on a graph structure, characterized by comprising the following steps S1 to S6.

[0017] S1. Divide the nodes in the blockchain into proposer nodes and voter nodes. By dividing the nodes, different nodes can perform different functions, which can effectively improve the efficiency of the nodes and the scalability of the node blockchain. When a new node is added to the blockchain, the newly added node is also divided to make the newly added node a proposer node or a voter node.

[0018] In order to balance the number of proposer nodes and voter nodes in the blockchain and avoid excessive proportion of proposer nodes or voter nodes, which would reduce the overall efficiency of the blockchain, when a new node is added to the blockchain, it will be classified as a proposer node or a voter node based on the number of existing proposer nodes and voter nodes.

[0019] S2. The proposer node continues to receive transaction information from the client, and packages the transaction information into blocks and submits them to the voting node. S2 can be called the transaction broadcast stage. In order to improve the overall efficiency of the blockchain, when the client sends transaction information, it can send transaction information to all proposer nodes at the same time, and the transaction information sent to different proposer nodes is different. When a client generates multiple transactions at the same time, multiple transaction information can be sent to different proposer nodes respectively, so that these transaction information can be processed in parallel in the blockchain without waiting for the previous transaction to be completely completed before the next transaction. Furthermore, after receiving the transaction information, the proposer node stores the transaction information in the transaction list maintained by itself; after the proposer node packages the transaction information into blocks, it signs the block as a proposer.

[0020] S3, the voting node votes on the block and feeds back the voting results to the proposer node. S3 can be called the voting stage. Specifically, after receiving the block, the voting node verifies the legitimacy of the block, that is, votes on the block. Correspondingly, the voting result of the voting node on the block is legal or illegal. After the voting node votes on the block, the voter signs the voting result. The voting node can vote for all received blocks in parallel to improve the processing efficiency of the block and avoid excessive processing delays. Furthermore, after receiving the block, the proposer node stores the block in the event list maintained by itself.

[0021] S4. When the proportion of legal voting results of the block reaches the preset first threshold, the proposer node confirms the block as a legal block. When the proportion of legal voting results of the block reaches the first threshold, it means that the block has been confirmed as legal by the majority of voting nodes, so the proposer node can confirm the block as a legal block at this time. In this embodiment, the first threshold is set to 2 / 3, that is, when the block is voted and legal by 2 / 3 of the voters, the proposer node confirms the block as a legal block. In addition, considering that the blockchain may continue to expand during operation, the number of voting nodes will gradually increase, and accordingly, the time consumed by the process of voting by voting nodes will also increase. In order to avoid consuming too much time in the process of voting for a block, the first threshold is set based on the number of all voting nodes. As the total number of nodes continues to increase, the first threshold is also continuously reduced.

[0022] S5. When the number of legal blocks held by the proposer node reaches the preset second threshold, all legal blocks are sorted by hash operation to generate block dependencies, and the block dependencies are broadcast. As the consensus process continues, the proposer node will store more and more legal blocks. The time when different proposer nodes receive voting results may be different. For example, the set of legal blocks received by proposer node P1 is BP1{b 11 ,b 12 ,b 21 ,b 22 ,b 31 ,b 32}}, the set of legal blocks received by the proposer node P2 is BP2{b 12 ,b 11 ,b 21 ,b 31 ,b 22 ,b 32}, the set of legal blocks received by the proposer node P3 is BP3{b 12 ,b 21 ,b 11 ,b 22 ,b 31 ,b 32}. This situation will cause the order of legal blocks in each proposer node to be different, resulting in poor stability and consistency of the entire blockchain. To avoid this problem, when the number of legal blocks held by the proposer node is large, that is, when it reaches the second threshold, the proposer node sorts the legal blocks through hash operations to generate block dependencies. After the block dependencies are generated, the proposer node broadcasts the block dependencies in the blockchain, so that all proposer nodes can interact with each other's generated block dependencies, and finally achieve a unified ordering of legal blocks.

[0023] More specifically, when the number of legal blocks held by the proposer node reaches a preset second threshold, the proposer node performs a hash calculation based on the transaction content and transaction summary in the transaction information to generate a hash value corresponding to the legal block, and sorts all legal blocks based on the hash value to generate a block dependency. The generated hash value is a 256-bit random number, thereby ensuring that different proposer nodes can calculate different results. After generating the hash value, the proposer node sorts all hash values ​​based on the value of the hash value, and the sorting result is the sorting result of the legal block, that is, the dependency relationship of all legal blocks.

[0024] S6: All proposer nodes reorder the legal blocks based on block dependencies and store block information. S5 and S6 can be collectively referred to as the synchronization phase.

[0025] After all proposer nodes have reordered the legal blocks, in each proposer node, all legal blocks have the same order. Based on all the reordered legal blocks, a directed acyclic graph with legal blocks as vertices can be generated, which ensures the stability of the blockchain and the consistency of all proposer nodes. More specifically, because the proposer node sorts the legal blocks to generate block dependencies after the number of legal blocks it holds reaches the second threshold, in fact, each time the proposer node generates block dependencies, the number of legal blocks processed is consistent. Each processing process can be called a cycle, and the number of legal blocks processed in each cycle is the same. Among all the legal blocks processed in the previous cycle, the legal block with the smallest Hash value is the last one, and it is connected to the first legal block with the largest Hash value in the next cycle, thereby realizing the connection of all legal blocks in different cycles.

[0026] In order to further improve the efficiency of the blockchain, the processes of the proposer node receiving transaction information, the proposer node packaging the transaction information into blocks, the proposer node submitting blocks, and the voter node voting on blocks are all executed in parallel. i Submitted by the user, and the proposer node is ready to send transaction information B1~B i The generated blocks are submitted to the voting nodes for voting; in the second round of the blockchain, transaction information B i+1 ~B j Submitted by the user, transaction information B1~B i The generated block is in the voting stage of the voting node; in the third round of the blockchain, transaction information B j+1 ~B b Submitted by the user, transaction information B1~B i The generated blocks have been synchronized among all proposer nodes, that is, the proposer nodes reorder all legal blocks, and the transaction information B i+1 ~B j It is in the voting stage of the voter node. By enabling the proposer node and the voter node to process tasks in parallel, the blockchain system is allowed to process concurrently at different stages without having to wait for the previous stage to be fully completed, which effectively improves the efficiency of the blockchain system.

[0027] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A pipeline BFT consensus algorithm based on a graph structure, characterized in that: The steps include: Divide the nodes in the blockchain into proposer nodes and voter nodes; The proposer node continuously receives transaction information from the client, packages the transaction information into blocks and submits them to the voter node; The voting node votes on the block and feeds back the voting results to the proposer node; When the proportion of legal voting results of a block reaches a preset first threshold, the proposer node confirms the block as a legal block; When the number of legal blocks held by the proposer node reaches a preset second threshold, all legal blocks are sorted by hash operation to generate block dependencies, and the block dependencies are broadcasted; All proposer nodes reorder the legal blocks based on block dependencies and store block information.

2. A pipeline BFT consensus algorithm based on a graph structure as claimed in claim 1, characterized in that: The processes of the proposer node receiving transaction information, the proposer node packaging the transaction information into blocks, the proposer node submitting blocks, and the voter node voting on blocks are all executed in parallel.

3. A pipeline BFT consensus algorithm based on a graph structure as claimed in claim 1, characterized in that: When the client sends transaction information, it can send the transaction information to all proposer nodes at the same time, and the transaction information sent to different proposer nodes is different; After receiving the transaction information, the proposer node stores the transaction information in the transaction list maintained by itself; After receiving the block, the proposer node stores the block in the event list maintained by itself.

4. A pipeline BFT consensus algorithm based on a graph structure as described in claim 1, characterized in that: When the number of legal blocks held by the proposer node reaches a preset second threshold, the proposer node performs hash calculation based on the transaction content and transaction summary in the transaction information to generate a hash value corresponding to the legal block, and sorts all legal blocks based on the hash value to generate block dependencies.

5. A pipeline BFT consensus algorithm based on a graph structure as claimed in claim 1, characterized in that: After the proposer node packages the transaction information into a block, it signs the block as a proposer; after the voter node votes on the block, it signs the voting result as a voter.

6. A pipeline BFT consensus algorithm based on a graph structure as claimed in claim 1, characterized in that: After all proposer nodes have reordered the legal blocks, a directed acyclic graph with the legal blocks as vertices is generated based on all the reordered legal blocks.

7. A pipeline BFT consensus algorithm based on a graph structure as claimed in claim 1, characterized in that: The first threshold is set based on the number of all the voter nodes.

8. A pipeline BFT consensus algorithm based on a graph structure as described in claim 1, characterized in that: When a new node is added to the blockchain, it is classified as a proposer node or a voter node based on the number of existing proposer nodes and voter nodes.