CN113283892A - PoSearch and PBFT fusion consensus algorithm based on voting mechanism - Google Patents
PoSearch and PBFT fusion consensus algorithm based on voting mechanism Download PDFInfo
- Publication number
- CN113283892A CN113283892A CN202110580630.0A CN202110580630A CN113283892A CN 113283892 A CN113283892 A CN 113283892A CN 202110580630 A CN202110580630 A CN 202110580630A CN 113283892 A CN113283892 A CN 113283892A
- Authority
- CN
- China
- Prior art keywords
- nodes
- message
- node
- committee
- client
- 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
Links
- 238000004422 calculation algorithm Methods 0.000 title claims abstract description 53
- 230000007246 mechanism Effects 0.000 title claims abstract description 19
- 230000004927 fusion Effects 0.000 title claims abstract description 14
- 238000002360 preparation method Methods 0.000 claims abstract description 28
- 238000012790 confirmation Methods 0.000 claims abstract description 7
- 238000004364 calculation method Methods 0.000 claims description 9
- 238000000034 method Methods 0.000 claims description 9
- 238000005457 optimization Methods 0.000 claims description 7
- 238000005065 mining Methods 0.000 claims description 6
- 238000011156 evaluation Methods 0.000 claims description 3
- 238000000605 extraction Methods 0.000 claims description 3
- 230000004044 response Effects 0.000 claims description 3
- 239000002699 waste material Substances 0.000 description 4
- 238000013475 authorization Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000012795 verification Methods 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000008030 elimination Effects 0.000 description 1
- 238000003379 elimination reaction Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/08—Payment architectures
- G06Q20/085—Payment architectures involving remote charge determination or related payment systems
Landscapes
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Strategic Management (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Multi Processors (AREA)
Abstract
The invention discloses a PoSearch and PBFT fusion consensus algorithm based on a voting mechanism, which comprises the steps of issuing a task by a client node, searching for a mine digging node, and finding out a plurality of nodes for optimizing the optimal solution of a problem; the client side initiates a request message to the main node, the main node distributes a number to the received client side request message, broadcasts a pre-preparation message to other committee nodes, the pre-preparation message is added to a message issued by the client side, the preparation stage is entered after the pre-preparation message is verified to pass, the preparation message is also added to the received pre-preparation message, all the committee nodes verify the validity of the message and write the message into a message log, all the committee nodes broadcast confirmation messages to all the nodes except the client side and write the confirmation messages into the message log, and the committee nodes send a reply message to the client side. The invention effectively improves the transaction time required by the consensus algorithm when the number of nodes in the network is large in scale, and improves the algorithm transaction throughput.
Description
Technical Field
The invention relates to the technical field of block chain service credit, in particular to a PoSearch and PBFT fusion consensus algorithm based on a voting mechanism.
Background
Broadly, blockchain technology is a decentralized infrastructure and distributed computing paradigm that utilizes a cryptographically chained blockstructure to validate and store data, utilizes a distributed node consensus algorithm to generate and update data, and utilizes automated script code (intelligent contracts) to program and manipulate data. The consensus algorithm as a key technology of the blockchain directly influences the transaction processing capability, expandability and safety of the blockchain.
The current block chain consensus can be divided into two categories, one is an authorization consensus mechanism, and nodes in an authorization network can participate in a subsequent consensus mechanism after generally completing identity authentication through a public key infrastructure. In an unauthorized network, nodes are added and withdrawn at any time, the number of the nodes is dynamically changed and unpredictable, and unauthorized consensus completes the processes of block selector election, block generation, node verification and block chain updating and the like through a specific algorithm. The basic flow can be divided into a block electing person, a generating block and a node verification updating block chain.
The block chain can be divided into a public chain, a alliance chain and a private chain, and an authorization consensus mechanism is adopted in the alliance chain. In the current mainstream consensus algorithm, although the decentralization degree of a PoW (workload certification) algorithm is high, the node computing resource waste is large, the transaction efficiency is low, and although the PoS (rights and interests certification) algorithm is superior to the PoW consensus algorithm in the transaction efficiency, the decentralization degree is low; the PBFT (Byzantine fault tolerance) algorithm used in the traditional distributed system can complete consensus through three parts of pre-preparation, preparation and commitment, and is suitable for a alliance chain.
Disclosure of Invention
The invention aims to provide a PoSearch and PBFT fusion consensus algorithm based on a voting mechanism to solve the problems.
The technical scheme adopted by the invention for solving the technical problems is as follows:
a PoSearch and PBFT fusion consensus algorithm based on a voting mechanism comprises two steps of selecting a committee node and performing PBFT consensus by the PoSearch algorithm; wherein,
the PoSearch algorithm selection committee node comprises: the client node issues tasks, and mine digging nodes are searched according to the client node issuing tasks, so that a plurality of nodes of optimal solutions of optimization problems are found; committee nodes performing PBFT consensus including: the client side initiates a request message to the main node, the main node distributes a number to the received client side request message, then broadcasts a pre-preparation message to other committee nodes, adds the pre-preparation message to a message issued by the client side, enters a preparation stage after the pre-preparation message is verified to pass, adds the preparation message to the received pre-preparation message, verifies the validity of the message and writes the message into a message log, all the committee nodes broadcast confirmation messages to all the nodes except the committee node and write the confirmation messages into the message log, and the committee nodes send reply messages to the client side.
Further, the task information includes an evaluator and task contents, the evaluator is used for evaluating whether the result is the optimal solution, inputting a certain calculation result, outputting the judgment result task contents of whether the result is the optimal solution, and the task contents are used for other nodes to directly run calculation, so that the optimal solution is searched by using the calculation force.
Further, the method for searching the mining node according to the task issued by the client node comprises the following steps: the client node broadcasts the task information to all the nodes in the network, and all other nodes receive the task information and perform optimal solution search work according to the task information to compete to become the mining node.
Further, the method for finding out a plurality of nodes of the optimal solution of the optimization problem comprises the following steps: after the nodes which finish the tasks issued by the client nodes are verified by the evaluator, the evaluation results of the evaluator are broadcast to the whole network; the first nodes which preferentially find the optimal solution and broadcast the result are marked as committee nodes, and if the optimal solution is found by the nodes in the same time period, the nodes are selected in a random extraction mode; voting among the committee nodes, integrating the time of finding the optimal solution by the committee nodes and the participation of the nodes in the task of the optimal solution, enabling the nodes with shorter time and higher participation to have higher voting rate, and finally obtaining the node with the highest vote number to serve as a main node.
Further, the request message sent by the client to the master node includes operation information, a timestamp, and a client number.
Further, the reply message includes information of a timestamp, a client number, a node number, and an operation result.
Further, if the client receives a plurality of same response messages from different nodes and the reply message has a corresponding timestamp and an operation result, the client considers the operation result as a correct execution result.
Has the advantages that:
the invention effectively improves the transaction time required by the consensus algorithm when the scale of the nodes in the network is large, improves the transaction throughput of the algorithm, increases the expandability of the consensus algorithm, and can ensure the stable implementation of the consensus when the scale of the nodes is large; the voting mechanism is added, so that the probability that the main node is a malicious node can be reduced, and the consensus fault tolerance is enhanced. On the other hand, the PoSearch algorithm utilizes the original computing resources, and avoids excessive resource waste.
Drawings
FIG. 1 is a flow chart of a method of the present invention;
FIG. 2 is a flow chart of the PBFT consensus algorithm of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to the attached figure 1, the invention discloses a fusion algorithm based on consensus of PoSearch and PBFT, which is used for electing nodes for PBFT algorithm through PoSearch algorithm and reducing the number of nodes participating in PBFT algorithm. Aiming at the defect that the PoW algorithm wastes computing resources, a PoSearch consensus algorithm is introduced, and the resources wasted in the original PoW algorithm are utilized to compute the optimal solution. The method comprises two steps of selecting a committee node and carrying out PBFT consensus on the committee node by a PoSearch algorithm; wherein,
the PoSearch algorithm selection committee node comprises the following steps:
and S1, the client node issues corresponding tasks, the task information comprises an evaluator and task contents, the evaluator is used for evaluating whether the result is the optimal solution or not, inputting a certain calculation result, outputting the judgment result whether the result is the optimal solution or not, the task contents are used for other nodes to directly run calculation, and the optimal solution is searched by using the calculation power.
S2, the client node broadcasts the task information to all nodes within the network.
And S3, all other nodes receive the task information, and perform optimal solution search work according to the task information to compete to become the mining node.
And S4, the nodes which finish the tasks issued by the client nodes are verified by the evaluator, and then the evaluation results of the evaluator are broadcast over the whole network.
And S5, marking the first (3f +1) nodes which preferentially find the optimal solution and broadcast the result as committee nodes, and if a plurality of nodes find the optimal solution in the same time period, selecting the nodes in a random extraction mode.
And S6, voting among the committee nodes, integrating the time of finding the optimal solution by the committee nodes and the participation of the nodes in the task of the optimal solution (the number of times of issuing the task and the number of times of participating in finding the optimal solution), wherein the nodes with shorter time and higher participation have higher voting rate, and finally the node with the highest obtained vote number becomes a main node.
The committee node performing PBFT consensus comprises the following steps:
and S7, the client side sends a request message to the main node, wherein the request message comprises operation information, a timestamp, a client side number and the like.
S8, the master node assigns a number m to the received client request message, then broadcasts a pre-prepare message to other committee nodes, and appends the pre-prepare message to the message issued by the client.
And S9, each other committee node enters a preparation stage after receiving and verifying the pre-preparation message, broadcasts the preparation message to other nodes, and appends the preparation message to the received pre-preparation message.
And S10, verifying the validity of the preparation message after all committee nodes including the main node receive the message and writing the message into the message log.
S11, after the prepare message is verified as authentic, all committee nodes broadcast an acknowledge message to all nodes except itself, and the other nodes write the acknowledge message into the message log after receiving the acknowledge message.
And S12, the committee node sends a reply message to the customer service end, the reply message comprises information such as a time stamp, a client number, a node number and an operation result, and if the client receives f +1 same response messages from different nodes and the reply message has corresponding time stamps and operation results, the client considers that the operation result is a correct execution result.
And in the subsequent n rounds of consensus, completing the consensus process in the committee nodes, and reselecting the committee nodes after determining the n rounds of consensus.
The PoSearch algorithm selects committee nodes: the posearch (proof of search) is a search proof algorithm based on the principle of the PoW algorithm, the basic principle of the algorithm is similar to that of the PoW consensus algorithm, but an optimization problem is introduced, and an optimal solution is calculated by using the calculation resources of the calculated random number in the original PoW algorithm. The concepts of an evaluator (evaluator), a client (client) and a task (job) are introduced, the evaluator is used for judging whether a certain result is the optimal solution of the problem, and the output result is necessarily the same when the input in the evaluator is the same. The task is an executable request to find the optimal solution of the optimization problem, and the task also comprises the evaluator and all the information needed for executing the search request. A client is a node that submits tasks, and any node that can submit a task and that has submitted a task becomes a client node. Provisions are made at the same time: a) in the mining nodes, the first (3f +1) nodes which firstly put forward the best solution can enter the committee to participate in PBFT consensus by taking time as an order; b) the node can not submit the optimization problem of the self-known result; c) and when the optimization problem needing to be solved does not exist in the network, calculating the corresponding random number by adopting a PoW algorithm.
Committee nodes performed PBFT consensus: voting is carried out in the committee nodes, the node with the highest voting number is obtained and serves as a main node, other committee nodes serve as backup nodes, the PBFT consensus is divided into two parts, the first part is distributed consensus achievement, namely the consensus is completed through three parts, namely a pre-preparation part, a preparation part and a commitment part; and the second part is view-change, when the main node has a problem and cannot process the data request in time, other backup nodes initiate view conversion, the main node becomes a new main node to start working after the view conversion is successful, the transaction confirmation time is increased at the stage, the main node is elected by adding a voting mechanism, the main node is ensured to be a non-malicious node, the elimination rate of the malicious node is increased, and the fault tolerance is enhanced.
The invention effectively improves the transaction time required by the consensus algorithm when the scale of the nodes in the network is large, improves the transaction throughput of the algorithm, increases the expandability of the consensus algorithm, and can ensure the stable implementation of the consensus when the scale of the nodes is large; the voting mechanism is added, so that the probability that the main node is a malicious node can be reduced, and the consensus fault tolerance is enhanced. On the other hand, the PoSearch algorithm utilizes the original computing resources, and avoids excessive resource waste.
In addition, in the permission alliance chain, a plurality of credit platform nodes exist, a certain node serves as a client to issue request information (for example, the request information comprises a change of certain credit information), verification is carried out through the consensus algorithm of the invention, the above operation is carried out, and the request information is agreed.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (7)
1. A PoSearch and PBFT fusion consensus algorithm based on a voting mechanism is characterized by comprising two steps of selecting a committee node and performing PBFT consensus on the committee node by the PoSearch algorithm; wherein,
the PoSearch algorithm selection committee node comprises: the client node issues tasks, and mine digging nodes are searched according to the client node issuing tasks, so that a plurality of nodes of optimal solutions of optimization problems are found; committee nodes performing PBFT consensus including: the client side initiates a request message to the main node, the main node distributes a number to the received client side request message, then broadcasts a pre-preparation message to other committee nodes, adds the pre-preparation message to a message issued by the client side, enters a preparation stage after the pre-preparation message is verified to pass, adds the preparation message to the received pre-preparation message, verifies the validity of the message and writes the message into a message log, all the committee nodes broadcast confirmation messages to all the nodes except the committee node and write the confirmation messages into the message log, and the committee nodes send reply messages to the client side.
2. The PoSearch and PBFT fusion consensus algorithm based on the voting mechanism as claimed in claim 1, wherein the task information comprises an evaluator and task contents, the evaluator is configured to evaluate whether a result is an optimal solution, input a certain calculation result, output a determination result task content whether the result is the optimal solution, and use the determination result task content to directly run calculations at other nodes, and search for the optimal solution by using computing power.
3. The PoSearch and PBFT fusion consensus algorithm based on voting mechanism according to claim 2, wherein the method for finding the mining node according to the task issued by the client node comprises the following steps: the client node broadcasts the task information to all the nodes in the network, and all other nodes receive the task information and perform optimal solution search work according to the task information to compete to become the mining node.
4. The PoSearch and PBFT fusion consensus algorithm based on voting mechanism according to claim 3, wherein the method for finding the plurality of nodes for optimizing the optimal solution of the problem comprises: after the nodes which finish the tasks issued by the client nodes are verified by the evaluator, the evaluation results of the evaluator are broadcast to the whole network; the first nodes which preferentially find the optimal solution and broadcast the result are marked as committee nodes, and if the optimal solution is found by the nodes in the same time period, the nodes are selected in a random extraction mode; voting among the committee nodes, integrating the time of finding the optimal solution by the committee nodes and the participation of the nodes in the task of the optimal solution, enabling the nodes with shorter time and higher participation to have higher voting rate, and finally obtaining the node with the highest vote number to serve as a main node.
5. The PoSearch and PBFT fusion consensus algorithm based on voting mechanism according to claim 1, wherein the request message initiated by the client to the master node comprises operation information, a timestamp and a client number.
6. The PoSearch and PBFT fusion consensus algorithm based on voting mechanism as claimed in claim 5, wherein the reply message comprises information of a timestamp, a client number, a node number, and an operation result.
7. The PoSearch and PBFT fusion consensus algorithm based on voting mechanism according to claim 6, wherein if the client receives a plurality of identical response messages from different nodes, and the reply message has corresponding timestamps and operation results, the client considers the operation results as correct execution results.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110580630.0A CN113283892A (en) | 2021-05-26 | 2021-05-26 | PoSearch and PBFT fusion consensus algorithm based on voting mechanism |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110580630.0A CN113283892A (en) | 2021-05-26 | 2021-05-26 | PoSearch and PBFT fusion consensus algorithm based on voting mechanism |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113283892A true CN113283892A (en) | 2021-08-20 |
Family
ID=77281818
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110580630.0A Pending CN113283892A (en) | 2021-05-26 | 2021-05-26 | PoSearch and PBFT fusion consensus algorithm based on voting mechanism |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113283892A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115086349A (en) * | 2022-06-10 | 2022-09-20 | 河南工业大学 | Efficient block chain consensus algorithm based on assembly line |
WO2023056975A1 (en) * | 2021-10-09 | 2023-04-13 | 支付宝(杭州)信息技术有限公司 | Consensus method and blockchain system |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109165092A (en) * | 2018-07-10 | 2019-01-08 | 矩阵元技术(深圳)有限公司 | A kind of common recognition method, apparatus and system based on effective calculation power contribution |
CN109347804A (en) * | 2018-09-19 | 2019-02-15 | 电子科技大学 | A kind of Byzantine failure tolerance common recognition optimization method for block chain |
US20200026699A1 (en) * | 2018-07-20 | 2020-01-23 | True Blockchain Technology Ltd. | Highly Performant Decentralized Public Ledger with Hybrid Consensus |
CN111131184A (en) * | 2019-12-06 | 2020-05-08 | 长沙理工大学 | Autonomous adjusting method of block chain consensus mechanism |
CN112532581A (en) * | 2020-10-26 | 2021-03-19 | 南京辰阔网络科技有限公司 | Improved PBFT consensus method based on consensus participation and transaction activity |
CN112636905A (en) * | 2020-12-11 | 2021-04-09 | 北京航空航天大学 | System and method for extensible consensus mechanism based on multiple roles |
-
2021
- 2021-05-26 CN CN202110580630.0A patent/CN113283892A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109165092A (en) * | 2018-07-10 | 2019-01-08 | 矩阵元技术(深圳)有限公司 | A kind of common recognition method, apparatus and system based on effective calculation power contribution |
US20200026699A1 (en) * | 2018-07-20 | 2020-01-23 | True Blockchain Technology Ltd. | Highly Performant Decentralized Public Ledger with Hybrid Consensus |
CN109347804A (en) * | 2018-09-19 | 2019-02-15 | 电子科技大学 | A kind of Byzantine failure tolerance common recognition optimization method for block chain |
CN111131184A (en) * | 2019-12-06 | 2020-05-08 | 长沙理工大学 | Autonomous adjusting method of block chain consensus mechanism |
CN112532581A (en) * | 2020-10-26 | 2021-03-19 | 南京辰阔网络科技有限公司 | Improved PBFT consensus method based on consensus participation and transaction activity |
CN112636905A (en) * | 2020-12-11 | 2021-04-09 | 北京航空航天大学 | System and method for extensible consensus mechanism based on multiple roles |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023056975A1 (en) * | 2021-10-09 | 2023-04-13 | 支付宝(杭州)信息技术有限公司 | Consensus method and blockchain system |
CN115086349A (en) * | 2022-06-10 | 2022-09-20 | 河南工业大学 | Efficient block chain consensus algorithm based on assembly line |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102561726B1 (en) | Method for selecting consensus node using nonse, method and apparatus for generating blockchain using the same | |
CN109447795B (en) | Byzantine consensus method supporting rapid achievement of final confirmation | |
CN109559120B (en) | Weight-based block chain consensus method, system, storage medium and electronic device | |
CN110599173B (en) | Block chain consensus node determination method, device, equipment and storage medium | |
CN110189128B (en) | Distributed consensus method and device for block rapid generation | |
Kogias et al. | Enhancing bitcoin security and performance with strong consistency via collective signing | |
CN110351067B (en) | Block chain consensus method for master-slave multi-chains | |
CN109214795A (en) | A kind of block chain mixing common recognition method based on DAG algorithm | |
CN111311414A (en) | Block chain multi-party consensus method based on consistent hash algorithm | |
CN111382456A (en) | Proposal message processing method, device, equipment and storage medium | |
CN113283892A (en) | PoSearch and PBFT fusion consensus algorithm based on voting mechanism | |
CN110120936B (en) | Block chain-based distributed network attack detection and safety measurement system and method | |
CN111291060A (en) | Method, device and computer readable medium for managing block chain nodes | |
CN111092896A (en) | Food traceability distributed data synchronization method based on optimized PAXOS | |
CN110084596B (en) | Method and device for processing block chain mixed consensus | |
Islam et al. | A comparative analysis of proof-of-authority consensus algorithms: Aura vs Clique | |
CN113242305B (en) | Cross-chain transaction processing method, device, computer equipment and medium | |
CN111292098A (en) | Trusted service supply chain-oriented block chain consensus mechanism construction method | |
Zhang et al. | An efficient and robust committee structure for sharding blockchain | |
CN112966048A (en) | Block chain consensus method | |
CN114913013A (en) | House renting transaction system and house renting transaction method based on block chain | |
CN110990790A (en) | Data processing method and equipment | |
CN111865595A (en) | Block chain consensus method and device | |
Monrat et al. | Addressing the performance of blockchain by discussing sharding techniques | |
Chen et al. | A Vehicular Trust Blockchain Framework with Scalable Byzantine Consensus |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210820 |
|
RJ01 | Rejection of invention patent application after publication |