This application claims the benefit of Korean Patent Applications No. 10-2023-0078605, filed Jun. 20, 2023, and No. 10-2024-0063090, filed May 14, 2024, which are hereby incorporated by reference in their entireties into this application.
The present disclosure relates generally to technology for a distributed consensus in a blockchain, and more particularly to technology for selecting random nodes for a consensus congress for each block and performing a consensus for adding a new block to a chain by the consensus congress.
Generally, as the number of participating nodes in a blockchain increases, the time taken to confirm a block also increases. As one of methods for overcoming this, part of all nodes are selected for a consensus congress, and the consensus congress confirms a new block, whereby the time taken to confirm the block may be reduced. Here, when fixed nodes are used for a consensus congress, which results in a centralization issue, and in order to prevent this issue, a method of selecting random nodes for a consensus congress has been employed. As existing methods of selecting random nodes for a consensus congress, distributed consensus technologies for arbitrarily selecting nodes from among all nodes using a Verifiable Random Function (VRF) or randomly selecting nodes for forming a consensus congress using a nonce chain have been introduced.
In the distributed consensus technology using the VRF, each node performs an operation corresponding to the VRF, and whether it is selected for a consensus congress is determined based on the result of the operation. The node selected for the consensus congress submits the voting result thereof along with evidence. However, this method has a disadvantage that the size of the consensus congress can be estimated based only on a probability distribution and it cannot be exactly known how many nodes are selected for the consensus congress. As a result, the exact number of nodes comprising the majority or two-thirds of the consensus congress cannot be precisely known, and thus a complex consensus process is required.
The paper titled “Algorithm based on Byzantine agreement among decentralized agents (BADA)”, which was published on Oct. 20, 2020, U.S. Patent Application Publication No. 2019-0327084, U.S. Patent Application Publication No. 2019-0379538, U.S. Patent Application Publication No. 2020-0403776, and U.S. Patent Application Publication No. 2023-0066169 disclose in detail a method for selecting a consensus congress based on a nonce chain and a method for generating a blockchain using the same. In the technologies disclosed in the aforementioned paper and patents, because the size of a consensus congress can be determined depending on the number of participating nodes, the number of nodes comprising the majority or two-thirds of the consensus congress is made known when the consensus congress is determined, and thus a simple consensus algorithm such as Practical Byzantine Fault Tolerance (PBFT) may be used. However, this method also has the disadvantage of requiring a message transfer protocol for determining a consensus congress.
The message transfer protocol for determining a consensus congress includes a process of sending and receiving messages for forming a consensus congress between nodes, which imposes a significant load on the system as the number of nodes participating in a blockchain increases. Therefore, new blockchain consensus technology that can reduce or eliminate message exchanges for forming a consensus congress is urgently required.
An object of the present disclosure is to form a blockchain consensus congress by selecting a number of random nodes corresponding to the size of the consensus congress determined depending on the number of participating nodes while minimizing exchanges of messages for forming the consensus congress.
Another object of the present disclosure is to use public node identifiers such that a consensus congress, which is randomly selected for each block without the exchange of messages for forming the consensus congress, performs a consensus using a simple consensus algorithm, such as PBFT or the like, thereby maintaining decentralization while reducing message complexity of a blockchain system and improving performance.
In order to accomplish the above objects, a method for a distributed consensus performed by a distributed consensus apparatus according to the present disclosure includes generating public vote identifiers using public node identifiers corresponding to nodes constituting a blockchain, generating a pass vote list by performing an operation corresponding to a success probability of p for each of the public vote identifiers, and performing a distributed consensus based on at least part of consensus congress nodes corresponding to the pass vote list.
Here, the pass vote list may be generated in such a way that each of the nodes constituting the blockchain performs the operation for the nodes, including itself, based on the public vote identifiers. Here, pass vote lists that the nodes constituting the blockchain generate at a specific time may be identical to each other.
Here, the operation may be to compare a random value generated using the public vote identifier and previous block information with a threshold corresponding to the success probability.
Here, a number of public vote identifiers equal to the number of votes of each of the nodes may be generated for the node using the public node identifier corresponding to the node.
Here, the consensus congress nodes may be selected from among nodes included in the pass vote list.
Here, a consensus for a previous block corresponding to the previous block information may be finally confirmed by a chair node selected from among the consensus congress nodes for a current block.
Here, the public vote identifiers may be generated by adding or subtracting one of generation values, including 0, to or from the public node identifier corresponding to each of the nodes.
Here, the public node identifiers may be public keys corresponding to the nodes.
Here, among the consensus congress nodes, a node corresponding to a largest or smallest value, among values corresponding to results of the operations, may become a chair node.
Also, an apparatus for a distributed consensus according to an embodiment of the present disclosure includes one or more processors and executable memory for storing at least one program executed by the one or more processors.
Here, the at least one program may generate public vote identifiers using public node identifiers corresponding to nodes constituting a blockchain, generate a pass vote list by performing an operation corresponding to a success probability of p for each of the public vote identifiers, and perform a distributed consensus based on at least part of consensus congress nodes corresponding to the pass vote list.
Here, the pass vote list may be generated in such a way that each of the nodes constituting the blockchain performs the operation for the nodes, including itself, based on the public vote identifiers. Here, pass vote lists that the nodes constituting the blockchain generate at a specific time may be identical to each other.
Here, the operation may be to compare a random value generated using the public vote identifier and previous block information with a threshold corresponding to the success probability.
Here, a number of public vote identifiers equal to the number of votes of each of the nodes may be generated for the node using the public node identifier corresponding to the node.
Here, the consensus congress nodes may be selected from among nodes included in the pass vote list.
Here, a consensus for a previous block corresponding to the previous block information may be finally confirmed by a chair node selected from among the consensus congress nodes for a current block.
Also, a method for generating a blockchain according to an embodiment of the present disclosure includes receiving a committed message corresponding to a previous block; generating a pass vote list using information about the previous block and public vote identifiers; receiving, by a chair node corresponding to a current block, confirm messages from consensus congress nodes corresponding to the pass vote list and finally confirming, by the chair node, a result of a consensus for the previous block based on the confirm messages, the chair node being recognized based on the pass vote list; and transmitting, by the chair node, a prepare message for connecting the current block to the blockchain to consensus committee nodes selected from among the consensus congress nodes.
Here, the method for generating a blockchain according to an embodiment of the present disclosure may further include receiving, by the chair node, commit messages from the consensus committee nodes; and transmitting, by the chair node, a committed message corresponding to the current block to all nodes.
Here, the pass vote list may be generated in such a way that each of nodes constituting the blockchain performs an operation corresponding to a success probability of p for the nodes, including itself, based on the public vote identifiers. Here, pass vote lists that the nodes constituting the blockchain generate at a specific time may be identical to each other.
Here, the operation may be to compare a random value generated using the public vote identifier and the information about the previous block with a threshold corresponding to the success probability.
Here, a number of public vote identifiers equal to the number of votes of each of the nodes may be generated for the node using a public node identifier corresponding to the node.
The above and other objects, features, and advantages of the present disclosure will be more clearly understood from the following detailed description taken in conjunction with the accompanying drawings, in which:
The advantages and features of the present disclosure and methods of achieving them will be apparent from the following exemplary embodiments to be described in more detail with reference to the accompanying drawings. However, it should be noted that the present disclosure is not limited to the following exemplary embodiments, and may be implemented in various forms. Accordingly, the exemplary embodiments are provided only to disclose the present disclosure and to let those skilled in the art know the category of the present disclosure, and the present disclosure is to be defined based only on the claims. The same reference numerals or the same reference designators denote the same elements throughout the specification.
It will be understood that, although the terms “first,” “second,” etc. may be used herein to describe various elements, these elements are not intended to be limited by these terms. These terms are only used to distinguish one element from another element. For example, a first element discussed below could be referred to as a second element without departing from the technical spirit of the present disclosure.
The terms used herein are for the purpose of describing particular embodiments only and are not intended to limit the present disclosure. As used herein, the singular forms are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms “comprises,” “comprising,”, “includes” and/or “including,” when used herein, 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.
Unless differently defined, all terms used herein, including technical or scientific terms, have the same meanings as terms generally understood by those skilled in the art to which the present disclosure pertains. Terms identical to those defined in generally used dictionaries should be interpreted as having meanings identical to contextual meanings of the related art, and are not to be interpreted as having ideal or excessively formal meanings unless they are definitively defined in the present specification.
Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings. In the following description of the present disclosure, the same reference numerals are used to designate the same or similar elements throughout the drawings, and repeated descriptions of the same components will be omitted.
According to the aforementioned existing technologies, the number of nodes to be selected as candidates for a consensus congress cannot be known before a chair node receives messages about whether other nodes are selected for the consensus congress in the process for forming the consensus congress. Accordingly, the chair node according to the existing technologies sets the threshold time for forming a consensus congress, waits for responses from 3f+1 nodes (f being a Byzantine size and an integer equal to or greater than 1), and requires an exception handling process for handling the case in which the number of nodes forming the consensus congress is less than 3f+1 when the threshold time expires. However, according to the present disclosure, because all of the nodes are aware of the number of nodes that succeed in a coin toss operation, the node corresponding to the chair, and nodes forming the consensus congress, the consensus may be immediately performed without the exchange of messages related to the configuration of the consensus congress.
In order to start a consensus for a block, participating nodes, which participate in a blockchain, may be assumed to be connected with a network. Here, the nodes generally use cryptography based on a public key for integrity of transferred data, and to this end, a blockchain node x may generate a public key pkx from its private key skx and share its public key with additional nodes connected with the network. Subsequently, the node x may securely transfer data using its private key skx, and the additional nodes may decrypt the transferred data using the public key pkx of the node x and also authenticate the source of the data. Here, the public key of each of the blockchain nodes may be an example of a public node identifier according to an embodiment of the present disclosure. That is, in an embodiment of the present disclosure, a public node identifier is information open to other nodes, and may be information through which a specific node can be identified. Here, the public node identifier may be the identifier of a specific node that other nodes know or can know about. Here, the public node identifier may be shared among the corresponding node and the additional nodes, and may be transferred through information included in a message transmitted from the corresponding node to the additional nodes. For example, the public node identifier may alternatively be a serial number assigned to each of the blockchain nodes. For example, the public node identifier may be the public key itself of each of the blockchain nodes, or may be identification information generated based on the public key.
As described in detail in the aforementioned U.S. Patent Application Publication No. 2023-0066169, blockchain nodes may have a number of votes corresponding to shares possessed thereby. Likewise, in the present disclosure, blockchain nodes may have a number of votes greater than 1, and a consensus congress may be selected based on a result of performing a number of operations corresponding to the number of votes with a success probability of p. For example, when a specific node has two votes, if it succeeds in the operation corresponding to the success probability of p even for one of the two votes, the node may become a candidate for a consensus congress.
Referring to
The public vote identifier may be an identifier corresponding to each vote (or a coin toss), and may be generated from a public node identifier. Here, a number of public vote identifiers equal to the number of votes of each of nodes participating in a blockchain may be generated for the node using the public node identifier corresponding to the node. For example, when node A has ten votes because it has ten shares, ten public vote identifiers for node A may be generated based on the public node identifier of node A. For example, when node B has two votes because it has two shares, two public vote identifiers for node B may be generated based on the public node identifier of node B.
The vote identifier list ID_list illustrated in
In the example of
The first node transfers the public node identifier thereof (e.g., the public key pk0) and the fact that it has three votes to the additional nodes. Each of the additional nodes receiving the data may calculate three public vote identifiers ID0, ID0+1, and ID0+2 of the first node, and the calculated three public vote identifiers of the first node may be stored in the vote identifier list ID_list. Because each of the additional nodes also transfers the public node identifier thereof and the number of votes possessed thereby to other nodes in the same manner, the nodes participating in the blockchain may individually generate the vote identifier list ID_list illustrated in
In the example illustrated in
Accordingly, a single public vote identifier may be generated for each of the second node, the third node, and the fourth node, and three public vote identifiers may be generated for the first node. Here, ID0 that is one of the three public vote identifiers for the first node may be set to be the same as the public node identifier (e.g., the public key pk0) of the first node. Here, ID0+1 that is another one of the three public vote identifiers for the first node may be set to a value acquired by adding 1 to the public node identifier thereof. Here, ID0+2 that is a further one of the three public vote identifiers for the first node may be set to a value acquired by adding 2 to the public node identifier of the first node. Particularly, when a public key is used as the public node identifier, even though public vote identifiers generated by sequentially incrementing by 1 from the public node identifier are used as described above, the possibility that the public vote identifiers are repeated is close to zero. That is, each of the public vote identifiers ID0+1 and ID0+2 is a value acquired by adding an arbitrary value to the public key of the node, and because it is almost impossible to find a private key corresponding thereto, it may be regarded as arbitrary data. As described above, the public keys of the nodes and the pieces of arbitrary data, the total number of which equals to the total number of votes, may be stored in the vote identifier list ID_list.
Here, ID1 that is the public vote identifier for the second node may be set to be the same as the public node identifier (e.g., the public key pk1) of the second node. Here, ID2 that is the public vote identifier for the third node may be set to be the same as the public node identifier (e.g., the public key pk2) of the third node. Here, ID3 that is the public vote identifier for the fourth node may be set to be the same as the public node identifier (e.g., the public key pk3) of the fourth node.
Consequently, a total of six public vote identifiers ID0, ID0+1, ID0+2, ID1, ID2, and ID3 for the four nodes may be stored in the vote identifier list, as illustrated in
When multiple public vote identifiers are generated from a single public node identifier, a method of sequentially incrementing by a preset number (e.g., 1) from the public node identifier (the first public vote identifier being set to the public node identifier) is used in the example of
That is, according to an embodiment of the present disclosure, each of nodes participating in a blockchain may disclose the public node identifier (e.g., the public key) thereof and the number of votes possessed thereby to the other nodes. Accordingly, all of the nodes participating in the blockchain may respectively generate the vote identifier list ID_list illustrated in
In the example illustrated in
In a blockchain consensus process, the agreed-upon block is stored in a committed message after it is completed, and may then be propagated to all nodes. That is, in the blockchain consensus process, a chair may propagate the block completed in a commit phase to all the nodes in a committed phase. Accordingly, when the agreed-upon block is completed, the respective nodes of the blockchain may have already generated the vote identifier list ID_list, and upon receiving the committed message, by which the agreed-upon block that is completed is propagated to all of the nodes, the nodes may generate a pass vote list Pass_list by performing an operation corresponding to a success probability of p using the header value Block_Header of the completed block.
That is, the nodes receiving the block extract the header value Block_Header of the block and perform the operation corresponding to the success probability (p) using the extracted header value along with the public vote identifiers within the vote identifier list ID_list generated as shown in
In the example illustrated in
Here, the hash function may be SHA256 or the like. Here, the random value Hi generated to correspond to the public vote identifier IDi may be a value acquired by extracting some bits from the output of the hash function. For example, the random value Hi may be a value corresponding to part (e.g., lower 32 bits [31:0]) of 256 bits [255:0] output from the SHA256 function.
That is, the random values Hi corresponding to the respective votes are generated, and only values that are not greater than a preset threshold T, among the generated random values, may be stored in the pass vote list Pass_list in the form of a pair of [node number, Hi].
Here, an arbitrary value may be used as the threshold T, and as described in the aforementioned U.S. Patent Application Publication No. 2023-0066169 and the like, the success probability p of the votes (coin tosses) of nodes and 3f+1, which is the size of a consensus congress, may be calculated by applying Equations (1) and (2) below. Here, the threshold T satisfying the success probability p of the coin toss may be calculated in consideration of the maximum value of the random value Hi.
Coin tosses are performed for all random values Hi by implementing the coin toss with the success probability of p through a process (operation) of comparing the threshold T with the magnitude of the random value Hi, and when the coin toss succeeds, the pair of [node number, Hi] is added to the pass vote list Pass_list.
In the example illustrated in
That is, only when the operation succeeds (the random value does not exceed T as a result of comparison with the threshold) can the result be stored in the pass vote list Pass_list in the example of
Here, the result values stored in the pass vote list Pass_list may be arranged in order of the magnitude of the random values. For example, the results values stored in the pass vote list Pass_list may be arranged in ascending order of the magnitude of the random values. In the example illustrated in
Referring to
The node NODE2 is a chair node for a consensus for a block Bn. The node NODE2 transmits a prepare message for the consensus for the block Bn to consensus committee nodes NODE1, NODE2, and NODE3, completes the agreed-upon block Bn by receiving commit messages from the consensus committee nodes NODE1, NODE2, and NODE3, and transmits a committed message for propagating the completed agreed-upon block Bn to all of the nodes NODE0, NODE1, NODE2, and NODE3.
All of the nodes NODE0, NODE1, NODE2, and NODE3 receiving the committed message for the completed agreed-upon block Bn may form a consensus congress for a block Bn+1 using block information Header_Bn for the completed agreed-upon block Bn.
That is, the chair node NODE2 corresponding to the agreed-upon block Bn propagates the block Bn, which is completed in the commit phase, to all of the nodes NODE0, NODE1, NODE2, and NODE3 in the committed phase, as illustrated in
The nodes receiving the block Bn extract the header value of the block Bn, generate random values by performing a hash operation on the extracted header value and respective public vote identifiers included in a vote identifier list, and generate a pass vote list by comparing the random values with a preset threshold.
The pass vote list for the block Bn+1 may be calculated by all of the nodes receiving the committed message corresponding to the block Bn, and information about the members of the consensus congress of the pass vote list needs to be maintained in order for all of the nodes receiving the committed message corresponding to the block Bn+1 to confirm that the block is signed by valid signers. Here, the chair may need the information about the members of the consensus congress of the pass vote list in all of the phases (including confirm, prepare, commit, and committed phases) of the consensus in order to form the consensus congress and the consensus committee. The remaining nodes, excluding the chair, need the information about the members of the consensus congress of the pass vote list in order to check the chair node and to perform a consensus when they are the members of the consensus congress, and nodes that are not included in the consensus congress may need the information about the members of the consensus congress of the pass vote list in order to check whether the committed block is signed by the nodes belonging to the consensus committee.
Here, the pass vote list for the block Bn+1 may be generated only after the committed message corresponding to the block Bn is received. Accordingly, a time period during which the valid pass vote list is maintained is managed to not be too long, and a random value to be used for a coin toss (an operation with a success probability of p) may be appropriately generated.
In the example illustrated in
Here, [NODE1, H1] may be the operation result corresponding to the random value H1 calculated based on a single public vote identifier of the node NODE1, [NODE0, H0] may be the operation result corresponding to the random value H0 calculated based on the first public vote identifier (e.g., the public key of the node NODE0), among the three public vote identifiers of the node NODE0, [NODE3, H3] may be the operation result corresponding to the random value H3 calculated based on a single public vote identifier of the node NODE3, [NODE0, H0+1] may be the operation result corresponding to the random value H0+1 calculated based on the second public vote identifier (e.g., the public key of the NODE0+1), among the three public vote identifiers of the node NODE0, and [NODE2, H2] may be the operation result corresponding to the random value H2 calculated based on a single public vote identifier of the node NODE2. In the example of
Here, the consensus congress 201 for the block Bn+1 is configured with [NODE1, H1], [NODE0, H0], [NODE3, H3], and [NODE0, H0+1]. Here, because [NODE1, H1] corresponds to the smallest random value, the node NODE1 may become a chair node for a consensus for the subsequent block Bn+1, as illustrated in
In the example of
As described above, the existing technology does not allow each of votes by the shares of nodes to be exercised individually for each consensus congress, but according to the present disclosure, when a consensus congress is selected, the votes of the nodes may be individually exercised for selecting the consensus congress.
The consensus for the block Bn+1 may be performed through a process in which the chair node NODE1 receives commit messages from the nodes NODE0, NODE1, and NODE3 corresponding to the consensus committee and transmits a committed message corresponding thereto to all of the nodes, as illustrated in
Upon receiving the committed message corresponding to the block Bn+1, all of the nodes may generate a pass vote list corresponding to a block Bn+2. That is, each of the nodes receiving the committed message corresponding to the block Bn+1 extracts the header value of the block Bn+1, generates random values by performing a hash operation on the extracted header value and the respective public vote identifiers included in the vote identifier list, and generates a pass vote list for the block Bn+2 by comparing the random values with a preset threshold.
In the example illustrated in
Here, [NODE3, H3] may be the operation result corresponding to the random value H3 calculated based on a single public vote identifier of the node NODE3, [NODE0, H0+1] may be the operation result corresponding to the random value H0+1 calculated based on the second public vote identifier (e.g., the public key of the node NODE0+1), among the three public vote identifiers of the node NODE0, [NODE0, H0] may be the operation result corresponding to the random value H0 calculated based on the first public vote identifier (e.g., the public key of the node NODE0), among the three public vote identifiers of the node NODE0, [NODE2, H2] may be the operation result corresponding to the random value H2 calculated based on a single public vote identifier of the node NODE2, and [NODE1, H1] may be the operation result corresponding to the random value H1 calculated based on a single public vote identifier of the node NODE1. In the example of
Here, the consensus congress 205 for the block Bn+2 is configured with [NODE3, H3], [NODE0, H0+1], [NODE0, H0], and [NODE2, H2]. Here, because [NODE3, H3] corresponds to the smallest random value, the node NODE3 may become a chair node for the consensus for the subsequent block Bn+2, as illustrated in
In the example of
In the existing distributed consensus technologies, such as a distributed consensus method using a nonce chain, and the like, each of nodes succeeding in a coin toss has to generate a message for verifying that the node itself succeeds in the coin toss and transmit the same to additional nodes. Based on the message received from the specific node, the additional nodes confirm that the corresponding node succeeded in the coin toss and form a consensus congress.
However, according to the present disclosure, all nodes are able to generate an identical pass vote list for a specific block using public node identifiers assigned to the respective nodes, such as public keys or the like, and thus, the nodes can easily check the nodes forming a consensus congress without special messages for forming the consensus congress, whereby the consensus efficiency may be maximized.
That is, according to the present disclosure, distributed nodes connected to a blockchain may calculate the configuration of a consensus congress for a subsequent block by themselves without receiving messages related to the new consensus congress from other nodes. The nodes participating in the consensus individually calculate values for selecting the consensus congress for the subsequent block for each of the nodes using the public vote identifiers of all of the participating nodes and data extracted from a current block, thereby calculating the consensus congress for the subsequent block.
Referring to
The example of
In the example illustrated in
In the process for a consensus for the initial block Binit, the node NODE0 that is randomly selected as a chair for the consensus for the initial block solely generates the initial block by signing the block while passing through prepare and commit phases, and transfers the initial block to all of the nodes NODE0, NODE1, NODE2, NODE3, and NODE4.
As illustrated in
In the confirm phase, each of the nodes verifies the signature of the initial block Binit, and when there is a problem, this indicates failure of the consensus, and a protocol for again performing a consensus is performed. When there is no problem in the verification result, a pass vote list Pass_list is generated using vote identifiers contained in the stored vote identifier list ID_list of the nodes and the header value of the initial block Binit, as described with reference to
In the example of
Referring again to
The node NODE2, which is a chair for the block Binit+1, randomly selects 2f+1 nodes from among the nodes submitting the checksum and Qi. The node NODE2 checks whether the checksums of the selected nodes are the same as each other to thereby confirm that the nodes receive the same block Binit, and performs a consensus together with the 2f+1 nodes. In the example illustrated in
As it can be seen through
In the prepare phase for the block Binit+1, the node NODE2 generates a preparatory block including transactions received from a guest or the transactions received from the nodes in the confirm phase for the block Binit. Here, a prepare message (including a prepare block) may be generated by including the values of Pk, Q, and r acquired by combining the public keys and Qi of the respective nodes NODE2, NODE0, and NODE3 in the block, and may then be transferred to the nodes NODE2, NODE0, and NODE3 for the consensus. The nodes NODE2, NODE0, and NODE3 receiving the prepare message check whether or not the block is normal, and when the block is normal, each of the nodes generates si signed with the private key thereof and returns a commit message to the chair node NODE2. The chair node NODE2 receiving all of the commit messages generates S by combining values corresponding to si, generates a committed block by completing a signature (r, S), and transfers the committed block to all of the nodes.
Each of the nodes receiving the committed block checks the validity of the block by checking the public keys and signatures corresponding to the 2f+1 nodes of the consensus congress. When the checking result is valid, Hi is calculated using the header value of the block Binit+1 and a next pass vote list may be generated, whereby a consensus congress for a block Binit+2 may be formed. In the example of
Referring to
That is, it can be seen that, when the node NODE5 is added as a participating node during the consensus period for a block Bn, as shown in
In the example of
In the consensus process for the block Bn+1, the node NODE2, which is a chair node, agrees upon the new block through the prepare and commit phases and propagates the completed block to all of the nodes. That is, the new node may participate in the consensus through the process illustrated in
Referring to
The steps illustrated in
First, variables for generating public vote identifiers are initialized at step S510. That is, at step S510, the variable ‘loop’ is set to a value corresponding to the number of votes of a corresponding node, the variable ‘count’ is set to 0, and a vote identifier list ID_list is initialized.
Subsequently, the variable ‘count’ is compared with the variable ‘loop’ at step S520. When ‘count’ is less than ‘loop’ as the result of the comparison at step S520, a public vote identifier corresponding to the sum of the public key (the public node identifier) of the corresponding node and the variable ‘count’ is added in the vote identifier list ID_list at step S530. As illustrated in
When the public vote identifier is added at step S530, the variable ‘count’ is increased by 1 at step S540, and the process goes back to step S520, whereby the variable ‘count’ is compared with the variable ‘loop’.
When ‘count’ is not less than ‘loop’ as the result of the comparison at step S520, the process of generating vote identifiers for the corresponding node is terminated.
Through the process illustrated in
Although the case in which the public vote identifiers are generated by adding a preset number to the public node identifier is illustrated in the example of
Here, the public vote identifiers may be generated by a vote identifier generator (function). In the example illustrated in
The vote identifier generator (function) may be any of various forms of functions that receive a public node identifier as input and output a number of public vote identifiers equal to the number of votes. Here, the vote identifier generator may include a duplicate checker for checking whether the generated public vote identifiers are repeated. Here, the duplicate checker may check not only whether the generated public vote identifier is a duplicate of other vote identifiers but also whether the generated public vote identifier is a duplicate of a public node identifier corresponding to another node.
As described above, when a number of public vote identifiers equal to the number of votes of a single node is generated and when a coin toss is performed using the public vote identifiers, the coin tosses can be performed in parallel, whereby the speed of the operation for selecting a consensus congress may increase, compared to a method in which the result of a single coin toss performed in a specific node is hashed and a subsequent coin toss is performed based thereon.
The public vote identifiers generated by the vote identifier generator may be unique identifiers respectively corresponding to the votes possessed by the node, and the number of bits representing the public vote identifier and the number of bits representing the public node identifier may be equal to each other or may be different from each other.
Referring to
The node NODE0 confirms that [NODE1, H1], [NODE0, H0], [NODE3, H3], and [NODE0, H0+1] are selected from the pass vote list for a consensus congress and confirms that the result value [NODE0, H0] corresponding to itself is located at the second position in the pass vote list, thereby confirming that it is selected for the consensus congress. Here, the node NODE0 may know that the node NODE1 becomes a chair based on the first result value [NODE1, H1] of the pass vote list. Further, the node NODE0 confirms that the result value [NODE0, H0+1] corresponding to itself is located at the fourth position in the pass vote list, thereby confirming that it has two votes in the consensus congress.
The node NODE1 confirms that [NODE1, H1], [NODE0, H0], [NODE3, H3], and [NODE0, H0+1] are selected from the pass vote list for a consensus congress, and may know that it is selected for the consensus congress based on the first result value [NODE1, H1] and it becomes a chair.
The node NODE2 confirms that [NODE1, H1], [NODE0, H0], [NODE3, H3], and [NODE0, H0+1] are selected from the pass vote list for a consensus congress, and may confirm that the result value [NODE2, H2] corresponding to itself is not included in the consensus congress. Here, the node NODE2 may know that the node NODE1 becomes a chair based on the first result value [NODE1, H1] of the pass vote list.
The node NODE3 confirms that [NODE1, H1], [NODE0, H0], [NODE3, H3], and [NODE0, H0+1] are selected from the pass vote list for a consensus congress and confirms that the result value [NODE3, H3] corresponding to itself is located at the third position in the pass vote list, thereby confirming that it is selected for the consensus congress. Here, the node NODE3 may know that the node NODE1 becomes a chair based on the first result value [NODE1, H1] of the pass vote list.
The node NODE1 receives confirm messages from the consensus congress nodes NODE0, NODE1, and NODE3 because it is a chair.
The nodes NODE0 and NODE3 send the confirm message to the node NODE1 after they confirm that they are included in the consensus congress although they are not a chair node.
The chair forms a consensus committee by selecting nodes from the consensus congress, and it can be seen that the nodes NODE1, NODE0, and NODE3 are selected for the consensus committee in the example illustrated in
When the chair forms the consensus committee by selecting the nodes NODE1, NODE0, and NODE3, as illustrated in
If the chair forms the consensus committee by selecting [NODE1, H1], [NODE0, H0], and [NODE0, H0+1] from among the result values corresponding to the consensus congress, unlike that illustrated in
Accordingly, because the generated Pk and r vary depending on the configuration of the consensus committee, the members of the consensus committee generate si using the received r in the state in which they do not know the signers, and the chair is not able to simultaneously generate two multi-signatures.
However, it is necessary to notify the consensus committee nodes of the nodes belonging to the consensus committee such that they check whether the chair completes the consensus by receiving 2f+1 signatures (603). Here, because all of the nodes have the pass vote list Pass_list, 0 is assigned to the chair node and sequential numbers are assigned to the nodes depending on their positions in the pass vote list. Then, the consensus committee configuration information may be represented as a bitmap and transferred.
As illustrated in
When multi-signature is completed, the block that is agreed upon is transferred as a committed block. Here, the consensus committee configuration information is provided, and may be used to check the nodes that put a signature in the pass vote list Pass_list (605).
Further, the nodes again generate a pass vote list Pass_list in order to form a consensus congress for a subsequent block Bn+2 using the received block.
Referring to
Here, a number of public vote identifiers equal to the number of votes of each of the nodes may be generated for the node using the public node identifier corresponding to the node.
Here, the public vote identifiers may be generated by adding or subtracting one of generation values, including 0, to or from the public node identifier corresponding to each of the nodes.
Here, the public node identifiers may be public keys corresponding to the nodes.
Also, in the distributed consensus method according to an embodiment of the present disclosure, an operation corresponding to a success probability of p is performed for each of the public vote identifiers, whereby a pass vote list is generated at step S720.
Here, the pass vote list may be generated in such a way that each of the nodes constituting the blockchain performs the operations for the nodes, including itself, based on the public vote identifiers. Here, the pass vote lists that the nodes constituting the blockchain generate at a specific time may be identical to each other.
Here, the operation may be to compare a random value generated using the public vote identifier and previous block information with a threshold corresponding to the success probability.
Also, in the distributed consensus method according to an embodiment of the present disclosure, a distributed consensus is performed based on at least part of consensus congress nodes corresponding to the pass vote list at step S730.
Here, the consensus congress nodes may be selected from among nodes included in the pass vote list.
Here, a consensus for a previous block corresponding to the previous block information may be finally confirmed by a chair node selected from among the consensus congress nodes for a current block.
Here, among the consensus congress nodes, a node corresponding to a largest or smallest value, among values corresponding to results of the operations, may become a chair node.
The distributed consensus method illustrated in
Referring to
Also, in the blockchain generation method according to an embodiment of the present disclosure, a pass vote list is generated using information about the previous block and public vote identifiers at step S820.
Here, the pass vote list may be generated in such a way that each of nodes constituting the blockchain performs an operation corresponding to a success probability of p for the nodes, including itself, based on the public vote identifiers. Here, the pass vote lists that the nodes constituting the blockchain generate at a specific time may be identical to each other.
Here, the operation may be to compare a random value generated using the public vote identifier and the information about the previous block with a threshold corresponding to the success probability.
Here, a number of public vote identifiers equal to the number of votes of each of the nodes may be generated for the node using the public node identifier corresponding to the node.
Also, in the blockchain generation method according to an embodiment of the present disclosure, a chair node corresponding to a current block receives confirm messages from consensus congress nodes corresponding to the pass vote list and finally confirms the result of the consensus for the previous block based on the confirm messages at step S830. Here, the chair node may be recognized based on the pass vote list.
Also, in the blockchain generation method according to an embodiment of the present disclosure, the chair node transmits a prepare message for connecting the current block to the blockchain to consensus committee nodes selected from among the consensus congress nodes at step S840.
Also, in the blockchain generation method according to an embodiment of the present disclosure, the chair node receives commit messages from the consensus committee nodes at step S850.
Also, in the blockchain generation method according to an embodiment of the present disclosure, the chair node transmits a committed message corresponding to the current block to all of the nodes at step S860.
The distributed consensus apparatus, the blockchain generation apparatus, and nodes constituting a blockchain according to an embodiment may be implemented in a computer system 900 including a computer-readable recording medium.
The computer system 900 may include one or more processors 910, memory 930, a user-interface input device 940, a user-interface output device 950, and storage 960, which communicate with each other via a bus 920. Also, the computer system 900 may further include a network interface 970 connected with a network 980. The processor 910 may be a central processing unit or a semiconductor device for executing a program or processing instructions stored in the memory 930 or the storage 960. The memory 930 and the storage 960 may be storage media including at least one of a volatile medium, a nonvolatile medium, a detachable medium, a non-detachable medium, a communication medium, or an information delivery medium, or a combination thereof. For example, the memory 930 may include ROM 931 or RAM 932.
Here, at least one program may be recorded in the memory 930.
Here, the processor 910 may execute the program. Here, the program may generate public vote identifiers using public node identifiers corresponding to the nodes constituting the blockchain, generate a pass vote list by performing an operation corresponding to a success probability of p for each of the public vote identifiers, and perform a distributed consensus based on at least part of consensus congress nodes corresponding to the pass vote list.
Here, the pass vote list may be generated in such a way that each of the nodes constituting the blockchain performs the operation for the nodes including itself based on the public vote identifiers. Here, the pass vote lists that the nodes constituting the blockchain generate at a specific time may be identical to each other.
Here, the operation may be to compare a random value generated using the public vote identifier and previous block information with a threshold corresponding to the success probability.
Here, a number of public vote identifiers equal to the number of votes of each of the nodes may be generated for the node using the public node identifier corresponding to the node.
Here, the consensus congress nodes may be selected from among nodes included in the pass vote list.
Here, a consensus for a previous block corresponding to the previous block information may be finally confirmed by a chair node selected from among the consensus congress nodes for a current block.
Here, the public vote identifiers may be generated by adding or subtracting one of generation values, including 0, to or from the public node identifier corresponding to each of the nodes.
Here, the public node identifiers may be public keys corresponding to the nodes.
Here, among the consensus congress nodes, a node corresponding to a largest or smallest value, among values corresponding to the results of the operations, may become a chair node.
According to the present disclosure, all blockchain nodes, including a chair node, are aware of the nodes selected for a consensus congress, the number of nodes selected for the consensus congress, and the chair node before they receive messages about whether other nodes are selected for the consensus congress, so a consensus may be immediately performed without the exchange of messages related to the configuration of the consensus congress.
Also, the present disclosure may form a blockchain consensus congress by selecting a number of random nodes corresponding to the size of the consensus congress determined depending on the number of participating nodes while minimizing exchanges of messages for forming the consensus congress.
Also, the present disclosure uses public node identifiers such that a consensus congress randomly selected for each block without the exchange of messages for forming the consensus congress performs a consensus using a simple consensus algorithm, such as PBFT or the like, thereby reducing the message complexity of a blockchain system, improving performance, and maintaining decentralization.
Also, the present disclosure may efficiently reconfigure a blockchain consensus congress, the size of which is set for each block, without the exchange of additional messages.
Also, the present disclosure may prevent the complexity of a protocol for message exchanges from increasing and reduce latency because it does not require the exchange of messages for forming a consensus congress.
Also, the present disclosure may be easily applied to existing simple consensus algorithms by forming a consensus congress, the size of which is set depending on the number of participating nodes, without the exchange of messages for forming the consensus congress.
As described above, the method and apparatus for a distributed consensus and the blockchain generation method using the same according to the present disclosure are not limitedly applied to the configurations and operations of the above-described embodiments, but all or some of the embodiments may be selectively combined and configured, so the embodiments may be modified in various ways.
Number | Date | Country | Kind |
---|---|---|---|
10-2023-0078605 | Jun 2023 | KR | national |
10-2024-0063090 | May 2024 | KR | national |