CN115002111B - Block chain consensus method based on group tree structure - Google Patents

Block chain consensus method based on group tree structure Download PDF

Info

Publication number
CN115002111B
CN115002111B CN202210564115.8A CN202210564115A CN115002111B CN 115002111 B CN115002111 B CN 115002111B CN 202210564115 A CN202210564115 A CN 202210564115A CN 115002111 B CN115002111 B CN 115002111B
Authority
CN
China
Prior art keywords
node
block
message
proposed
leaf
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210564115.8A
Other languages
Chinese (zh)
Other versions
CN115002111A (en
Inventor
胡凯
万季
任旖航
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beihang University
Original Assignee
Beihang University
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 Beihang University filed Critical Beihang University
Priority to CN202210564115.8A priority Critical patent/CN115002111B/en
Publication of CN115002111A publication Critical patent/CN115002111A/en
Application granted granted Critical
Publication of CN115002111B publication Critical patent/CN115002111B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/44Star or tree networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/04Network management architectures or arrangements
    • H04L41/044Network management architectures or arrangements comprising hierarchical management structures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer And Data Communications (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a block chain consensus method based on a group tree structure, wherein nodes participating in consensus communicate in a tree topology, a block chain link point group tree divides block chain link points into a plurality of different groups, and consensus and broadcast are independently performed in each group, so that the block chain system consistency consensus is realized, the algorithm has higher performance and expandability, n-n broadcast among the nodes is avoided, the number of message communication is reduced, and the system performance is improved through the tree topology. And the block chain consensus method comprises four stages of a preparation stage, an proposing stage, a confirming stage and a determining stage, so that the block consistency consensus is realized, n-n broadcasting among nodes is avoided, the communication of tree node topology is realized, the network communication and the calculation amount of related nodes are reduced through the parallel broadcasting of groups, and the algorithm has higher performance and expandability.

Description

Block chain consensus method based on group tree structure
Technical Field
The invention relates to a block chain consensus method based on a group tree structure.
Background
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus algorithm, encryption algorithm and the like. The block chain is formed by a single block, each block records the state change of the database at the current time, all blocks can be combined into complete historical data, in order to prevent the splitting or the forging of the block chain state, the blocks are linked by using a hash value, and the linear sequence formed among the blocks is not changeable. It is the special block structure and operation mechanism that makes the blockchain technique possess decentralization, anonymity, non-tampering, security and stability characteristics. The block chain solves the trust problem in the open network environment, can be used as an important support technology in the business field needing to construct wide trusted relationship, and can be combined with the industries of payment settlement, data sharing, electronic evidence storage, traceability, food and the like for expansion and application.
The consensus algorithm is an algorithm for enabling all participants to achieve agreement on task execution results in a multi-party collaborative environment, is mostly applied to ensuring data consistency of a distributed system, and is the basis and core of a block chain technology. To add a block to a blockchain system, it needs to pass through the consensus of each node of the blockchain, and the non-tamper property of the blockchain is also ensured by the consensus algorithm of the blockchain. The block chain is used as a decentralized distributed system, the decision weight is dispersed in each node, and trust is not needed between the nodes, so that the effectiveness of the block data of each node is consistent by using a consensus algorithm for achieving the purpose of joint accounting. The consensus algorithm, as a key technology in the blockchain, directly affects the transaction processing capability, expandability and security of the blockchain, and thus becomes a hotspot of research on the blockchain technology.
The Practical Byzantine Fault-tolerant algorithm (PBFT) is proposed to solve the problem of the Byzantine consistency, and although there are other commonly used algorithms for solving the problem of the Byzantine consistency, such as HQ, zyzzyva, etc., the block chain technology mainly uses the Practical Byzantine Fault-tolerant algorithm to solve the problem of the data consistency in the block chain.
The practical Byzantine fault-tolerant algorithm allows f = (n-1)/3 nodes to have errors on the premise of ensuring the activity (liveness) and the safety (safety) of the algorithm, wherein f is the number of the error nodes, and n is the total number of the nodes. Security means that the replication service satisfies linear consistency, the distributed system performs operations atomically like a centralized system, and all clients will eventually receive replies to their requests as long as the number of failed replicas does not exceed (n-1)/3 and the delay (t) does not grow indefinitely. In the algorithm, nodes are divided into a main node and a replica node, and the relationship between the main node and the replica node is changed only when view change is carried out, so that the nodes are not equal to each other.
The practical Byzantine fault-tolerant algorithm removes two stages of requests and responses, and mainly comprises three stages: a pre-preparation phase, a preparation phase and a confirmation phase. In the algorithm, the client only sends the request information to the main node, and the replica node cannot receive the corresponding information, so that the loyalty of the main node is relied on in the whole consistency process. In the response phase, both the primary node and the replica node respond, and the client selects the majority of the response results to determine the final result of the request. The pre-preparation stage is that the main node numbers the request received from the client and broadcasts the calculated data to each copy node; and the replica node judges the information such as message signature, abstract, view number and the like according to the information sent by the main node, and finally broadcasts the judgment result of the node to all other nodes. Since the phase is a consistency process initiated by the master node, the master node does not send decision information about the phase, and only the replica node broadcasts the decision information. The preparation phase is that all nodes broadcast the preparation message of the node after receiving the pre-preparation message, and then the nodes verify the signature of the preparation message and verify whether the view number is valid or not after receiving the preparation message. The preparation phase is complete after receiving 2f identical pre-preparation and preparation messages sent from different nodes. In the confirmation phase, after the preparation phase is completed, the received information is firstly verified, and if the received information passes the verification, the confirmation information is broadcasted to other nodes, and then the confirmation phase is entered. After the node enters the confirmation stage, when confirmation messages sent by other nodes are received, the signature of the message is judged, the validity of the view to which the message belongs is verified, after 2f +1 confirmation messages are received, the confirmation stage is finished, the confirmation messages are fed back to the client, and therefore the whole algorithm process is finished.
The message communication complexity of the PBFT consensus algorithm is O (n) 2 ) And the nodes need to advance a consensus step through n-n interaction, and as the number of the nodes increases, the throughput tends to decline rapidly.
The fragmentation technology is to divide the network into different groups, and to ensure that each group processes different transactions by a certain distribution means, and finally to achieve the result that the common computer simultaneously solves the transactions of high order of magnitude. Scalability is an important performance indicator of blockchains, meaning that as the number of nodes in a blockchain network increases, the processing performance of the system for transactions also increases. The sharding technique is a commonly used technical solution for improving performance in distributed databases, such as the Spanner of Google.
In the field of block chains, fragmentation is only an idea introduced in the field of distributed systems, and there are three fragmentation modes in the specific practical process: network fragmentation, transaction fragmentation, and status fragmentation. The implementation difficulty of the three slices and the segmentation degree of the block chain system architecture are gradually increased. The first two fragments are firstly proposed and implemented, are the basic implementation specifications of the fragment scheme, and are called as a partial fragment scheme, because the partial fragment scheme only fragments the nodes and the transaction which are elements in the consensus process, the parallelization of the consensus process is realized, but the nodes of the whole network are still required to share the same complete global account book. The state fragmentation also fragments the storage state of the ledger, which is also called a full fragmentation scheme, the global ledger is segmented into each fragmentation, and each fragmentation only maintains part of ledger data related to own user.
The network fragmentation is to distribute nodes in the network into different fragments by using an algorithm, and data stored between different fragments is consistent. It is not enough to simply use a random algorithm to assign nodes to different pieces, and we must also ensure the consistency of opinions of different members of one piece of the network. The transaction fragment is to distribute the transaction to different fragments for processing according to different transaction types, for example, the transaction is classified and divided according to Hash, type, characteristics and the like of the transaction, and data consistency still needs to be maintained among different fragments. The state fragmentation divides the whole storage area, and different fragments store different parts, so that each node is only responsible for hosting own fragmentation data, but not storing the complete block chain state.
In most of the existing block chain consensus algorithms, when a new block is generated, nodes participating in consensus need to communicate with all other nodes, message communication needs to be performed between the nodes through n-n broadcasting, the number of message communication between the nodes is exponentially increased along with the increase of the number of the nodes, and the message communication complexity is high. In addition, the blockchain master node often needs to collect messages of all nodes participating in consensus and pack transaction information in all nodes into a new block, and network communication and calculation amount borne by the master node is large, which becomes a bottleneck of performance and expandability of the blockchain system.
Disclosure of Invention
In order to solve the above technical problems, the present invention provides a block chain consensus method based on a group tree architecture.
The invention adopts the following technical scheme:
a blockchain consensus method based on a group tree architecture, the group tree architecture including three levels of nodes, namely a root node, a child node and a leaf node, the child node being a next level node of the root node, the leaf node being a next level node of the child node, the blockchain consensus method comprising:
a preparation stage: the leaf node generates and sends a first preparation message to a corresponding child node according to a received command sent by a user, wherein the first preparation message comprises related data of a block requested to be generated; the child nodes process the received first preparation messages from different leaf nodes, generate and send second preparation messages to the root node;
a proposal phase: traversing the self group tree by the root node, and sending a first block proposal message to all child nodes; the child node receives the first block proposal message from the root node and then carries out relevant verification, and if the verification is passed, the child node sends a second block proposal message to a corresponding leaf node;
and (3) confirmation stage: the leaf node carries out validity verification of the block proposal according to the second block proposal message, and if the verification is passed, the leaf node sends a first confirmation message to the corresponding child node; the child node collects first confirmation messages of all corresponding leaf nodes, and if the first confirmation messages of all the corresponding leaf nodes are received, the child node generates and sends second confirmation messages to the root node;
a decision phase; the root node verifies the validity according to the second confirmation message, and if the second confirmation message passes the verification, a first block proposal decision message is generated and sent to the child node; the child node receives the first block proposal decision message and then carries out validity verification, and if the verification is passed, a second block proposal decision message is generated and sent to the leaf node; the leaf node verifies the validity of the second block proposal decision message, and if the verification is passed, the leaf node executes a corresponding command.
As a specific embodiment, the first prepare message includes a command list that the leaf node takes from the command buffer pool in time sequence, a timestamp of a transmission transaction corresponding to the leaf node, a view of a leaf node request generation block, a height of the leaf node request generation block, and a hash value corresponding to the leaf node, where the hash value corresponding to the leaf node is calculated from the timestamp of the transmission transaction corresponding to the leaf node, the view of the leaf node request generation block, the height of the leaf node request generation block, and the command list that the leaf node takes from the command buffer pool in time sequence;
the child node processes the received first preparation message from different leaf nodes, generates and sends a second preparation message to the root node, and the method comprises the following steps:
the second preparation message comprises a command list corresponding to the child node, a timestamp of a sending transaction corresponding to the child node, a view of a block requested to be generated by the child node, the height of the block requested to be generated by the child node and a hash value corresponding to the child node;
the command list corresponding to the child node is the superposition of command lists taken by all leaf nodes corresponding to the child node from the command buffer pool according to the time sequence;
the hash value corresponding to the child node is obtained by calculating a timestamp of a sending transaction corresponding to the child node, a view of a block requested to be generated by the child node, the height of the block requested to be generated by the child node and a command list corresponding to the child node.
As one embodiment, the first block proposal message includes a root node proposed block, a root node proposed view, a root node proposed block height, and a root node corresponding signature; the signature corresponding to the root node is obtained according to the block proposed by the root node, the view proposed by the root node and the height of the block proposed by the root node;
the second block proposal message comprises the first block proposal message and a signature corresponding to the child node, and the signature corresponding to the child node is obtained according to the block proposed by the root node, the view proposed by the child node and the block height proposed by the child node.
As an embodiment, in the proposal phase, after receiving the first block proposal message from the root node, the child node performs relevant verification, including:
verifying the validity of a signature corresponding to a root node in the first block proposal message, if the validity verification is passed, judging whether the identity of the root node is consistent with the identity of the root node in the group tree of the user, if so, judging whether a view proposed by the root node is consistent with a view of a block requested to be generated by a child node, and judging whether the height of the block proposed by the root node is consistent with the height of the block requested to be generated by the child node, if so, judging that the final verification is passed.
As a specific embodiment, the first confirmation message includes a view of the leaf node request generation block, a height of the leaf node request generation block, and a partial threshold signature vote generated by the leaf node for the proposed block of the root node;
the second confirmation message comprises a view of the child node requesting generation of the block, a height of the child node requesting generation of the block, and a partial threshold signature vote within the group; the partial threshold signature votes within the group are a superposition of the partial threshold signature votes generated for the proposed block of the root node for all leaf nodes.
As an embodiment, in the validation stage, the leaf node performs validity verification of the block proposal according to the second block proposal message, including:
if the command list chronologically fetched by the leaf node from the command buffer pool is contained in the block proposed by the root node, and the view of the block requested to be generated by the leaf node is consistent with the view proposed by the root node and the height of the block requested to be generated by the leaf node is consistent with the height of the block proposed by the root node, the validity verification is passed.
As a specific implementation manner, in the decision phase, the root node performs validity verification according to the second acknowledgement message, including: if the root node receives second confirmation messages of effective department threshold signature votes exceeding a first preset threshold value, the validity verification is passed;
the first block proposal decision message comprises a block proposed by a root node, a view proposed by the root node, a block height proposed by the root node and a complete threshold signature, and the complete threshold signature is obtained by voting and synthesizing partial threshold signatures valid in the second confirmation message;
the child node performing validity verification after receiving the first block proposal decision message, comprising:
and the child node judges whether the sender of the first block proposal decision message is the root node in the self group tree, if so, the validity of the complete threshold signature in the first block proposal decision message is verified, and if the validity is verified, the verification is passed.
As one embodiment, the second block proposal decision message includes the first block proposal decision message and a signature corresponding to the child node; the signature corresponding to the child node is obtained according to the block proposed by the root node, the view proposed by the child node and the height of the block proposed by the child node;
the leaf node validates the second block proposal decision message, and if the validation is passed, executes a command, including:
the leaf node determining whether a height of a root node proposed block in the second block proposal decision message is consistent with a height of a leaf node request generation block, and whether a view of the root node proposed block in the second block proposal decision message is consistent with a view of a leaf node request generation block;
if the root node proposed block height in the second block proposal decision message is consistent with the leaf node request generated block height, and the root node proposed view in the second block proposal decision message is consistent with the leaf node request generated block view, then execute the corresponding command.
The block chain consensus method based on the group tree structure provided by the invention designs the block chain link point group tree structure, nodes participating in consensus communicate in a tree topology, the block chain link point group tree divides block chain links into a plurality of different groups, consensus and broadcasting are independently performed inside each group, the block chain system consistency consensus is realized based on a three-layer structure of the group tree, so that the algorithm has higher performance and expandability, n-n broadcasting among the nodes is avoided, broadcasting and calculation tasks are distributed to each group by the tree topology structure to be executed, the number of message communication is reduced, and the system performance is improved by the tree topology. In addition, in the block chain consensus process based on the group tree structure, block consistency consensus is realized through four stages, namely a preparation stage, an proposing stage, a confirming stage and a determining stage, n-n broadcasting among nodes is avoided, tree node topology communication is realized, network communication and calculation amount of related nodes are reduced through group parallel broadcasting, and the algorithm has high performance and expandability.
Drawings
In order to more clearly illustrate the technical solution of the embodiment of the present invention, the drawings needed to be used in the embodiment will be briefly described as follows:
FIG. 1 is a block diagram of a group tree architecture provided in an embodiment of the present application;
fig. 2 is a flowchart illustrating four stages of a block chain consensus method based on a group tree structure according to an embodiment of the present disclosure.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items and includes such combinations.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
In order to explain the technical means described in the present application, the following description will be given by way of specific embodiments.
Before describing the block chain consensus method based on the block chain structure in detail, the block chain node point group tree structure is introduced first, and hereinafter referred to as a group tree for short. The group tree includes three levels of nodes, which are a root node, a child node and a leaf node, respectively, the child node is a next level node of the root node, and the leaf node is a next level node of the child node. As shown in fig. 1, the root node identity is the leader, and therefore, the root node is also referred to as the leader node. The child nodes are forwarder nodes and the leaf nodes are listener nodes. All child nodes and leaf nodes share a unique root node. In this embodiment, each group includes one forwarder node and several listener nodes. The node functions of the group and the individual identities are as follows:
group (2): n nodes in the node set are divided into k groups with similar sizes<C 1 ,C 2 ,..,C k >Each group C k Therein at least comprises
Figure BDA0003657110820000091
And each block chain node. Each group contains a unique forwarder node and several listener nodes.
The leader node: the system is a root node of a group tree, only one leader node exists in the system at the same time, and the leader node is only communicated with a forwarder node. The leader node has two roles: (1) It is responsible for proposing new blocks and sending the proposed blocks to the forwarder node; (2) It verifies the partial threshold signature message sent by the forwarder node. If a partial threshold signature is received that is valid beyond the threshold value, it may combine the partial threshold signatures into a complete threshold signature.
The forwarder node: each group C k There is one and only one forwarder node, which has two roles: (1) The method comprises the steps that the method communicates with a leader node, verifies a message signature sent by the leader, and sends a message or a block proposal containing a complete threshold signature sent by the leader to nodes in a group; (2) It is related to the audiences in the groupThe nodes communicate, collect partial threshold signatures or transaction information of the nodes of the audiences in the group and send the partial threshold signatures or the transaction information to the leader.
The listener node: the slave listening node does not communicate directly with the leader node, it communicates directly with the forwarder node, and updates its own state based on the message. The follower node has two roles: (1) It collects the order information sent by the user and sends it to the forwarder node; (2) It determines whether the message sent by the forwarder node is valid and whether to send a partial threshold signature to the forwarder node as voting information.
In this embodiment, a threshold signature mechanism is used to vote on a message. All nodes hold the same single public key and verification function, node N i A partial signature of a message may be generated using a private key and a signature function. If the node receives partial threshold signatures of at least threshold t messages, a complete threshold signature can be synthesized by a signature function. Other nodes may verify the validity of the full threshold signature using the public key and a verification function.
As shown in FIG. 1, assume that the blockchain system consists of 14 nodes, divided into 3 groups<C 1 ,C 2 ,C 3 >Node N 1 Is the leader node, node N 2 、N 6 、N 10 If it is a forwarder node and the other nodes are listener nodes, the group C 1 =<N 2 ,N 3 ,N 4 ,N 5 >Group C 2 =<N 6 ,N 7 ,N 8 ,N 9 >Group C 3 =<N 10 ,N 11 ,N 12 ,N 13 ,N 14 >. User 1 sends transaction 3 to the listener nodes in group 1, users 2, 3 send transactions 6, 9 to the listener nodes in group 2, and users 4, 5 can still download complete block information containing transaction 3, transaction 6 and transaction 9, although not sending transactions to the listener nodes in group 3. The block information downloaded by the user from different groups is the same, and the same block contains the complete transaction information from different groups.
After nodes participating in consensus are constructed into a tree topology to communicate, how to collect command information received by a user and sent by a listener to enable a system to continuously generate new blocks and achieve efficient data consistency consensus of different nodes is still a problem to be solved, and then the block chain consensus method based on the group tree architecture is introduced to achieve data consensus based on the block chain link point group tree architecture.
The user first needs to establish a connection with a blockchain link point in order to send commands to the blockchain system or to obtain commands from the blockchain system. The user broadcasts a connection establishment request to the listener nodes, and selects an appropriate listener node to establish connection according to network delay of the user and the listener nodes and resource consumption conditions of the listener nodes. The listener nodes are in a one-to-many relationship with the users, each listener node can serve multiple users, but each user can only be connected with one listener node. Suppose that at this time, user and listener nodes N k A connection is established.
The block chain consensus method based on the group tree structure provided in this embodiment includes four phases during the algorithm execution, which are a preparation Phase (preparation Phase), a proposed Phase (forward Phase), a confirmation Phase (Commit Phase), and a decision Phase (decision Phase), as shown in fig. 2. Each stage will be specifically described below.
Preparatory Phase (prep Phase): the leaf node generates and sends a first preparation message to a corresponding child node according to a received command sent by a user, wherein the first preparation message comprises related data of a block requested to be generated; the child node processes the received first prepare message from a different leaf node, generates and sends a second prepare message to the root node.
Sleeper node N k Gathering commands sent by the user or responding to command inquiry requests of the user. When receiving a sending command from a user, classifying the received command from the user according to a sending user account, and sequencing transactions initiated by the same user account according to the sending time. In this embodiment, the listener node N k Corresponding forwarder nodePoint to forwarder node N j . The command sent by the user may be a command for generating a tile, or may be other related commands, such as a transaction command. Sleeper node N k According to the received command sent by the user, generating and sending the command to the forwarder node N j Sending a first Prepare message, i.e. Prepare k A message. As an embodiment, when the listener node timer expires or the number of commands in the command buffer pool reaches the maximum value of the number of commands contained in a single block, the listener node N k To the forwarder node N j Sending Prepare k Message, prepare k The message specifically consists of:
Prepare k =(Trans k ,v′ k ,h′ k ,t k ,Hash k )
wherein, trans k Representing listener node N k Lists of commands, t, taken chronologically from a command buffer pool k Node N being the listener k Corresponding timestamp of the transmitted transaction, v' k Node N being the listener k Request to generate View, h 'of tiles' k Node N being the listener k Requesting the height of the generating block, hash k Node N for the listener k The corresponding hash value. According to listener node N k Time stamp t of the corresponding send transaction k Node N of listening follower k Request to generate view v 'of tile' k Node N of listening and receiving k Requesting to generate height h 'of tile' k And listener node N k Trans-list of commands taken from a buffer pool of commands in chronological order k Calculating Hash k
Thus, prepare k The message comprises a slave node N k Time stamp t of the corresponding send transaction k Node N of listening and receiving k Request to generate view v 'of tile' k Node N of listening and receiving k Requesting to generate height h 'of tile' k Node N of listening and receiving k Trans command list chronologically taken from a command buffer pool k And Hash k
Forwarder node N j Prepare received from corresponding different listener nodes k The message is processed to obtain a second prepared message, i.e. Prepare j A message. The specific treatment process is as follows:
Prepare j the message specifically consists of:
Figure BDA0003657110820000121
Figure BDA0003657110820000122
representing a forwarder node N j The corresponding command list is known by the calculation formula, and the forwarder node N j The corresponding command list is associated with the forwarder node N j Superposition of the list of commands chronologically taken from the command buffer pool by all the corresponding slave listening nodes, | C m I denotes the forwarder node N j The number of listener nodes in the group; t is t j Representing a forwarder node N j Corresponding timestamp, v 'of the transmitted transaction' j Representing a forwarder node N j Request to generate view, h 'of tile' j Representing a forwarder node N j Requesting the height of the generating block, hash j Representing a forwarder node N j The corresponding hash value. It should be understood that the forwarder node N j Corresponding Hash value Hash j By forwarder node N j Time stamp t of the corresponding send transaction j Forwarder node N j Request to generate view v 'of tile' j Forwarder node N j Requesting to generate height h 'of tile' j And forwarder node N j Corresponding command list
Figure BDA0003657110820000123
And (4) calculating.
Thus, prepare j The message comprises: forwarder node N j Corresponding command list
Figure BDA0003657110820000124
Forwarder node N j Corresponding Hash value Hash j Forwarder node N j Time stamp t of the corresponding send transaction j Forwarder node N j Request to generate view v 'of tile' j And forwarder node N j Requesting height h 'of a generated tile' j
Proposed Phase (pro Phase): traversing the self group tree by the root node, and sending a first block proposal message to all child nodes; and after receiving the first block proposal message from the root node, the child nodes carry out relevant verification, and if the verification is passed, the child nodes send second block proposal messages to corresponding leaf nodes.
Leader node N i Traversing the self group tree, and sending a first block proposal message, namely a block proposal prompt, to all the forwarder nodes i A message. Block proposal Propose i The message specifically consists of:
Figure BDA0003657110820000125
Figure BDA0003657110820000126
representing leader node N i Proposed Block, v' i Representing leader node N i Proposed View, h' represents leader node N i The height of the proposed block is such that,
Figure BDA0003657110820000127
representing leader node N i The corresponding signature. Wherein the leader node N i Corresponding signature
Figure BDA0003657110820000128
According to leader node N i Proposed Block
Figure BDA0003657110820000129
Leader node N i Proposed View v' i And leader node N i Proposed Block height h' i The obtained and obtained light-emitting diode is, moreover,
Figure BDA0003657110820000131
is by the leader node N i Generated using a private key and a signature function.
Thus, block proposal Propose i The message comprises: leader node N i Proposed Block
Figure BDA0003657110820000132
Leader node N i Proposed View v' i Leader node N i Proposed Block height h' i And signatures
Figure BDA0003657110820000133
Forwarder node N j Receiving node N from leader i Block proposal (2) of (1) i A message. In this embodiment, the forwarder node N j Receiving node N from leader i Block proposal (2) of (1) i And carrying out related verification after the message, wherein the verification process comprises the following steps: propose is proposed for a certificate block i Signing in messages
Figure BDA0003657110820000134
If the validity is verified, whether the identity of the forwarder node is consistent with the identity of the forwarder node in the self group tree is judged, and if so, the leader node N is judged i Proposed view v' i And forwarder node N j Request to generate view v 'of tile' j Whether consistent, and leader node N i Proposed Block height h' i And forwarder node N j Requesting height h 'of a generated tile' j Is consistent, i.e. v 'is satisfied' i =v′ j And h' i =h′ j And if so, judging that the final verification is passed. After the verification is passed, the forwarder node N j Searching the self group tree, and sending a second block proposal message, namely a block, to all the listener nodes in the self groupBlock proposal Propose j Message, block proposal Propose i The message specifically consists of:
Figure BDA0003657110820000135
Figure BDA0003657110820000136
is a forwarder node N j Corresponding signature, signature
Figure BDA0003657110820000137
According to leader node N i Proposed block
Figure BDA0003657110820000138
Forwarder node N j Requesting to generate view v 'of tile' j And leader node N i Proposed Block height h' h And (6) obtaining. Furthermore, a forwarder node N j V 'to View Using its own private Key and signature function' j And height h' j Block proposal of (2)
Figure BDA0003657110820000139
Signing to obtain a signature
Figure BDA00036571108200001310
Thus, block proposal Propose j The message comprises: block proposal Propose i Message and signature
Figure BDA00036571108200001311
Signature
Figure BDA00036571108200001312
And from the leader node N i Transmitted Propose i Message composition of new Propose j The message is sent to the listener slave node.
And a confirmation stage: the leaf node carries out validity verification of the block proposal according to the second block proposal message, and if the verification is passed, the leaf node sends a first confirmation message to the corresponding child node; and the child nodes collect the first confirmation messages of all corresponding leaf nodes, and if the first confirmation messages of all corresponding leaf nodes are received, the child nodes generate and send second confirmation messages to the root node.
Slave node N k Propose the Propose according to the block j The message performs validity verification of the block proposal, and as one embodiment, the following gives a specific verification process: if the slave node N k Trans command list chronologically taken from a command buffer pool k Is included in the leader node N i Proposed Block
Figure BDA0003657110820000141
I.e. the ordered command list of the self-proposal is included in the block proposal, i.e.
Figure BDA0003657110820000142
And listener node N k Request to generate view v 'of tile' k With leader node N i Proposed View v' i Coincident and listen follower node N k Requesting to generate height h 'of tile' k With leader node N i Proposed Block height h' i Consistent, meaning that the listening node considers the leader node N i Proposed Block
Figure BDA0003657110820000143
If the verification result is valid, the verification is passed. If the verification is passed, the node N of the listener k To the forwarder node N j Sending a first acknowledgement message, commit k Message, representing consent in corresponding View v' k And a height h' k The block proposal of (1). Commit k The specific composition of the message is as follows:
Figure BDA0003657110820000144
wherein
Figure BDA0003657110820000145
Representing listener node N k Generated for leader node N i Proposed Block
Figure BDA0003657110820000146
The partial threshold signature votes. Sleeper node N k Can be generated using private keys and signature functions
Figure BDA0003657110820000147
Therefore, commit k The message comprises: slave node N k Request to generate view v 'of tile' k Node N of listening and receiving k Requesting to generate height h 'of tile' k And partial threshold signature voting
Figure BDA0003657110820000148
Forwarder node N j Collecting Commit sent by each listener node in the group k Message, if receiving Commit sent by all the listener nodes k Message, then forwarder node N j Generating and directing leader node N i Sending a second acknowledgment message, commit j A message. Commit j The message is specifically composed as follows:
Figure BDA0003657110820000149
Figure BDA00036571108200001410
indicating partial threshold signature votes within a group, partial threshold signature votes within a group
Figure BDA00036571108200001411
Including all corresponding slave listening nodes, for the leader node N i Proposed Block
Figure BDA00036571108200001412
Partial threshold signature voting
Figure BDA00036571108200001413
And (4) superposing.
Then Commit j The message comprises: forwarder node N j View v' of request generation Block, forwarder node N j Height N' of request generation block and partial threshold signature voting within group
Figure BDA00036571108200001414
Hence, the forwarder node N j Part of collected threshold signature in group is transferred to Commit j In a message, sent to the leader node N i
A decision phase; the root node carries out validity verification according to the second confirmation message, and if the verification is passed, a first block proposal decision message is generated and sent to the child node; the child node receives the first block proposal decision message and then carries out validity verification, and if the verification is passed, a second block proposal decision message is generated and sent to the leaf node; the leaf node verifies the validity of the second block proposal decision message, and if the verification is passed, the leaf node executes a block generation command.
Leader node N i Receiving Commit j After the message, according to Commit j The message is validated, and as a specific implementation, a validation process is given as follows:
judging leader node N i Whether valid department threshold signature votes exceeding a first predetermined threshold are received
Figure BDA0003657110820000151
Since each Commit j All messages correspond to a department threshold signature vote
Figure BDA0003657110820000152
Then the leader node N i Receiving valid department threshold signature votes exceeding a first predetermined threshold
Figure BDA0003657110820000153
Equivalent as leader node N i Receiving votes exceeding a first predetermined threshold with valid department threshold signatures
Figure BDA0003657110820000154
Commit of j A message. In this embodiment, the first preset threshold value is t, t ≧ 2f, and f denotes the number of nodes which may fail. Then, if leader node N i Receiving more than t valid department-threshold signature votes
Figure BDA0003657110820000155
Representing leader node N i More than 2f views v 'are gathered' i And a height h' i Is considered to agree with the block proposal by most forwarder nodes
Figure BDA0003657110820000156
And (5) passing the verification. After the verification is passed, the leader node N i Generating a complete threshold signature by signature function
Figure BDA0003657110820000157
And broadcasting a first block proposal decision message, i.e., block proposal delete, to the forwarder node i Message, block proposal Decide i The message specifically consists of:
Figure BDA0003657110820000158
complete threshold signature
Figure BDA0003657110820000159
By Commit j And voting and synthesizing the effective partial threshold signatures in the message.
Thus, block proposalDecide i The message comprises: leader node N i Proposed Block
Figure BDA00036571108200001510
Leader node N i Proposed View v' i Leader node N i Proposed Block height h' i And full threshold signature
Figure BDA00036571108200001511
Forwarder node N j Receiving a block proposal Decide i After the message, validity verification is performed, and as a specific implementation, a validity verification process is given as follows: forwarder node N j Decision block proposed Decide i Whether the sender of the message is a leader node in the group tree of the sender, if so, verifying that the block proposes the Decide i Validity of the full threshold signature in the message may be verified using a public key and a verification function. And if the validity verification passes, the verification is passed. If the verification is passed, the forwarder node N j Searching the self-group tree, sending a second block proposal decision message, i.e. a block proposal delete, to all the listener nodes in the self-group j Message, block proposal Decide i The message specifically consists of:
Figure BDA0003657110820000161
thus, the block proposal Decide j The message includes a block proposal Decide i And signatures
Figure BDA0003657110820000162
Forwarder node N j Pair view v 'using its own private key and signature function' j And height h' j Block proposal of (2)
Figure BDA0003657110820000163
Carry out signatureTo sign a signature
Figure BDA0003657110820000164
And from the leader node N i Transmitted Decide i Message composition of new Decide j The message is sent to the listener slave node.
Slave node N k For Decide j The validity of the message is verified, and as a specific implementation, a specific verification process is given as follows: slave node N k Determination of Decide j Leader node N in a message i Proposed Block height h' i And listener node N k Requesting to generate height h 'of tile' k Whether consistent, and leader node N i Proposed view v' i And listener node N k Requesting to generate view v 'of tile' k Is consistent, namely, is h 'satisfied' k =h′ i And v' k =v′ i If h is satisfied' k =h′ i And v' k =v′ i Indicating listener node N k Dee as Decide j If the height and view of the requested production block in the message are consistent with the self-verification, executing corresponding command, specifically executing block proposal
Figure BDA0003657110820000165
Updating node N in response to the command j Height of (a) and self block chain structure.
Therefore, the application provides a group tree structure of block chain nodes, wherein the nodes participating in consensus communicate in a tree topology, the block chain link point group tree divides the block chain link points into a plurality of different groups, and the consensus and broadcast are independently performed in each group, so that n-n broadcast among the nodes is avoided. The tree topology structure disperses the broadcast and calculation tasks into each group for execution, thereby reducing the number of message communication. Moreover, the application provides a block chain consensus method based on a group tree structure, four-stage consensus algorithms including a preparation stage (Prepare Phase), a proposal stage (dispose Phase), a confirmation stage (Commit Phase) and a decision stage (delete Phase) are designed based on the group tree, and the communication of tree node topology is realized through a threshold signature algorithm message signature mechanism, so that the algorithm has high performance and expandability.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (8)

1. A blockchain consensus method based on a group tree structure, wherein the group tree structure comprises three levels of nodes, namely a root node, a child node and a leaf node, the child node is a node next to the root node, and the leaf node is a node next to the child node, the blockchain consensus method comprising:
a preparation stage: the leaf node generates and sends a first preparation message to a corresponding child node according to a received command sent by a user, wherein the first preparation message comprises related data of a block requested to be generated; the child nodes process the received first preparation messages from different leaf nodes, generate and send second preparation messages to the root node;
a proposal stage: traversing the self group tree by the root node, and sending a first block proposal message to all child nodes; after receiving the first block proposal message from the root node, the child node performs related verification, and if the verification is passed, the child node sends a second block proposal message to a corresponding leaf node;
and (3) confirmation stage: the leaf node carries out validity verification of the block proposal according to the second block proposal message, and if the verification is passed, the leaf node sends a first confirmation message to the corresponding child node; the child node collects first confirmation messages of all corresponding leaf nodes, and if the first confirmation messages of all the corresponding leaf nodes are received, the child node generates and sends second confirmation messages to the root node;
a decision phase; the root node carries out validity verification according to the second confirmation message, and if the verification is passed, a first block proposal decision message is generated and sent to the child node; the child node receives the first block proposal decision message and then carries out validity verification, and if the verification is passed, a second block proposal decision message is generated and sent to the leaf node; the leaf node verifies the validity of the second block proposal decision message, and if the verification is passed, the leaf node executes a corresponding command.
2. The block chain consensus method based on the group tree architecture as claimed in claim 1, wherein the first preparation message includes a command list taken by a leaf node from a command buffer pool in time sequence, a timestamp of a transmission transaction corresponding to the leaf node, a view of a leaf node request generation block, a height of the leaf node request generation block, and a hash value corresponding to the leaf node, and the hash value corresponding to the leaf node is calculated from the timestamp of the transmission transaction corresponding to the leaf node, the view of the leaf node request generation block, the height of the leaf node request generation block, and the command list taken by the leaf node from the command buffer pool in time sequence;
the child node processes the received first preparation message from different leaf nodes, generates and sends a second preparation message to the root node, and the method comprises the following steps:
the second preparation message comprises a command list corresponding to the child node, a timestamp of a sending transaction corresponding to the child node, a view of a block requested to be generated by the child node, the height of the block requested to be generated by the child node and a hash value corresponding to the child node;
the command list corresponding to the child node is the superposition of command lists taken by all leaf nodes corresponding to the child node from the command buffer pool according to the time sequence;
the hash value corresponding to the child node is obtained by calculating a timestamp of a sending transaction corresponding to the child node, a view of a block requested to be generated by the child node, the height of the block requested to be generated by the child node and a command list corresponding to the child node.
3. The group tree architecture-based blockchain consensus method of claim 1, wherein the first block proposal message comprises a root node proposed block, a root node proposed view, a root node proposed block height, and a root node corresponding signature; the signature corresponding to the root node is obtained according to the block proposed by the root node, the view proposed by the root node and the height of the block proposed by the root node;
the second block proposal message comprises the first block proposal message and a signature corresponding to the child node, and the signature corresponding to the child node is obtained according to the block proposed by the root node, the view proposed by the child node and the block height proposed by the child node.
4. The method of claim 3, wherein the performing the related verification after the child node receives the first block proposal message from the root node in the proposal phase comprises:
verifying the validity of a signature corresponding to a root node in the first block proposal message, if the validity verification is passed, judging whether the identity of the root node is consistent with the identity of the root node in the group tree of the root node, if so, judging whether a view proposed by the root node is consistent with a view of a block requested to be generated by a child node, and judging whether the height of the block proposed by the root node is consistent with the height of the block requested to be generated by the child node, if the view proposed by the root node is consistent with the view of the block requested to be generated by the child node, and the height of the block proposed by the root node is consistent with the height of the block requested to be generated by the child node, judging that the final verification is passed.
5. The group tree architecture-based block chain consensus method of claim 1, wherein said first acknowledgement message comprises a leaf node request to generate a view of a block, a leaf node request to generate a height of a block, and a leaf node generated partial threshold signature vote for a proposed block of a root node;
the second confirmation message comprises a view of the child node requesting generation of the chunk, a height of the child node requesting generation of the chunk, and a partial threshold signature vote within the group; the partial threshold signature votes within the group are a superposition of the partial threshold signature votes generated for the proposed block of the root node for all leaf nodes.
6. The method of claim 5, wherein the group tree based block chain consensus is performed,
in the validation stage, the leaf node performs validity verification of the block proposal according to the second block proposal message, including:
if the command list taken by the leaf node from the command buffer pool in time sequence is contained in the block proposed by the root node, and the view of the block requested to be generated by the leaf node is consistent with the view proposed by the root node and the height of the block requested to be generated by the leaf node is consistent with the height of the block proposed by the root node, the validity verification is passed.
7. The method of claim 1, wherein the validating by the root node in the determining step according to the second acknowledgement message comprises: if the root node receives second confirmation messages of effective department threshold signature votes exceeding a first preset threshold value, the validity verification is passed;
the first block proposal decision message comprises a block proposed by a root node, a view proposed by the root node, a block height proposed by the root node and a complete threshold signature, and the complete threshold signature is obtained by voting and synthesizing partial threshold signatures valid in the second confirmation message;
the child node performs validity verification after receiving the first block proposal decision message, and the method comprises the following steps:
and the child node judges whether the sender of the first block proposal decision message is the root node in the self group tree, if so, the validity of the complete threshold signature in the first block proposal decision message is verified, and if the validity is verified, the verification is passed.
8. The group tree based block chain consensus method of claim 7, wherein said second block proposal decision message comprises said first block proposal decision message and a signature corresponding to a child node; the signature corresponding to the child node is obtained according to the block proposed by the root node, the view proposed by the child node and the height of the block proposed by the child node;
the leaf node validates the second block proposal decision message, and if the validation is passed, executes a command, including:
the leaf node determining whether a height of a root node proposed block in the second block proposal decision message is consistent with a height of a leaf node request generation block, and whether a view of the root node proposed block in the second block proposal decision message is consistent with a view of a leaf node request generation block;
if the height of the root node proposed block in the second block proposal decision message is consistent with the height of the leaf node request generation block, and the view proposed by the root node in the second block proposal decision message is consistent with the view of the leaf node request generation block, executing the corresponding command.
CN202210564115.8A 2022-05-23 2022-05-23 Block chain consensus method based on group tree structure Active CN115002111B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210564115.8A CN115002111B (en) 2022-05-23 2022-05-23 Block chain consensus method based on group tree structure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210564115.8A CN115002111B (en) 2022-05-23 2022-05-23 Block chain consensus method based on group tree structure

Publications (2)

Publication Number Publication Date
CN115002111A CN115002111A (en) 2022-09-02
CN115002111B true CN115002111B (en) 2022-12-27

Family

ID=83026329

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210564115.8A Active CN115002111B (en) 2022-05-23 2022-05-23 Block chain consensus method based on group tree structure

Country Status (1)

Country Link
CN (1) CN115002111B (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190288513A1 (en) * 2018-03-13 2019-09-19 Nec Laboratories America, Inc. Decentralized energy management utilizing blockchain technology
CN110727737B (en) * 2019-10-29 2022-10-18 南京邮电大学 Intelligent medical data storage method based on multilevel block chain system architecture
CN111049895B (en) * 2019-12-09 2022-06-03 北京工商大学 Improved PBFT consensus method based on ISM
CN112769580B (en) * 2020-12-31 2023-08-01 广东海洋大学 Blockchain hierarchical excitation consensus algorithm

Also Published As

Publication number Publication date
CN115002111A (en) 2022-09-02

Similar Documents

Publication Publication Date Title
CN109871669B (en) Data sharing solution based on block chain technology
CN108616596B (en) Block chain self-adaptive consensus method based on dynamic authorization and network environment perception
CN109447795B (en) Byzantine consensus method supporting rapid achievement of final confirmation
CN110289966B (en) Byzantine fault tolerance-based anti-adaptive attack union chain consensus method
US20210194759A1 (en) Changing a master node in a blockchain system
CN111082943B (en) Efficient block chain consensus method
CN111311414A (en) Block chain multi-party consensus method based on consistent hash algorithm
Hassanzadeh-Nazarabadi et al. Lightchain: A dht-based blockchain for resource constrained environments
CN110990408A (en) Block chain-based business information cooperation method, business system and alliance chain
Stewart et al. Grandpa: a byzantine finality gadget
CN112636905B (en) System and method for extensible consensus mechanism based on multiple roles
CN111611315A (en) Financial big data-oriented multi-branch tree structure block chain integrated optimization storage method
CN110298754B (en) Consensus method applied to block chain
CN111092896A (en) Food traceability distributed data synchronization method based on optimized PAXOS
CN113328997B (en) Alliance chain crossing system and method
CN114050904B (en) Consensus system and method based on two-level leader node fragmentation structure
CN111798234B (en) Lightweight block chain system and construction method
CN113824563A (en) Cross-domain identity authentication method based on block chain certificate
Sohrabi et al. ZyConChain: A scalable blockchain for general applications
CN115665170A (en) Block chain consensus method based on reputation and node compression mechanism
CN114938292B (en) Multi-level optimization PBFT consensus method based on node credibility
JP2023515369A (en) Distributed database
CN115664682A (en) Consensus method for sharing medical data based on alliance chain master-slave multi-chain
Sohrabi et al. SAZyzz: Scaling AZyzzyva to meet blockchain requirements
CN115002111B (en) Block chain consensus method based on group tree structure

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant