CN113849564A - Block chain consensus method, consensus node and electronic equipment - Google Patents

Block chain consensus method, consensus node and electronic equipment Download PDF

Info

Publication number
CN113849564A
CN113849564A CN202111124498.9A CN202111124498A CN113849564A CN 113849564 A CN113849564 A CN 113849564A CN 202111124498 A CN202111124498 A CN 202111124498A CN 113849564 A CN113849564 A CN 113849564A
Authority
CN
China
Prior art keywords
consensus
data blocks
transaction set
transaction
node
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
CN202111124498.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.)
Alipay Hangzhou Information Technology Co Ltd
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Ant Blockchain Technology Shanghai Co Ltd
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 Alipay Hangzhou Information Technology Co Ltd, Ant Blockchain Technology Shanghai Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202111124498.9A priority Critical patent/CN113849564A/en
Publication of CN113849564A publication Critical patent/CN113849564A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/26Special purpose or proprietary protocols or architectures

Abstract

The embodiment of the specification provides a block chain consensus method, a consensus node and electronic equipment. The method comprises the following steps: the common identification main node executes an RBC protocol on a first transaction set in the transaction pool of the common identification main node, uses an erasure code algorithm to split the first transaction set into N data blocks corresponding to common identification nodes of the block chain, and sends the corresponding data blocks to all the common identification backup nodes based on the Rval message. The consensus backup node executes an RBC protocol, forwards the data blocks received from the Rval message to other consensus backup nodes through Echo messages, and restores the received data blocks to the first transaction set based on an erasure code algorithm after receiving N-2f Echo messages. The consensus master node initiates a consensus proposal for merkel tree attestation for all data blocks of the first set of transactions based on the PBFT protocol. And matching the transaction corresponding to the acquaintance-achieved Merckel tree certification from the respective first transaction sets by the consensus main node and the consensus backup node so as to execute block writing operation on the transaction.

Description

