WO2020258252A1 - Consensus method for block chain data and related device - Google Patents

Consensus method for block chain data and related device Download PDF

Info

Publication number
WO2020258252A1
WO2020258252A1 PCT/CN2019/093705 CN2019093705W WO2020258252A1 WO 2020258252 A1 WO2020258252 A1 WO 2020258252A1 CN 2019093705 W CN2019093705 W CN 2019093705W WO 2020258252 A1 WO2020258252 A1 WO 2020258252A1
Authority
WO
WIPO (PCT)
Prior art keywords
signature
block
node
confirmed
voting
Prior art date
Application number
PCT/CN2019/093705
Other languages
French (fr)
Chinese (zh)
Inventor
张骁
辛佳骏
Original Assignee
深圳市网心科技有限公司
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 深圳市网心科技有限公司 filed Critical 深圳市网心科技有限公司
Priority to CN201980059451.3A priority Critical patent/CN112689848B/en
Priority to PCT/CN2019/093705 priority patent/WO2020258252A1/en
Publication of WO2020258252A1 publication Critical patent/WO2020258252A1/en

Links

Images

Classifications

    • 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
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials

Definitions

  • This application relates to blockchain technology, and in particular to a consensus method of blockchain data and related equipment.
  • blockchain can support different consensus mechanisms.
  • the consensus mechanism is an important component of blockchain technology.
  • the goal of the blockchain consensus mechanism is to make all honest nodes maintain a consistent view of the blockchain.
  • PBFT Practical Byzantine-Fault-Tolerant
  • the consensus process is divided into three stages: pre-prepare, prepare, and commit.
  • the consensus process is as follows:
  • a proposal node (node C) is elected from the nodes of the whole network (node C, node 0, node 1, node 2, node 3), and the new block is generated by the proposal node; other nodes send the transaction sent by the client to the whole network Broadcast, the proposed node will collect multiple transactions that need to be placed in the new block from the network and store them in a list, and broadcast the list to the entire network; after receiving the transaction list, other nodes will execute these transactions according to the ranking simulation.
  • the embodiments of the present application provide a consensus method for blockchain data and related equipment to simplify the consensus process of the blockchain.
  • the first aspect of the embodiments of the present application provides a consensus method for blockchain data, which is applied to a proposal node, the proposal node is a node in a blockchain system, and the blockchain system further includes a plurality of voting nodes,
  • the method includes:
  • the aggregate signature is sent to the voting node, so that the block to be confirmed is determined to be valid when the voting node passes verification of the aggregate signature.
  • the block to be confirmed includes the transaction result, and before the receiving the signature information sent by the multiple voting nodes, the method further includes:
  • the transaction list is sent to the voting node, so that after the voting node simulates the execution of the transaction list to obtain a transaction result, the voting node generates a block to be confirmed according to the transaction result.
  • the transaction list includes historical block information
  • sending the transaction list to the voting node specifically includes:
  • the historical block information is sent to the voting node, so that the voting node matches the historical block information.
  • the method before the aggregating and generating an aggregated signature using the received multiple pieces of signature information, the method further includes:
  • the aggregating and generating an aggregate signature using the received multiple pieces of signature information includes:
  • the signature information further includes the hash value of the block header of the block to be confirmed.
  • the blockchain system includes 3F+1 nodes, the preset value includes 2F, and F is a natural number greater than zero.
  • the second aspect of the embodiments of the present application provides a consensus method for blockchain data, which is applied to voting nodes, where the voting nodes are nodes in a blockchain system, and the blockchain system further includes a proposal node.
  • Methods include:
  • the block to be confirmed includes a transaction result, and obtaining the block to be confirmed includes:
  • the transaction list includes historical block information
  • the method further includes:
  • the method further includes:
  • the blockchain system includes 3F+1 nodes, where F is a natural number greater than 0, and the verification of the aggregate signature includes:
  • the signature information further includes the hash value of the block header of the block to be confirmed.
  • the third aspect of the embodiments of the present application provides a consensus device for blockchain data.
  • the device includes a memory and a processor.
  • the memory stores a consensus program for blockchain data that can run on the processor.
  • the consensus program of the blockchain data is executed by the processor, the method described in any one of the foregoing method embodiments is implemented.
  • the device is a node of a blockchain network.
  • the fourth aspect of the embodiments of the present application provides a consensus system for blockchain data, which is applied to a proposed node.
  • the proposed node is a node in a blockchain system.
  • the blockchain system also includes a voting node.
  • the system includes:
  • the first receiving unit is configured to receive signature information respectively sent by the multiple voting nodes, where the signature information includes the signature of the block to be confirmed by the voting node;
  • a judging unit for judging whether the quantity of the received signature information reaches a preset value
  • the first generating unit is configured to, when the judging unit determines that the quantity of the received signature information reaches a preset value, use the multiple received signature information to aggregate to generate an aggregate signature;
  • the first sending unit is configured to send the aggregate signature to the voting node, so that the block to be confirmed is determined to be valid when the voting node passes the verification of the aggregate signature.
  • the block to be confirmed includes the transaction result, and the system further includes:
  • the second receiving unit receives transaction information sent by the multiple voting nodes respectively;
  • the sorting unit is used to sort the transaction information to obtain a transaction list
  • the second sending unit is configured to send the transaction list to the voting node, so that after the voting node simulates the execution of the transaction list to obtain a transaction result, the voting node generates a block to be confirmed according to the transaction result .
  • the transaction list includes historical block information
  • the second sending unit is further configured to:
  • the historical block information is sent to the voting node, so that the voting node matches the historical block information.
  • system further includes:
  • the simulation execution unit is used to simulate execution of the transaction list to obtain the transaction result
  • the second generating unit is configured to generate a block to be confirmed according to the transaction result, and sign the block to be confirmed to obtain a first signature
  • the first generating unit is specifically configured to:
  • the signature information further includes the hash value of the block header of the block to be confirmed.
  • the blockchain system includes 3F+1 nodes, the preset value includes 2F, and F is a natural number greater than zero.
  • the fifth aspect of the embodiments of the present application provides a consensus system for blockchain data, which is applied to voting nodes.
  • the voting nodes are nodes in a blockchain system.
  • the blockchain system further includes a proposal node.
  • Methods include:
  • the obtaining unit is used to obtain the block to be confirmed
  • the voting signature unit is used to sign the block to be confirmed and generate signature information
  • a sending unit configured to send the signature information to the proposal node
  • a receiving unit configured to receive an aggregate signature sent by the proposing node, where the aggregate signature is generated by the proposing node after aggregating multiple pieces of signature information;
  • the first determining unit is configured to determine that the block to be confirmed is valid when the aggregate signature is verified.
  • the block to be confirmed includes a transaction result
  • the obtaining unit is specifically configured to:
  • the transaction list includes historical block information
  • the system further includes:
  • the judging unit is configured to use its own database to judge whether there is target data matching the historical block message;
  • the trigger unit is configured to trigger the generation of the block to be confirmed according to the transaction result when the judgment unit determines that there is target data matching the historical block message in its own database.
  • the system further includes:
  • the second determining unit is configured to determine that the target data in the own database is valid after determining that the block to be confirmed is valid.
  • the blockchain system includes 3F+1 nodes, F is a natural number greater than 0, and the verification unit is specifically configured to:
  • the signature information further includes the hash value of the block header of the block to be confirmed.
  • the sixth aspect of the embodiments of the present application provides a computer-readable storage medium.
  • the computer-readable storage medium stores a consensus program for blockchain data.
  • the consensus program for blockchain data can be configured by one or more
  • the processor executes to implement the blockchain data consensus method according to any one of the foregoing method embodiments.
  • the embodiments of this application have the following advantages: receiving signature information respectively sent by the multiple voting nodes, where the signature information includes the signature of the block to be confirmed by the voting node; judging all received Whether the amount of the signature information reaches a preset value; if so, use the received multiple signature information to aggregate to generate an aggregate signature; send the aggregate signature to the voting node, so that when the voting node When the aggregate signature is verified, it is determined that the block to be confirmed is valid. Therefore, generating aggregated signatures in the consensus process of the blockchain can aggregate the signature votes from various voting nodes, simplify the consensus process of the blockchain, and achieve consensus on more data, thereby reducing congestion in the network. risk.
  • Figure 1 is an embodiment of a consensus method for blockchain data in the prior art
  • FIG. 2 is a schematic diagram of an embodiment of a consensus method for blockchain data in an embodiment of the application
  • FIG. 3 is another schematic diagram of an embodiment of a consensus method for blockchain data in an embodiment of the application.
  • Figure 3-1 is another schematic diagram of an embodiment of a blockchain data consensus method in an embodiment of the application
  • FIG. 4 is another schematic diagram of an embodiment of a consensus method for blockchain data in an embodiment of the application.
  • FIG. 5 is another schematic diagram of an embodiment of a blockchain data consensus method in an embodiment of the application.
  • Fig. 6 is a schematic diagram of an embodiment of a consensus system for blockchain data in an embodiment of the application
  • FIG. 7 is another schematic diagram of an embodiment of a consensus system for blockchain data in an embodiment of the application.
  • FIG. 8 is a schematic diagram of an embodiment of a consensus system for blockchain data in an embodiment of the application.
  • the following embodiments of the present application provide a blockchain data consensus method and related equipment for simplifying the blockchain consensus process.
  • PBFT Practical Byzantine-Fault-Tolerant
  • N 3f+1
  • the consensus process includes a request process (request), a consensus process and a response process (reply).
  • the consensus process is divided into three stages: pre-prepare, prepare, and commit.
  • the consensus process is as follows: C. Node 0, node 1, node 2, node 3) elect a proposal node (node C), the new block is generated by the proposal node; other nodes will broadcast the transaction sent by the client to the whole network, and the proposal node will The network collects multiple transactions that need to be placed in the new block and stores them in a list, and broadcasts the list to the entire network; after other nodes receive the transaction list, they execute these transactions according to the sorting simulation.
  • the embodiments of the present application provide a blockchain data consensus method and related equipment to simplify the blockchain consensus process.
  • An embodiment of a blockchain data consensus method in the embodiment of the present application includes:
  • the voting node obtains the block to be confirmed
  • the voting node obtains the block to be confirmed.
  • proposal nodes Proposer
  • voting nodes voting nodes
  • the proposal node is responsible for collecting transactions, packaging blocks and verifying voting information
  • the voting node is responsible for verifying blocks and voting for valid blocks.
  • the voting node can obtain the block to be confirmed sent by the proposal node to the voting node through the blockchain system, or it can receive the message to be confirmed sent by the proposal node to further generate the block to be confirmed, or other The method of obtaining is not limited here.
  • the voting node can use the aggregate signature algorithm to vote and sign the block to be confirmed to obtain signature information.
  • the voting node can verify the legality of the voting information.
  • the voting node uses the aggregate signature algorithm to vote and sign the block to be confirmed to obtain the signature information .
  • the voting node sends signature information to the proposing node
  • the voting node after obtaining the signature information in step 202, the voting node sends the signature information to the proposing node, so that the proposing node knows that the voting node has voted on the block to be confirmed, that is, knows that the voting node approves The block to be confirmed.
  • the signature information may also include the hash value of the block header of the block to be confirmed, where the hash value of the block header of the block to be confirmed is used to identify the block information corresponding to the signature information , That is, it indicates that the signature information has a corresponding relationship with the block to be confirmed.
  • the proposing node judges whether the preset value is reached
  • the proposing node judges whether the quantity of the received signature information reaches a preset value, if so, execute step 205, and if not, execute step 208.
  • the proposing node can determine whether the number of signature information received within a preset time period reaches a preset value.
  • a verification mechanism of the PBFT algorithm can be introduced here, that is, the proposed node can also be used as a voting node to participate in voting, or not to participate in voting.
  • the specific judgment process can refer to the authentication mode of the PBFT algorithm, that is, the blockchain system includes a total of 3F+1 nodes, and F is a natural number greater than 0.
  • the default value in this step is 2F, that is, if the proposal node receives 2F nodes within the preset time period to determine the signature information for the block to be confirmed, that is, it is determined that the number of signature information reaches the preset value, then step 205 is executed, if not, Step 208 is executed.
  • the signature information is aggregated using an aggregation signature algorithm.
  • this step is similar to the aforementioned step 202, and does not limit the aggregation signature algorithm.
  • the EC-Schnorr signature algorithm can be taken as an example for description. Please refer to the implementation process of the EC-Schnorr algorithm described in Figure 5. The interaction between users can be abstracted into 4 steps.
  • the signing node sends a Commitment to the aggregation node, as shown in 1 in the figure; in the second step, the aggregation node sends a challenge to the signing node, as shown in 2 in the figure; the third step, the signing node According to the challenge, a response (Response) is generated, as shown in Figure 3; in the fourth step, the aggregation node generates an aggregate signature according to the commitment and response of the signature node, and broadcasts the aggregate signature to all signature verification nodes, as shown in Figure 4.
  • the multiple interactions between the aggregation node and the signature node are to ensure that each signature node is the owner of the public key corresponding to the signature and prevent the signature node from doing evil.
  • the proposing node sends the aggregate signature to the voting node
  • the proposing node after obtaining the aggregate signature in step 205, the proposing node sends the aggregate signature to the voting node.
  • the voting node determines that the aggregate signature is valid
  • the voting node determines that the aggregated signature passes the legality verification, it is determined that the block to be confirmed is valid.
  • the voting node receives the aggregated signature and verifies that the aggregated signature contains legal multi-signatures from 2F+1 nodes for the current block, it can be determined to be confirmed The block is valid, and you can subsequently submit a new block and its transaction to the local blockchain, update the status database, or add the voting information to the transaction pool to wait for the transaction, etc.
  • the specifics are not limited here.
  • the proposing node determines in step 204 that the quantity of the received signature information does not reach the preset value, other operations are performed, that is, it is determined that the block to be confirmed has not been approved by the blockchain system .
  • the proposing node does not perform the step of generating an aggregated signature based on the signature information, and can directly discard the block to be confirmed, or resubmit and wait for the next polling process, or other operations, which are not specifically done here limited.
  • the proposing node receives the signature information sent by the multiple voting nodes, the signature information includes the signature of the block to be confirmed by the voting node; it is judged whether the amount of the received signature information reaches a preset value Value; if so, use the multiple received signature information to aggregate to generate an aggregate signature; send the aggregate signature to the voting node, so that when the voting node passes the verification of the aggregate signature, it is determined that the The block to be confirmed is valid. Therefore, generating aggregated signatures in the consensus process of the blockchain can aggregate the signature votes from various voting nodes, simplify the consensus process of the blockchain, and achieve consensus on more data, thereby reducing congestion in the network. risk.
  • a proposal node is elected from the nodes of the entire network, and the new block is generated by the proposal node.
  • node 0 is a proposal node, and other nodes are voting nodes.
  • the voting node broadcasts the transaction sent by the client to the entire network.
  • the proposed node will collect multiple transactions that need to be placed in the new block from the network and store it in a list, and broadcast the list to the entire network.
  • After the voting node receives the transaction list it executes these transactions according to the ranking simulation. After all transactions are executed, use your private key to sign the block to be confirmed, and then return the signature to the proposing node.
  • the proposing node verifies the received block voting signatures. If the proposing node receives legal signatures from more than 2f nodes, it will use the multi-signature aggregation algorithm to aggregate the signatures together with its own signature on the block to generate a multi-signature. If a node receives a multi-signature message and verifies that this multi-signature message contains legal multi-signatures from 2f+1 nodes for the current block, it can submit the new block and its transactions to the local blockchain and state database.
  • the process of obtaining the block to be confirmed by the voting node in step 201 may be implemented by the proposal node. Please refer to Figure 3 below.
  • the specific execution process of step 201 may include:
  • Voting nodes obtain transaction information
  • the voting nodes obtain transaction information, that is, each voting node obtains transaction information generated by its own client.
  • the voting node sends transaction information to the proposal node
  • each voting node sends the obtained transaction information to the proposal node.
  • each voting node can send it in the form of a blockchain network broadcast, or it can be sent in a direct point-to-point sending mode. Make a limit.
  • the proposal node sorts the transaction information
  • the proposing node sorts the transaction information collected in step 302 to obtain a transaction list.
  • step 205 when the proposing node determines in step 204 that the quantity of the received signature information reaches the preset value, the signature Information is aggregated using an aggregate signature algorithm, and the process of obtaining an aggregate signature can specifically incorporate the transaction list into the aggregate signature.
  • the proposing node simulates the execution of the transaction list to obtain the transaction result; after generating the block to be confirmed according to the transaction result, the proposing node signs the block to be confirmed to obtain the first signature, so that the step Aggregating and generating an aggregate signature by using the plurality of received signature information in 204 specifically includes: aggregating the first signature of the proposing node with the multiple signature information received in step 203 to obtain the aggregate signature.
  • the proposing node sends a transaction list to the voting node
  • the proposing node sends the transaction list generated in step 303 to the voting node.
  • the voting node simulates the execution of the transaction
  • the voting node simulates the execution of the transaction list according to the standard process, and generates the transaction result.
  • the voting node generates a block to be confirmed.
  • the voting node generates a block to be confirmed according to the transaction result obtained in step 305.
  • the block to be confirmed may be a block to be confirmed, and the block contains all the transactions in the above transaction list;
  • the transaction ranking list obtained by the voting node in step 304 also includes historical block information, and a judgment step for the execution preconditions of step 305 can also be added.
  • the specific additional steps include:
  • the voting node uses its own database to determine whether the historical block message has target data that matches the historical block message, if yes, execute step 308, and if not, execute step 309.
  • the historical block information can be all the information of the historical block or the hash value of all the information of the historical block.
  • the historical block information can also be the proposal The hash value of the latest n (n is an integer greater than 0) blocks in the node database.
  • the historical block information can be stored in the transaction ranking list information in the form of a block header, or it can be Other types of historical block information are not specifically limited here.
  • the voting node when the voting node determines that there is target data matching the historical block information in its database, it triggers the execution of step 306 to generate a block to be confirmed according to the transaction result.
  • the voting node finds whether the hash value in the historical block information of the block to be confirmed matches the previous block in its own database, if it matches, it means that the block of the voting node and the proposed node are highly consistent.
  • the follow-up consensus process can be executed.
  • the voting node when the voting node determines that there is no target data matching the historical block information in its database, the voting node performs other operations.
  • the voting node can check the block height, if If the block height in the historical block information is higher than the corresponding block height in the own database, the block must be synchronized first; if it is not higher than yourself, then no voting will be performed.
  • the voting node can determine its own database
  • the target data matching the historical block information is also a valid block.
  • Another difference between the multi-signature-based consensus algorithm in this solution and the traditional PBFT algorithm is that the consensus algorithm in this solution requires an additional block to confirm the absolute consistency of the previous block. Due to the loss of messages or other abnormal attacks in the network, a single round of consensus may be inconsistent between different nodes, but for two consecutive blocks that pass the consensus, a consensus is reached in the following block Time can mean that the block before it can be confirmed absolutely consistent in the network, so the security of the consensus algorithm can still be guaranteed.
  • a consensus system for blockchain data in an embodiment of the present application which is applied to a proposed node, and the system includes:
  • the first receiving unit 601 is configured to receive signature information sent by the multiple voting nodes, where the signature information includes the signature of the block to be confirmed by the voting node;
  • the judging unit 602 is configured to judge whether the quantity of the received signature information reaches a preset value
  • the first generating unit 603 is configured to, when the judging unit determines that the quantity of the received signature information reaches a preset value, use the multiple received signature information to aggregate to generate an aggregate signature;
  • the first sending unit 604 is configured to send the aggregate signature to the voting node, so that the block to be confirmed is determined to be valid when the voting node passes the verification of the aggregate signature.
  • the block to be confirmed includes the transaction result, and the system further includes:
  • the second receiving unit 605 is configured to receive transaction information respectively sent by the multiple voting nodes
  • the sorting unit 606 is configured to sort the transaction information to obtain a transaction list
  • the second sending unit 607 is configured to send the transaction list to the voting node, so that after the voting node simulates the execution of the transaction list and obtains the transaction result, the voting node generates an area to be confirmed according to the transaction result Piece.
  • the transaction list includes historical block information
  • the second sending unit 607 is further configured to:
  • the historical block information is sent to the voting node, so that the voting node matches the historical block information.
  • the system further includes:
  • the simulation execution unit 608 is configured to simulate execution of the transaction list to obtain the transaction result
  • the second generating unit 609 is configured to generate a block to be confirmed according to the transaction result, and sign the block to be confirmed to obtain a first signature;
  • the first generating unit 603 is specifically configured to:
  • the signature information further includes the hash value of the block header of the block to be confirmed.
  • the blockchain system includes 3F+1 nodes, the preset value includes 2F, and F is a natural number greater than zero.
  • an embodiment of the present application also provides a consensus system for blockchain data, which is applied to voting nodes, where the voting nodes are nodes in a blockchain system, and the blockchain system also includes a proposal node ,
  • the system includes:
  • the obtaining unit 701 is configured to obtain a block to be confirmed
  • the voting signature unit 702 is configured to sign the block to be confirmed and generate signature information
  • the sending unit 703 is configured to send the signature information to the proposal node
  • the receiving unit 704 is configured to receive an aggregate signature sent by the proposing node, where the aggregate signature is generated by the proposing node after aggregating multiple pieces of signature information;
  • the verification unit 705 is configured to verify the aggregate signature
  • the first determining unit 706 is configured to determine that the block to be confirmed is valid when the aggregated signature is verified.
  • the block to be confirmed includes a transaction result
  • the obtaining unit 701 is specifically configured to:
  • the transaction list includes historical block information
  • the system further includes:
  • the judging unit 707 is configured to use its own database to judge whether there is target data matching the historical block message;
  • the trigger unit 708 is configured to trigger the generation of the block to be confirmed according to the transaction result when the judgment unit determines that there is target data matching the historical block message in its own database.
  • the system further includes:
  • the second determining unit 709 is configured to determine that the target data in the own database is valid after determining that the block to be confirmed is valid.
  • the blockchain system includes 3F+1 nodes, F is a natural number greater than 0, and the verification unit 705 is specifically configured to:
  • the signature information further includes the hash value of the block header of the block to be confirmed.
  • the blockchain data consensus device 1 may be a PC (Personal Computer, personal computer), or a smart phone, a tablet computer, a palmtop computer, a portable computer, or a network storage device terminal device.
  • PC Personal Computer
  • smart phone a tablet computer, a palmtop computer, a portable computer, or a network storage device terminal device.
  • the device 1 may be a node forming a CDN network or a blockchain network.
  • the data consensus device 1 of the blockchain may include a memory 11, a processor 12, and a bus 13.
  • the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc.
  • the memory 11 may be an internal storage unit of the data consensus device 1 of the blockchain, for example, the hard disk of the data consensus device 1 of the blockchain.
  • the memory 11 may also be an external storage device of the data consensus device 1 of the blockchain, for example, a plug-in hard disk equipped on the data consensus device 1 of the blockchain, a smart media card (SMC). ), Secure Digital (SD) card, Flash Card, etc.
  • SMC smart media card
  • SD Secure Digital
  • the memory 11 may also include both an internal storage unit of the data consensus device 1 of the blockchain and an external storage device.
  • the memory 11 can be used not only to store the application software and various data of the data consensus device 1 installed in the blockchain, such as the code of the data consensus program 01 of the blockchain, etc., but also to temporarily store the output or will be output The data.
  • the processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor or other data processing chip in some embodiments, and is used to run the program code or processing stored in the memory 11 Data, such as the implementation of blockchain data consensus program 01, etc.
  • CPU central processing unit
  • controller microcontroller
  • microprocessor or other data processing chip in some embodiments, and is used to run the program code or processing stored in the memory 11 Data, such as the implementation of blockchain data consensus program 01, etc.
  • the bus 13 may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • PCI peripheral component interconnect standard
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, only one thick line is used in FIG. 8 to represent, but it does not mean that there is only one bus or one type of bus.
  • the data consensus device of the blockchain may also include a network interface 14.
  • the network interface 14 may optionally include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the device 1 Establish a communication connection with other electronic devices.
  • the device 1 may also include a user interface.
  • the user interface may include a display (Display) and an input unit such as a keyboard (Keyboard).
  • the optional user interface may also include a standard wired interface and a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light emitting diode) touch device, etc.
  • the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the data consensus device 1 of the blockchain and to display a visualized user interface.
  • FIG. 8 only shows the data consensus device 1 of the blockchain with components 11-14 and the data consensus program 01 of the blockchain.
  • the definition of the block chain data consensus device 1 may include fewer or more components than shown in the figure, or a combination of certain components, or a different component arrangement.
  • the size of the sequence number of each step does not mean the order of execution.
  • the order of execution of each step should be determined by its function and internal logic, and it is not applicable to this application.
  • the implementation process of the embodiment constitutes any limitation.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • each unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of this application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code .

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • Economics (AREA)
  • Signal Processing (AREA)
  • Development Economics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The embodiments of the present application disclose a consensus method for block chain data, comprising: a proposing node receiving signature information sent by a plurality of voting nodes respectively, the signature information comprising signatures of the voting nodes on a block to be confirmed; determining whether the number of pieces of received signature information reaches a preset value; if so, aggregating the plurality of pieces of received signature information to generate an aggregated signature; and sending the aggregated signature to the voting nodes, so that the block to be confirmed is determined to be valid when the verification performed by the voting nodes for the aggregated signature is passed. Also disclosed are a consensus system and device for block chain data. An aggregated signature is generated in the consensus process of block chains, and the signature votes from voting nodes can be aggregated, so that the consensus process of block chains is simplified, thereby reducing the risk of occurrence of network congestion.

Description

一种区块链数据的共识方法及相关设备A consensus method of blockchain data and related equipment 技术领域Technical field
本申请涉及区块链技术,尤其涉及一种区块链数据的共识方法及相关设备。This application relates to blockchain technology, and in particular to a consensus method of blockchain data and related equipment.
背景技术Background technique
区块链作为一种按时间顺序存储数据的数据结构,可支持不同的共识机制。共识机制是区块链技术的重要组件,区块链共识机制的目标是使所有的诚实节点保存一致的区块链视图。As a data structure that stores data in chronological order, blockchain can support different consensus mechanisms. The consensus mechanism is an important component of blockchain technology. The goal of the blockchain consensus mechanism is to make all honest nodes maintain a consistent view of the blockchain.
实用拜占庭容错***(PBFT,Practical Byzantine-Fault-Tolerant)是区块链中较为常用的一种共识算法,即服务作为状态机进行建模,状态机在分布式***的不同节点进行副本复制,每个状态机的副本都保存了服务的状态,同时也实现了服务的操作。Practical Byzantine-Fault-Tolerant (PBFT, Practical Byzantine-Fault-Tolerant) is a commonly used consensus algorithm in the blockchain, that is, the service is modeled as a state machine, and the state machine is replicated at different nodes in the distributed system. Each copy of the state machine saves the state of the service and also realizes the operation of the service.
PBFT算法的流程中,设定参与共识的节点总数为N=3f+1,其中f为潜在的拜占庭(恶意)节点数量,以f=1,即N=4节点为例组成的共识网络,如图1所示。在该流程中,包括请求过程(request)、共识过程和响应过程(reply),其中,共识过程分为pre-prepare、prepare、commit三个阶段,该共识过程具体如下:In the process of the PBFT algorithm, the total number of nodes participating in the consensus is set to N=3f+1, where f is the number of potential Byzantine (malicious) nodes, taking f=1, that is, N=4 nodes as an example of a consensus network, such as As shown in Figure 1. In this process, it includes a request process (request), a consensus process and a response process (reply). The consensus process is divided into three stages: pre-prepare, prepare, and commit. The consensus process is as follows:
从全网节点(节点C、节点0、节点1、节点2、节点3)选举出一个提议节点(节点C),新区块由提议节点负责生成;其它节点把客户端发来的交易向全网广播,提议节点将从网络收集到需放在新区块内的多个交易排序后存入列表,并将该列表向全网广播;其它节点接收到交易列表后,根据排序模拟执行这些交易。所有交易执行完后,基于交易结果计算新区块的哈希摘要,并向全网广播;如果一个节点收到的2f条来自其它节点发来的摘要都和自己的相同,就向全网广播一条commit消息;如果一个节点收到2f+1条commit消息,即可提交新区块及其交易到本地的区块链和状态数据库,即确认新区块为合法区块。A proposal node (node C) is elected from the nodes of the whole network (node C, node 0, node 1, node 2, node 3), and the new block is generated by the proposal node; other nodes send the transaction sent by the client to the whole network Broadcast, the proposed node will collect multiple transactions that need to be placed in the new block from the network and store them in a list, and broadcast the list to the entire network; after receiving the transaction list, other nodes will execute these transactions according to the ranking simulation. After all transactions are executed, calculate the hash digest of the new block based on the transaction result and broadcast it to the entire network; if a node receives 2f digests from other nodes that are the same as its own, then broadcast one to the entire network Commit message; if a node receives 2f+1 commit messages, it can submit the new block and its transactions to the local blockchain and state database, that is, confirm that the new block is a legal block.
在上述流程描述中可以了解到,PBFT算法的通信复杂度较高,对于n个节点组成的区块链共识网络,每一轮共识过程需要O(n^2)次通信。对于同机房 的少数节点组成的网络而言,高通信复杂度所导致的性能问题影响不大,但由于在很多场景下,区块链需要更多的节点参与才能更能体现出公信力和实用价值,因此存在节点数量增长的需求。实验表明,当PBFT算法应用在节点数量大于19的时候,性能会变得明显低下;当节点数量到达31时,共识算法将几乎无法正常工作。It can be understood from the above process description that the communication complexity of the PBFT algorithm is relatively high. For a blockchain consensus network composed of n nodes, each round of consensus process requires O(n^2) communications. For a network composed of a few nodes in the same computer room, the performance problems caused by high communication complexity have little impact, but because in many scenarios, the blockchain needs more nodes to participate in order to better reflect credibility and practical value , So there is a demand for an increase in the number of nodes. Experiments show that when the PBFT algorithm is applied to the number of nodes greater than 19, the performance will become significantly lower; when the number of nodes reaches 31, the consensus algorithm will almost not work properly.
发明内容Summary of the invention
本申请实施例提供了一种区块链数据的共识方法及其相关设备,用于简化区块链的共识过程。The embodiments of the present application provide a consensus method for blockchain data and related equipment to simplify the consensus process of the blockchain.
本申请实施例第一方面提供了一种区块链数据的共识方法,应用于提议节点,所述提议节点为区块链***中的节点,所述区块链***还包括多个投票节点,所述方法包括:The first aspect of the embodiments of the present application provides a consensus method for blockchain data, which is applied to a proposal node, the proposal node is a node in a blockchain system, and the blockchain system further includes a plurality of voting nodes, The method includes:
接收所述多个投票节点分别发送的签名信息,所述签名信息包括所述投票节点对待确认区块的签名;Receiving signature information respectively sent by the multiple voting nodes, where the signature information includes the signature of the block to be confirmed by the voting node;
判断接收到的所述签名信息的数量是否达到预设值;Judging whether the quantity of the received signature information reaches a preset value;
若是,则利用接收到的多个所述签名信息聚合生成聚合签名;If so, use the received multiple pieces of signature information to aggregate to generate an aggregate signature;
将所述聚合签名发送至所述投票节点,以使得当所述投票节点对所述聚合签名通过验证时确定所述待确认区块有效。The aggregate signature is sent to the voting node, so that the block to be confirmed is determined to be valid when the voting node passes verification of the aggregate signature.
可选地,所述待确认区块包括交易结果,在所述接收所述多个投票节点发送的签名信息之前,所述方法还包括:Optionally, the block to be confirmed includes the transaction result, and before the receiving the signature information sent by the multiple voting nodes, the method further includes:
接收所述多个投票节点分别发送的交易信息;Receiving transaction information respectively sent by the multiple voting nodes;
对所述交易信息进行排序,得到交易列表;Sort the transaction information to obtain a transaction list;
将所述交易列表发送至所述投票节点,以使得所述投票节点模拟执行所述交易列表得到交易结果之后,所述投票节点根据所述交易结果生成待确认区块。The transaction list is sent to the voting node, so that after the voting node simulates the execution of the transaction list to obtain a transaction result, the voting node generates a block to be confirmed according to the transaction result.
可选地,所述交易列表包括历史区块信息,将所述交易列表发送至所述投票节点具体还包括:Optionally, the transaction list includes historical block information, and sending the transaction list to the voting node specifically includes:
将所述历史区块信息发送至所述投票节点,以使得所述投票节点对所述历史区块信息进行匹配。The historical block information is sent to the voting node, so that the voting node matches the historical block information.
可选地,在所述利用接收到的多个所述签名信息聚合生成聚合签名之前,所述方法还包括:Optionally, before the aggregating and generating an aggregated signature using the received multiple pieces of signature information, the method further includes:
模拟执行所述交易列表,得到交易结果;Simulate the execution of the transaction list to obtain the transaction result;
根据所述交易结果生成待确认区块,并对所述待确认区块进行签名,得到第一签名;Generate a block to be confirmed according to the transaction result, and sign the block to be confirmed to obtain a first signature;
所述利用接收到的多个所述签名信息聚合生成聚合签名包括:The aggregating and generating an aggregate signature using the received multiple pieces of signature information includes:
将所述第一签名与接收到的多个所述签名信息进行聚合,得到聚合签名。Aggregating the first signature and the multiple pieces of received signature information to obtain an aggregated signature.
可选地,所述签名信息还包括所述待确认区块的区块头的哈希值。Optionally, the signature information further includes the hash value of the block header of the block to be confirmed.
可选地,所述区块链***包括3F+1个节点,所述预设值包括2F,F为大于0的自然数。Optionally, the blockchain system includes 3F+1 nodes, the preset value includes 2F, and F is a natural number greater than zero.
本申请实施例第二方面提供了一种区块链数据的共识方法,应用于投票节点,所述投票节点为区块链***中的节点,所述区块链***还包括提议节点,所述方法包括:The second aspect of the embodiments of the present application provides a consensus method for blockchain data, which is applied to voting nodes, where the voting nodes are nodes in a blockchain system, and the blockchain system further includes a proposal node. Methods include:
获取待确认区块;Get the block to be confirmed;
对所述待确认区块进行签名,生成签名信息;Sign the block to be confirmed to generate signature information;
将所述签名信息发送至所述提议节点;Sending the signature information to the proposing node;
接收所述提议节点发送的聚合签名,所述聚合签名为所述提议节点利用多个所述签名信息聚合后生成的;Receiving an aggregate signature sent by the proposing node, where the aggregate signature is generated by the proposing node after aggregating multiple pieces of signature information;
验证所述聚合签名;Verifying the aggregate signature;
当所述聚合签名通过验证时,确定所述待确认区块有效。When the aggregate signature is verified, it is determined that the block to be confirmed is valid.
可选地,所述待确认区块包括交易结果,所述获取待确认区块包括:Optionally, the block to be confirmed includes a transaction result, and obtaining the block to be confirmed includes:
获取交易信息;Obtain transaction information;
将所述交易信息发送至所述提议节点;Sending the transaction information to the proposal node;
接收所述提议节点发送的交易列表,所述交易列表为所述提议节点对所述交易信息进行排序得到;Receiving a transaction list sent by the proposing node, where the transaction list is obtained by sorting the transaction information by the proposing node;
模拟执行所述交易列表,得到交易结果;Simulate the execution of the transaction list to obtain the transaction result;
根据所述交易结果生成待确认区块。Generate a block to be confirmed according to the transaction result.
可选地,所述交易列表包括历史区块信息,所述方法还包括:Optionally, the transaction list includes historical block information, and the method further includes:
使用自身数据库判断是否存在与所述历史区块消息匹配的目标数据;Use its own database to determine whether there is target data matching the historical block message;
若存在,则触发所述根据所述交易结果生成待确认区块。If it exists, trigger the generation of the block to be confirmed according to the transaction result.
可选地,在确定所述待确认区块有效之后,所述方法还包括:Optionally, after determining that the block to be confirmed is valid, the method further includes:
当确定所述待确认区块有效之后,则确定所述自身数据库中的目标数据有效。After determining that the block to be confirmed is valid, it is determined that the target data in the own database is valid.
可选地,所述区块链***包括3F+1个节点,F为大于0的自然数,所述验证所述聚合签名包括:Optionally, the blockchain system includes 3F+1 nodes, where F is a natural number greater than 0, and the verification of the aggregate signature includes:
验证所述聚合签名中包含签名信息的数量是否大于或等于2F+1;Verifying whether the amount of signature information contained in the aggregate signature is greater than or equal to 2F+1;
若是,则确定所述聚合签名通过验证;If yes, it is determined that the aggregated signature passes verification;
若否,则确定所述聚合签名未通过验证。If not, it is determined that the aggregated signature fails the verification.
可选地,所述签名信息还包括所述待确认区块的区块头的哈希值。Optionally, the signature information further includes the hash value of the block header of the block to be confirmed.
本申请实施例第三方面提供了一种区块链数据的共识装置,所述装置包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的区块链数据的共识程序,所述区块链数据的共识程序被所述处理器执行时实现如前述方法实施例中任一项所述的方法。The third aspect of the embodiments of the present application provides a consensus device for blockchain data. The device includes a memory and a processor. The memory stores a consensus program for blockchain data that can run on the processor. When the consensus program of the blockchain data is executed by the processor, the method described in any one of the foregoing method embodiments is implemented.
可选地,所述装置为区块链网络的节点。Optionally, the device is a node of a blockchain network.
本申请实施例第四方面提供了一种区块链数据的共识***,应用于提议节点,所述提议节点为区块链***中的节点,所述区块链***还包括投票节点,所述***包括:The fourth aspect of the embodiments of the present application provides a consensus system for blockchain data, which is applied to a proposed node. The proposed node is a node in a blockchain system. The blockchain system also includes a voting node. The system includes:
第一接收单元,用于接收所述多个投票节点分别发送的签名信息,所述签名信息包括所述投票节点对待确认区块的签名;The first receiving unit is configured to receive signature information respectively sent by the multiple voting nodes, where the signature information includes the signature of the block to be confirmed by the voting node;
判断单元,用于判断接收到的所述签名信息的数量是否达到预设值;A judging unit for judging whether the quantity of the received signature information reaches a preset value;
第一生成单元,用于当所述判断单元确定接收到的所述签名信息的数量达到预设值时,则利用接收到的多个所述签名信息聚合生成聚合签名;The first generating unit is configured to, when the judging unit determines that the quantity of the received signature information reaches a preset value, use the multiple received signature information to aggregate to generate an aggregate signature;
第一发送单元,用于将所述聚合签名发送至所述投票节点,以使得当所述投票节点对所述聚合签名通过验证时确定所述待确认区块有效。The first sending unit is configured to send the aggregate signature to the voting node, so that the block to be confirmed is determined to be valid when the voting node passes the verification of the aggregate signature.
可选地,所述待确认区块包括交易结果,所述***还包括:Optionally, the block to be confirmed includes the transaction result, and the system further includes:
第二接收单元接收所述多个投票节点分别发送的交易信息;The second receiving unit receives transaction information sent by the multiple voting nodes respectively;
排序单元,用于对所述交易信息进行排序,得到交易列表;The sorting unit is used to sort the transaction information to obtain a transaction list;
第二发送单元,用于将所述交易列表发送至所述投票节点,以使得所述投 票节点模拟执行所述交易列表得到交易结果之后,所述投票节点根据所述交易结果生成待确认区块。The second sending unit is configured to send the transaction list to the voting node, so that after the voting node simulates the execution of the transaction list to obtain a transaction result, the voting node generates a block to be confirmed according to the transaction result .
可选地,所述交易列表包括历史区块信息,所述第二发送单元还用于:Optionally, the transaction list includes historical block information, and the second sending unit is further configured to:
将所述历史区块信息发送至所述投票节点,以使得所述投票节点对所述历史区块信息进行匹配。The historical block information is sent to the voting node, so that the voting node matches the historical block information.
可选地,所述***还包括:Optionally, the system further includes:
模拟执行单元,用于模拟执行所述交易列表,得到交易结果;The simulation execution unit is used to simulate execution of the transaction list to obtain the transaction result;
第二生成单元,用于根据所述交易结果生成待确认区块,并对所述待确认区块进行签名,得到第一签名;The second generating unit is configured to generate a block to be confirmed according to the transaction result, and sign the block to be confirmed to obtain a first signature;
所述第一生成单元具体用于:The first generating unit is specifically configured to:
将所述第一签名与接收到的多个所述签名信息进行聚合,得到聚合签名。Aggregating the first signature and the multiple pieces of received signature information to obtain an aggregated signature.
可选地,所述签名信息还包括所述待确认区块的区块头的哈希值。Optionally, the signature information further includes the hash value of the block header of the block to be confirmed.
可选地,所述区块链***包括3F+1个节点,所述预设值包括2F,F为大于0的自然数。Optionally, the blockchain system includes 3F+1 nodes, the preset value includes 2F, and F is a natural number greater than zero.
本申请实施例第五方面提供了一种区块链数据的共识***,应用于投票节点,所述投票节点为区块链***中的节点,所述区块链***还包括提议节点,所述方法包括:The fifth aspect of the embodiments of the present application provides a consensus system for blockchain data, which is applied to voting nodes. The voting nodes are nodes in a blockchain system. The blockchain system further includes a proposal node. Methods include:
获取单元,用于获取待确认区块;The obtaining unit is used to obtain the block to be confirmed;
投票签名单元,用于对所述待确认区块进行签名,生成签名信息;The voting signature unit is used to sign the block to be confirmed and generate signature information;
发送单元,用于将所述签名信息发送至所述提议节点;A sending unit, configured to send the signature information to the proposal node;
接收单元,用于接收所述提议节点发送的聚合签名,所述聚合签名为所述提议节点利用多个所述签名信息聚合后生成的;A receiving unit, configured to receive an aggregate signature sent by the proposing node, where the aggregate signature is generated by the proposing node after aggregating multiple pieces of signature information;
验证单元,用于验证所述聚合签名;A verification unit for verifying the aggregate signature;
第一确定单元,用于当所述聚合签名通过验证时,确定所述待确认区块有效。The first determining unit is configured to determine that the block to be confirmed is valid when the aggregate signature is verified.
可选地,所述待确认区块包括交易结果,所述获取单元具体用于:Optionally, the block to be confirmed includes a transaction result, and the obtaining unit is specifically configured to:
获取交易信息;Obtain transaction information;
将所述交易信息发送至所述提议节点;Sending the transaction information to the proposal node;
接收所述提议节点发送的交易列表,所述交易列表为所述提议节点对所述 交易信息进行排序得到;Receiving a transaction list sent by the proposing node, where the transaction list is obtained by sorting the transaction information by the proposing node;
模拟执行所述交易列表,得到交易结果;Simulate the execution of the transaction list to obtain the transaction result;
根据所述交易结果生成待确认区块。Generate a block to be confirmed according to the transaction result.
可选地,所述交易列表包括历史区块信息,所述***还包括:Optionally, the transaction list includes historical block information, and the system further includes:
判断单元,用于使用自身数据库判断是否存在与所述历史区块消息匹配的目标数据;The judging unit is configured to use its own database to judge whether there is target data matching the historical block message;
触发单元,用于当所述判断单元确定自身数据库中存在与所述历史区块消息匹配的目标数据,则触发所述根据所述交易结果生成待确认区块。The trigger unit is configured to trigger the generation of the block to be confirmed according to the transaction result when the judgment unit determines that there is target data matching the historical block message in its own database.
可选地,在确定所述待确认区块有效之后,所述***还包括:Optionally, after determining that the block to be confirmed is valid, the system further includes:
第二确定单元,用于当确定所述待确认区块有效之后,则确定所述自身数据库中的目标数据有效。The second determining unit is configured to determine that the target data in the own database is valid after determining that the block to be confirmed is valid.
可选地,所述区块链***包括3F+1个节点,F为大于0的自然数,所述验证单元具体用于:Optionally, the blockchain system includes 3F+1 nodes, F is a natural number greater than 0, and the verification unit is specifically configured to:
验证所述聚合签名中包含签名信息的数量是否大于或等于2F+1;Verifying whether the amount of signature information contained in the aggregate signature is greater than or equal to 2F+1;
若是,则确定所述聚合签名通过验证;If yes, it is determined that the aggregated signature passes verification;
若否,则确定所述聚合签名未通过验证。If not, it is determined that the aggregated signature fails the verification.
可选地,所述签名信息还包括所述待确认区块的区块头的哈希值。Optionally, the signature information further includes the hash value of the block header of the block to be confirmed.
本申请实施例第六方面提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有区块链数据的共识程序,所述区块链数据的共识程序可被一个或者多个处理器执行,以实现如前述方法实施例中任一项所述的区块链数据的共识方法。The sixth aspect of the embodiments of the present application provides a computer-readable storage medium. The computer-readable storage medium stores a consensus program for blockchain data. The consensus program for blockchain data can be configured by one or more The processor executes to implement the blockchain data consensus method according to any one of the foregoing method embodiments.
从以上技术方案可以看出,本申请实施例具有以下优点:接收所述多个投票节点分别发送的签名信息,所述签名信息包括所述投票节点对待确认区块的签名;判断接收到的所述签名信息的数量是否达到预设值;若是,则利用接收到的多个所述签名信息聚合生成聚合签名;将所述聚合签名发送至所述投票节点,以使得当所述投票节点对所述聚合签名通过验证时确定所述待确认区块有效。因此,在区块链的共识过程中生成聚合签名,可以将来自各个投票节点的签名投票进行聚合,简化区块链的共识过程,可以对更多的数据进行共识,从而降低网络中发生阻塞的风险。It can be seen from the above technical solutions that the embodiments of this application have the following advantages: receiving signature information respectively sent by the multiple voting nodes, where the signature information includes the signature of the block to be confirmed by the voting node; judging all received Whether the amount of the signature information reaches a preset value; if so, use the received multiple signature information to aggregate to generate an aggregate signature; send the aggregate signature to the voting node, so that when the voting node When the aggregate signature is verified, it is determined that the block to be confirmed is valid. Therefore, generating aggregated signatures in the consensus process of the blockchain can aggregate the signature votes from various voting nodes, simplify the consensus process of the blockchain, and achieve consensus on more data, thereby reducing congestion in the network. risk.
附图说明Description of the drawings
图1为现有技术中区块链数据的共识方法的一个实施例;Figure 1 is an embodiment of a consensus method for blockchain data in the prior art;
图2为本申请实施例中一种区块链数据的共识方法实施例的一个示意图;FIG. 2 is a schematic diagram of an embodiment of a consensus method for blockchain data in an embodiment of the application;
图3为本申请实施例中一种区块链数据的共识方法实施例的另一个示意图;3 is another schematic diagram of an embodiment of a consensus method for blockchain data in an embodiment of the application;
图3-1为本申请实施例中一种区块链数据的共识方法实施例的另一个示意图;Figure 3-1 is another schematic diagram of an embodiment of a blockchain data consensus method in an embodiment of the application;
图4为本申请实施例中一种区块链数据的共识方法实施例的另一个示意图;4 is another schematic diagram of an embodiment of a consensus method for blockchain data in an embodiment of the application;
图5为本申请实施例中一种区块链数据的共识方法实施例的另一个示意图;FIG. 5 is another schematic diagram of an embodiment of a blockchain data consensus method in an embodiment of the application;
图6为本申请实施例中一种区块链数据的共识***实施例的一个示意图;Fig. 6 is a schematic diagram of an embodiment of a consensus system for blockchain data in an embodiment of the application;
图7为本申请实施例中一种区块链数据的共识***实施例的另一个示意图;FIG. 7 is another schematic diagram of an embodiment of a consensus system for blockchain data in an embodiment of the application;
图8为本申请实施例中一种区块链数据的共识***实施例的一个示意图。FIG. 8 is a schematic diagram of an embodiment of a consensus system for blockchain data in an embodiment of the application.
具体实施方式Detailed ways
下本申请实施例提供了一种区块链数据的共识方法及其相关设备,用于简化区块链的共识过程。The following embodiments of the present application provide a blockchain data consensus method and related equipment for simplifying the blockchain consensus process.
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。In order to enable those skilled in the art to better understand the solution of the application, the technical solutions in the embodiments of the application will be clearly and completely described below in conjunction with the drawings in the embodiments of the application. Obviously, the described embodiments are only It is a part of the embodiments of this application, not all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work should fall within the protection scope of this application.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以 及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、***、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe specific Order or precedence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments described herein can be implemented in an order other than the content illustrated or described herein. In addition, the terms "including" and "having" and any variations of them are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to the clearly listed Those steps or units may include other steps or units that are not clearly listed or are inherent to these processes, methods, products, or equipment.
在现有技术中,实用拜占庭容错***(PBFT,Practical Byzantine-Fault-Tolerant)是区块链中较为常用的一种共识算法,即服务作为状态机进行建模,状态机在分布式***的不同节点进行副本复制,每个状态机的副本都保存了服务的状态,同时也实现了服务的操作。PBFT算法的流程中,设定参与共识的节点总数为N=3f+1,其中f为潜在的拜占庭(恶意)节点数量,以f=1,即N=4节点为例组成的共识网络,如图1所示。在该流程中,包括请求过程(request)、共识过程和响应过程(reply),其中,共识过程分为pre-prepare、prepare、commit三个阶段,该共识过程具体如下:从全网节点(节点C、节点0、节点1、节点2、节点3)选举出一个提议节点(节点C),新区块由提议节点负责生成;其它节点把客户端发来的交易向全网广播,提议节点将从网络收集到需放在新区块内的多个交易排序后存入列表,并将该列表向全网广播;其它节点接收到交易列表后,根据排序模拟执行这些交易。所有交易执行完后,基于交易结果计算新区块的哈希摘要,并向全网广播;如果一个节点收到的2f条来自其它节点发来的摘要都和自己的相同,就向全网广播一条commit消息;如果一个节点收到2f+1条commit消息,即可提交新区块及其交易到本地的区块链和状态数据库,即确认新区块为合法区块。在上述流程描述中可以了解到,PBFT算法的通信复杂度较高,对于n个节点组成的区块链共识网络,每一轮共识过程需要O(n^2)次通信。对于同机房的少数节点组成的网络而言,高通信复杂度所导致的性能问题影响不大,但由于在很多场景下,区块链需要更多的节点参与才能更能体现出公信力和实用价值,因此存在节点数量增长的需求。实验表明,当PBFT算法应用在节点数量大于19的时候,性能会变得明显低下;当节点数量到达31时,共识算法将几乎无法正常工作。为此,本申请实施例提供了一种区块链数据的共识方法及其相关设备,用于简化区块链的共识过程。In the prior art, Practical Byzantine-Fault-Tolerant (PBFT, Practical Byzantine-Fault-Tolerant) is a commonly used consensus algorithm in the blockchain, that is, the service is modeled as a state machine, which is different in distributed systems. The node performs copy replication, and each copy of the state machine saves the state of the service and also realizes the operation of the service. In the process of the PBFT algorithm, the total number of nodes participating in the consensus is set to N=3f+1, where f is the number of potential Byzantine (malicious) nodes, taking f=1, that is, N=4 nodes as an example of a consensus network, such as As shown in Figure 1. In this process, it includes a request process (request), a consensus process and a response process (reply). The consensus process is divided into three stages: pre-prepare, prepare, and commit. The consensus process is as follows: C. Node 0, node 1, node 2, node 3) elect a proposal node (node C), the new block is generated by the proposal node; other nodes will broadcast the transaction sent by the client to the whole network, and the proposal node will The network collects multiple transactions that need to be placed in the new block and stores them in a list, and broadcasts the list to the entire network; after other nodes receive the transaction list, they execute these transactions according to the sorting simulation. After all transactions are executed, calculate the hash digest of the new block based on the transaction result and broadcast it to the entire network; if a node receives 2f digests from other nodes that are the same as its own, then broadcast one to the entire network Commit message; if a node receives 2f+1 commit messages, it can submit the new block and its transactions to the local blockchain and state database, that is, confirm that the new block is a legal block. It can be understood from the above process description that the communication complexity of the PBFT algorithm is relatively high. For a blockchain consensus network composed of n nodes, each round of consensus process requires O(n^2) communications. For a network composed of a few nodes in the same computer room, the performance problems caused by high communication complexity have little impact, but because in many scenarios, the blockchain needs more nodes to participate in order to better reflect credibility and practical value , So there is a demand for the number of nodes to grow. Experiments show that when the PBFT algorithm is applied to the number of nodes greater than 19, the performance will become significantly lower; when the number of nodes reaches 31, the consensus algorithm will almost not work properly. To this end, the embodiments of the present application provide a blockchain data consensus method and related equipment to simplify the blockchain consensus process.
为了便于理解,下面对本申请实施例中的具体流程进行描述,请参阅图2, 本申请实施例中一种区块链数据的共识方法的一个实施例包括:For ease of understanding, the following describes the specific process in the embodiment of the present application. Please refer to FIG. 2. An embodiment of a blockchain data consensus method in the embodiment of the present application includes:
201、投票节点获取待确认区块;201. The voting node obtains the block to be confirmed;
本实施例中,投票节点获取待确认区块。In this embodiment, the voting node obtains the block to be confirmed.
在一个区块生成周期中,区块链***中的众多节点将通过特定的算法选择出提议节点(Proposer)和投票节点(Validators,也称为验证人节点),即在区块链中参与共识的角色包括两类:提议节点与投票节点,提议节点负责收集交易、打包区块和验证投票信息;投票节点负责验证区块和给有效的区块进行投票。本步骤中,投票节点可以通过区块链***中获取得到提议节点发送给该投票节点的待确认区块,也可以是接收提议节点发送的待确认消息进一步生成待确认区块,还可以是其他的获取方式,具体此处不做限定。In a block generation cycle, many nodes in the blockchain system will select proposal nodes (Proposer) and voting nodes (Validators, also known as validators) through specific algorithms, that is, participate in consensus in the blockchain There are two types of roles: the proposal node and the voting node. The proposal node is responsible for collecting transactions, packaging blocks and verifying voting information; the voting node is responsible for verifying blocks and voting for valid blocks. In this step, the voting node can obtain the block to be confirmed sent by the proposal node to the voting node through the blockchain system, or it can receive the message to be confirmed sent by the proposal node to further generate the block to be confirmed, or other The method of obtaining is not limited here.
202、投票节点对待确认区块进行投票;202. The voting node votes for the block to be confirmed;
本实施例中,投票节点可以使用聚合签名算法对待确认区块进行投票签名,得到签名信息。In this embodiment, the voting node can use the aggregate signature algorithm to vote and sign the block to be confirmed to obtain signature information.
具体的,该投票节点可以对该投票信息进行合法性验证,当该投票节点确定该投票信息通过合法性验证的时候,则该投票节点使用聚合签名算法对待确认区块进行投票签名,得到签名信息。Specifically, the voting node can verify the legality of the voting information. When the voting node determines that the voting information passes the legality verification, the voting node uses the aggregate signature algorithm to vote and sign the block to be confirmed to obtain the signature information .
此外,在本方案的实际应用过程中,可以使用常用的聚合签名算法参与其中,例如EC-Schnorr多重签名算法、BLS签名算法、Gamma签名算法或者是其他的聚合签名算法参与其中,此处不做限定。In addition, in the actual application process of this scheme, you can use common aggregate signature algorithms to participate in it, such as EC-Schnorr multi-signature algorithm, BLS signature algorithm, Gamma signature algorithm, or other aggregate signature algorithms. limited.
203、投票节点向提议节点发送签名信息;203. The voting node sends signature information to the proposing node;
本实施例中,投票节点在步骤202得到签名信息之后,将该签名信息发送至提议节点,以使得该提议节点得知该投票节点对该待确认区块进行投票,即得知该投票节点认可该待确认区块。In this embodiment, after obtaining the signature information in step 202, the voting node sends the signature information to the proposing node, so that the proposing node knows that the voting node has voted on the block to be confirmed, that is, knows that the voting node approves The block to be confirmed.
具体在方案的实施过程中,该签名信息还可以包括待确认区块的区块头的哈希值,其中,待确认区块的区块头的哈希值用于标识该签名信息对应的区块信息,即标识该签名信息与该待确认区块存在对应关系。Specifically, during the implementation of the solution, the signature information may also include the hash value of the block header of the block to be confirmed, where the hash value of the block header of the block to be confirmed is used to identify the block information corresponding to the signature information , That is, it indicates that the signature information has a corresponding relationship with the block to be confirmed.
204、提议节点判断是否达到预设值;204. The proposing node judges whether the preset value is reached;
本实施例中,提议节点判断接收到的所述签名信息的数量是否达到预设值,若是,则执行步骤205,若否,则执行步骤208。In this embodiment, the proposing node judges whether the quantity of the received signature information reaches a preset value, if so, execute step 205, and if not, execute step 208.
具体的,提议节点可以判断在预设时间段内接收到的该签名信息的数量是否达到预设值。Specifically, the proposing node can determine whether the number of signature information received within a preset time period reaches a preset value.
作为一个优选实施例,在这里可以引入PBFT算法的验证机制,即此处提议节点也可以作为投票节点进行参与投票,也可以不参与投票。具体判断过程可以借鉴PBFT算法的认证模式,即该区块链***中一共包括3F+1个节点,F为大于0的自然数以该提议节点参与投票为例,此时本步骤中的预设值为2F,即该提议节点在预设时间段内若接收到2F个节点确定对该待确认区块的签名信息时,即确定签名信息的数量达到预设值,则执行步骤205,若否,则执行步骤208。As a preferred embodiment, a verification mechanism of the PBFT algorithm can be introduced here, that is, the proposed node can also be used as a voting node to participate in voting, or not to participate in voting. The specific judgment process can refer to the authentication mode of the PBFT algorithm, that is, the blockchain system includes a total of 3F+1 nodes, and F is a natural number greater than 0. Take the proposed node to participate in voting as an example. At this time, the default value in this step is 2F, that is, if the proposal node receives 2F nodes within the preset time period to determine the signature information for the block to be confirmed, that is, it is determined that the number of signature information reaches the preset value, then step 205 is executed, if not, Step 208 is executed.
205、若是,则提议节点将签名信息进行聚合;205. If yes, propose that the node aggregate the signature information;
本实施例中,当提议节点在步骤204中确定接收到的所述签名信息的数量达到预设值时,则将该签名信息使用聚合签名算法进行聚合。In this embodiment, when the proposing node determines in step 204 that the quantity of the received signature information reaches a preset value, the signature information is aggregated using an aggregation signature algorithm.
具体的,本步骤与前述步骤202类似,不对聚合签名算法进行限制。具体在方案的执行过程中,可以以EC-Schnorr签名算法为例进行说明,请参阅图5中描述的EC-Schnorr算法实现流程,用户之间的交互可以抽象为4个步骤。第一步,签名节点发送承诺(Commitment)给聚合节点,如图中①所示;第二步,聚合节点发送挑战(Challenge)给签名节点,如图中②所示;第三步,签名节点根据挑战生成回应(Response),如图中③所示;第四步,聚合节点根据签名节点的承诺及回应生成聚合签名,并且广播聚合签名给所有的签名验证节点,如图中④所示。聚合节点与签名节点之间的多次交互是为了确保每个签名节点是签名所对应公钥的拥有者,防止签名节点作恶。Specifically, this step is similar to the aforementioned step 202, and does not limit the aggregation signature algorithm. In the execution of the scheme, the EC-Schnorr signature algorithm can be taken as an example for description. Please refer to the implementation process of the EC-Schnorr algorithm described in Figure 5. The interaction between users can be abstracted into 4 steps. In the first step, the signing node sends a Commitment to the aggregation node, as shown in ① in the figure; in the second step, the aggregation node sends a challenge to the signing node, as shown in ② in the figure; the third step, the signing node According to the challenge, a response (Response) is generated, as shown in Figure ③; in the fourth step, the aggregation node generates an aggregate signature according to the commitment and response of the signature node, and broadcasts the aggregate signature to all signature verification nodes, as shown in Figure ④. The multiple interactions between the aggregation node and the signature node are to ensure that each signature node is the owner of the public key corresponding to the signature and prevent the signature node from doing evil.
206、提议节点发送聚合签名至投票节点;206. The proposing node sends the aggregate signature to the voting node;
本实施例中,提议节点在步骤205得到该聚合签名之后,将该聚合签名发送至投票节点。In this embodiment, after obtaining the aggregate signature in step 205, the proposing node sends the aggregate signature to the voting node.
207、投票节点确定聚合签名有效;207. The voting node determines that the aggregate signature is valid;
本实施例中,当投票节点确定该聚合签名通过合法性验证时,则确定所述待确认区块有效。In this embodiment, when the voting node determines that the aggregated signature passes the legality verification, it is determined that the block to be confirmed is valid.
具体的,此处仍以PBFT为例,当该投票节点收到该聚合签名之后,并验证此聚合签名包含针对当前区块的来自2F+1个节点的合法多重签名,即可认 定该待确认区块有效,后续可以提交新区块及其交易到本地的区块链、更新状态数据库或者将该带投票信息添加入交易池排队等待交易等,具体此处不做限定。Specifically, here is still taking PBFT as an example. When the voting node receives the aggregated signature and verifies that the aggregated signature contains legal multi-signatures from 2F+1 nodes for the current block, it can be determined to be confirmed The block is valid, and you can subsequently submit a new block and its transaction to the local blockchain, update the status database, or add the voting information to the transaction pool to wait for the transaction, etc. The specifics are not limited here.
208、若否,则提议节点执行其他操作。208. If not, propose the node to perform other operations.
本实施例中,当该提议节点在步骤204中确定接收到的所述签名信息的数量未达到预设值时,则执行其他操作,即确定该待确认区块未获得区块链***的认可,则该提议节点不执行根据签名信息生成聚合签名的步骤,可直接将该待确认区块进行丢弃,或者是重新提交等待下一轮询过程,还可以是其他的操作,具体此处不做限定。In this embodiment, when the proposing node determines in step 204 that the quantity of the received signature information does not reach the preset value, other operations are performed, that is, it is determined that the block to be confirmed has not been approved by the blockchain system , The proposing node does not perform the step of generating an aggregated signature based on the signature information, and can directly discard the block to be confirmed, or resubmit and wait for the next polling process, or other operations, which are not specifically done here limited.
本实施例中,提议节点接收所述多个投票节点分别发送的签名信息,所述签名信息包括所述投票节点对待确认区块的签名;判断接收到的所述签名信息的数量是否达到预设值;若是,则利用接收到的多个所述签名信息聚合生成聚合签名;将所述聚合签名发送至所述投票节点,以使得当所述投票节点对所述聚合签名通过验证时确定所述待确认区块有效。因此,在区块链的共识过程中生成聚合签名,可以将来自各个投票节点的签名投票进行聚合,简化区块链的共识过程,可以对更多的数据进行共识,从而降低网络中发生阻塞的风险。In this embodiment, the proposing node receives the signature information sent by the multiple voting nodes, the signature information includes the signature of the block to be confirmed by the voting node; it is judged whether the amount of the received signature information reaches a preset value Value; if so, use the multiple received signature information to aggregate to generate an aggregate signature; send the aggregate signature to the voting node, so that when the voting node passes the verification of the aggregate signature, it is determined that the The block to be confirmed is valid. Therefore, generating aggregated signatures in the consensus process of the blockchain can aggregate the signature votes from various voting nodes, simplify the consensus process of the blockchain, and achieve consensus on more data, thereby reducing congestion in the network. risk.
具体可参阅图4的共识流程,从全网节点选举出一个提议节点,新区块由提议节点负责生成。图中节点0为提议节点,其他节点为投票节点。For details, please refer to the consensus process in Figure 4. A proposal node is elected from the nodes of the entire network, and the new block is generated by the proposal node. In the figure, node 0 is a proposal node, and other nodes are voting nodes.
投票节点把客户端发来的交易向全网广播,提议节点将从网络收集到需放在新区块内的多个交易排序后存入列表,并将该列表向全网广播。投票节点接收到交易列表后,根据排序模拟执行这些交易。所有交易执行完后,用自己的私钥对待确认的区块进行签名,然后将签名返回给提议节点。提议节点验证接收到的区块投票签名,如果提议节点收到超过2f个节点的合法签名,则通过多重签名聚合算法,连同自己对区块的签名一起,将签名聚合生成一个多重签名。如果一个节点收到多重签名消息,并验证此多重签名消息包含针对当前区块的来自2f+1个节点的合法多重签名,即可提交新区块及其交易到本地的区块链和状态数据库。The voting node broadcasts the transaction sent by the client to the entire network. The proposed node will collect multiple transactions that need to be placed in the new block from the network and store it in a list, and broadcast the list to the entire network. After the voting node receives the transaction list, it executes these transactions according to the ranking simulation. After all transactions are executed, use your private key to sign the block to be confirmed, and then return the signature to the proposing node. The proposing node verifies the received block voting signatures. If the proposing node receives legal signatures from more than 2f nodes, it will use the multi-signature aggregation algorithm to aggregate the signatures together with its own signature on the block to generate a multi-signature. If a node receives a multi-signature message and verifies that this multi-signature message contains legal multi-signatures from 2f+1 nodes for the current block, it can submit the new block and its transactions to the local blockchain and state database.
本申请实施例中,基于图2所述实施例,具体在步骤201投票节点获取待确认区块的过程可以是通过提议节点来实现。下面请参阅图3,本申请实施例 一种区块链数据的共识方法的另一个实施例中,基于图2所述实施例,具体在步骤201的执行过程可以包括:In the embodiment of the present application, based on the embodiment described in FIG. 2, the process of obtaining the block to be confirmed by the voting node in step 201 may be implemented by the proposal node. Please refer to Figure 3 below. In another embodiment of a blockchain data consensus method in an embodiment of the present application, based on the embodiment described in Figure 2, the specific execution process of step 201 may include:
301、投票节点获取交易信息;301. Voting nodes obtain transaction information;
本实施例中,投票节点获取交易信息,即各个投票节点获取自身客户端所生成的交易信息。In this embodiment, the voting nodes obtain transaction information, that is, each voting node obtains transaction information generated by its own client.
302、投票节点向提议节点发送交易信息;302. The voting node sends transaction information to the proposal node;
本实施例中,各个投票节点将获取得到的交易信息发送至提议节点,例如,各个投票节点可以通过区块链网络广播的形式进行发送,也可以是直接点对点发送模式进行发送,具体此处不做限定。In this embodiment, each voting node sends the obtained transaction information to the proposal node. For example, each voting node can send it in the form of a blockchain network broadcast, or it can be sent in a direct point-to-point sending mode. Make a limit.
303、提议节点对该交易信息进行排序;303. The proposal node sorts the transaction information;
本实施例中,提议节点对在步骤302收集到的交易信息进行排序,得到交易列表。In this embodiment, the proposing node sorts the transaction information collected in step 302 to obtain a transaction list.
作为一个优选实施例,具体在图3对应实施例中引入交易列表之后,步骤205中,当提议节点在步骤204中确定接收到的所述签名信息的数量达到预设值时,则将该签名信息使用聚合签名算法进行聚合,得到聚合签名的过程具体可以将该交易列表引入聚合签名中。As a preferred embodiment, specifically after introducing the transaction list in the embodiment corresponding to FIG. 3, in step 205, when the proposing node determines in step 204 that the quantity of the received signature information reaches the preset value, the signature Information is aggregated using an aggregate signature algorithm, and the process of obtaining an aggregate signature can specifically incorporate the transaction list into the aggregate signature.
具体地,该提议节点模拟执行所述交易列表,得到交易结果;根据所述交易结果生成待确认区块之后,该提议节点对所述待确认区块进行签名,得到第一签名,从而,步骤204中利用接收到的多个所述签名信息聚合生成聚合签名具体包括:将该提议节点的第一签名与步骤203接收到的多个签名信息进行聚合,得到聚合签名。Specifically, the proposing node simulates the execution of the transaction list to obtain the transaction result; after generating the block to be confirmed according to the transaction result, the proposing node signs the block to be confirmed to obtain the first signature, so that the step Aggregating and generating an aggregate signature by using the plurality of received signature information in 204 specifically includes: aggregating the first signature of the proposing node with the multiple signature information received in step 203 to obtain the aggregate signature.
304、提议节点向投票节点发送交易列表;304. The proposing node sends a transaction list to the voting node;
本实施例中,提议节点向投票节点发送步骤303生成的交易列表。In this embodiment, the proposing node sends the transaction list generated in step 303 to the voting node.
305、投票节点模拟执行交易;305. The voting node simulates the execution of the transaction;
本实施例中,投票节点按照标准流程模拟执行该交易列表,生成交易结果。In this embodiment, the voting node simulates the execution of the transaction list according to the standard process, and generates the transaction result.
306、投票节点生成待确认区块。306. The voting node generates a block to be confirmed.
本实施例中,投票节点根据步骤305得到的交易结果生成待确认区块。In this embodiment, the voting node generates a block to be confirmed according to the transaction result obtained in step 305.
举例来说,待确认区块可以是待确认的区块,该区块中包含上述交易列表中的全部交易;For example, the block to be confirmed may be a block to be confirmed, and the block contains all the transactions in the above transaction list;
本实施例中,具体在方案的执行过程中,投票节点在步骤304获取得到的交易排序列表还包括历史区块信息,还可以增加对步骤305的执行前提条件的判断步骤,下面请参阅图3-1,具体增加的步骤包括:In this embodiment, specifically during the execution of the solution, the transaction ranking list obtained by the voting node in step 304 also includes historical block information, and a judgment step for the execution preconditions of step 305 can also be added. Please refer to Figure 3 below. -1, the specific additional steps include:
307、使用自身数据库判断是否存在与所述历史区块消息匹配的目标数据;307. Use its own database to determine whether there is target data matching the historical block message;
本实施例中,该投票节点使用自身数据库判断历史区块消息是否存在与所述历史区块消息匹配的目标数据,若是,则执行步骤308,若否,则执行步骤309。In this embodiment, the voting node uses its own database to determine whether the historical block message has target data that matches the historical block message, if yes, execute step 308, and if not, execute step 309.
具体的,该历史区块信息可以为历史区块的全部信息,也可以是历史区块全部信息的哈希值,作为一个优选方案,为了节省网络资源,该历史区块信息还可以是该提议节点数据库中最新n(n为大于0的整数)个区块的哈希值,作为一个优选方案,该历史区块信息可以以区块头的形式存在加载在该交易排序列表信息中,还可以是其他类型的历史区块信息,具体此处不做限定。Specifically, the historical block information can be all the information of the historical block or the hash value of all the information of the historical block. As a preferred solution, in order to save network resources, the historical block information can also be the proposal The hash value of the latest n (n is an integer greater than 0) blocks in the node database. As a preferred solution, the historical block information can be stored in the transaction ranking list information in the form of a block header, or it can be Other types of historical block information are not specifically limited here.
308、若存在,则触发所述根据所述交易结果生成待确认区块。308. If it exists, trigger the generation of the block to be confirmed according to the transaction result.
本实施例中,当投票节点确定自身数据库中存在与所述历史区块信息匹配的目标数据时,则触发执行步骤306根据所述交易结果生成待确认区块。In this embodiment, when the voting node determines that there is target data matching the historical block information in its database, it triggers the execution of step 306 to generate a block to be confirmed according to the transaction result.
具体的,如果投票节点发现待确认区块的历史区块信息中的哈希值与自身数据库中之前的区块是否匹配,若匹配,则说明该投票节点与该提议节点的区块高度一致,可以执行后续的共识流程。Specifically, if the voting node finds whether the hash value in the historical block information of the block to be confirmed matches the previous block in its own database, if it matches, it means that the block of the voting node and the proposed node are highly consistent. The follow-up consensus process can be executed.
309、若不存在,则执行其他操作。309. If it does not exist, perform other operations.
本实施例中,当该投票节点确定自身数据库中不存在与所述历史区块信息匹配的目标数据时,则该投票节点执行其他操作,示例性地,该投票节点可以检查区块高度,如果历史区块信息中的区块高度高于自身数据库中对应的区块高度,那么首先要同步区块;如果不高于自己,那么就不会进行投票。In this embodiment, when the voting node determines that there is no target data matching the historical block information in its database, the voting node performs other operations. Illustratively, the voting node can check the block height, if If the block height in the historical block information is higher than the corresponding block height in the own database, the block must be synchronized first; if it is not higher than yourself, then no voting will be performed.
本申请实施例中,基于图3-1所述实施例,具体在步骤207确定所述待确认区块有效之后,则确定所述自身数据库中的目标数据有效,即该投票节点可以确定自身数据库中与历史区块信息匹配的目标数据也是有效区块。In the embodiment of this application, based on the embodiment described in Fig. 3-1, specifically after the block to be confirmed is determined to be valid in step 207, it is determined that the target data in the own database is valid, that is, the voting node can determine its own database The target data matching the historical block information is also a valid block.
本方案中基于多重签名的共识算法与传统的PBFT算法不同的另一个点在于本方案的共识算法需要一个额外的区块确认前一个区块的绝对一致性。由于网络中消息有丢失或其他异常攻击的情况,单一一轮的共识存在在不同节点 之间存在不一致的可能,但对于连续的两个通过共识的区块,在后面的区块达成共识的时候就可以意味着在它之前的区块可以在网络中确认绝对一致,因此共识算法的安全性依然可以得到保证。Another difference between the multi-signature-based consensus algorithm in this solution and the traditional PBFT algorithm is that the consensus algorithm in this solution requires an additional block to confirm the absolute consistency of the previous block. Due to the loss of messages or other abnormal attacks in the network, a single round of consensus may be inconsistent between different nodes, but for two consecutive blocks that pass the consensus, a consensus is reached in the following block Time can mean that the block before it can be confirmed absolutely consistent in the network, so the security of the consensus algorithm can still be guaranteed.
上面从方法部分对本申请实施例进行了介绍,下面从虚拟装置的角度对本申请进行说明。The embodiments of the present application are described above from the method part, and the present application is described below from the perspective of a virtual device.
请参阅图6,本申请实施例中一种区块链数据的共识***,应用于提议节点,该***包括:Please refer to FIG. 6, a consensus system for blockchain data in an embodiment of the present application, which is applied to a proposed node, and the system includes:
第一接收单元601,用于接收所述多个投票节点分别发送的签名信息,所述签名信息包括所述投票节点对待确认区块的签名;The first receiving unit 601 is configured to receive signature information sent by the multiple voting nodes, where the signature information includes the signature of the block to be confirmed by the voting node;
判断单元602,用于判断接收到的所述签名信息的数量是否达到预设值;The judging unit 602 is configured to judge whether the quantity of the received signature information reaches a preset value;
第一生成单元603,用于当所述判断单元确定接收到的所述签名信息的数量达到预设值时,则利用接收到的多个所述签名信息聚合生成聚合签名;The first generating unit 603 is configured to, when the judging unit determines that the quantity of the received signature information reaches a preset value, use the multiple received signature information to aggregate to generate an aggregate signature;
第一发送单元604,用于将所述聚合签名发送至所述投票节点,以使得当所述投票节点对所述聚合签名通过验证时确定所述待确认区块有效。The first sending unit 604 is configured to send the aggregate signature to the voting node, so that the block to be confirmed is determined to be valid when the voting node passes the verification of the aggregate signature.
作为一个优选方案,所述待确认区块包括交易结果,所述***还包括:As a preferred solution, the block to be confirmed includes the transaction result, and the system further includes:
第二接收单元605,用于接收所述多个投票节点分别发送的交易信息;The second receiving unit 605 is configured to receive transaction information respectively sent by the multiple voting nodes;
排序单元606,用于对所述交易信息进行排序,得到交易列表;The sorting unit 606 is configured to sort the transaction information to obtain a transaction list;
第二发送单元607,用于将所述交易列表发送至所述投票节点,以使得所述投票节点模拟执行所述交易列表得到交易结果之后,所述投票节点根据所述交易结果生成待确认区块。The second sending unit 607 is configured to send the transaction list to the voting node, so that after the voting node simulates the execution of the transaction list and obtains the transaction result, the voting node generates an area to be confirmed according to the transaction result Piece.
作为一个优选方案,所述交易列表包括历史区块信息,所述第二发送单元607还用于:As a preferred solution, the transaction list includes historical block information, and the second sending unit 607 is further configured to:
将所述历史区块信息发送至所述投票节点,以使得所述投票节点对所述历史区块信息进行匹配。The historical block information is sent to the voting node, so that the voting node matches the historical block information.
作为一个优选方案,所述***还包括:As a preferred solution, the system further includes:
模拟执行单元608,用于模拟执行所述交易列表,得到交易结果;The simulation execution unit 608 is configured to simulate execution of the transaction list to obtain the transaction result;
第二生成单元609,用于根据所述交易结果生成待确认区块,并对所述待确认区块进行签名,得到第一签名;The second generating unit 609 is configured to generate a block to be confirmed according to the transaction result, and sign the block to be confirmed to obtain a first signature;
所述第一生成单元603具体用于:The first generating unit 603 is specifically configured to:
将所述第一签名与接收到的多个所述签名信息进行聚合,得到聚合签名。Aggregating the first signature and the multiple pieces of received signature information to obtain an aggregated signature.
作为一个优选方案,所述签名信息还包括所述待确认区块的区块头的哈希值。As a preferred solution, the signature information further includes the hash value of the block header of the block to be confirmed.
作为一个优选方案,所述区块链***包括3F+1个节点,所述预设值包括2F,F为大于0的自然数。As a preferred solution, the blockchain system includes 3F+1 nodes, the preset value includes 2F, and F is a natural number greater than zero.
请参阅图7,本申请实施例还提供了一种区块链数据的共识***,应用于投票节点,所述投票节点为区块链***中的节点,所述区块链***还包括提议节点,所述***包括:Referring to FIG. 7, an embodiment of the present application also provides a consensus system for blockchain data, which is applied to voting nodes, where the voting nodes are nodes in a blockchain system, and the blockchain system also includes a proposal node , The system includes:
获取单元701,用于获取待确认区块;The obtaining unit 701 is configured to obtain a block to be confirmed;
投票签名单元702,用于对所述待确认区块进行签名,生成签名信息;The voting signature unit 702 is configured to sign the block to be confirmed and generate signature information;
发送单元703,用于将所述签名信息发送至所述提议节点;The sending unit 703 is configured to send the signature information to the proposal node;
接收单元704,用于接收所述提议节点发送的聚合签名,所述聚合签名为所述提议节点利用多个所述签名信息聚合后生成的;The receiving unit 704 is configured to receive an aggregate signature sent by the proposing node, where the aggregate signature is generated by the proposing node after aggregating multiple pieces of signature information;
验证单元705,用于验证所述聚合签名;The verification unit 705 is configured to verify the aggregate signature;
第一确定单元706,用于当所述聚合签名通过验证时,确定所述待确认区块有效。The first determining unit 706 is configured to determine that the block to be confirmed is valid when the aggregated signature is verified.
可选地,所述待确认区块包括交易结果,所述获取单元701具体用于:Optionally, the block to be confirmed includes a transaction result, and the obtaining unit 701 is specifically configured to:
获取交易信息;Obtain transaction information;
将所述交易信息发送至所述提议节点;Sending the transaction information to the proposal node;
接收所述提议节点发送的交易列表,所述交易列表为所述提议节点对所述交易信息进行排序得到;Receiving a transaction list sent by the proposing node, where the transaction list is obtained by sorting the transaction information by the proposing node;
模拟执行所述交易列表,得到交易结果;Simulate the execution of the transaction list to obtain the transaction result;
根据所述交易结果生成待确认区块。Generate a block to be confirmed according to the transaction result.
可选地,所述交易列表包括历史区块信息,所述***还包括:Optionally, the transaction list includes historical block information, and the system further includes:
判断单元707,用于使用自身数据库判断是否存在与所述历史区块消息匹配的目标数据;The judging unit 707 is configured to use its own database to judge whether there is target data matching the historical block message;
触发单元708,用于当所述判断单元确定自身数据库中存在与所述历史区块消息匹配的目标数据,则触发所述根据所述交易结果生成待确认区块。The trigger unit 708 is configured to trigger the generation of the block to be confirmed according to the transaction result when the judgment unit determines that there is target data matching the historical block message in its own database.
可选地,在确定所述待确认区块有效之后,所述***还包括:Optionally, after determining that the block to be confirmed is valid, the system further includes:
第二确定单元709,用于当确定所述待确认区块有效之后,则确定所述自身数据库中的目标数据有效。The second determining unit 709 is configured to determine that the target data in the own database is valid after determining that the block to be confirmed is valid.
可选地,所述区块链***包括3F+1个节点,F为大于0的自然数,所述验证单元具体705用于:Optionally, the blockchain system includes 3F+1 nodes, F is a natural number greater than 0, and the verification unit 705 is specifically configured to:
验证所述聚合签名中包含签名信息的数量是否大于或等于2F+1;Verifying whether the amount of signature information contained in the aggregate signature is greater than or equal to 2F+1;
若是,则确定所述聚合签名通过验证;If yes, it is determined that the aggregated signature passes verification;
若否,则确定所述聚合签名未通过验证。If not, it is determined that the aggregated signature fails the verification.
可选地,所述签名信息还包括所述待确认区块的区块头的哈希值。Optionally, the signature information further includes the hash value of the block header of the block to be confirmed.
在本实施例中,区块链的数据共识装置1可以是PC(Personal Computer,个人电脑),也可以是智能手机、平板电脑、掌上电脑、便携计算机、网络存储设备终端设备。In this embodiment, the blockchain data consensus device 1 may be a PC (Personal Computer, personal computer), or a smart phone, a tablet computer, a palmtop computer, a portable computer, or a network storage device terminal device.
该装置1可以是组成CDN网络或者区块链网络的节点。The device 1 may be a node forming a CDN network or a blockchain network.
该区块链的数据共识装置1可以包括存储器11、处理器12和总线13。The data consensus device 1 of the blockchain may include a memory 11, a processor 12, and a bus 13.
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器11在一些实施例中可以是区块链的数据共识装置1的内部存储单元,例如该区块链的数据共识装置1的硬盘。存储器11在另一些实施例中也可以是区块链的数据共识装置1的外部存储设备,例如区块链的数据共识装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括区块链的数据共识装置1的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于区块链的数据共识装置1的应用软件及各类数据,例如区块链的数据共识程序01的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。Wherein, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of the data consensus device 1 of the blockchain, for example, the hard disk of the data consensus device 1 of the blockchain. In other embodiments, the memory 11 may also be an external storage device of the data consensus device 1 of the blockchain, for example, a plug-in hard disk equipped on the data consensus device 1 of the blockchain, a smart media card (SMC). ), Secure Digital (SD) card, Flash Card, etc. Further, the memory 11 may also include both an internal storage unit of the data consensus device 1 of the blockchain and an external storage device. The memory 11 can be used not only to store the application software and various data of the data consensus device 1 installed in the blockchain, such as the code of the data consensus program 01 of the blockchain, etc., but also to temporarily store the output or will be output The data.
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行区块链的数据共识程序01等。The processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor or other data processing chip in some embodiments, and is used to run the program code or processing stored in the memory 11 Data, such as the implementation of blockchain data consensus program 01, etc.
该总线13可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称 EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。为便于表示,图8中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The bus 13 may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, only one thick line is used in FIG. 8 to represent, but it does not mean that there is only one bus or one type of bus.
进一步地,区块链的数据共识装置还可以包括网络接口14,网络接口14可选的可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该装置1与其他电子设备之间建立通信连接。Further, the data consensus device of the blockchain may also include a network interface 14. The network interface 14 may optionally include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the device 1 Establish a communication connection with other electronic devices.
可选地,该装置1还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在区块链的数据共识装置1中处理的信息以及用于显示可视化的用户界面。Optionally, the device 1 may also include a user interface. The user interface may include a display (Display) and an input unit such as a keyboard (Keyboard). The optional user interface may also include a standard wired interface and a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light emitting diode) touch device, etc. Among them, the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the data consensus device 1 of the blockchain and to display a visualized user interface.
图8仅示出了具有组件11-14以及区块链的数据共识程序01的区块链的数据共识装置1,本领域技术人员可以理解的是,图8示出的结构并不构成对区块链的数据共识装置1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。FIG. 8 only shows the data consensus device 1 of the blockchain with components 11-14 and the data consensus program 01 of the blockchain. Those skilled in the art can understand that the structure shown in FIG. The definition of the block chain data consensus device 1 may include fewer or more components than shown in the figure, or a combination of certain components, or a different component arrangement.
可以理解的是,在本申请的各种实施例中,上述各步骤的序号的大小并不意味着执行顺序的先后,各步骤的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It can be understood that, in the various embodiments of the present application, the size of the sequence number of each step does not mean the order of execution. The order of execution of each step should be determined by its function and internal logic, and it is not applicable to this application. The implementation process of the embodiment constitutes any limitation.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的***,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working process of the above-described system, device, and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的***,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个***,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of this application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code .
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, a person of ordinary skill in the art should understand that: The technical solutions recorded in the embodiments are modified, or some of the technical features are equivalently replaced; these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (17)

  1. 一种区块链数据的共识方法,其特征在于,应用于提议节点,所述提议节点为区块链***中的节点,所述区块链***还包括多个投票节点,所述方法包括:A consensus method for blockchain data, characterized in that it is applied to a proposal node, the proposal node is a node in a blockchain system, the blockchain system further includes a plurality of voting nodes, and the method includes:
    接收所述多个投票节点分别发送的签名信息,所述签名信息包括所述投票节点对待确认区块的签名;Receiving signature information respectively sent by the multiple voting nodes, where the signature information includes the signature of the block to be confirmed by the voting node;
    判断接收到的所述签名信息的数量是否达到预设值;Judging whether the quantity of the received signature information reaches a preset value;
    若是,则利用接收到的多个所述签名信息聚合生成聚合签名;If so, use the received multiple pieces of signature information to aggregate to generate an aggregate signature;
    将所述聚合签名发送至所述投票节点,以使得当所述投票节点对所述聚合签名通过验证时确定所述待确认区块有效。The aggregate signature is sent to the voting node, so that the block to be confirmed is determined to be valid when the voting node passes verification of the aggregate signature.
  2. 根据权利要求1所述的方法,其特征在于,所述待确认区块包括交易结果,在所述接收所述多个投票节点发送的签名信息之前,所述方法还包括:The method according to claim 1, wherein the block to be confirmed includes a transaction result, and before the receiving the signature information sent by the multiple voting nodes, the method further comprises:
    接收所述多个投票节点分别发送的交易信息;Receiving transaction information respectively sent by the multiple voting nodes;
    对所述交易信息进行排序,得到交易列表;Sort the transaction information to obtain a transaction list;
    将所述交易列表发送至所述投票节点,以使得所述投票节点模拟执行所述交易列表得到交易结果之后,所述投票节点根据所述交易结果生成所述待确认区块。The transaction list is sent to the voting node, so that after the voting node simulates the execution of the transaction list to obtain a transaction result, the voting node generates the block to be confirmed according to the transaction result.
  3. 根据权利要求2所述的方法,其特征在于,所述交易列表包括历史区块信息,将所述交易列表发送至所述投票节点具体还包括:The method according to claim 2, wherein the transaction list includes historical block information, and sending the transaction list to the voting node specifically further includes:
    将所述历史区块信息发送至所述投票节点,以使得所述投票节点对所述历史区块信息进行匹配。The historical block information is sent to the voting node, so that the voting node matches the historical block information.
  4. 根据权利要求2所述的方法,其特征在于,在所述利用接收到的多个所述签名信息聚合生成聚合签名之前,所述方法还包括:The method according to claim 2, characterized in that, before said using the received multiple pieces of signature information to aggregate to generate an aggregate signature, the method further comprises:
    模拟执行所述交易列表,得到交易结果;Simulate the execution of the transaction list to obtain the transaction result;
    根据所述交易结果生成待确认区块,并对所述待确认区块进行签名,得到第一签名;Generate a block to be confirmed according to the transaction result, and sign the block to be confirmed to obtain a first signature;
    所述利用接收到的多个所述签名信息聚合生成聚合签名包括:The aggregating and generating an aggregate signature using the received multiple pieces of signature information includes:
    将所述第一签名与接收到的多个所述签名信息进行聚合,得到聚合签名。Aggregating the first signature and the multiple pieces of received signature information to obtain an aggregated signature.
  5. 根据权利要求1至4任一项所述的方法,其特征在于,所述签名信息 还包括所述待确认区块的区块头的哈希值。The method according to any one of claims 1 to 4, wherein the signature information further includes the hash value of the block header of the block to be confirmed.
  6. 根据权利要求1至4任一项所述的方法,其特征在于,所述区块链***包括3F+1个节点,所述预设值包括2F,F为大于0的自然数。The method according to any one of claims 1 to 4, wherein the blockchain system includes 3F+1 nodes, the preset value includes 2F, and F is a natural number greater than zero.
  7. 一种区块链数据的共识方法,其特征在于,应用于投票节点,所述投票节点为区块链***中的节点,所述区块链***还包括提议节点,所述方法包括:A consensus method for blockchain data, characterized in that it is applied to voting nodes, where the voting nodes are nodes in a blockchain system, the blockchain system further includes a proposal node, and the method includes:
    获取待确认区块;Get the block to be confirmed;
    对所述待确认区块进行签名,生成签名信息;Sign the block to be confirmed to generate signature information;
    将所述签名信息发送至所述提议节点;Sending the signature information to the proposing node;
    接收所述提议节点发送的聚合签名,所述聚合签名为所述提议节点利用多个所述签名信息聚合后生成的;Receiving an aggregate signature sent by the proposing node, where the aggregate signature is generated by the proposing node after aggregating multiple pieces of signature information;
    验证所述聚合签名;Verifying the aggregate signature;
    当所述聚合签名通过验证时,确定所述待确认区块有效。When the aggregate signature is verified, it is determined that the block to be confirmed is valid.
  8. 根据权利要求7所述的方法,其特征在于,所述待确认区块包括交易结果,所述获取待确认区块包括:The method according to claim 7, wherein the block to be confirmed comprises a transaction result, and the obtaining the block to be confirmed comprises:
    获取交易信息;Obtain transaction information;
    将所述交易信息发送至所述提议节点;Sending the transaction information to the proposal node;
    接收所述提议节点发送的交易列表,所述交易列表为所述提议节点对所述交易信息进行排序得到;Receiving a transaction list sent by the proposing node, where the transaction list is obtained by sorting the transaction information by the proposing node;
    模拟执行所述交易列表,得到交易结果;Simulate the execution of the transaction list to obtain the transaction result;
    根据所述交易结果生成待确认区块。Generate a block to be confirmed according to the transaction result.
  9. 根据权利要求8所述的方法,其特征在于,所述交易列表包括历史区块信息,所述方法还包括:The method according to claim 8, wherein the transaction list includes historical block information, and the method further comprises:
    使用自身数据库判断是否存在与所述历史区块消息匹配的目标数据;Use its own database to determine whether there is target data matching the historical block message;
    若存在,则触发所述根据所述交易结果生成待确认区块。If it exists, trigger the generation of the block to be confirmed according to the transaction result.
  10. 根据权利要求9所述的方法,其特征在于,在确定所述待确认区块有效之后,所述方法还包括:The method according to claim 9, wherein after determining that the block to be confirmed is valid, the method further comprises:
    当确定所述待确认区块有效之后,则确定所述自身数据库中的目标数据有效。After determining that the block to be confirmed is valid, it is determined that the target data in the own database is valid.
  11. 根据权利要求7至10任一项所述的方法,其特征在于,所述区块链***包括3F+1个节点,F为大于0的自然数,所述验证所述聚合签名包括:The method according to any one of claims 7 to 10, wherein the blockchain system includes 3F+1 nodes, F is a natural number greater than 0, and the verifying the aggregated signature includes:
    验证所述聚合签名中包含签名信息的数量是否大于或等于2F+1;Verifying whether the amount of signature information contained in the aggregate signature is greater than or equal to 2F+1;
    若是,则确定所述聚合签名通过验证;If yes, it is determined that the aggregated signature passes verification;
    若否,则确定所述聚合签名未通过验证。If not, it is determined that the aggregated signature fails the verification.
  12. 根据权利要求7至10任一项所述的方法,其特征在于,所述签名信息还包括所述待确认区块的区块头的哈希值。The method according to any one of claims 7 to 10, wherein the signature information further includes a hash value of the block header of the block to be confirmed.
  13. 一种区块链数据的共识装置,其特征在于,所述装置包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的区块链数据的共识程序,所述区块链数据的共识程序被所述处理器执行时实现如权利要求1-12任一项所述的方法。A consensus device for blockchain data, characterized in that the device includes a memory and a processor, the memory stores a consensus program for blockchain data that can run on the processor, and the block When the chain data consensus program is executed by the processor, the method according to any one of claims 1-12 is realized.
  14. 根据权利要求13所述的装置,其特征在于,所述装置为区块链网络的节点。The device according to claim 13, wherein the device is a node of a blockchain network.
  15. 一种区块链数据的共识***,其特征在于,应用于提议节点,所述提议节点为区块链***中的节点,所述区块链***还包括多个投票节点,所述***包括:A consensus system for blockchain data, characterized in that it is applied to a proposal node, the proposal node is a node in a blockchain system, the blockchain system further includes a plurality of voting nodes, and the system includes:
    第一接收单元,用于接收所述多个投票节点分别发送的签名信息,所述签名信息包括所述投票节点对待确认区块的签名;The first receiving unit is configured to receive signature information respectively sent by the multiple voting nodes, where the signature information includes the signature of the block to be confirmed by the voting node;
    判断单元,用于判断接收到的所述签名信息的数量是否达到预设值;A judging unit for judging whether the quantity of the received signature information reaches a preset value;
    第一生成单元,用于当所述判断单元确定接收到的所述签名信息的数量达到预设值时,则利用接收到的多个所述签名信息聚合生成聚合签名;The first generating unit is configured to, when the judging unit determines that the quantity of the received signature information reaches a preset value, use the multiple received signature information to aggregate to generate an aggregate signature;
    第一发送单元,用于将所述聚合签名发送至所述投票节点,以使得当所述投票节点对所述聚合签名通过验证时确定所述待确认区块有效。The first sending unit is configured to send the aggregate signature to the voting node, so that the block to be confirmed is determined to be valid when the voting node passes the verification of the aggregate signature.
  16. 一种区块链数据的共识***,其特征在于,应用于投票节点,所述投票节点为区块链***中的节点,所述区块链***还包括提议节点,所述***包括:A consensus system for blockchain data, characterized in that it is applied to voting nodes, where the voting nodes are nodes in a blockchain system, the blockchain system further includes a proposal node, and the system includes:
    获取单元,用于获取待确认区块;The obtaining unit is used to obtain the block to be confirmed;
    投票签名单元,用于对所述待确认区块进行签名,生成签名信息;The voting signature unit is used to sign the block to be confirmed and generate signature information;
    发送单元,用于将所述签名信息发送至所述提议节点;A sending unit, configured to send the signature information to the proposal node;
    接收单元,用于接收所述提议节点发送的聚合签名,所述聚合签名为所述提议节点利用多个所述签名信息聚合后生成的;A receiving unit, configured to receive an aggregate signature sent by the proposing node, where the aggregate signature is generated by the proposing node after aggregating multiple pieces of signature information;
    验证单元,用于验证所述聚合签名;A verification unit for verifying the aggregate signature;
    第一确定单元,用于当所述聚合签名通过验证时,确定所述待确认区块有效。The first determining unit is configured to determine that the block to be confirmed is valid when the aggregate signature is verified.
  17. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有区块链数据的共识程序,所述区块链数据的共识程序可被一个或者多个处理器执行,以实现如权利要求1至12中任一项所述的区块链数据的共识方法。A computer-readable storage medium, characterized in that a consensus program for blockchain data is stored on the computer-readable storage medium, and the consensus program for blockchain data can be executed by one or more processors to Realize the consensus method of blockchain data according to any one of claims 1-12.
PCT/CN2019/093705 2019-06-28 2019-06-28 Consensus method for block chain data and related device WO2020258252A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201980059451.3A CN112689848B (en) 2019-06-28 2019-06-28 Method and related equipment for consensus of block chain data
PCT/CN2019/093705 WO2020258252A1 (en) 2019-06-28 2019-06-28 Consensus method for block chain data and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/093705 WO2020258252A1 (en) 2019-06-28 2019-06-28 Consensus method for block chain data and related device

Publications (1)

Publication Number Publication Date
WO2020258252A1 true WO2020258252A1 (en) 2020-12-30

Family

ID=74061449

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/093705 WO2020258252A1 (en) 2019-06-28 2019-06-28 Consensus method for block chain data and related device

Country Status (2)

Country Link
CN (1) CN112689848B (en)
WO (1) WO2020258252A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114615281A (en) * 2022-03-07 2022-06-10 中国科学院软件研究所 Block chaining-out method and PoS protocol confirmation method based on small-scale committee

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113256417B (en) * 2021-05-14 2022-07-12 杭州链网科技有限公司 Transaction sharing-based consensus block method and system
CN113783935B (en) * 2021-08-12 2022-04-01 清华大学 Byzantine fault-tolerant method and device
CN113783946A (en) * 2021-08-25 2021-12-10 山东区块链研究院 Re-voting binary consensus method and device based on threshold signature
CN113630257B (en) * 2021-10-09 2022-01-04 支付宝(杭州)信息技术有限公司 Consensus method, block chain system and consensus node
CN114782047B (en) * 2021-12-29 2023-06-30 张海滨 Data consensus method and distributed system
CN114338715B (en) * 2021-12-31 2024-06-21 杭州趣链科技有限公司 Data synchronization method, blockchain system, terminal equipment and storage medium
CN114745140B (en) * 2022-06-13 2022-08-23 天津市城市规划设计研究总院有限公司 Urban planning field block chain consensus verification method and system based on aggregation encryption

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107968708A (en) * 2017-11-10 2018-04-27 财付通支付科技有限公司 Generate method, apparatus, terminal and the server of signature
CN108182635A (en) * 2017-12-18 2018-06-19 深圳前海微众银行股份有限公司 Block chain common recognition method, system and computer readable storage medium
CN109150598A (en) * 2018-08-10 2019-01-04 上交所技术有限责任公司 A kind of BFT common recognition algorithm bandwidth utilization rate improved method based on block piece
CN109360100A (en) * 2018-11-13 2019-02-19 北京航空航天大学 Transaction rapid acknowledgment method and device based on block chain technology

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3651060B2 (en) * 1995-04-29 2005-05-25 ソニー株式会社 Television signal recording device
US10304143B2 (en) * 2016-05-05 2019-05-28 Lance Timothy Kasper Consensus system for manipulation resistant digital record keeping
US10360191B2 (en) * 2016-10-07 2019-07-23 International Business Machines Corporation Establishing overlay trust consensus for blockchain trust validation system
CN110914852A (en) * 2017-08-05 2020-03-24 普罗克鲁斯科技有限公司 Method and system for securing blockchains using transaction attestation
KR102019211B1 (en) * 2017-11-14 2019-11-04 주식회사 아이콘루프 Method for generating block chain capable of overcoming byzantine fault
CN108108487B (en) * 2018-01-10 2019-11-22 杭州复杂美科技有限公司 A kind of common recognition method of block chain
GB2576375A (en) * 2018-08-17 2020-02-19 Uvue Ltd Transaction system and method of operation thereof
CN109241192B (en) * 2018-09-18 2021-06-15 百度在线网络技术(北京)有限公司 Data modification and block verification method, device, equipment and medium for block chain
CN109559120B (en) * 2018-12-03 2021-11-19 国网电子商务有限公司 Weight-based block chain consensus method, system, storage medium and electronic device
CN109872152B (en) * 2019-01-11 2022-07-15 平安科技(深圳)有限公司 Block chain consensus method based on share authorization certification mechanism and related equipment
CN110708171B (en) * 2019-12-13 2020-06-12 腾讯科技(深圳)有限公司 Block chain consensus voting method, device, equipment and storage medium
CN111382456B (en) * 2020-06-01 2020-10-23 腾讯科技(深圳)有限公司 Proposal message processing method, device, equipment and storage medium
CN112685796B (en) * 2021-03-12 2021-06-18 腾讯科技(深圳)有限公司 Block chain-based block consensus method and related equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107968708A (en) * 2017-11-10 2018-04-27 财付通支付科技有限公司 Generate method, apparatus, terminal and the server of signature
CN108182635A (en) * 2017-12-18 2018-06-19 深圳前海微众银行股份有限公司 Block chain common recognition method, system and computer readable storage medium
CN109150598A (en) * 2018-08-10 2019-01-04 上交所技术有限责任公司 A kind of BFT common recognition algorithm bandwidth utilization rate improved method based on block piece
CN109360100A (en) * 2018-11-13 2019-02-19 北京航空航天大学 Transaction rapid acknowledgment method and device based on block chain technology

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114615281A (en) * 2022-03-07 2022-06-10 中国科学院软件研究所 Block chaining-out method and PoS protocol confirmation method based on small-scale committee
CN114615281B (en) * 2022-03-07 2023-02-28 中国科学院软件研究所 Block chaining and block outputting method based on small-scale committee and PoS protocol confirmation method

