WO2020258912A1 - 一种区块链共识方法、装置和*** - Google Patents
一种区块链共识方法、装置和*** Download PDFInfo
- Publication number
- WO2020258912A1 WO2020258912A1 PCT/CN2020/077518 CN2020077518W WO2020258912A1 WO 2020258912 A1 WO2020258912 A1 WO 2020258912A1 CN 2020077518 W CN2020077518 W CN 2020077518W WO 2020258912 A1 WO2020258912 A1 WO 2020258912A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- message
- transaction
- network
- node
- client
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1087—Peer-to-peer [P2P] networks using cross-functional networking aspects
- H04L67/1089—Hierarchical topologies
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/50—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
- G06Q20/3829—Payment protocols; Details thereof insuring higher security of transaction involving key management
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/44—Star or tree networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1087—Peer-to-peer [P2P] networks using cross-functional networking aspects
- H04L67/1091—Interfacing with client-server systems or between P2P systems
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1087—Peer-to-peer [P2P] networks using cross-functional networking aspects
- H04L67/1093—Some peer nodes performing special functions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3247—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
Definitions
- the present invention relates to the field of blockchain technology, and in particular to a blockchain consensus method, device and system.
- Consensus means that the participating nodes are in the same state. In the blockchain, it is mainly to ensure that the order of requested transactions is globally consistent.
- the peer-to-peer network can be understood as a public network.
- common peer-to-peer network consensus solutions are Proof Of Work (POW) and Proof of Stake (POS).
- the performance is low, the transaction volume carried by each block is small, and the confirmation time of each transaction is long; it consumes energy, and the use of mining mechanisms leads to a serious waste of energy.
- the embodiments of the present invention provide a blockchain consensus method, device, and system to solve the technical problems of long transaction confirmation time and small transaction volume carried by the block.
- a blockchain consensus method is provided, which is applied to a master node in the same network as a client, and includes: receiving transaction messages sent by the client and Transaction messages sent by at least one peer node, or transaction messages sent by at least two peer nodes are received; wherein, the peer node, the master node, and the client are all in the same network; it is determined that the received Whether the transaction messages are consistent with each other, if so, send the transaction message to the master node in the upper-level network.
- a blockchain consensus method which is applied to the master node in the highest priority network.
- the method includes: generating a proposal message according to the received transaction message;
- the fault-tolerant consensus mechanism makes a consensus decision on the proposal message; after the consensus decision is passed, the proposal message is sent to the master node in the next-level network.
- a blockchain consensus method is also provided, which is applied to a master node in a medium-priority network, and the method includes: receiving a proposal sent by a master node in the highest-priority network Message, the proposal message is verified; after the verification is passed, the transaction data in the proposal message is written into the block, and the signature of the master node is attached to the proposal message, and the proposal The message is sent to the peer node in the same network as the master node and the master node in the next level network; until the next level network is the network where the client is located.
- a blockchain consensus method is also provided, which is applied to a peer node in the same network as a client, and the method includes: receiving a transaction message sent by the client , And verify it; after the verification is passed, attach the signature of the peer node to the transaction message, and send the transaction message to the master node in the same network as the peer node .
- a blockchain consensus device which is set on a master node in the same network as a client, and the device includes: a first receiving module for receiving the client The transaction message sent by the peer node and the transaction message sent by at least one peer node, or the transaction message sent by at least two peer nodes are received; wherein, the peer node, the master node, and the client are all in the same In the network; the first sending module is used to determine whether the received transaction messages are consistent, and if so, send the transaction messages to the master node in the upper-level network.
- a block chain consensus device which is set in the master node in the highest priority network, and the device includes: a proposal module for generating according to the received transaction message Proposal message; consensus module, used to make a consensus decision on the proposal message based on the Byzantine fault-tolerant consensus mechanism; the second sending module, used to send the proposal message to the master node in the next level network after the consensus decision is passed.
- a blockchain consensus device which is set in a master node in a medium priority network, and the device includes: a second receiving module for receiving the highest priority network
- the proposal message sent by the master node in the master node verifies the proposal message; the write module is used to write the transaction data in the proposal message into the block after the signature verification is passed, and write it on the proposal message Attach the signature of the master node, and send the proposal message to the peer node in the same network as the master node and the master node in the next level network; until the next level network is the client The network where the end is located.
- a blockchain consensus device which is set on a peer node in the same network as the client.
- the device includes: a third receiving module for receiving The transaction message sent by the client terminal and verify the signature; the third sending module is used to attach the signature of the peer node to the transaction message after the verification is passed, and send the transaction message To the master node in the same network as the peer node.
- an electronic device including: one or more processors; a storage device, configured to store one or more programs, when the one or more programs are One or more processors execute, so that the one or more processors implement the method described in any of the foregoing embodiments.
- a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the method described in any of the above embodiments is implemented.
- a blockchain consensus method including: a client sends a transaction message to at least two nodes in the same network as the client; wherein, the at least The two nodes include at least two of a master node and a peer node; the master node in the same network as the client receives the transaction message sent by the client and at least one transaction message sent by the peer node, Or, receiving transaction messages sent by at least two of the peer nodes; if the transaction data in the transaction messages are consistent, the transaction message is sent to the master node in the upper level network until the upper level network has priority The highest priority level is the highest; the master node in the highest priority network generates a proposal message based on the received transaction message, and performs a consensus decision on the proposal message based on the Byzantine fault-tolerant consensus mechanism; after the consensus decision is passed, the proposal message is sent to the next The master node in the first-level network until the next-level network is the network where the client is located.
- a blockchain consensus system including: a client terminal, configured to send transaction messages to at least two nodes in the same network as the client terminal; wherein , The at least two nodes include at least two of a master node and a peer node; the master node in the same network as the client is used to receive a transaction message sent by the client and at least one of the pair The transaction message sent by the peer node, or the transaction message sent by at least two peer nodes is received; if the transaction data in the transaction message is consistent, the transaction message is sent to the master node in the upper-level network until all The priority of the upper-level network is the highest; the master node in the highest-priority network is used to generate proposal messages according to the received transaction messages, and make consensus judgments on the proposal messages based on the Byzantine fault-tolerant consensus mechanism; the consensus judgment passes After that, the proposal message is sent to the master node in the next level network until the next level network is the network where the client
- An embodiment of the above-mentioned invention has the following advantages or beneficial effects: Because the consensus decision based on the Byzantine fault-tolerant consensus mechanism is adopted for the proposal message, after the consensus decision is passed, the proposal message is sent to the master node in the next level network until the next The level network is the technical means of the network where the client is located, so it overcomes the technical problems of long transaction confirmation time and small transaction volume carried by blocks in the prior art.
- the embodiment of the present invention uses cryptographic algorithms to ensure data consistency in a peer-to-peer network environment, and consensus based on the Byzantine fault-tolerant consensus mechanism can effectively improve consensus efficiency; in the actual consensus process, a hierarchical regional consensus mechanism is adopted , Through the consensus reached in a small area, and the method of broadcasting, on the one hand, it is very compatible with the peer-to-peer network, on the other hand, it can reduce the waste of resources caused by mining, thereby effectively improving the efficiency of consensus.
- Figure 1 is a framework diagram of a blockchain consensus system according to an embodiment of the present invention
- Fig. 2 is a schematic diagram of the main process of a blockchain consensus method according to an embodiment of the present invention
- Fig. 3 is a schematic diagram of a proposal message according to an embodiment of the present invention.
- FIG. 4 is a schematic diagram of the main process of a blockchain consensus method according to another embodiment of the present invention.
- Fig. 5 is a schematic diagram of the main process of a blockchain consensus method according to another embodiment of the present invention.
- FIG. 6 is a schematic diagram of the main flow of a blockchain consensus method according to an embodiment of the present invention.
- Figure 7 is a schematic diagram of the main modules of a blockchain consensus device according to an embodiment of the present invention.
- FIG. 8 is a schematic diagram of the main modules of a blockchain consensus device according to another embodiment of the present invention.
- FIG. 9 is an exemplary system architecture diagram to which the embodiment of the present invention can be applied.
- FIG. 10 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
- Fig. 1 is a framework diagram of a blockchain consensus system according to an embodiment of the present invention.
- a point-to-point network ie, a public network
- FIG. 1 exemplarily shows a three-level sub-network, for example, the priority of the sub-network A is higher than the priority of the sub-network B, and the priority of the sub-network B is higher than the priority of the sub-network C. Due to the different network ranges of blockchain applications, the number of priorities of each sub-network is not limited to the three levels shown in Figure 1. It can be more or less, and sub-networks of the same priority.
- the public network is the Internet, which is a collection of computer networks formed by connecting computer networks (including local area networks and metropolitan area networks) of different locations and sizes in the world.
- the sub-network may be a local area network, a metropolitan area network, or the like.
- each sub-network has a master node (Leader) and multiple peer nodes (Peer), and both the Peer node and the leader node can receive transaction messages issued by the client.
- the Leader node is a hierarchical structure.
- the lower-level Leader node can know the upper-level Leader node, and the upper-level Leader node can also know the lower-level Leader node set; each leader node can know all the Peer nodes in the same sub-network; each Peer node can know the same child Other Peer nodes in the network and Leader nodes in the same sub-network. Therefore, the priority of the sub-network that the leader node joins determines the priority of the leader node.
- each peer node may be only one node that can communicate with the external network.
- This node is the leader node of the local area network, and the other nodes in the local area network are peer nodes, and each peer node has an equal status.
- the Leader node is not static. When the Peer node detects an abnormality of the Leader node in the current network environment, it can be re-elected through the Raft protocol, etc. However, the leader nominated during the election process must have network access to the superior leader. If the leader node detects that the parent leader node corresponding to the node is abnormal (for example, the network is unavailable), it can broadcast to the surrounding network that can be connected. After receiving it, other Leader nodes in the surrounding network will send a response, and then the leader node will respond accordingly The parent Leader node changes.
- Fig. 2 is a schematic diagram of the main process of a blockchain consensus method according to an embodiment of the present invention.
- the blockchain consensus method may include:
- Step 201 The client sends a transaction message to at least two nodes in the same network as the client.
- the client terminal After ensuring the legitimacy of the transaction message, the client terminal sends the transaction message to at least two nodes (either Peer node or Leader node) that are in the same network as the client terminal to prevent individual nodes from cheating. Specifically, the client may send transaction messages to the Leader node and at least one Peer node, or may send transaction messages to at least two Peer nodes. It should be pointed out that the client can only send transaction messages to nodes that have established a connection with the client.
- nodes either Peer node or Leader node
- the client will send transaction messages to at least two nodes in sub-network C, such as Peer31, Peer32, and Peer33 in sub-network C, or, Leader30, Peer31, Peer32 and Peer34 in network C.
- the transaction message includes transaction data and a client's signature.
- Cryptographic algorithms can be used to process transaction data to ensure data consistency. Specifically, the transaction data can be hashed first, and then the hash value can be processed using the client's private key to obtain the client's signature. If the public key of the client is not broadcast to each node in advance, the transaction message should also include the public key of the client for the node to verify the client's signature.
- Step 202 The master node in the same network as the client receives the transaction message sent by the client and the transaction message sent by at least one of the peer nodes, or receives the transaction message sent by at least two of the peer nodes.
- Transaction message if the transaction data in the transaction message is consistent, the transaction message is sent to the master node in the upper-level network until the priority of the upper-level network is the highest.
- the master node in the same network as the client receives the transaction message sent by the client and the transaction message sent by at least one of the peer nodes, or receives the transaction message sent by the at least two peer nodes
- the transaction message includes: a peer node in the same network as the client receives the transaction message sent by the client and verifies it; after the verification is passed, the transaction message is appended with the transaction message The signature of the peer node, and send the transaction message to the master node in the same network as the peer node; or, the master node in the same network as the client receives the message sent by the client
- the transaction message and at least one of the peer nodes send the transaction message and verify the signature respectively; or, receive the transaction message sent by at least two of the peer nodes and verify the signature respectively.
- the client sends a transaction message to the Peer node, after the Peer node receives the transaction message sent by the client, it verifies the client's signature through the client's public key. Specifically, the transaction data in the transaction message is hashed, and the hash value is compared with the signature after decryption by the public key. If the verification is passed, the signature of the Peer node is attached to the transaction message, and the transaction message with the signature of the Peer node attached is sent to the Leader node in the same network as the Peer node. Therefore, the Leader node will receive the transaction message sent by the Peer node (forwarded by one or more Peer nodes), and may also receive the transaction message sent by the client, that is, the Leader node will receive at least two transaction messages.
- the Leader node receives the transaction message sent by the Peer node, it first verifies the signature of the Peer node. After the verification is passed, the client signature is verified to obtain the transaction data. The first verification is to verify that the transaction message forwarded by the Peer node has not been tampered with during network transmission, and to ensure the authenticity of the transaction message forwarded by the Peer node; the second verification is to verify that the transaction data in the transaction message is the customer Transaction data sent by the client. If the Leader node receives the transaction message sent by the client, it only needs to verify the client's signature to obtain the transaction data.
- the leader node will determine whether it has a parent leader. If there is a parent leader, it will add its own signature to the transaction message and send it to the parent leader; the parent leader After receiving the message, the same operation (including verification and additional signature) will be done until the current Leader node is the highest level Leader. Verifying each transaction message through the Leader node can ensure the consistency of transaction data. It should be pointed out that the parent leader needs to verify each signature in the transaction message in turn to ensure that the transaction data sent by the client has not been tampered with.
- the transaction message is sent to the master node in the upper-level network until the priority of the upper-level network is the highest, including: being in contact with the client
- the master node in the same network judges whether the transaction data in each transaction message received is consistent based on the principle of majority; if so, append the signature of the master node to the transaction message, and send the transaction message to the previous
- the master node in the upper-level network the master node in the upper-level network verifies the received transaction message; after the verification is passed, the master node’s signature is attached to the transaction message, and the transaction
- the transaction message is sent to the master node in the upper-level network; until the priority of the upper-level network is the highest.
- the Leader node obtains the transaction data in each transaction message through verification and determines whether the transaction data in each transaction message is consistent. For example, it can be determined whether multiple received transaction data are consistent based on the majority principle. If the transaction data is confirmed to be consistent, the transaction messages that are deemed to have not been tampered with are packaged into a transaction message, and the Leader node's signature is attached and sent to the parent Leader.
- Step 303 The master node in the highest priority network generates a proposal message according to the received transaction message, and makes a consensus decision on the proposal message based on the Byzantine Fault Tolerance Consensus Mechanism (BFT); after the consensus decision is passed, the proposal message is sent To the master node in the lower-level network until the lower-level network is the network where the client is located.
- BFT Byzantine Fault Tolerance Consensus Mechanism
- the Leader node in the highest priority network can generate proposal messages based on the transaction messages received within a period of time or a certain number of transaction messages.
- the proposal message includes the data list, the current round of consensus identification, the identification of the master node in the highest priority network, and the signature of the master node in the highest priority network, as shown in FIG. 3.
- Each transaction data in the data list is arranged in sequence based on the transaction time, that is, the data that needs to be written into the block. For example, when the number of transaction messages received by the Leader node in the highest priority network reaches 100, the 100 transaction messages will be packaged; or it will be received within 2 seconds after receiving the first transaction message. The received transaction messages are packaged into proposal messages.
- the default generation method of this round of consensus identification (CID) is self-increment.
- the transaction message sent by the lower-level Leader node carries multi-level signatures.
- the Leader node in the highest priority network only needs to verify the correctness of the transaction data. After the verification is passed, it will be packaged into a proposal message.
- leader node in the highest priority network changes, the new leader node can start numbering again, add its own signature, and broadcast to the peer node and lower leader node in the same network.
- Leader node changes For example, the Leader node itself exits abnormally (other nodes will detect that the Leader node has no heartbeat), or there is a problem with the data sent by the Leader node (Of course, this problem is not necessarily caused by the Leader node, but also There may be a problem in the transmission process). Under these circumstances, other peer nodes will think that the leader node is not safe enough, so they will trigger the re-election of the leader node.
- the master node identifier in the highest priority network may be the ID or IP of the master node.
- IP has the problem of duplication.
- ID is selected as the master node identification to ensure the uniqueness of the identification.
- the proposal message may further carry the public key of the current node (that is, the Leader node in the highest priority network). Whether to carry the public key can be freely determined, because the public key itself is public and can be negotiated in advance, or can be carried in a message, which is not limited in the embodiment of the present invention.
- performing a consensus decision on the proposal message based on a Byzantine fault-tolerant consensus mechanism includes: the master node in the highest priority network sends the proposal message to the master node itself and the highest priority network The master node and the peer node receive the proposal message, and make a consensus decision on the proposal message based on the Byzantine fault-tolerant consensus mechanism.
- Leader00 in the highest priority network sends proposal messages to Peer01, Peer02, Peer03, Peer04, and Leader00 itself in the same network.
- Peer01, Peer02, Peer03, Peer04, and Leader00 will all be based on the Byzantine fault-tolerant consensus mechanism. Consensus judgment is made on the proposal message.
- the consensus decision on the proposal message based on the Byzantine fault-tolerant consensus mechanism includes: verifying the proposal message, and after the verification is passed, generating a Write message according to the proposal message; wherein, the The written message includes the current round of consensus identification and signature; broadcasts the written message to all nodes in the current network; performs signature verification and consensus rule determination on the received written message, and after the judgment is passed, according to the Write the message to generate an Accpet message; where the received message includes the current round of consensus identification and signature; broadcast the received message to all nodes in the current network; verify the received message and Consensus rule determination.
- Both the Peer node and the Leader node perform signature verification and CID sequence confirmation on the received proposal message; after the verification is passed, the Write message is broadcast to other nodes in the same network and the current node itself.
- the Write message does not need to contain specific messages. Content, only CID and signature are required.
- Whether to carry the public key can be freely determined, because the public key itself is public and can be negotiated in advance, or can be carried in a message, which is not limited in the embodiment of the present invention.
- After other nodes in the same network and the current node receive the Write message they will verify the Write message and make a consensus rule decision. Specifically, a consensus can be reached using the principle of N ⁇ 3f+1, where N is the total number of nodes, and f is the number of malicious nodes. For example, if 4 nodes participate in the consensus, then 1 node is allowed to be abnormal (f is the number of evils), and if there are 7 nodes, 2 nodes are allowed to be abnormal.
- the Accpet message is generated and the signature of the current node is attached, and the Accept message is broadcast to other nodes in the same network and the current node itself.
- the Accpet message is similar to the Write message, and only the CID and signature are required.
- Whether to carry the public key can be freely determined, because the public key itself is public and can be negotiated in advance, or can be carried in a message, which is not limited in the embodiment of the present invention.
- other nodes in the same network and the current node verify the Accept message and make a consensus rule determination (for example, N ⁇ 3f+1). If the judgment is passed, it indicates that the current round of consensus is successful, and the transaction data in the proposal message can be written into the block.
- the next-level network is the network where the client is located; a peer node in the same network as the master node receives the proposal message sent by the master node, and verifies the proposal message; After the sign is approved, the transaction data in the proposal message is written into the block.
- the proposal message sent by the upper-level Leader node carries multi-level signatures. Peer nodes in the same network as the upper-level Leader node and the lower-level Leader nodes only need to verify the correctness of the transaction data, and write the transaction data after the verification is passed. Into the block. In the embodiment of the present invention, for the lower-level Leader node, it is necessary to sign the proposal message of the current round of consensus, and then broadcast the signed proposal message to the Peer node and the lower-level Leader node in the same network as it, and so on. , Until the client's network (ie the lowest level network).
- the method may further include: at least two nodes that are in the same network as the client and have established connections with the client receive the proposal message, and perform processing on the proposal message. Sign verification; after the verification is passed, the transaction data in the proposal message is written into the block, and a response message is sent to the client.
- the client sends the transaction message to at least two nodes (Peer node or Leader node) that are in the same network as the client, To prevent individual nodes from cheating. Therefore, after the verification is passed, at least two nodes (Peer node or Leader node) that are in the same network with the client and establish a connection with the client will not only write transaction data into the block, but also The client sends a response message.
- Each Peer node does not know whether other Peer nodes will answer the client, and each Peer node that establishes a connection with the client will answer the client.
- the Byzantine fault-tolerant consensus mechanism has the advantages of low energy consumption, large throughput, and short confirmation time.
- the embodiment of the present invention combines BFT with a peer-to-peer network to achieve consensus in the entire blockchain system under a peer-to-peer network environment. Can effectively improve consensus efficiency and reduce costs.
- the present invention uses the Byzantine fault-tolerant consensus mechanism to make a consensus decision on the proposal message. After the consensus decision is passed, the proposal message is sent to the master node in the next-level network until the next The level network is the technical means of the network where the client is located, thereby solving the technical problems of long transaction confirmation time and small transaction volume carried by blocks in the prior art.
- the embodiment of the present invention uses cryptographic algorithms to ensure data consistency in a peer-to-peer network environment, and consensus based on the Byzantine fault-tolerant consensus mechanism can effectively improve consensus efficiency; in the actual consensus process, a hierarchical regional consensus mechanism is adopted , Through the consensus reached in a small area, and the method of broadcasting, on the one hand, it is very compatible with the peer-to-peer network, on the other hand, it can reduce the waste of resources caused by mining, thereby effectively improving the efficiency of consensus.
- Fig. 4 is a schematic diagram of the main process of a blockchain consensus method according to another embodiment of the present invention.
- the blockchain consensus method is applied to a master node in the same network as a client, and includes: step 401, receiving a transaction message sent by the client and a transaction message sent by at least one peer node, or receiving at least two A transaction message sent by a peer node; wherein the peer node, the master node, and the client are all in the same network; step 402, it is determined whether the received transaction message is consistent, and if so, The transaction message is sent to the master node in the upper level network.
- the client terminal After ensuring the legitimacy of the transaction message, the client terminal sends the transaction message to at least two nodes (either Peer node or Leader node) that are in the same network as the client terminal to prevent individual nodes from cheating. Specifically, the client can send the transaction message to the Leader node and at least one Peer node, and can also send the transaction message to at least two Peer nodes.
- the client can send the transaction message to the Leader node and at least one Peer node, and can also send the transaction message to at least two Peer nodes.
- the transaction message includes transaction data and a client's signature.
- Cryptographic algorithms can be used to process transaction data to ensure data consistency.
- step 401 includes: receiving the transaction message sent by the client and the transaction message sent by at least one peer node, and verifying the transaction message respectively; or, receiving the transaction message sent by at least two peer nodes and verifying the transaction message respectively. It performs signature verification; wherein the transaction message sent by the peer node includes the transaction message sent by the client and the signature of the peer node. Since in step 201, the client sends a transaction message to the Peer node, after receiving the transaction message sent by the client, the Peer node verifies the client's signature through the client's public key.
- the transaction data in the transaction message is hashed, and the hash value is compared with the signature after decryption by the public key. If the verification is passed, the signature of the Peer node is attached to the transaction message, and the transaction message with the signature of the Peer node attached is sent to the Leader node in the same network as the Peer node. Therefore, the Leader node will receive the transaction message sent by the Peer node (forwarded by one or more Peer nodes), and may also receive the transaction message sent by the client, that is, the Leader node will receive at least two transaction messages. If the Leader node receives the transaction message sent by the Peer node, it first verifies the signature of the Peer node.
- the client signature is verified to obtain the transaction data.
- the first verification is to verify that the transaction message forwarded by the Peer node has not been tampered with during network transmission, and to ensure the authenticity of the transaction message forwarded by the Peer node; the second verification is to verify that the transaction data in the transaction message is the customer Transaction data sent by the client. If the Leader node receives the transaction message sent by the client, it only needs to verify the client's signature to obtain the transaction data.
- step 402 includes: judging whether the transaction data in each transaction message received is consistent based on the principle of majority; if so, attaching the signature of the master node to the transaction message, and sending the transaction message To the master node in the upper level network. If it is determined that the transaction data in the transaction message is consistent, the leader node will determine whether it has a parent leader. If there is a parent leader, it will add its own signature to the transaction message and send it to the parent leader; the parent leader After receiving the message, the same operation (including verification and additional signature) will be done until the current Leader node is the highest level Leader. Verifying each transaction message through the Leader node can ensure the consistency of transaction data.
- Fig. 5 is a schematic diagram of the main process of a blockchain consensus method according to another embodiment of the present invention.
- the block chain consensus method is applied to the master node in the highest priority network, and includes: step 501, generating a proposal message according to the received transaction message; step 502, performing consensus judgment on the proposal message based on the Byzantine fault-tolerant consensus mechanism; Step 503: After the consensus decision is passed, the proposal message is sent to the master node in the next level network.
- the Leader node in the highest priority network can generate proposal messages based on the transaction messages received within a period of time or a certain number of transaction messages.
- the proposal message includes the data list, the current round of consensus identification, the identification of the master node in the highest priority network, and the signature of the master node in the highest priority network.
- performing a consensus decision on the proposal message based on a Byzantine fault-tolerant consensus mechanism includes: sending the proposal message to the master node itself and a peer node in the highest priority network; receiving the proposal message , And based on the Byzantine fault-tolerant consensus mechanism to make a consensus judgment on the proposal message.
- the consensus decision on the proposal message based on the Byzantine fault-tolerant consensus mechanism includes: verifying the proposal message, and after the verification is passed, generating a write message according to the proposal message; wherein, the write message Including the current round of consensus identification and signature; broadcast the write message to all nodes in the current network; perform signature verification and consensus rule determination on the received write message, and after the determination is passed, according to the write message Generate a received message; where the received message includes the current round of consensus identification and signature; broadcast the received message to all nodes in the current network; perform signature verification and consensus rule determination on the received received message.
- the present invention also provides a blockchain consensus method, applied to a master node in a medium priority network, including: receiving a proposal message sent by a master node in the highest priority network, and verifying the proposal message; After the signature is passed, the transaction data in the proposal message is written into the block, and the signature of the master node is attached to the proposal message, and the proposal message is sent to the same network as the master node The peer node and the master node in the lower-level network; until the lower-level network is the network where the client is located.
- the present invention also provides a blockchain consensus method, which is applied to peer nodes in the same network as the client, including: receiving the transaction message sent by the client and verifying it; after the verification is passed Attach the signature of the peer node to the transaction message, and send the transaction message to a master node in the same network as the peer node.
- the method further includes: receiving a proposal message, verifying the proposal message; after the verification is passed, writing the transaction data in the proposal message to a block, and sending a response to the client news.
- Fig. 6 is a schematic diagram of the main process of a blockchain consensus method according to a reference embodiment of the present invention. The entire process is described in detail below with an example of only two-level Leader nodes.
- the blockchain consensus method may include the following steps:
- step 601 the client sends the transaction message to the Peer11 node, Peer12 node, Peer14 node and Leader10 node.
- the client may first hash the transaction data, and then use the client's private key to process the hash value to obtain the client's signature. If the public key of the client is not broadcast to each node in advance, the transaction message should also carry the public key of the client for the node to verify the client's signature.
- Peer11, Peer12, Peer14, and Leader10 nodes are in the same network as the client and are connected to the client, after ensuring the legitimacy of the transaction message, the client broadcasts the transaction message, Peer11 node, Peer12 node, Peer14 node and Leader10 node respectively received the transaction message.
- FIG. 6 exemplarily shows the process of the Peer11 node receiving the transaction message.
- the client can also send transaction messages to Peer11, Peer12, and Peer13 nodes, and can also be Peer12 and Peer13 nodes, which is not limited in the embodiment of the present invention to prevent individual nodes from cheating.
- Step 602 the Peer11 node receives the transaction message sent by the client and verifies it; after the verification is passed, the Peer11 node's signature is attached to the transaction message, and the transaction message is sent to the Leader10 node .
- the signature verification and signature process of Peer12 node and Peer14 node is similar to that of Peer11 node, and will not be repeated.
- the Leader10 node receives the transaction message sent by the client and the Peer11 node, Peer12 node, and Peer14 node send transaction messages, and verifies them respectively; after the verification passes, the transaction in each received transaction message is determined Whether the data is consistent; if so, attach the signature of the Leader10 node to the transaction message, and send the transaction message to the Leader00 node in the upper level network.
- Leader10 node receives the transaction message sent by the Peer node, it first verifies the signature of the Peer node. After the verification is passed, the client signature is verified to obtain the transaction data.
- the Leader00 node In step 604, the Leader00 node generates a proposal message according to the received transaction message, and sends the proposal message to the Leader00 node, Peer01, Peer02, Peer03, and Peer04 nodes.
- FIG. 6 exemplarily shows the Peer01 node and the Peer02 node, which are similar to the execution process of each Peer node in the same network as the Leader00 node, and will not be repeated.
- Step 605 The Leader00 node, Peer01 node, Peer02 node, Peer03 node, and Peer04 node verify the proposal message, and after the verification is passed, generate a Write message according to the proposal message, and broadcast the Write message to the current network All nodes.
- Both the Peer node and the Leader node perform signature verification and CID sequence confirmation on the received proposal message; after the verification is passed, the Write message is broadcast to other nodes in the current network and the current node itself.
- the Write message does not need to contain specific messages. Content, only CID and signature are required.
- Step 606 Leader00 node, Peer01 node, Peer02 node, Peer03 node, Peer04 node, receive the Write message, verify the signature of the Write message and determine the consensus rule, after the judgment is passed, generate an Accpet message according to the Write message, and broadcast the Accpet message to All nodes in the current network.
- the CID sequence is mainly confirmed, the signature is verified by Hash, and the consensus rule is determined by the legal rule (N ⁇ 3f+1 principle).
- the Leader00 node, Peer01 node, Peer02 node, Peer03 node, and Peer04 node receive the Accpet message, and perform signature verification and consensus rule determination on the Accpet message; if the determination is passed, it indicates that the current round of consensus is successful.
- the Leader00 node writes the transaction data in the proposal message into the block, and sends the proposal message to the Leader10 node in the next level network after signing the proposal message; Peer01 node, Peer02 node, Peer03 node, Peer04 node, and The transaction data in the proposal message is written into the block.
- the Leader10 node receives the proposal message and verifies the proposal message; after the verification is passed, the transaction data in the proposal message is written into the block, and the Leader10 node is attached to the proposal message
- the signature of is broadcast to Peer11 node, Peer12 node, Peer13 node, Peer14 node.
- step 610 the Peer11 node, Peer12 node, Peer13 node, and Peer14 node receive the proposal message sent by the Leader10 node, and verify the proposal message; after the verification is passed, the transaction data in the proposal message is written into the block.
- the Peer11 node, Peer12 node, Peer14 node and Leader10 node may also send a response message to the client.
- Fig. 7 is a schematic diagram of main modules of a blockchain consensus device according to an embodiment of the present invention.
- the blockchain consensus device 700 is set on a master node in the same network as the client, and includes: a first receiving module 701, configured to receive a transaction message and at least one pair sent by the client A transaction message sent by a peer node, or a transaction message sent by at least two peer nodes is received; wherein the peer node, the master node, and the client are all in the same network; the first sending module 702, It is used to determine whether the received transaction messages are consistent, and if so, the transaction message is sent to the master node in the upper level network.
- the transaction message includes transaction data and a client's signature
- Receiving transaction messages sent by the client and transaction messages sent by at least one peer node, or receiving transaction messages sent by at least two peer nodes, includes:
- the transaction message sent by the peer node includes the transaction message sent by the client and the signature of the peer node.
- judging whether the received transaction messages are consistent, and if so, sending the transaction message to the master node in the upper-level network including:
- Fig. 8 is a schematic diagram of main modules of a blockchain consensus device according to another embodiment of the present invention.
- the blockchain consensus device 800 is set up at the master node in the highest priority network, and includes: a proposal module 801 for generating proposal messages based on received transaction messages; and a consensus module 802 for generating proposal messages based on The Byzantine fault-tolerant consensus mechanism makes a consensus decision on the proposal message; the second sending module 803 is configured to send the proposal message to the master node in the next level network after the consensus decision is passed.
- the proposal message is generated according to the received transaction message, including:
- the proposal message includes the data list, the current round of consensus identification, the identification of the master node in the highest priority network, and the signature of the master node in the highest priority network.
- the consensus decision on the proposal message based on the Byzantine fault-tolerant consensus mechanism includes:
- the proposal message is received, and a consensus decision is made on the proposal message based on the Byzantine fault-tolerant consensus mechanism.
- the consensus decision on the proposal message based on the Byzantine fault-tolerant consensus mechanism includes:
- the embodiment of the present invention also provides a blockchain consensus device, which is set on a master node in a medium-priority network, and includes: a second receiving module for receiving proposal messages sent by the master node in the highest-priority network.
- the proposal message is verified; the writing module is used to write the transaction data in the proposal message into the block after the verification is passed, and add the signature of the master node to the proposal message, and
- the proposal message is sent to the peer node in the same network as the master node and the master node in the next level network; until the next level network is the network where the client is located.
- a blockchain consensus device which is set at a peer node in the same network as the client, and includes: a third receiving module, configured to receive transaction messages sent by the client, and Verify the signature; the third sending module is used to attach the signature of the peer node to the transaction message after the signature verification is passed, and send the transaction message to the same node as the peer node The master node in the network.
- a fourth receiving module configured to receive a proposal message and verify the proposal message; after the verification is passed, write the transaction data in the proposal message into the block and send it to the The client sends a reply message.
- the present invention also provides a blockchain consensus system, including: a client terminal for sending transaction messages to at least two nodes in the same network as the client terminal; wherein, the at least two nodes include a master At least two of a node and a peer node; a master node in the same network as the client, used to receive transaction messages sent by the client and transaction messages sent by at least one of the peer nodes, or, Receive transaction messages sent by at least two of the peer nodes; if the transaction data in the transaction messages are consistent, send the transaction message to the master node in the upper-level network until the priority of the upper-level network is Highest; The master node in the highest priority network is used to generate proposal messages based on the received transaction messages, and make consensus judgments on the proposal messages based on the Byzantine fault-tolerant consensus mechanism; after the consensus judgment is passed, the proposal messages are sent to The master node in the lower-level network until the lower-level network is the network where the client is located.
- a blockchain consensus system including: a client terminal for sending
- the transaction message includes transaction data and a client's signature
- the system also includes: a peer node in the same network as the client, for receiving the transaction message sent by the client and verifying it; after the verification is passed, the transaction message is displayed on the transaction message. Attach the signature of the peer node, and send the transaction message to the master node in the same network as the peer node; or,
- the master node in the same network as the client is also used to: receive transaction messages sent by the client and transaction messages sent by at least one of the peer nodes, and verify and sign them respectively; or, receive at least two The transaction messages sent by each of the peer nodes are verified and signed respectively.
- the master node in the same network as the client is further used to determine whether the transaction data in each transaction message received is consistent based on the principle of majority; if so, append the transaction message to the transaction message. Signature of the master node, and sending the transaction message to the master node in the upper level network;
- the system also includes: a master node in the upper-level network for verifying the received transaction message; after the verification is passed, attach the signature of the master node to the transaction message, and The transaction message is sent to the master node in the upper-level network; until the priority of the upper-level network is the highest.
- the master node in the highest priority network is also used to:
- the proposal message includes the data list, the current round of consensus identification, the identification of the master node in the highest priority network, and the signature of the master node in the highest priority network.
- the system further includes a peer node in the highest priority network
- the master node in the highest priority network is further used to: send the proposal message to the master node itself and the peer node in the highest priority network;
- the master node and the peer node are configured to receive the proposal message, and respectively make a consensus decision on the proposal message based on the Byzantine fault-tolerant consensus mechanism.
- the consensus decision on the proposal message based on the Byzantine fault-tolerant consensus mechanism includes:
- the master node in the highest priority network is further used to: send the proposal message to the master node in the next level network;
- the master node in the lower-level network is also used to: receive the proposal message, verify the proposal message; after the verification is passed, write the transaction data in the proposal message into the block, and log in The proposal message is appended with the signature of the master node, and the proposal message is sent to the peer node in the same network as the master node and the master node in the next level network; until the next level The network is the network where the client is located;
- the peer node in the same network as the master node is used to: receive the proposal message sent by the master node, and verify the proposal message; after the verification is passed, write the transaction data in the proposal message Block.
- At least two nodes that are in the same network as the client and have established a connection with the client are also used to: receive the proposal message, and verify the proposal message; after the verification is passed, Write the transaction data in the proposal message into a block, and send a response message to the client.
- the present invention uses the Byzantine fault-tolerant consensus mechanism to make a consensus decision on the proposal message. After the consensus decision is passed, the proposal message is sent to the master node in the next-level network until the next The level network is the technical means of the network where the client is located, thereby solving the technical problems of long transaction confirmation time and small transaction volume carried by blocks in the prior art.
- the embodiment of the present invention uses cryptographic algorithms to ensure data consistency in a peer-to-peer network environment, and consensus based on the Byzantine fault-tolerant consensus mechanism can effectively improve consensus efficiency; in the actual consensus process, a hierarchical regional consensus mechanism is adopted , Through the consensus reached in a small area, and the method of broadcasting, on the one hand, it is very compatible with the peer-to-peer network, on the other hand, it can reduce the waste of resources caused by mining, thereby effectively improving the efficiency of consensus.
- FIG. 9 shows an exemplary system architecture 900 of a blockchain consensus method or a blockchain consensus system to which embodiments of the present invention can be applied.
- the system architecture 900 may include terminal devices 901, 902, and 903, a network 904, and a server 905.
- the network 904 is used to provide a medium for communication links between the terminal devices 901, 902, 903 and the server 905.
- the network 904 may include various connection types, such as wired, wireless communication links, or fiber optic cables, and so on.
- the user can use the terminal devices 901, 902, and 903 to interact with the server 904 through the network 904 to receive or send messages and so on.
- Various communication client applications may be installed on the terminal devices 901, 902, and 903, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).
- the terminal devices 901, 902, and 903 may be various electronic devices that have a display screen and support web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and so on.
- the server 905 may be a server that provides various services, for example, a back-end management server (just an example) that provides support for shopping websites browsed by users using the terminal devices 901, 902, 903.
- the background management server can analyze and process the received product information query request and other data, and feed back the processing results (such as target push information, product information-only examples) to the terminal device.
- terminal devices, networks, and servers in FIG. 9 are merely illustrative. According to implementation needs, there can be any number of terminal devices, networks and servers.
- FIG. 10 shows a schematic structural diagram of a computer system 1000 suitable for implementing a terminal device of an embodiment of the present invention.
- the terminal device shown in FIG. 10 is only an example, and should not bring any limitation to the function and application scope of the embodiment of the present invention.
- the computer system 1000 includes a central processing unit (CPU) 1001, which can be based on a program stored in a read only memory (ROM) 1002 or a program loaded from a storage part 1008 into a random access memory (RAM) 1003 And perform various appropriate actions and processing.
- CPU central processing unit
- RAM random access memory
- various programs and data required for the operation of the system 1000 are also stored.
- the CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other through a bus 1004.
- An input/output (I/O) interface 1005 is also connected to the bus 1004.
- the following components are connected to the I/O interface 1005: an input part 1006 including a keyboard, a mouse, etc.; an output part 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and speakers, etc.; a storage part 1008 including a hard disk, etc. ; And a communication section 1009 including a network interface card such as a LAN card, a modem, and the like. The communication section 1009 performs communication processing via a network such as the Internet.
- the driver 1010 is also connected to the I/O interface 1005 as needed.
- a removable medium 1011 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as required, so that the computer program read therefrom is installed into the storage part 1008 as required.
- the process described above with reference to the flowchart can be implemented as a computer software program.
- the disclosed embodiments of the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart.
- the computer program may be downloaded and installed from the network through the communication part 1009, and/or installed from the removable medium 1011.
- the central processing unit (CPU) 1001 the above-mentioned functions defined in the system of the present invention are executed.
- the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two.
- the computer-readable storage medium may be, for example, but not limited to, an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
- the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
- a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
- the computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium.
- the computer-readable medium may send, propagate, or transmit the program for use by or in combination with the instruction execution system, apparatus, or device .
- the program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
- each block in the flowchart or block diagram may represent a module, program segment, or part of code, and the above-mentioned module, program segment, or part of code contains one or more for realizing the specified logical function Executable instructions.
- the functions noted in the blocks may also occur in a different order than noted in the drawings. For example, two blocks shown in succession can actually be executed substantially in parallel, or they can sometimes be executed in the reverse order, depending on the functions involved.
- each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be It is realized by a combination of dedicated hardware and computer instructions.
- the modules involved in the described embodiments of the present invention can be implemented in software or hardware.
- the described modules can also be provided in the processor.
- a processor includes a first receiving module and a first sending module, where the names of these modules do not constitute the module under certain circumstances. The limitation of itself.
- the present invention also provides a computer-readable medium.
- the computer-readable medium may be included in the device described in the foregoing embodiment; or it may exist alone without being assembled into the device.
- the aforementioned computer-readable medium carries one or more programs.
- the device includes: receiving transaction messages sent by the client and transactions sent by at least one peer node Message, or receiving transaction messages sent by at least two peer nodes; wherein the peer node, the master node, and the client are all in the same network; determine whether the received transaction messages are consistent, If it is, the transaction message is sent to the master node in the upper level network.
- the consensus decision based on the Byzantine fault-tolerant consensus mechanism is adopted for the proposal message, after the consensus decision is passed, the proposal message is sent to the master node in the next level network until the next level network is the client.
- the embodiment of the present invention uses cryptographic algorithms to ensure data consistency in a peer-to-peer network environment, and consensus based on the Byzantine fault-tolerant consensus mechanism can effectively improve consensus efficiency; in the actual consensus process, a hierarchical regional consensus mechanism is adopted , Through the consensus reached in a small area, and the method of broadcasting, on the one hand, it is very compatible with the peer-to-peer network, on the other hand, it can reduce the waste of resources caused by mining, thereby effectively improving the efficiency of consensus.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Computing Systems (AREA)
- Strategic Management (AREA)
- Finance (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer And Data Communications (AREA)
- Hardware Redundancy (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
Description
Claims (18)
- 一种区块链共识方法,其应用于与客户端处于同一网络中的主节点,所述方法包括:接收所述客户端发送的交易消息和至少一个对等节点发送的交易消息,或者,接收至少两个对等节点发送的交易消息;其中,所述对等节点与所述主节点、所述客户端均处于同一网络中;判断接收到的所述交易消息是否一致,若是,则将交易消息发送至上一级网络中的主节点。
- 根据权利要求1所述的方法,其中,所述交易消息包括交易数据和客户端的签名;所述接收客户端发送的交易消息和至少一个对等节点发送的交易消息、或者接收至少两个对等节点发送的交易消息包括:接收客户端发送的交易消息和至少一个对等节点发送交易消息,并分别对其进行验签;或者,接收至少两个对等节点发送的交易消息,并分别对其进行验签;其中,所述对等节点发送的交易消息包括所述客户端发送的交易消息和所述对等节点的签名。
- 根据权利要求1所述的方法,其中,所述判断接收到的所述交易消息是否一致,若是,则将交易消息发送至上一级网络中的主节点进一步包括:基于多数原则判断接收到的各个交易消息中的交易数据是否一致;若是,则在所述交易消息上附加上所述主节点的签名,并将所述交易消息发送至上一级网络中的主节点。
- 一种区块链共识方法,其应用于最高优先级网络中的主节点,所述方法包括:根据接收到的交易消息生成提案消息;基于拜占庭容错共识机制对所述提案消息进行共识判定;共识判定通过后,将所述提案消息发送至下一级网络中的主节点。
- 根据权利要求4所述的方法,其中,所述根据接收到的交易消息生成提案消息进一步包括:根据预设时间段内接收到的交易消息或者预设数量的交易消息,生成提案消息;其中,所述提案消息包括数据列表、本轮共识标识、所述最高优先级网络中的主节点标识和所述最高优先级网络中的主节点的签名。
- 根据权利要求4所述的方法,其中,所述基于拜占庭容错共识机制对所述提案消息进行共识判定进一步包括:将所述提案消息发送至所述主节点自身和所述最高优先级网络中的对等节点;接收所述提案消息,并基于拜占庭容错共识机制对所述提案消息进行共识判定。
- 根据权利要求6所述的方法,其中,所述基于拜占庭容错共识机制对所述提案消息进行共识判定进一步包括:对所述提案消息进行验签,验证通过后,根据所述提案消息生成写入消息;其中,所述写入消息包括本轮共识标识和签名;将所述写入消息广播至当前网络中的所有节点;对接收到的所述写入消息进行验签和共识规则判定,判定通过后,根据所述写入消息生成接收消息;其中,所述接收消息包括本轮共识标识和签名;将所述接收消息广播至当前网络中的所有节点;以及对接收到的所述接收消息进行验签和共识规则判定。
- 一种区块链共识方法,其应用于中等优先级网络中的主节点,所述方法包括:接收最高优先级网络中的主节点发送的提案消息,对所述提案消息进行验签;验签通过后,将所述提案消息中的交易数据写入区块,并在所述提案消息上附加上所述主节点的签名,将所述提案消息发送至与所述主节点处于同一网络中的对等节点和下一级网络中的主节点;直到所述下一级网络为所述客户端所处的网络。
- 一种区块链共识方法,其应用于与客户端处于同一网络中的对等节点,所述方法包括:接收所述客户端发送的交易消息,并对其进行验签;验签通过后,在所述交易消息上附加上所述对等节点的签名,并将所述交易消息发送至与所述对等节点处于同一网络中的主节点。
- 根据权利要求9所述的方法,进一步包括:接收提案消息,对所述提案消息进行验签;验签通过后,将所述提案消息中的交易数据写入区块,并向所述客户端发送应答消息。
- 一种区块链共识装置,其设置于与客户端处于同一网络中的主节点,所述装置包括:第一接收模块,用于接收所述客户端发送的交易消息和至少一个对等节点发送的交易消息,或者,接收至少两个所述对等节点发送的交易消息;其中,所述对等节点与所述主节点、所述客户端均处于同一网络中;第一发送模块,用于判断接收到的所述交易消息是否一致,若是,则将交易消息发送至上一级网络中的主节点。
- 一种区块链共识装置,其设置于最高优先级网络中的主节点,所述装置包括:提案模块,用于根据接收到的交易消息生成提案消息;共识模块,用于基于拜占庭容错共识机制对所述提案消息进行共识判定;第二发送模块,用于共识判定通过后,将所述提案消息发送至下一级网络中的主节点。
- 一种区块链共识装置,其设置于中等优先级网络中的主节点,所述装置包括:第二接收模块,用于接收最高优先级网络中的主节点发送的提案消息,对所述提案消息进行验签;写入模块,用于验签通过后,将所述提案消息中的交易数据写入区块,并在所述提案消息上附加上所述主节点的签名,将所述提案消息发送至与所述主节点处于同一网络中的对等节点和下一级网络中的主节点;直到所述下一级网络为所述客户端所处的网络。
- 一种区块链共识装置,其设置于与客户端处于同一网络中的对等节点,所述装置包括:第三接收模块,用于接收所述客户端发送的交易消息,并对其进行验签;第三发送模块,用于验签通过后,在所述交易消息上附加上所述对等节点的签名,并将所述交易消息发送至与所述对等节点处于同一网络中的主节点。
- 一种区块链共识方法,包括:客户端将交易消息发送至与所述客户端处于同一网络中的至少两个节点;其中,所述至少两个节点包括主节点和对等节点中的至少两 个;与所述客户端处于同一网络中的主节点接收所述客户端发送的交易消息和至少一个所述对等节点发送的交易消息,或者,接收至少两个所述对等节点发送的交易消息;若所述交易消息中的交易数据一致,则将交易消息发送至上一级网络中的主节点,直到所述上一级网络的优先级为最高;最高优先级网络中的主节点根据接收到的交易消息生成提案消息,并基于拜占庭容错共识机制对所述提案消息进行共识判定;共识判定通过后,将所述提案消息发送至下一级网络中的主节点,直到所述下一级网络为所述客户端所处的网络。
- 一种区块链共识***,包括:客户端,用于将交易消息发送至与所述客户端处于同一网络中的至少两个节点;其中,所述至少两个节点包括主节点和对等节点中的至少两个;与所述客户端处于同一网络中的主节点,用于接收所述客户端发送的交易消息和至少一个所述对等节点发送的交易消息,或者,接收至少两个所述对等节点发送的交易消息;若所述交易消息中的交易数据一致,则将交易消息发送至上一级网络中的主节点,直到所述上一级网络的优先级为最高;最高优先级网络中的主节点,用于根据接收到的交易消息生成提案消息,并基于拜占庭容错共识机制对所述提案消息进行共识判定;共识判定通过后,将所述提案消息发送至下一级网络中的主节点,直到所述下一级网络为所述客户端所处的网络。
- 一种电子设备,包括:一个或多个处理器;存储装置,用于存储一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行,使得所述 一个或多个处理器实现如权利要求1-10中任一所述的方法。
- 一种计算机可读介质,其上存储有计算机程序,所述程序被处理器执行时实现如权利要求1-10中任一所述的方法。
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US17/616,543 US20220239496A1 (en) | 2019-06-26 | 2020-03-03 | Blockchain consensus method, device and system |
JP2021568814A JP2022533396A (ja) | 2019-06-26 | 2020-03-03 | ブロックチェーンコンセンサス方法、装置及びシステム |
KR1020217040523A KR102566892B1 (ko) | 2019-06-26 | 2020-03-03 | 블록체인 합의 방법, 디바이스 및 시스템 |
JP2023184790A JP2024010123A (ja) | 2019-06-26 | 2023-10-27 | ブロックチェーンコンセンサス方法、装置及びシステム |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910560228.9A CN112150141A (zh) | 2019-06-26 | 2019-06-26 | 一种区块链共识方法、装置和*** |
CN201910560228.9 | 2019-06-26 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020258912A1 true WO2020258912A1 (zh) | 2020-12-30 |
Family
ID=73869776
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/077518 WO2020258912A1 (zh) | 2019-06-26 | 2020-03-03 | 一种区块链共识方法、装置和*** |
Country Status (5)
Country | Link |
---|---|
US (1) | US20220239496A1 (zh) |
JP (2) | JP2022533396A (zh) |
KR (1) | KR102566892B1 (zh) |
CN (1) | CN112150141A (zh) |
WO (1) | WO2020258912A1 (zh) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113179166A (zh) * | 2021-04-13 | 2021-07-27 | 华东师范大学 | 基于高鲁棒性拜占庭容错的联盟链数据安全实时上链方法 |
CN113364874A (zh) * | 2021-06-09 | 2021-09-07 | 网易(杭州)网络有限公司 | 基于区块链的节点同步方法、装置、存储介质及服务器 |
CN115002221A (zh) * | 2022-06-06 | 2022-09-02 | 长春理工大学 | 一种适用于物联网的区块链共识方法及*** |
CN116720917A (zh) * | 2023-06-16 | 2023-09-08 | 深圳职业技术学院 | 一种分布式碳交易市场共识方法 |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112634054A (zh) * | 2021-01-11 | 2021-04-09 | 杭州复杂美科技有限公司 | 交易执行方法、区块链一体机和区块链网络 |
CN115499128A (zh) * | 2021-06-01 | 2022-12-20 | 中移雄安信息通信科技有限公司 | 区块链共识方法、装置、***及存储介质 |
CN113489792B (zh) * | 2021-07-07 | 2023-02-03 | 上交所技术有限责任公司 | 一种在跨数据中心集群共识算法中减少数据中心间网络传输次数的方法 |
CN113922864B (zh) * | 2021-10-09 | 2023-07-28 | 郑州大学 | 一种基于拜占庭共识的多层卫星网络安全保障方法 |
KR20230115721A (ko) * | 2022-01-27 | 2023-08-03 | 주식회사 미디움 | 블록체인 합의 방법, 블록체인 합의 장치, 블록체인 합의 방법을 수행하는 컴퓨터 프로그램 및 합의 방법이 저장된 프로그램이 저장된 컴퓨터 프로그램 기록매체 |
KR102439351B1 (ko) * | 2022-02-10 | 2022-09-01 | 주식회사 스카이플레이 | Esg를 위한 비채굴 블록체인 네트워크 시스템 및 그 시스템에 참여하는 서버 노드의 동작 방법 |
CN117411894A (zh) * | 2022-07-08 | 2024-01-16 | 腾讯科技(深圳)有限公司 | 共识网络的数据处理方法、装置、程序产品、设备和介质 |
CN117221332B (zh) * | 2023-06-08 | 2024-04-12 | 天津大学 | 基于多领导者拜占庭容错共识的高鲁棒***易打包方法 |
CN116566995B (zh) * | 2023-07-10 | 2023-09-22 | 安徽中科晶格技术有限公司 | 一种基于分类、聚类算法的区块链数据传输方法 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107392608A (zh) * | 2017-07-11 | 2017-11-24 | 北京博晨技术有限公司 | 基于区块链***的数字资产交易方法及区块链*** |
CN108134706A (zh) * | 2018-01-02 | 2018-06-08 | 中国工商银行股份有限公司 | 区块链多活高可用***、计算机设备以及方法 |
CN109039847A (zh) * | 2018-08-07 | 2018-12-18 | 广州三牛信息科技有限公司 | 一种利用dmt解决区块链全网消息一致性问题的方法及装置 |
CN109819003A (zh) * | 2017-11-22 | 2019-05-28 | 南京理工大学 | 一种区块链的分层共识方法和*** |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11108627B2 (en) * | 2016-12-30 | 2021-08-31 | Intel Corporation | Object identification for groups of IoT devices |
CN110445619B (zh) * | 2017-03-30 | 2020-10-16 | 腾讯科技(深圳)有限公司 | 区块链***、消息处理方法及存储介质 |
KR20200032086A (ko) * | 2017-06-01 | 2020-03-25 | 쉬비, 인크. 디/비/에이 액소니 | 안전한 액세스 제한 관리를 통해 분산된 블록 체인 데이터 구조 배포 |
US20190251199A1 (en) * | 2018-02-14 | 2019-08-15 | Ivan Klianev | Transactions Across Blockchain Networks |
US20190305957A1 (en) * | 2018-04-02 | 2019-10-03 | Ca, Inc. | Execution smart contracts configured to establish trustworthiness of code before execution |
CN108665365B (zh) * | 2018-05-16 | 2021-07-13 | 四川大学 | 一种混合区块链架构***、处理方法及处理*** |
CN108984662B (zh) * | 2018-06-28 | 2021-02-09 | 杭州复杂美科技有限公司 | 一种区块链数据同步方法 |
US11270017B2 (en) * | 2018-10-16 | 2022-03-08 | International Business Machines Corporation | Selective exchange of transaction data |
-
2019
- 2019-06-26 CN CN201910560228.9A patent/CN112150141A/zh active Pending
-
2020
- 2020-03-03 WO PCT/CN2020/077518 patent/WO2020258912A1/zh active Application Filing
- 2020-03-03 US US17/616,543 patent/US20220239496A1/en active Pending
- 2020-03-03 KR KR1020217040523A patent/KR102566892B1/ko active IP Right Grant
- 2020-03-03 JP JP2021568814A patent/JP2022533396A/ja active Pending
-
2023
- 2023-10-27 JP JP2023184790A patent/JP2024010123A/ja active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107392608A (zh) * | 2017-07-11 | 2017-11-24 | 北京博晨技术有限公司 | 基于区块链***的数字资产交易方法及区块链*** |
CN109819003A (zh) * | 2017-11-22 | 2019-05-28 | 南京理工大学 | 一种区块链的分层共识方法和*** |
CN108134706A (zh) * | 2018-01-02 | 2018-06-08 | 中国工商银行股份有限公司 | 区块链多活高可用***、计算机设备以及方法 |
CN109039847A (zh) * | 2018-08-07 | 2018-12-18 | 广州三牛信息科技有限公司 | 一种利用dmt解决区块链全网消息一致性问题的方法及装置 |
Non-Patent Citations (1)
Title |
---|
LIBO FENG, HUI ZHANG, YONG CHEN, LIQI LOU: "Scalable Dynamic Multi-Agent Practical Byzantine Fault-Tolerant Consensus in Permissioned Blockchain", APPLIED SCIENCES, MDPI, BASEL, SWITZERLAND, vol. 8, no. 10, Basel, Switzerland, pages 1 - 21, XP055723251, ISSN: 2076-3417, DOI: 10.3390/app8101919 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113179166A (zh) * | 2021-04-13 | 2021-07-27 | 华东师范大学 | 基于高鲁棒性拜占庭容错的联盟链数据安全实时上链方法 |
CN113179166B (zh) * | 2021-04-13 | 2022-07-08 | 华东师范大学 | 基于高鲁棒性拜占庭容错的联盟链数据安全实时上链方法 |
CN113364874A (zh) * | 2021-06-09 | 2021-09-07 | 网易(杭州)网络有限公司 | 基于区块链的节点同步方法、装置、存储介质及服务器 |
CN113364874B (zh) * | 2021-06-09 | 2022-06-10 | 网易(杭州)网络有限公司 | 基于区块链的节点同步方法、装置、存储介质及服务器 |
CN115002221A (zh) * | 2022-06-06 | 2022-09-02 | 长春理工大学 | 一种适用于物联网的区块链共识方法及*** |
CN115002221B (zh) * | 2022-06-06 | 2023-06-23 | 长春理工大学 | 一种适用于物联网的区块链共识方法及*** |
CN116720917A (zh) * | 2023-06-16 | 2023-09-08 | 深圳职业技术学院 | 一种分布式碳交易市场共识方法 |
Also Published As
Publication number | Publication date |
---|---|
US20220239496A1 (en) | 2022-07-28 |
CN112150141A (zh) | 2020-12-29 |
JP2022533396A (ja) | 2022-07-22 |
KR102566892B1 (ko) | 2023-08-11 |
KR20220006623A (ko) | 2022-01-17 |
JP2024010123A (ja) | 2024-01-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020258912A1 (zh) | 一种区块链共识方法、装置和*** | |
WO2020168937A1 (zh) | 区块链多方见证方法、装置、设备及计算机可读存储介质 | |
JP6985576B2 (ja) | ビジネスプロセスシステム、ビジネスデータ処理方法及び装置 | |
US11502854B2 (en) | Transparently scalable virtual hardware security module | |
WO2018177124A1 (zh) | 业务处理方法、装置、数据共享***及存储介质 | |
WO2018076759A1 (zh) | 基于区块链的多链管理方法、***、电子装置及存储介质 | |
US20210304201A1 (en) | Transaction verification method and apparatus, storage medium, and electronic device | |
JP2020516105A (ja) | 分散システムにおけるネットワークノードに対する回復処理の実行 | |
US11777914B1 (en) | Virtual cryptographic module with load balancer and cryptographic module fleet | |
US9641340B2 (en) | Certificateless multi-proxy signature method and apparatus | |
JP2009534940A (ja) | ピアツーピアコンタクト情報交換 | |
WO2022057275A1 (zh) | 校验数据的方法、装置、设备和计算机可读介质 | |
JP2024505692A (ja) | ブロックチェーンネットワークに基づくデータ処理方法、装置及びコンピュータ機器 | |
CN111125781B (zh) | 一种文件签名方法、装置和文件签名验证方法、装置 | |
Rui et al. | Research on secure transmission and storage of energy IoT information based on Blockchain | |
CN113206746B (zh) | 一种数字证书管理方法和装置 | |
CN113873004B (zh) | 一种任务执行方法和装置以及分布式计算*** | |
WO2022088710A1 (zh) | 一种镜像管理方法及装置 | |
WO2023231558A1 (zh) | 区块链共识方法、装置、介质、电子设备和程序产品 | |
WO2024021406A1 (zh) | 一种防范网络攻击的方法及装置 | |
WO2023185042A1 (zh) | 直连通道的建立方法及装置 | |
EP4365808A1 (en) | Data verification method and apparatus | |
CN113179169B (zh) | 一种数字证书管理方法和装置 | |
CN113112269B (zh) | 多重签名方法、计算机设备和存储介质 | |
US9154548B2 (en) | Auditable distribution of a data file |
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: 20830581 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 2021568814 Country of ref document: JP Kind code of ref document: A |
|
ENP | Entry into the national phase |
Ref document number: 20217040523 Country of ref document: KR Kind code of ref document: A |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS (EPO FORM 1205A DATED 14.04.2022) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20830581 Country of ref document: EP Kind code of ref document: A1 |