Block chain consensus method, consensus node and electronic equipment
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a block chain consensus method, a block chain consensus node, and an electronic device.
Background
Based on the characteristics of the block chain, in the consensus protocol of the main node and standby node working modes, proposed data of each round of consensus proposals are packaged by a consensus main node and synchronously transmitted to all consensus backup nodes of the block chain. Assuming that the number of consensus nodes of the block chain is N, for a round of consensus proposals, the consensus master node needs to send N-1 proposals, which causes a significant overhead on the network bandwidth of the consensus master node.
With the explosive growth of block chain services in the future, to obtain higher throughput, consensus of more data needs to be achieved in unit time, the burden on a consensus master node is greater, and the consensus efficiency is reduced instead. Therefore, a technical solution capable of reducing the bandwidth consumed by the consensus primary node to initiate the consensus proposal is needed.
Disclosure of Invention
An embodiment of the present disclosure provides a block chain consensus method, a consensus node, and an electronic device, which can complete block chain consensus with a smaller bandwidth overhead on a consensus master node side.
In order to achieve the above object, the embodiments of the present specification are implemented as follows:
in a first aspect, a method for identifying a blockchain is provided, including:
the common identification main node of the block chain executes a reliable broadcast transmission RBC protocol on a first transaction set in a transaction pool of the common identification main node, so that an erasure code algorithm is used for splitting the first transaction set into N data blocks corresponding to common identification nodes of the block chain, and corresponding data blocks are sent to all common identification backup nodes of the block chain based on a Rval message, wherein the data blocks split by the first transaction set correspond to a Mercury tree certificate calculated based on the erasure code algorithm, and N is the number of the common identification nodes of the block chain;
the common identification backup node executes the RBC protocol to forward the corresponding data blocks received from the Rval message to other common identification backup nodes through Echo messages, and after N-2f Echo messages are received, the received data blocks are restored to the first transaction set based on the erasure code algorithm, wherein f is the fault-tolerant number of the common identification nodes of the block chain;
after the RBC protocol is executed on the first transaction set, the consensus master node executes a practical byzantine PBFT protocol on the mercker tree certificates of all data blocks of the first transaction set to initiate consensus proposals for the mercker tree certificates of all data blocks of the first transaction set;
the consensus backup node responding to the consensus proposal based on the PBFT protocol to complete consensus for the Mercker tree attestation of all data blocks of the first transaction set;
after the acquaintance tree certificates of all the data blocks of the first transaction set are identified, the acquaintance main node and the acquaintance backup node match the transaction corresponding to the acquaintance tree certificate from the respective first transaction set, so as to execute block writing operation on the matched transaction.
In a second aspect, a block chain consensus method is provided, including:
the common identification main node executes a reliable broadcast transmission RBC protocol on a first transaction set in a transaction pool of the common identification main node, so as to divide the first transaction set into N data blocks corresponding to common identification nodes of the block chain by using an erasure code algorithm, and sends corresponding data blocks to all common identification backup nodes of the block chain based on a Rval message, so that the common identification backup nodes execute the RBC protocol, forwards the corresponding data blocks received from the Rval message to other common identification backup nodes by an Echo message, and broadcasts a Ready message to the block chain after receiving N-f Echo messages, and after receiving 2f +1 Ready messages, restores the received data blocks into the first transaction set based on the erasure code algorithm, wherein the data blocks divided by the first transaction set correspond to a Merck tree certificate calculated based on the erasure code algorithm, n is the number of the consensus nodes of the block chain, and f is the fault-tolerant number of the consensus nodes of the block chain;
after executing the RBC protocol on the first transaction set, the consensus master node executes a practical byzantine PBFT protocol on the merkel tree certificates of all data blocks of the first transaction set to initiate consensus suggestions for the merkel tree certificates of all data blocks of the first transaction set, such that the consensus backup node responds to the consensus suggestions based on the PBFT protocol to complete consensus on the merkel tree certificates of all data blocks of the first transaction set;
after the acquaintance tree certificates of all the data blocks of the first transaction set are identified, the acquaintance main node matches the transaction corresponding to the acquaintance tree certificate from the first transaction set so as to execute a writing block operation on the matched transaction.
In a third aspect, a block chain consensus method is provided, including:
receiving, by a common identification backup node of a block chain, a data block corresponding to the common identification backup node sent when a common identification master node of the block chain executes an RBC protocol, wherein the data block corresponding to the common identification backup node is a reliable broadcast transmission RBC protocol executed by the common identification master node on a first transaction set in a transaction pool of the common identification master node, so as to split the first transaction set into N data blocks corresponding to the common identification node of the block chain by using an erasure coding algorithm, and sending the data blocks to the common identification backup node based on an Rval message;
the common identification backup node executes the RBC protocol, forwards the corresponding data blocks received from the Rval message to other common identification backup nodes through Echo messages, and restores the received data blocks into the first transaction set based on the erasure code algorithm after receiving N-2f Echo messages, wherein f is the fault-tolerant number of the common identification nodes of the block chain;
after the consensus master node performs a practical Byzantine PBFT protocol on the Mercker tree proofs of all data blocks of the first transaction set to initiate a consensus proposal for the Mercker tree proofs of all data blocks of the first transaction set, the consensus backup node responds to the consensus proposal based on the PBFT protocol to complete consensus on the Mercker tree proofs of all data blocks of the first transaction set;
after the acquaintance tree certificates of all the data blocks of the first transaction set are identified, the acquaintance backup node matches the transaction corresponding to the acquaintance tree certificate from the restored first transaction set so as to execute a writing block operation on the matched transaction.
In a fourth aspect, a consensus node of a blockchain is provided, including:
a first RBC execution module, wherein the common identification master node executes a reliable broadcast transmission RBC protocol on a first transaction set in a transaction pool of the common identification master node, so as to split the first transaction set into N data blocks corresponding to common identification nodes of the block chain by using an erasure code algorithm, and sends the corresponding data blocks to each common identification backup node of the block chain based on a Rval message, so that the common identification backup nodes execute the RBC protocol, forward the corresponding data blocks received from the Rval message to other common identification backup nodes by an Echo message, and after receiving N-2f Echo messages, restore the received data blocks to the first transaction set based on the erasure code algorithm, wherein the data blocks into which the first transaction split set is corresponding to a computed tacle tree certificate based on the erasure code algorithm, N is the number of common identification nodes of the block chain, f is the fault tolerance number of the consensus node of the block chain;
a first PBFT execution module to execute a practical Byzantine PBFT protocol on the Mercker tree proofs of all data blocks of the first transaction set after the RBC protocol is executed on the first transaction set to initiate a consensus proposal for the Mercker tree proofs of all data blocks of the first transaction set, such that the consensus backup node responds to the consensus proposal based on the PBFT protocol to complete consensus of the Mercker tree proofs of all data blocks of the first transaction set;
and the first writing block module is used for matching the transaction corresponding to the acquaintance-reached Mercker tree certificate from the first transaction set after the acquaintance tree certificates of all the data blocks in the first transaction set are identified, so as to execute writing block operation on the matched transaction.
In a fifth aspect, an electronic device is provided comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being executed by the processor to:
a reliable broadcast transmission RBC protocol is performed on a first transaction set in a transaction pool of a consensus master node, to split the first set of transactions into N data blocks corresponding to common nodes of the chain of blocks using an erasure coding algorithm, and sends corresponding data blocks to each consensus backup node of the block chain based on the Rval message, so that the consensus backup node executes the RBC protocol, the corresponding data block received from the Rval message is forwarded to other cognizant backup nodes through the Echo message, and after receiving N-2f Echo messages, restoring the received data blocks to the first transaction set based on the erasure coding algorithm, the data blocks divided by the first transaction set correspond to a Mercker tree certificate calculated based on the erasure code algorithm, N is the number of common identification nodes of the block chain, and f is the fault-tolerant number of the common identification nodes of the block chain;
after the RBC protocol is executed for the first transaction set, executing a practical byzantine PBFT protocol on the merkel tree proofs of all data blocks of the first transaction set to initiate a consensus proposal for the merkel tree proofs of all data blocks of the first transaction set, such that the consensus backup node responds to the consensus proposal based on the PBFT protocol to complete the consensus for the merkel tree proofs of all data blocks of the first transaction set;
after the acquaintance tree certificates of all the data blocks of the first transaction set are identified, matching the transaction corresponding to the acquaintance tree certificate from the first transaction set so as to execute a writing block operation on the matched transaction.
In a sixth aspect, a computer readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
a reliable broadcast transmission RBC protocol is performed on a first transaction set in a transaction pool of a consensus master node, to split the first set of transactions into N data blocks corresponding to common nodes of the chain of blocks using an erasure coding algorithm, and sends corresponding data blocks to each consensus backup node of the block chain based on the Rval message, so that the consensus backup node executes the RBC protocol, the corresponding data block received from the Rval message is forwarded to other cognizant backup nodes through the Echo message, and after receiving N-2f Echo messages, restoring the received data blocks to the first transaction set based on the erasure coding algorithm, the data blocks divided by the first transaction set correspond to a Mercker tree certificate calculated based on the erasure code algorithm, N is the number of common identification nodes of the block chain, and f is the fault-tolerant number of the common identification nodes of the block chain;
after the RBC protocol is executed for the first transaction set, executing a practical byzantine PBFT protocol on the merkel tree proofs of all data blocks of the first transaction set to initiate a consensus proposal for the merkel tree proofs of all data blocks of the first transaction set, such that the consensus backup node responds to the consensus proposal based on the PBFT protocol to complete the consensus for the merkel tree proofs of all data blocks of the first transaction set;
after the acquaintance tree certificates of all the data blocks of the first transaction set are identified, matching the transaction corresponding to the acquaintance tree certificate from the first transaction set so as to execute a writing block operation on the matched transaction.
In a seventh aspect, a consensus node of a blockchain is provided, including:
a receiving module, configured to receive a data block corresponding to a consensus backup node sent by a consensus master node of the block chain when an RBC protocol is executed, where the data block corresponding to the consensus backup node is a reliable broadcast transmission RBC protocol executed by the consensus master node on a first transaction set in a transaction pool of the consensus master node, so as to split the first transaction set into N data blocks corresponding to the consensus node of the block chain by using an erasure code algorithm, and send the data block to the consensus backup node based on a Rval message;
the second RBC execution module executes the RBC protocol, forwards the corresponding data blocks received from the Rval message to other common identification backup nodes through Echo messages, restores the received data blocks to the first transaction set based on an erasure code algorithm after receiving N-2f Echo messages, and restores the received data blocks to the first transaction set based on the erasure code algorithm, wherein f is a common identification node fault-tolerant number of the block chain;
a second PBFT execution module that, after the consensus master node executes a practical Byzantine PBFT protocol on the Mercker tree proofs of all data blocks of the first transaction set to initiate a consensus proposal for the Mercker tree proofs of all data blocks of the first transaction set, responds to the consensus proposal based on the PBFT protocol to complete consensus on the Mercker tree proofs of all data blocks of the first transaction set;
and the second writing block module is used for matching the transaction corresponding to the acquaintance-reached tacher tree certificate from the restored first transaction set by the consensus backup node after the acquaintance tree certificates of all the data blocks of the first transaction set are identified, so as to execute writing block operation on the matched transaction.
In an eighth aspect, an electronic device is provided comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being executed by the processor to:
receiving data blocks corresponding to a consensus backup node sent by a consensus main node of the block chain when the consensus main node executes an RBC protocol, wherein the data blocks corresponding to the consensus backup node are data blocks corresponding to a first transaction set in a transaction pool of the consensus main node, which are sent by the consensus main node to the consensus backup node, and perform reliable broadcast transmission RBC protocol on the first transaction set in the transaction pool of the consensus main node, so that the first transaction set is split into N data blocks corresponding to the consensus node of the block chain by using an erasure coding algorithm, and the data blocks are sent to the consensus backup node based on a Rval message;
executing the RBC protocol, forwarding the corresponding data blocks received from the Rval message to other common identification backup nodes through Echo messages, broadcasting Ready messages to the blockchain after receiving N-f Echo messages, and restoring the received data blocks into the first transaction set based on the erasure code algorithm after receiving 2f +1 Ready messages, wherein f is the fault tolerance number of the common identification nodes of the blockchain;
after the consensus master node performs a practical Byzantine PBFT protocol on the Mercker tree proofs of all data blocks of the first transaction set to initiate a consensus proposal for the Mercker tree proofs of all data blocks of the first transaction set, responding to the consensus proposal based on the PBFT protocol to complete consensus of the Mercker tree proofs of all data blocks of the first transaction set;
after the acquaintance of the mercker tree certificates of all the data blocks of the first transaction set are identified, matching the transaction corresponding to the acquaintance merker tree certificates from the restored first transaction set, and executing writing block operation on the matched transaction.
In a ninth aspect, there is provided a computer readable storage medium having a computer program stored thereon, the computer program when executed by a processor implementing the steps of:
receiving data blocks corresponding to a consensus backup node sent by a consensus main node of the block chain when the consensus main node executes an RBC protocol, wherein the data blocks corresponding to the consensus backup node are data blocks corresponding to a first transaction set in a transaction pool of the consensus main node, which are sent by the consensus main node to the consensus backup node, and perform reliable broadcast transmission RBC protocol on the first transaction set in the transaction pool of the consensus main node, so that the first transaction set is split into N data blocks corresponding to the consensus node of the block chain by using an erasure coding algorithm, and the data blocks are sent to the consensus backup node based on a Rval message;
executing the RBC protocol, forwarding the corresponding data blocks received from the Rval message to other common identification backup nodes through Echo messages, broadcasting Ready messages to the blockchain after receiving N-f Echo messages, and restoring the received data blocks into the first transaction set based on the erasure code algorithm after receiving 2f +1 Ready messages, wherein f is the fault tolerance number of the common identification nodes of the blockchain;
after the consensus master node performs a practical Byzantine PBFT protocol on the Mercker tree proofs of all data blocks of the first transaction set to initiate a consensus proposal for the Mercker tree proofs of all data blocks of the first transaction set, responding to the consensus proposal based on the PBFT protocol to complete consensus of the Mercker tree proofs of all data blocks of the first transaction set;
after the acquaintance of the mercker tree certificates of all the data blocks of the first transaction set are identified, matching the transaction corresponding to the acquaintance merker tree certificates from the restored first transaction set, and executing writing block operation on the matched transaction.
The scheme of the embodiment of the specification realizes consensus through an RBC protocol and a PBFT protocol. In the RBC protocol stage, the consensus master node splits a transaction set serving as proposed data into data blocks corresponding to the consensus backup nodes by using an erasure code transmission mechanism of the RBC protocol, sends the split data blocks to the corresponding consensus backup nodes, and forwards the data blocks to the corresponding consensus backup nodes, so that the transmission of the proposed data is shared, and the transmission fault tolerance is realized by using a smaller network bandwidth and a smaller storage space overhead of the consensus master node. In the stage of the PBFT protocol, the acquaintance main node takes the Mercker tree certificate of the data block of the result of the RBC protocol as an acquaintance object to initiate an acquaintance proposal, so that the acquaintance-achieved Mercker tree certificates are matched back to corresponding transactions to complete block writing operation.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present specification, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative efforts.
Fig. 1 is a schematic flowchart of a block chain consensus method provided in an embodiment of the present disclosure.
Fig. 2 is a first structural diagram of a consensus node provided in an embodiment of the present disclosure.
Fig. 3 is a second structural diagram of a consensus node provided in an embodiment of the present disclosure.
Fig. 4 is a schematic structural diagram of an electronic device provided in an embodiment of this specification.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present specification, and not all of the embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification without any inventive step should fall within the scope of protection of the present specification.
As described above, in the block chain consensus protocol in the current active/standby node operating mode, proposed data of each round of consensus proposals is packaged by the consensus master node and synchronously transmitted to each consensus backup node of the block chain. Assuming that the number of consensus nodes of the block chain is N, for a round of consensus proposals, the consensus master node needs to send N-1 proposals, which causes a significant overhead on the network bandwidth of the consensus master node. With the explosive growth of block chain services in the future, to obtain higher throughput, consensus of more data needs to be achieved in unit time, the burden on a consensus master node is greater, and the consensus efficiency is reduced instead. In view of the above, this document aims to provide a technical solution that can implement block chain consensus with less bandwidth overhead of a consensus primary node, so as to meet the increasing demand of future block chain services.
Fig. 1 is a flowchart illustrating a block chain consensus method according to an embodiment of the present disclosure. The method shown in fig. 1 may be performed by a corresponding apparatus below, comprising the steps of:
s102, the common identification main node of the block chain executes a reliable broadcast transmission RBC protocol on a first transaction set in a transaction pool of the common identification main node, so that the first transaction set is divided into N data blocks corresponding to common identification nodes of the block chain by using an erasure code algorithm, and the corresponding data blocks are sent to all common identification backup nodes of the block chain based on a Rval message, wherein the data blocks divided by the first transaction set correspond to a Mercury tree certificate calculated based on the erasure code algorithm, and N is the number of the common identification nodes of the block chain.
Erasure Coding (EC) is a method of data fault-tolerant protection that segments data into segments, expands, encodes, and stores redundant data blocks in different locations, such as disks, storage nodes, or other geographic locations. From a data function perspective, the protection provided by erasure codes can be given by the following formula: x is represented by k + y. The variable x "represents the value of the original data or symbol. The variable "y" represents the value of an extra or redundant symbol added after a failure that provides protection. The variable "x" represents the total value of the symbols created after the erasure coding process. For example, in one EC 10/16 configuration, there would be 6 additional symbols (variable m) added to the 10 original symbols (variable k). These 16 data segments (variable n) may be spread over 16 drives, nodes or geographical locations, while the original file may be reconstructed from 10 verification segments. That is, the original file can be restored even if 6 drives, nodes, or geographic locations are lost or unavailable. It can be seen that the erasure code only needs redundancy with a small amount of data to achieve restoration of data.
In this embodiment of the present specification, the execution of the RBC protocol by the consensus master node is to synchronize the first transaction set (which is subsequently used as proposed data) needing consensus in the own transaction pool to the consensus backup node of the blockchain summary by using erasure coding technology. Based on erasure code technology, after splitting a transaction set in a self transaction pool into data blocks corresponding to all consensus nodes, the consensus master node only needs to send the data blocks corresponding to the consensus backup nodes to all the consensus backup nodes. That is, in the synchronization process, the data volume sent by the consensus master node is only the data volume of one transaction set.
S104, the consensus backup node executes an RBC protocol to forward the corresponding data blocks received from the Rval message to other consensus backup nodes through Echo messages, and after N-2f Echo messages are received, the received data blocks are restored to a first transaction set based on an erasure code algorithm, wherein f is the fault tolerance number of the consensus node of the block chain.
It should be understood that, when the common node in the embodiments of the present specification executes the RBC protocol, the common backup node is provided with the data block corresponding to the common backup node only through the Rval message. In order to enable the common identification backup node to obtain the complete first transaction set, in this step, each common identification backup node of the block chain further needs to forward the data block corresponding to the common identification backup node to other common identification backup nodes through an Echo message of the RBC protocol. When any consensus backup node receives N-2f Echo messages (indicating that enough data blocks based on the erasure coding algorithm to restore the first transaction set are collected), it attempts to restore the first intersection to achieve data synchronization of the first intersection.
It can be seen that, in the process of transmitting the first transaction set by using the erasure code algorithm based on the RBC protocol, the consensus backup node also consumes the network bandwidth to assist the consensus main node in forwarding the data block corresponding to the consensus main node, thereby sharing the transmission pressure on the side of the consensus main node.
S106, after the RBC protocol is executed on the first transaction set, the consensus master node executes a practical byzantine PBFT protocol on the mercker tree certificates of all data blocks of the first transaction set to initiate a consensus proposal for the mercker tree certificates of all data blocks of the first transaction set.
It should be understood that the consensus proposal of the merkel tree proof of all data blocks of the first transaction set. The result is generated by the common identification main node executing the RBC protocol and belongs to the execution result of the RBC protocol. Since the data blocks can be represented by the merkel tree certificates with smaller data amount, when the merkel tree certificates of all the data blocks of the first transaction set are commonly recognized by the main node to execute the PBFT protocol, the data amount transmitted by the PBFT protocol can be saved.
S108, the consensus backup node responds to the consensus proposal based on the PBFT protocol to complete the consensus of the Mercker tree proofs for all the data blocks of the first transaction set.
It should be understood that in the embodiments of the present specification, the consensus objects of the PBFT protocol are proven by the traditional transaction set data instead of the merkel tree, but the consensus principle is not changed, so the consensus can be completed using the traditional PBFT protocol logic.
S110, after the Mercker tree certificates of all the data blocks in the first transaction set are identified, the main common identification node and the backup common identification node match the transactions corresponding to the Mercker tree certificates reaching the common identification from the respective first transaction sets, so as to execute block writing operation on the matched transactions.
Compared with the conventional PBFT protocol, since the consensus object is replaced by the mercker tree certificate from the transaction set data, the result of the PBFT protocol is determined to be the mercker tree certificate achieving consensus, and the consensus primary node and the consensus backup node are required to re-match the corresponding transaction from the respective determined transaction sets, and then perform a block writing operation on the matched transaction (also understood to be the transaction achieving consensus).
It should be understood here that the first transaction set on the side of the consensus backup node is synchronized by the consensus master node performing the RBC protocol, while the first transaction set on the side of the consensus master node is itself derived from the transaction pool of the target consensus node.
The method of the embodiments of the present description achieves consensus through the RBC protocol and the PBFT protocol. In the RBC protocol stage, the consensus master node splits a transaction set serving as proposed data into data blocks corresponding to the consensus backup nodes by using an erasure code transmission mechanism of the RBC protocol, sends the split data blocks to the corresponding consensus backup nodes, and forwards the data blocks to the corresponding consensus backup nodes, so that the transmission of the proposed data is shared, and the transmission fault tolerance is realized by using a smaller network bandwidth and a smaller storage space overhead of the consensus master node. In the stage of the PBFT protocol, the acquaintance main node takes the Mercker tree certificate of the data block of the result of the RBC protocol as an acquaintance object to initiate an acquaintance proposal, so that the acquaintance-achieved Mercker tree certificates are matched back to corresponding transactions to complete block writing operation.
The following describes in detail the consensus method of the examples of the present specification.
In the method according to the embodiment of the present disclosure, the common-identity node of the block chain implements a common-identity uplink for transactions based on the RBC protocol + PBFT protocol. Here, the number of common nodes of the block chain is set to be N, and the fault-tolerant number of common nodes of byzantine is set to be f, where N > is 3f + 1. The corresponding consensus process is as follows:
RBC protocol stage:
the consensus main node selects a plurality of transactions to be agreed from the transaction pool of the consensus main node to form a first transaction set.
The consensus master node splits the first transaction set into N ordered data blocks in one-to-one correspondence with the consensus nodes of the blockchain according to a consensus sequence using an erasure coding algorithm. Here, each data block includes at least one transaction in the first transaction set, the data blocks split based on the erasure code algorithm correspond to hash values, and root hashes of all the data blocks construct a merkle tree.
For ease of understanding, assuming that the blockchain is provided with 6 consensus nodes including consensus master nodes (the remainder being consensus backup nodes), and the transactions in the first transaction set are 20, i.e., tx1 through tx20, the first transaction set may be split into 6 data blocks, i.e., block1 through block 6. Correspondingly, the correspondence between the data blocks and the transactions is as follows:
consensus node 1: block 1{ tx1, tx2, tx3, tx4}
And (3) the consensus node 2: block 2{ tx5, tx6, tx7}
The consensus node 3: block 3{ tx8, tx9, tx10}
The consensus node 4: block 4{ tx11, tx12, tx13}
The consensus node 5: block 5{ tx14, tx15, tx16}
The consensus node 6: block 6{ tx17, tx18, tx19, tx20}
And then, the common identification main node Rval message sends corresponding data blocks to all common identification backup nodes of the block chain.
Here, the consensus node 1 is taken as a consensus master node. The Rval message sent by the consensus node 1 to the consensus node 2 carries the Mercker tree certificates corresponding to the root hash, block2 and block 2; the Rval message sent by the consensus node 1 to the consensus node 3 carries the tacler tree certificates corresponding to the root hash, block3 and block 3; … … consensus node 1 sends a Rval message to consensus node 6 carrying the merkel tree certificates corresponding to root hash, block6 and block 6.
And then, after receiving the Rval message of the consensus master node, the consensus backup node forwards the root hash in the Rval message, the data block and the tacher tree certificate corresponding to the data block to other consensus backup nodes through the Echo message.
For example, the consensus node 2 sends the tacle tree certificates carrying root hashes, block2 and block2 correspondences to the consensus nodes 1, 3, 4, 5 and 6; the consensus node 3 sends a Mercker tree certificate carrying root hash, block3 and block3 corresponding to the consensus nodes 1, 2, 4, 5 and 6; … … consensus node 6 sends a merkel tree certificate carrying root hashes, block6 and block6 correspondences to consensus nodes 1, 2, 3, 4, 5.
After receiving the N-2f Echo messages, any consensus backup node attempts to restore the received data blocks (the data blocks in the Rval message sent by the consensus master node and the data blocks in the Echo messages sent by other consensus backup nodes) back to the first transaction set by using an erasure code algorithm, and reconstructs the merkel tree of the first transaction set to check whether the reconstructed merkel tree is consistent with the received merkel tree certificate. If so, a Ready message is broadcast to the blockchain.
In addition, on the basis, if the data blocks obtained from the Echo message and the Rval message are not enough to restore the first transaction set, any consensus backup node can also obtain the data blocks in the Rval message received by other consensus backup nodes from other consensus backup nodes to try to restore the first transaction set.
Then, for each consensus node, when f +1 identical Ready messages from different nodes are received, judging whether the consensus node broadcasts the Ready messages or not, and if not, broadcasting the Ready messages; when 2f +1 Ready messages from different consensus nodes are received, it means that the correct first transaction set is received, i.e. the consensus master node correctly synchronizes the first transaction set in its own transaction pool to the consensus backup node.
Here, the consensus master node locally maintains a consensus execution queue for storing the merkel tree certificates to be consensus. After the consensus main node splits the first transaction set into N data blocks, the consensus main node adds the N data blocks split into the first transaction set into the consensus execution queue of the consensus main node in sequence.
After the RBC protocol stage is finished, the consensus main node selects the Mercker tree certificate as a consensus object in sequence from the consensus execution queue to initiate a consensus proposal of the PBFT protocol. It should be appreciated that if the merkel tree proofs in the consensus execution queue exceed the maximum number of merkel tree proofs supported by one consensus proposal, the consensus master node may choose to initiate at least two rounds of consensus proposals to agree on merkel tree proofs in the consensus execution queue.
PBFT protocol stage:
the consensus master node initiates a consensus proposal with the merkel tree attestation of the data blocks of the first transaction set as proposal data.
The consensus process comprises the following steps:
the consensus master node broadcasts a pre-prepare message to each consensus backup node, the pre-prepare message mainly comprising a current consensus view (view) and a digest of the consensus master node (digest), and also comprising a merkel tree certificate for each data block of the first transaction set.
After receiving the pre-preamble message, the consensus backup node participating in the consensus checks whether the pre-preamble message is legal. For example, check view, digest, and Mercker trees for correctness.
If the pre-preparation message is legal, the state of the consensus proposal on each consensus node is determined to be prepared, the consensus backup node adds the received pre-preparation message to the local Log, and sends the preparation message to other consensus backup nodes.
After all the consensus nodes enter a prepared state, the check signature of the consensus node is sent to other consensus nodes through a commit message, and the commit message sent by the consensus node is added to a local Log (representing the approval of the consensus node).
When any consensus node finds that there is a quorum (quorum is a set of a certain number of consensus nodes needed to ensure all data consistency requirements and fault tolerance requirements) agreeing to the number assignment, it broadcasts a commit message to all other consensus nodes. And meanwhile, the commit messages from other consensus nodes are received successively.
If any consensus node receives 2f +1 commit messages, the consensus node is indicated to have a certificate named committed certificate, and the consensus proposal achieves a committed state on the consensus node. At this point, only by this one consensus node, it can be concluded that the request has reached committed status throughout a quantum. When the consensus proposal reaches a committed state, the fact shows that the network-wide consensus is achieved.
After all the Mercker tree proofs in the consensus execution queue of the consensus main node are agreed, the consensus main node and the consensus backup node match the transactions corresponding to the Mercker tree proofs achieving consensus from the respective first transaction sets, and write block operation is performed on the matched transactions.
For convenience of understanding, assuming that the mercker trees of the root hash 1 and the root hash 5 prove to achieve consensus, the consensus primary node and the consensus backup node perform writing block operations on transactions { tx1, tx2, tx3, tx4} corresponding to the root hash 1 and transactions { tx14, tx15, tx16} corresponding to the root hash 5, namely transactions { tx1, tx2, tx3, tx4 tx14, tx15, tx16} to complete uplink.
The above is an introduction to a round of RBC protocol + PBFT protocol. It should be understood that, after the acquirement of the merckel trees of all the data blocks of the first transaction set is confirmed to be completed, if the view is not switched (i.e. the acquirement master node is not replaced), the acquirement master node may further continue to execute a new round of the RBC protocol on the second transaction set in the transaction pool of the acquirement master node (the second transaction set is a transaction set in which the RBC protocol has not been executed by the acquirement master node in the transaction pool of the acquirement master node), and then initiate a consensus proposal of the PBFT protocol for the merckel trees of the data blocks split from the second transaction set, so as to complete the uplink of the second transaction set.
In addition, on the basis, the consensus master node may perform data persistence on the consensus execution queue local to the consensus master node, and if the consensus master node goes down, the consensus execution queue of the consensus master node may be restored to a state before the restart based on persistent data of the consensus master node after the restart.
The above is a description of the method of the embodiments of the present specification. It will be appreciated that appropriate modifications may be made without departing from the principles outlined herein, and such modifications are intended to be included within the scope of the embodiments herein.
Corresponding to the above consensus method shown in fig. 1, an embodiment of the present specification further provides a consensus node of a block chain. Fig. 2 is a block diagram of a consensus node 200 according to an embodiment of the present disclosure, including:
a first RBC executing module 210, where the common recognition master node executes a reliable broadcast transmission RBC protocol on a first transaction set in a transaction pool of the common recognition master node, so as to split the first transaction set into N data blocks corresponding to common recognition nodes of the block chain by using an erasure code algorithm, and sends the corresponding data blocks to each common recognition backup node of the block chain based on a Rval message, so that the common recognition backup node executes the RBC protocol, forwards the corresponding data blocks received from the Rval message to other common recognition backup nodes by using an Echo message, and after receiving N-2f Echo messages, restores the received data blocks to the first transaction set based on the erasure code algorithm, where the data blocks split from the first transaction set correspond to a kirer tree certificate calculated based on the erasure code algorithm, and N is acquiescent number of common recognition nodes of the block chain, f is the fault tolerance number of the consensus node of the block chain;
a first PBFT execution module 220 that executes a practical byzantine PBFT protocol on the merkel tree proofs of all data blocks of the first transaction set after executing the RBC protocol on the first transaction set to initiate a consensus proposal for the merkel tree proofs of all data blocks of the first transaction set, such that the consensus backup node responds to the consensus proposal based on the PBFT protocol to complete consensus of the merkel tree proofs of all data blocks of the first transaction set;
the first writing block module 230, after the acquirement of the mercker tree certificates of all the data blocks of the first transaction set is completed, matches the transaction corresponding to the acquirement of the mercker tree certificates from the first transaction set by the consensus master node, so as to perform a writing block operation on the matched transaction.
The consensus node in the embodiment of the present specification realizes consensus through an RBC protocol and a PBFT protocol. In the RBC protocol stage, an erasure code transmission mechanism of the RBC protocol is utilized to split a transaction set serving as proposed data into data blocks corresponding to the consensus backup nodes, the split data blocks are sent to the corresponding consensus backup nodes, and the consensus backup nodes forward the data blocks to share the transmission of the proposed data, so that the transmission fault tolerance is realized with smaller network bandwidth and storage space overhead of the consensus master node. In the stage of the PBFT protocol, the acquaintance main node takes the Mercker tree certificate of the data block of the result of the RBC protocol as an acquaintance object to initiate an acquaintance proposal, so that the acquaintance-achieved Mercker tree certificates are matched back to corresponding transactions to complete block writing operation.
Optionally, the consensus node of the embodiment of the present specification further includes:
a queue maintenance module, configured to, after the first RBC execution module 210 splits the first transaction set into N data blocks corresponding to the consensus node of the block chain using an erasure code algorithm, add the N data blocks split into the first transaction set to the consensus execution queue of the consensus master node in sequence; correspondingly, the first PBFT execution module 220 may select the merkel tree certificates of the data blocks of the first transaction set in order from the consensus execution queue to initiate at least one round of consensus proposition until the merkel tree certificates of all the data blocks of the first transaction set complete consensus.
Optionally, the first RBC execution module 210 and the first PBFT execution module 220 are in a serial relationship.
After the acquirement of the mercker trees of all the data blocks of the first transaction set is confirmed to be completed, if the block chain is not switched to a view, the first RBC execution module 210 executes a new round of RBC protocol on a second transaction set in the transaction pool of the common identity master node, where the second transaction set is a transaction set in the transaction pool of the common identity master node, on which the RBC protocol has not been executed by the common identity master node.
Optionally, a consensus execution queue of the consensus master node serves as persistent data of the consensus master node. If the consensus master node is restarted, the queue maintenance module may further restore the consensus execution queue of the consensus master node to a state before restarting based on persistent data of the consensus master node.
Optionally, when the PBFT protocol is executed for the merkel tree certificates of all the data blocks of the first transaction set, the consensus master node sends the merkel tree certificate as the current round of consensus object to other consensus nodes based on a Pre-prefix message of the PBFT protocol.
Obviously, the consensus node in this embodiment may be an execution subject of the consensus master node in the method shown in fig. 1, and may implement the corresponding function of the consensus master node in the method shown in fig. 1. Since the principle is the same, the detailed description is omitted here.
Corresponding to the above consensus method shown in fig. 1, an embodiment of the present specification further provides a consensus node of a block chain. Fig. 3 is a block diagram of a consensus node 300 according to an embodiment of the present disclosure, including:
a receiving module 310, configured to receive a data block corresponding to a consensus backup node sent by a consensus master node of the block chain when an RBC protocol is executed, where the data block corresponding to the consensus backup node is a reliable broadcast transmission RBC protocol executed by the consensus master node on a first transaction set in a transaction pool of the consensus master node, so as to split the first transaction set into N data blocks corresponding to the consensus node of the block chain by using an erasure coding algorithm, and send the data block to the consensus backup node based on a Rval message;
a second RBC executing module 320, configured to execute the RBC protocol, forward the corresponding data block received from the Rval message to other consensus backup nodes through Echo messages, and after receiving N-2f Echo messages, restore the received data block to the first transaction set based on an erasure code algorithm, and restore the received data block to the first transaction set based on the erasure code algorithm, where f is a consensus node fault-tolerant number of the block chain;
a second PBFT execution module 330 that, after the consensus master node executes a practical byzantine PBFT protocol on the merkel tree proofs of all data blocks of the first transaction set to initiate a consensus proposal for the merkel tree proofs of all data blocks of the first transaction set, responds to the consensus proposal based on the PBFT protocol to complete consensus on the merkel tree proofs of all data blocks of the first transaction set;
after the acquirement of the mercker tree certificates of all the data blocks of the first transaction set is completed, the second writing block module 340 matches the transaction corresponding to the acquirement of the mercker tree certificates from the restored first transaction set by the consensus backup node, so as to perform writing block operation on the matched transaction.
The consensus node in the embodiment of the present specification realizes consensus through an RBC protocol and a PBFT protocol. In the RBC protocol stage, the consensus master node splits a transaction set serving as proposed data into data blocks corresponding to the consensus backup nodes by using an erasure code transmission mechanism of the RBC protocol, sends the split data blocks to the corresponding consensus backup nodes, and forwards the data blocks to the corresponding consensus backup nodes, so that the transmission of the proposed data is shared, and the transmission fault tolerance is realized by using a smaller network bandwidth and a smaller storage space overhead of the consensus master node. In the stage of the PBFT protocol, the acquaintance main node takes the Mercker tree certificate of the data block of the result of the RBC protocol as an acquaintance object to initiate an acquaintance proposal, so that the acquaintance-achieved Mercker tree certificates are matched back to corresponding transactions to complete block writing operation.
Obviously, the consensus node according to this embodiment may be an execution subject of the consensus backup node in the method shown in fig. 1, and thus can implement the corresponding function of the consensus backup node in the method shown in fig. 1. Since the principle is the same, the detailed description is omitted here.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. Referring to fig. 4, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 4, but that does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads a corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form a consensus device of the block chain on a logic level, wherein the consensus device can be used as a consensus main node of the block chain or belongs to a component in the consensus main node. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
a reliable broadcast transmission RBC protocol is performed on a first transaction set in a transaction pool of a consensus master node, to split the first set of transactions into N data blocks corresponding to common nodes of the chain of blocks using an erasure coding algorithm, and sends corresponding data blocks to each consensus backup node of the block chain based on the Rval message, so that the consensus backup node executes the RBC protocol, the corresponding data block received from the Rval message is forwarded to other cognizant backup nodes through the Echo message, and after receiving N-2f Echo messages, restoring the received data blocks to the first transaction set based on the erasure coding algorithm, the data blocks divided by the first transaction set correspond to a Mercker tree certificate calculated based on the erasure code algorithm, N is the number of common identification nodes of the block chain, and f is the fault-tolerant number of the common identification nodes of the block chain;
after the RBC protocol is executed for the first transaction set, executing a practical byzantine PBFT protocol on the merkel tree proofs of all data blocks of the first transaction set to initiate a consensus proposal for the merkel tree proofs of all data blocks of the first transaction set, such that the consensus backup node responds to the consensus proposal based on the PBFT protocol to complete the consensus for the merkel tree proofs of all data blocks of the first transaction set;
after the acquaintance tree certificates of all the data blocks of the first transaction set are identified, matching the transaction corresponding to the acquaintance tree certificate from the first transaction set so as to execute a writing block operation on the matched transaction.
Or the processor reads a corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form a consensus device of the block chain on a logic level, wherein the consensus device can be used as a consensus backup node of the block chain or belongs to a component in the consensus backup node. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
receiving a data block corresponding to a consensus backup node sent by a consensus main node of the block chain when the consensus main node executes an RBC protocol, wherein the data block corresponding to the consensus backup node is a data block corresponding to a first transaction set in a transaction pool of the consensus main node, which is executed by the consensus main node for reliable broadcast transmission of the RBC protocol, so that the first transaction set is split into N data blocks corresponding to the consensus nodes of the block chain by using an erasure code algorithm, and the data block is sent to the consensus backup node based on a Rval message.
Executing the RBC protocol, forwarding the corresponding data blocks received from the Rval message to other common identification backup nodes through Echo messages, broadcasting Ready messages to the blockchain after receiving N-f Echo messages, and restoring the received data blocks into the first transaction set based on the erasure code algorithm after receiving 2f +1 Ready messages, wherein f is the fault tolerance number of the common identification nodes of the blockchain.
After the consensus master node performs a practical Byzantine PBFT protocol on the Mercker tree proofs of all data blocks of the first transaction set to initiate a consensus proposal for the Mercker tree proofs of all data blocks of the first transaction set, responding to the consensus proposal based on the PBFT protocol to complete consensus of the Mercker tree proofs of all data blocks of the first transaction set.
After the acquaintance of the mercker tree certificates of all the data blocks of the first transaction set are identified, matching the transaction corresponding to the acquaintance merker tree certificates from the restored first transaction set, and executing writing block operation on the matched transaction.
The consensus method as disclosed above in the embodiment of fig. 1 of the present specification may be applied to or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present specification may be embodied directly in a hardware decoding processor, or in a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
It should be understood that the electronic device in the embodiments of the present specification may implement the functions of the embodiment of the consensus master node or the consensus backup node shown in fig. 1, which are not described herein again.
Of course, besides the software implementation, the electronic device in this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Furthermore, the present specification embodiments also propose a computer-readable storage medium storing one or more programs, the one or more programs including instructions.
When executed by a portable electronic device including a plurality of application programs, the instructions may enable the portable electronic device to perform the method of the embodiment shown in fig. 1, and specifically perform the following steps corresponding to the consensus master node:
a reliable broadcast transmission RBC protocol is performed on a first transaction set in a transaction pool of a consensus master node, to split the first set of transactions into N data blocks corresponding to common nodes of the chain of blocks using an erasure coding algorithm, and sends corresponding data blocks to each consensus backup node of the block chain based on the Rval message, so that the consensus backup node executes the RBC protocol, the corresponding data block received from the Rval message is forwarded to other cognizant backup nodes through the Echo message, and after receiving N-2f Echo messages, restoring the received data blocks to the first transaction set based on the erasure coding algorithm, the data blocks divided by the first transaction set correspond to a mercker tree certificate calculated based on the erasure code algorithm, N is the number of common identification nodes of the block chain, and f is the fault tolerance number of the common identification nodes of the block chain.
After the RBC protocol is executed for the first transaction set, a practical byzantine PBFT protocol is executed for the merkel tree proofs of all data blocks of the first transaction set to initiate a consensus proposal for the merkel tree proofs of all data blocks of the first transaction set, such that the consensus backup node responds to the consensus proposal based on the PBFT protocol to complete the consensus for the merkel tree proofs of all data blocks of the first transaction set.
After the acquaintance tree certificates of all the data blocks of the first transaction set are identified, matching the transaction corresponding to the acquaintance tree certificate from the first transaction set so as to execute a writing block operation on the matched transaction.
Alternatively, when executed by a portable electronic device including multiple application programs, the instructions may enable the portable electronic device to perform the method of the embodiment shown in fig. 1, and specifically perform the following steps corresponding to the consensus backup node:
receiving a data block corresponding to a consensus backup node sent by a consensus main node of the block chain when the consensus main node executes an RBC protocol, wherein the data block corresponding to the consensus backup node is a data block corresponding to a first transaction set in a transaction pool of the consensus main node, which is executed by the consensus main node for reliable broadcast transmission of the RBC protocol, so that the first transaction set is split into N data blocks corresponding to the consensus nodes of the block chain by using an erasure code algorithm, and the data block is sent to the consensus backup node based on a Rval message.
Executing the RBC protocol, forwarding the corresponding data blocks received from the Rval message to other common identification backup nodes through Echo messages, broadcasting Ready messages to the blockchain after receiving N-f Echo messages, and restoring the received data blocks into the first transaction set based on the erasure code algorithm after receiving 2f +1 Ready messages, wherein f is the fault tolerance number of the common identification nodes of the blockchain.
After the consensus master node performs a practical Byzantine PBFT protocol on the Mercker tree proofs of all data blocks of the first transaction set to initiate a consensus proposal for the Mercker tree proofs of all data blocks of the first transaction set, responding to the consensus proposal based on the PBFT protocol to complete consensus of the Mercker tree proofs of all data blocks of the first transaction set.
After the acquaintance of the mercker tree certificates of all the data blocks of the first transaction set are identified, matching the transaction corresponding to the acquaintance merker tree certificates from the restored first transaction set, and executing writing block operation on the matched transaction.
It should be understood that the above-mentioned instructions, when executed by a portable electronic device including multiple application programs, can enable the consensus master node or the consensus backup node described above to implement the functions of the embodiment shown in fig. 1, which is not described in detail herein.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The above description is only an example of the present specification, and is not intended to limit the present specification. Various modifications and alterations to this description will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the scope of the claims of the present specification. Moreover, all other embodiments obtained by a person skilled in the art without making any inventive step shall fall within the scope of protection of this document.