Also Published As

Publication number Publication date
CN112689848A (en) 2021-04-20
CN112689848B (en) 2024-06-11

Similar Documents

Publication Publication Date Title
CN110300172B (en) Block chain data consensus method and related equipment
WO2020258252A1 (en) Consensus method for block chain data and related device
CN110288479B (en) Method and related equipment for consensus of block chain data
CN110383279B (en) System and method for detecting replay attacks
CN110247774A (en) A kind of the common recognition method and relevant device of block chain data
CN107579848B (en) Method for dynamically changing consensus node in practical Byzantine fault-tolerant consensus mechanism
CN112685796B (en) Block chain-based block consensus method and related equipment
CN110431577B (en) System and method for detecting replay attacks
US20200082126A1 (en) Methods and system for collecting statistics against distributed private data
WO2021244208A1 (en) Proposal message processing method and apparatus for blockchain, and device and storage medium
US20210256016A1 (en) Blockchain system and method
CN110771127B (en) Method and system for consistent distributed memory pools in a blockchain network
CN110708171A (en) Block chain consensus voting method, device, equipment and storage medium
CN110489946B (en) Copyright authentication method, device, equipment and storage medium based on block chain
CN111414373A (en) Consensus method and consensus system
CN111523890A (en) Data processing method and device based on block chain, storage medium and equipment
WO2020155811A1 (en) Block chain intelligent contract execution method, device and electronic apparatus
CN112118239B (en) Block chain consensus method and device, electronic equipment and storage medium
CN111338608B (en) Distributed application development method and device, node equipment and readable storage medium
US20210089673A1 (en) Information processing apparatus, information processing method, and program
JP2022539283A (en) A method and system for validating blockchain data stored in a storage format different from the blockchain
CN113888164A (en) Block chain transaction pool implementation method and device, computer equipment and storage medium
WO2023020242A1 (en) Blockchain-based data processing method and apparatus, computer device, computer-readable storage medium, and computer program product
GB2593109A (en) Reliability verification system for digital-asset data packet
CN110990790B (en) Data processing method and equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19935576

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19935576

Country of ref document: EP

Kind code of ref document: A1