Claims (13)

1. A method for block chain consensus, comprising:
the common identification main node of the block chain executes a reliable broadcast transmission RBC protocol on a first transaction set in a transaction pool of the common identification main node, so that an erasure code algorithm is used for splitting the first transaction set into N data blocks corresponding to common identification nodes of the block chain, and corresponding data blocks are sent to all common identification backup nodes of the block chain based on a Rval message, wherein the data blocks split by the first transaction set correspond to a Mercury tree certificate calculated based on the erasure code algorithm, and N is the number of the common identification nodes of the block chain;
the common identification backup node executes the RBC protocol to forward the corresponding data blocks received from the Rval message to other common identification backup nodes through Echo messages, and after N-2f Echo messages are received, the received data blocks are restored to the first transaction set based on the erasure code algorithm, wherein f is the fault-tolerant number of the common identification nodes of the block chain;
after the RBC protocol is executed on the first transaction set, the consensus master node executes a practical byzantine PBFT protocol on the mercker tree certificates of all data blocks of the first transaction set to initiate consensus proposals for the mercker tree certificates of all data blocks of the first transaction set;
the consensus backup node responding to the consensus proposal based on the PBFT protocol to complete consensus for the Mercker tree attestation of all data blocks of the first transaction set;
after the acquaintance tree certificates of all the data blocks of the first transaction set are identified, the acquaintance main node and the acquaintance backup node match the transaction corresponding to the acquaintance tree certificate from the respective first transaction set, so as to execute block writing operation on the matched transaction.
2. The method of claim 1, further comprising:
after the consensus main node splits the first transaction set into N data blocks corresponding to the consensus nodes of the block chain by using an erasure code algorithm, sequentially adding the N data blocks split into the first transaction set into N data blocks into a consensus execution queue of the consensus main node;
after the RBC protocol is executed for the first transaction set, the consensus master node executes a practical byzantine PBFT protocol for the mercker tree certificates of all data blocks of the first transaction set to initiate consensus proposals for the mercker tree certificates of all data blocks of the first transaction set, including:
the consensus master node selects the Mercker tree proofs of the data blocks of the first transaction set from the consensus execution queue of the consensus master node in sequence to initiate at least one round of consensus proposition until the Mercker tree proofs of all the data blocks of the first transaction set complete consensus.
3. The method of claim 1, wherein the first and second light sources are selected from the group consisting of,
the consensus master node serially executes the RBC protocol and the PBFT protocol, the method further comprising:
after the acquirement of the mercker trees of all the data blocks of the first transaction set is proved to be finished, if the view is not switched over in the block chain, the common identification master node executes the RBC protocol on a second transaction set in a transaction pool of the common identification master node, wherein the second transaction set refers to the transaction set in the transaction pool of the common identification master node, on which the RBC protocol has not been executed by the common identification master node.
4. The method of claim 2, wherein the first and second light sources are selected from the group consisting of,
a consensus execution queue of the consensus master node as persistent data for the consensus master node, the method further comprising:
and if the consensus main node is restarted, based on the persistent data of the consensus main node, restoring the consensus execution queue of the consensus main node to the state before restarting.
5. The method of claim 2, wherein the first and second light sources are selected from the group consisting of,
and when the principal node executes the PBFT protocol on the Mercker tree proofs of all the data blocks of the first transaction set, the principal node sends the Mercker tree proofs serving as the current round of consensus objects to other consensus nodes based on the Pre-prefix message of the PBFT protocol.
6. A method for block chain consensus, comprising:
the common identification main node executes a reliable broadcast transmission RBC protocol on a first transaction set in a transaction pool of the common identification main node, so as to divide the first transaction set into N data blocks corresponding to common identification nodes of the block chain by using an erasure code algorithm, and sends corresponding data blocks to all common identification backup nodes of the block chain based on a Rval message, so that the common identification backup nodes execute the RBC protocol, forwards the corresponding data blocks received from the Rval message to other common identification backup nodes by an Echo message, and broadcasts a Ready message to the block chain after receiving N-f Echo messages, and after receiving 2f +1 Ready messages, restores the received data blocks into the first transaction set based on the erasure code algorithm, wherein the data blocks divided by the first transaction set correspond to a Merck tree certificate calculated based on the erasure code algorithm, n is the number of the consensus nodes of the block chain, and f is the fault-tolerant number of the consensus nodes of the block chain;
after executing the RBC protocol on the first transaction set, the consensus master node executes a practical byzantine PBFT protocol on the merkel tree certificates of all data blocks of the first transaction set to initiate consensus suggestions for the merkel tree certificates of all data blocks of the first transaction set, such that the consensus backup node responds to the consensus suggestions based on the PBFT protocol to complete consensus on the merkel tree certificates of all data blocks of the first transaction set;
after the acquaintance tree certificates of all the data blocks of the first transaction set are identified, the acquaintance main node matches the transaction corresponding to the acquaintance tree certificate from the first transaction set so as to execute a writing block operation on the matched transaction.
7. A method for block chain consensus, comprising:
receiving, by a common identification backup node of a block chain, a data block corresponding to the common identification backup node sent when a common identification master node of the block chain executes an RBC protocol, wherein the data block corresponding to the common identification backup node is a reliable broadcast transmission RBC protocol executed by the common identification master node on a first transaction set in a transaction pool of the common identification master node, so as to split the first transaction set into N data blocks corresponding to the common identification node of the block chain by using an erasure coding algorithm, and sending the data blocks to the common identification backup node based on an Rval message;
the common identification backup node executes the RBC protocol, forwards the corresponding data blocks received from the Rval message to other common identification backup nodes through Echo messages, and restores the received data blocks into the first transaction set based on the erasure code algorithm after receiving N-2f Echo messages, wherein f is the fault-tolerant number of the common identification nodes of the block chain;
after the consensus master node performs a practical Byzantine PBFT protocol on the Mercker tree proofs of all data blocks of the first transaction set to initiate a consensus proposal for the Mercker tree proofs of all data blocks of the first transaction set, the consensus backup node responds to the consensus proposal based on the PBFT protocol to complete consensus on the Mercker tree proofs of all data blocks of the first transaction set;
after the acquaintance tree certificates of all the data blocks of the first transaction set are identified, the acquaintance backup node matches the transaction corresponding to the acquaintance tree certificate from the restored first transaction set so as to execute a writing block operation on the matched transaction.
8. A consensus node of a blockchain, comprising:
a first RBC execution module, wherein the common identification master node executes a reliable broadcast transmission RBC protocol on a first transaction set in a transaction pool of the common identification master node, so as to split the first transaction set into N data blocks corresponding to common identification nodes of the block chain by using an erasure code algorithm, and sends the corresponding data blocks to each common identification backup node of the block chain based on a Rval message, so that the common identification backup nodes execute the RBC protocol, forward the corresponding data blocks received from the Rval message to other common identification backup nodes by an Echo message, and after receiving N-2f Echo messages, restore the received data blocks to the first transaction set based on the erasure code algorithm, wherein the data blocks into which the first transaction split set is corresponding to a computed tacle tree certificate based on the erasure code algorithm, N is the number of common identification nodes of the block chain, f is the fault tolerance number of the consensus node of the block chain;
a first PBFT execution module to execute a practical Byzantine PBFT protocol on the Mercker tree proofs of all data blocks of the first transaction set after the RBC protocol is executed on the first transaction set to initiate a consensus proposal for the Mercker tree proofs of all data blocks of the first transaction set, such that the consensus backup node responds to the consensus proposal based on the PBFT protocol to complete consensus of the Mercker tree proofs of all data blocks of the first transaction set;
and the first writing block module is used for matching the transaction corresponding to the acquaintance-reached Mercker tree certificate from the first transaction set after the acquaintance tree certificates of all the data blocks in the first transaction set are identified, so as to execute writing block operation on the matched transaction.
9. An electronic device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being executed by the processor to:
a reliable broadcast transmission RBC protocol is performed on a first transaction set in a transaction pool of a consensus master node, to split the first set of transactions into N data blocks corresponding to common nodes of the chain of blocks using an erasure coding algorithm, and sends corresponding data blocks to each consensus backup node of the block chain based on the Rval message, so that the consensus backup node executes the RBC protocol, the corresponding data block received from the Rval message is forwarded to other cognizant backup nodes through the Echo message, and after receiving N-2f Echo messages, restoring the received data blocks to the first transaction set based on the erasure coding algorithm, the data blocks divided by the first transaction set correspond to a Mercker tree certificate calculated based on the erasure code algorithm, N is the number of common identification nodes of the block chain, and f is the fault-tolerant number of the common identification nodes of the block chain;
after the RBC protocol is executed for the first transaction set, executing a practical byzantine PBFT protocol on the merkel tree proofs of all data blocks of the first transaction set to initiate a consensus proposal for the merkel tree proofs of all data blocks of the first transaction set, such that the consensus backup node responds to the consensus proposal based on the PBFT protocol to complete the consensus for the merkel tree proofs of all data blocks of the first transaction set;
after the acquaintance tree certificates of all the data blocks of the first transaction set are identified, matching the transaction corresponding to the acquaintance tree certificate from the first transaction set so as to execute a writing block operation on the matched transaction.
10. A computer-readable storage medium having a computer program stored thereon, which when executed by a processor, performs the steps of:
a reliable broadcast transmission RBC protocol is performed on a first transaction set in a transaction pool of a consensus master node, to split the first set of transactions into N data blocks corresponding to common nodes of the chain of blocks using an erasure coding algorithm, and sends corresponding data blocks to each consensus backup node of the block chain based on the Rval message, so that the consensus backup node executes the RBC protocol, the corresponding data block received from the Rval message is forwarded to other cognizant backup nodes through the Echo message, and after receiving N-2f Echo messages, restoring the received data blocks to the first transaction set based on the erasure coding algorithm, the data blocks divided by the first transaction set correspond to a Mercker tree certificate calculated based on the erasure code algorithm, N is the number of common identification nodes of the block chain, and f is the fault-tolerant number of the common identification nodes of the block chain;
after the RBC protocol is executed for the first transaction set, executing a practical byzantine PBFT protocol on the merkel tree proofs of all data blocks of the first transaction set to initiate a consensus proposal for the merkel tree proofs of all data blocks of the first transaction set, such that the consensus backup node responds to the consensus proposal based on the PBFT protocol to complete the consensus for the merkel tree proofs of all data blocks of the first transaction set;
after the acquaintance tree certificates of all the data blocks of the first transaction set are identified, matching the transaction corresponding to the acquaintance tree certificate from the first transaction set so as to execute a writing block operation on the matched transaction.
11. A consensus node of a blockchain, comprising:
a receiving module, configured to receive a data block corresponding to a consensus backup node sent by a consensus master node of the block chain when an RBC protocol is executed, where the data block corresponding to the consensus backup node is a reliable broadcast transmission RBC protocol executed by the consensus master node on a first transaction set in a transaction pool of the consensus master node, so as to split the first transaction set into N data blocks corresponding to the consensus node of the block chain by using an erasure code algorithm, and send the data block to the consensus backup node based on a Rval message;
the second RBC execution module executes the RBC protocol, forwards the corresponding data blocks received from the Rval message to other common identification backup nodes through Echo messages, restores the received data blocks to the first transaction set based on an erasure code algorithm after receiving N-2f Echo messages, and restores the received data blocks to the first transaction set based on the erasure code algorithm, wherein f is a common identification node fault-tolerant number of the block chain;
a second PBFT execution module that, after the consensus master node executes a practical Byzantine PBFT protocol on the Mercker tree proofs of all data blocks of the first transaction set to initiate a consensus proposal for the Mercker tree proofs of all data blocks of the first transaction set, responds to the consensus proposal based on the PBFT protocol to complete consensus on the Mercker tree proofs of all data blocks of the first transaction set;
and the second writing block module is used for matching the transaction corresponding to the acquaintance-reached tacher tree certificate from the restored first transaction set by the consensus backup node after the acquaintance tree certificates of all the data blocks of the first transaction set are identified, so as to execute writing block operation on the matched transaction.
12. An electronic device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being executed by the processor to:
receiving data blocks corresponding to a consensus backup node sent by a consensus main node of the block chain when the consensus main node executes an RBC protocol, wherein the data blocks corresponding to the consensus backup node are data blocks corresponding to a first transaction set in a transaction pool of the consensus main node, which are sent by the consensus main node to the consensus backup node, and perform reliable broadcast transmission RBC protocol on the first transaction set in the transaction pool of the consensus main node, so that the first transaction set is split into N data blocks corresponding to the consensus node of the block chain by using an erasure coding algorithm, and the data blocks are sent to the consensus backup node based on a Rval message;
executing the RBC protocol, forwarding the corresponding data blocks received from the Rval message to other common identification backup nodes through Echo messages, broadcasting Ready messages to the blockchain after receiving N-f Echo messages, and restoring the received data blocks into the first transaction set based on the erasure code algorithm after receiving 2f +1 Ready messages, wherein f is the fault tolerance number of the common identification nodes of the blockchain;
after the consensus master node performs a practical Byzantine PBFT protocol on the Mercker tree proofs of all data blocks of the first transaction set to initiate a consensus proposal for the Mercker tree proofs of all data blocks of the first transaction set, responding to the consensus proposal based on the PBFT protocol to complete consensus of the Mercker tree proofs of all data blocks of the first transaction set;
after the acquaintance of the mercker tree certificates of all the data blocks of the first transaction set are identified, matching the transaction corresponding to the acquaintance merker tree certificates from the restored first transaction set, and executing writing block operation on the matched transaction.
13. A computer-readable storage medium having a computer program stored thereon, which when executed by a processor, performs the steps of:
receiving data blocks corresponding to a consensus backup node sent by a consensus main node of the block chain when the consensus main node executes an RBC protocol, wherein the data blocks corresponding to the consensus backup node are data blocks corresponding to a first transaction set in a transaction pool of the consensus main node, which are sent by the consensus main node to the consensus backup node, and perform reliable broadcast transmission RBC protocol on the first transaction set in the transaction pool of the consensus main node, so that the first transaction set is split into N data blocks corresponding to the consensus node of the block chain by using an erasure coding algorithm, and the data blocks are sent to the consensus backup node based on a Rval message;
executing the RBC protocol, forwarding the corresponding data blocks received from the Rval message to other common identification backup nodes through Echo messages, broadcasting Ready messages to the blockchain after receiving N-f Echo messages, and restoring the received data blocks into the first transaction set based on the erasure code algorithm after receiving 2f +1 Ready messages, wherein f is the fault tolerance number of the common identification nodes of the blockchain;
after the consensus master node performs a practical Byzantine PBFT protocol on the Mercker tree proofs of all data blocks of the first transaction set to initiate a consensus proposal for the Mercker tree proofs of all data blocks of the first transaction set, responding to the consensus proposal based on the PBFT protocol to complete consensus of the Mercker tree proofs of all data blocks of the first transaction set;
after the acquaintance of the mercker tree certificates of all the data blocks of the first transaction set are identified, matching the transaction corresponding to the acquaintance merker tree certificates from the restored first transaction set, and executing writing block operation on the matched transaction.
CN202111124498.9A 2021-09-24 2021-09-24 Block chain consensus method, consensus node and electronic equipment Pending CN113849564A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111124498.9A CN113849564A (en) 2021-09-24 2021-09-24 Block chain consensus method, consensus node and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111124498.9A CN113849564A (en) 2021-09-24 2021-09-24 Block chain consensus method, consensus node and electronic equipment

Publications (1)

Publication Number Publication Date
CN113849564A true CN113849564A (en) 2021-12-28

Family

ID=78979764

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111124498.9A Pending CN113849564A (en) 2021-09-24 2021-09-24 Block chain consensus method, consensus node and electronic equipment

Country Status (1)

Country Link
CN (1) CN113849564A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115208881A (en) * 2022-06-02 2022-10-18 哈尔滨工业大学(深圳) Block chain consensus method, equipment and storage medium
CN117478304A (en) * 2023-12-28 2024-01-30 湖南天河国云科技有限公司 Block chain management method, system and computer equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170344987A1 (en) * 2016-05-24 2017-11-30 Mastercard International Incorporated Method and system for an efficient consensus mechanism for permssioned blockchains using bloom filters and audit guarantees
CN109379397A (en) * 2018-08-31 2019-02-22 阿里巴巴集团控股有限公司 Transaction common recognition processing method and processing device, electronic equipment based on block chain
KR20190068799A (en) * 2017-12-11 2019-06-19 한국전자통신연구원 Method and apparatus for performing hierarchically agreement based on service zone
CN111526217A (en) * 2020-07-03 2020-08-11 支付宝(杭州)信息技术有限公司 Consensus method and system in block chain
US10873456B1 (en) * 2019-05-07 2020-12-22 LedgerDomain, LLC Neural network classifiers for block chain data structures
US20210256016A1 (en) * 2018-06-25 2021-08-19 Commonwealth Scientific And Industrial Research Organisation Blockchain system and method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170344987A1 (en) * 2016-05-24 2017-11-30 Mastercard International Incorporated Method and system for an efficient consensus mechanism for permssioned blockchains using bloom filters and audit guarantees
KR20190068799A (en) * 2017-12-11 2019-06-19 한국전자통신연구원 Method and apparatus for performing hierarchically agreement based on service zone
US20210256016A1 (en) * 2018-06-25 2021-08-19 Commonwealth Scientific And Industrial Research Organisation Blockchain system and method
CN109379397A (en) * 2018-08-31 2019-02-22 阿里巴巴集团控股有限公司 Transaction common recognition processing method and processing device, electronic equipment based on block chain
US10873456B1 (en) * 2019-05-07 2020-12-22 LedgerDomain, LLC Neural network classifiers for block chain data structures
CN111526217A (en) * 2020-07-03 2020-08-11 支付宝(杭州)信息技术有限公司 Consensus method and system in block chain

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115208881A (en) * 2022-06-02 2022-10-18 哈尔滨工业大学(深圳) Block chain consensus method, equipment and storage medium
CN115208881B (en) * 2022-06-02 2024-03-26 哈尔滨工业大学(深圳) Block chain consensus method, equipment and storage medium
CN117478304A (en) * 2023-12-28 2024-01-30 湖南天河国云科技有限公司 Block chain management method, system and computer equipment
CN117478304B (en) * 2023-12-28 2024-03-01 湖南天河国云科技有限公司 Block chain management method, system and computer equipment

Similar Documents

Publication Publication Date Title
CN111526219B (en) Alliance chain consensus method and alliance chain system
CN113873030A (en) Block chain consensus method, consensus node and electronic equipment
CN107819828B (en) Data transmission method and device, computer equipment and storage medium
CN113849564A (en) Block chain consensus method, consensus node and electronic equipment
CA2751358C (en) Distributed storage of recoverable data
JP7050955B2 (en) Prioritize storage of shared blockchain data
US20210312438A1 (en) Blockchain consensus method and device and electronic equipment
CN113612614B (en) Method, device, equipment and storage medium for consensus disaster recovery based on blockchain network
CN111475576A (en) Block chain based distributed database storage method and system
CN113852691A (en) Block chain consensus method, consensus node and electronic equipment
CN111431931A (en) Node consensus method and device
CN113761069A (en) Block chain consensus method, system, node and electronic equipment
JP7159348B2 (en) Dynamic Blockchain Data Storage Based on Error Correcting Codes
CN114422331B (en) Disaster recovery switching method, device and system
CN114900532A (en) Power data disaster tolerance method, system, device, computer equipment and storage medium
CN111522696B (en) Downtime processing method, data persistence method and hardware of block chain common identification node
WO2021190031A1 (en) Wdm-based data transmission method, apparatus, and system, and storage medium
CN110585724B (en) Method and device for updating form data in game client
CN115292340B (en) Block chain storage optimization method and device based on distributed network coding
CN113872961B (en) Block chain consensus method, consensus node and electronic equipment
CN116232893A (en) Consensus method and device of distributed system, electronic equipment and storage medium
CN114584326B (en) Block chain data processing method and device, electronic equipment and storage medium
CN114528139A (en) Method, device, electronic equipment and medium for data processing and node deployment
CN113630445A (en) Data storage method and device based on block chain network
CN112437142A (en) Data synchronization system and method for multiple data centers

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