Method for constructing a blockchain network and computer software program for implementing said method
The method and software program maintain a stable blockchain network by managing nodes into Voters and Signers, penalizing non-participating nodes, and ensuring continuous consensus building despite disconnections.
Patent Information
- Application Number
- JP2024521232
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2022-07-04
- Filing Date
- 2023-05-29
- Publication Date
- 2024-10-30
- Estimated Expiration
- 2043-05-29
AI Technical Summary
Maintaining a healthy blockchain network is challenging due to inconsistent connection stability and resource allocation issues on mobile devices, leading to frequent disconnections and hindered operation of nodes, which can disrupt consensus building.
A method and computer software program that manage nodes by creating a circular virtual network, recording block signatures, penalizing non-participating nodes, and deleting them if they fail to sign consecutively, ensuring stable consensus building through Voter and Signer nodes.
Ensures continuous consensus building by maintaining a stable network even when some nodes disconnect, by managing nodes effectively and removing non-participating ones, thus preventing network disruption.
Smart Images

Figure 0007575834000002 
Figure 0007575834000003 
Figure 0007575834000004
Abstract
Description
[Technical field]
[0001] The present invention relates to a method for configuring a blockchain network. [Background technology]
[0002] A blockchain network is an autonomous decentralized system in which the security and reliability of the entire network is increased by the participation of many computers and smartphones as nodes, and it is a system that does not allow data tampering or fraud.
[0003] In order to keep a blockchain network healthy, it is desirable for the nodes participating in the network to always be connected to the network and operating properly, but the current situation shows that this is difficult to achieve.
[0004] For example, networks that small mobile devices such as smartphones can connect to are generally WiFi or mobile networks, which are often significantly inferior in connection stability and traffic performance to the network lines used by computers hosted in data centers. For this reason, it is conceivable that devices will frequently be disconnected from the network and then reconnected again.
[0005] Furthermore, when running applications on such small mobile devices that significantly consume processor power or memory, such as games or video viewing, it is possible that the resources allocated to the blockchain application will be depleted, hindering its operation.
[0006] Under these circumstances, it is expected that there will be disadvantages to continuing to maintain nodes that are no longer fulfilling their role as part of the blockchain network, and in the future, it will be necessary to implement methods to minimize these disadvantages. Summary of the Invention [Problem to be solved by the invention]
[0007] This invention has been made in consideration of the above-mentioned circumstances, and aims to provide a system and method that can properly manage the nodes that make up a blockchain and can continue to execute consensus building without stopping the blockchain, even in situations where some nodes stop functioning for a long period of time. [Means for solving the problem]
[0008] In order to solve the above problems, according to a main aspect of the present invention, the following invention is provided.
[0009] (1) A method for constructing a blockchain network, The computer has a node management process for retaining information on nodes involved in consensus formation for adding data received via a P2P network to a blockchain and determining which nodes should sign based on a consensus algorithm; This node management process includes: A computer manages all the nodes participating in the consensus building and constructs a virtual network in which these nodes are connected in a circular fashion. a signing node recording step in which a computer records which node among the nodes constituting the virtual network was able to sign a block; a penalty step of determining a node that has not been involved in the block signature for a certain threshold number of consecutive times based on the record in the signature node recording step, and deleting the node from the nodes constituting the virtual network; The method according to claim 1, further comprising:
[0010] (2) In the method according to (1), The penalty step comprises: a signature-unable node recording step in which the computer checks at a predetermined timing whether a predetermined node among the nodes constituting the virtual network has been able to sign, and if the node has not been able to sign, increments a counter value indicating that the node has not been able to sign; a node deletion step of determining, at a predetermined timing, whether the counter value indicating that the signature has not been received of each node constituting the virtual network exceeds a predetermined threshold, and, if it is determined that there is a node whose counter value exceeds a predetermined threshold, deleting the node from the nodes constituting the virtual network; The method according to claim 1, further comprising:
[0011] (3) In the method according to (1), The predetermined timing is the timing at which a block is generated. A method comprising:
[0012] (4) In the method according to (1), The signing node recording step increments a counter value of a block signature counter of a node that generated a block every time the block is generated, and records which node was able to sign the block based on the value of the block signature counter. A method comprising:
[0013] (5) In the method according to (4), The step of recording the signature-disabled node further includes a step of adjusting the signature-disabled counter value by the predetermined node subtracting the signature counter value from the signature-disabled counter value upon confirmation. A method comprising:
[0014] (6) In the method according to (1), This node management process includes: A computer defines and manages the nodes that participate in consensus formation into Voter nodes, which operate in a more stable environment, and Signer nodes, and connects these nodes to each other to create a ring-shaped virtual network. The penalty step is to determine whether the node is a voter node, and if the node is a voter node, not to delete the node from the nodes that configure the virtual network. A method comprising:
[0015] (7) A computer software program for configuring a blockchain network, The computer holds information on nodes involved in consensus formation for adding data received via a P2P network to a blockchain, and executes a node management process for determining which nodes should sign based on a consensus algorithm; This node management process includes: A computer manages all the nodes participating in the consensus building and constructs a virtual network in which these nodes are connected in a circular fashion. a signing node recording step in which a computer records which node among the nodes constituting the virtual network was able to sign a block; a penalty step of determining a node that has not been involved in the block signature for a certain threshold number of consecutive times based on the record in the signature node recording step, and deleting the node from the nodes constituting the virtual network; It is to carry out A computer software program comprising:
[0016] (8) The computer software program according to (7), The penalty step comprises: a signature-unable node recording step in which the computer checks at a predetermined timing whether a predetermined node among the nodes constituting the virtual network has been able to sign, and if the node has not been able to sign, increments a counter value indicating that the node has not been able to sign; a node deletion step of determining, at a predetermined timing, whether the counter value indicating that the signature has not been received of each node constituting the virtual network exceeds a predetermined threshold, and, if it is determined that there is a node whose counter value exceeds a predetermined threshold, deleting the node from the nodes constituting the virtual network; A computer software program for executing the above.
[0017] (9) The computer software program according to (7), The predetermined timing is the timing at which a block is generated. A computer software program comprising:
[0018] (10) The computer software program according to (7), The signing node recording step increments a counter value of a block signature counter of a node that generated a block every time the block is generated, and records which node was able to sign the block based on the value of the block signature counter. A computer software program comprising:
[0019] (11) The computer software program according to (10), The step of recording the signature-disabled node further includes a step of adjusting the signature-disabled counter value by the predetermined node subtracting the signature counter value from the signature-disabled counter value upon confirmation. A computer software program comprising:
[0020] (12) The computer software program according to (7), This node management process includes: A computer defines and manages the nodes that participate in consensus formation into Voter nodes, which operate in a more stable environment, and Signer nodes, and connects these nodes to each other to create a ring-shaped virtual network. The penalty step is to determine whether the node is a voter node, and if the node is a voter node, not to delete the node from the nodes that configure the virtual network. A computer software program comprising:
[0021] Features of the present invention other than those described above will be disclosed in the following description of the embodiments of the present invention and the accompanying drawings. [Brief description of the drawings]
[0022] [Figure 1] FIG. 1 is a schematic diagram of a system configuration showing one embodiment of the present invention. [Diagram 2] FIG. 2 is a schematic diagram showing the sealer ring. [Diagram 3] FIG. 3 is a schematic diagram showing a state in which some sealers have stopped. [Figure 4] FIG. 4 is a flowchart showing the processing logic for verifying a block signature. [Diagram 5] FIG. 5 is a flowchart showing the processing logic when the penalty process is executed. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0023] Hereinafter, an embodiment of the present invention will be described with reference to the accompanying drawings.
[0024] (One embodiment) FIG. 1 shows the configuration of a blockchain execution server module (computer software program) 1 according to one embodiment of the present invention.
[0025] This execution server module 1 is a service program for constructing a blockchain network, and may run on a server machine such as Linux (registered trademark), or may be incorporated into an application program and run on a mobile terminal. In this case, this module 1 is stored on a storage medium mounted on each device, and is appropriately called and executed on a memory (not shown) by a CPU (not shown) of the device, thereby operating as each component of the present invention.
[0026] As shown in Fig. 1, this execution server module 1 has a smart contract execution unit 2, a consensus algorithm execution unit 3, a blockchain data storage function unit 4, a data synchronization function unit 5, and a P2P network construction function unit 6. Here, the smart contract execution unit 2 also provides an interface to the blockchain. The consensus algorithm execution unit 3 also provides a node management function unit 7.
[0027] Each of these components 2 to 7 has access to shared data 9 which stores smart contracts 10, consensus algorithms 11, blockchain data 12, and node information 13.
[0028] The detailed configuration and function of each of these components will be described below in detail with reference to their operation.
[0029] (Functions of smart contract execution unit, blockchain data storage function unit, data synchronization function unit, and P2P network construction function unit) The smart contract execution unit 2 is a virtual machine that executes a specific method (update method) of a smart contract 10 stored in the shared data 9 in response to an external call or transfer data to the blockchain network, and returns the result.
[0030] The P2P network construction functional unit 6 has the function of constructing a new node as a member of the blockchain P2P network and connecting blockchain execution servers to each other. That is, to call and execute the method of the smart contract 10, a node is required to access the blockchain network. To newly join a node to the blockchain network, one of the existing nodes must make the node a member of the blockchain P2P network.
[0031] The data synchronization function unit 5 synchronizes the latest blockchain data 12 at each node, and during this synchronization, it obtains data 11 from other nodes connected via P2P, verifies the correctness of the data, and then stores it as shared data 9. The blockchain data storage function unit 4 stores the above-mentioned blockchain shared data (blockchain data 12) in the storage area of a server or mobile terminal.
[0032] When the update method of the smart contract 10 is called, a transaction is assembled and sent from each node to the blockchain network. The transaction is propagated to all nodes that make up the blockchain network. At this time, each node queues the transaction as a transaction waiting to be stored in a block. Since it takes a certain amount of time for a transaction to be stored in a block, the update method is, in principle, an asynchronous process.
[0033] Execution of the update method of smart contract 10 corresponds to the invocation transaction of the method being stored in a new block. The update method is executed when a new block is created by a block creation node and when other nodes that are not block creation nodes receive a new block and verify its correctness.
[0034] The smart contract 10 is executed identically by all nodes on the blockchain network, and all associated state updates reach the same result.
[0035] The invocation and execution of the reference method of the smart contract 10 immediately returns a result using the verified smart contract code and internal state that the node has. The smart contract 10 can be executed in the above manner because all nodes on the blockchain network share the data 9, as described above.
[0036] The shared objects include not only blocks and transactions, but also the code and internal state of smart contracts. This allows any node to replay the execution of a smart contract from the transactions stored in the blocks, and independently verify the correctness of the internal state updates that accompany the execution. This mechanism realizes the tamper-resistance and other features of the blockchain as an execution platform for smart contracts.
[0037] (Consensus algorithm execution part) Next, the consensus algorithm execution unit 3 of this embodiment will be described.
[0038] The consensus algorithm 11 in this embodiment is based on Proof of Authority (PoA). PoA is a consensus algorithm based on the idea that only trustworthy nodes can sign blocks, and nodes called sealers form a ring-shaped virtual network and take turns signing blocks at designated times.
[0039] In this embodiment, to participate in a network that employs this algorithm, one must be approved and trusted via eKYC or other procedures (Aurhority). In that sense, although it is centralized, it is possible to exclude malicious participants at a practical level.
[0040] Below, an example will be described in which a consensus algorithm 11 having such a concept is implemented in the consensus algorithm execution unit 3 and node management function unit of this embodiment.
[0041] This consensus algorithm execution unit 3 executes consensus formation to add data received via the P2P network to the blockchain. For this purpose, it holds information 13 of all nodes involved in consensus formation. Then, a node management function unit 7 provided in this consensus algorithm execution unit 3 manages and determines which nodes should sign based on the consensus algorithm 11.
[0042] The operations of the consensus algorithm execution unit 3 and the node management function unit 7 will be described below.
[0043] (Syner and Voter) The node management function unit 7 manages the nodes participating in the consensus formation by dividing them into Signers and Voters. It is assumed that Signers operate on mobile terminals. With designated nodes, Voter runs on server computers, typically hosted in data centers with abundant network, power, and other computing resources.
[0044] [Table 1]
[0045] The node management function unit is configured to build a ring-shaped virtual network as shown in Figure 2 with voters and signers, and to operate the network by taking turns signing blocks that contain transactions. Here, voters and signers are called sealers (nodes that can sign blocks and add them to the blockchain). In this diagram, the blocks are arranged in the order S1->V1->S2->V2. The tokens will then be signed and added to the blockchain.
[0046] (Node management in the Sealer Ring) This healthy state is called the Sealer Ring. Let's say that all the Signers in this Sealer Ring are disconnected from the blockchain network due to a total failure of the mobile network, etc. In this case, as shown in Figure 3, only the Voters are built on a stable infrastructure and can continue to run the network. (Figure 3) However, if some signer nodes remain disconnected from the network for a long period of time, it is expected that there will be disadvantages to continuing to maintain these nodes as part of the blockchain network.
[0047] Therefore, the node management function unit 7 of this embodiment is configured to detect and eliminate this state.
[0048] That is, the node management function unit 7 has a signature node recording unit 16 that records which nodes among the nodes that make up the virtual network were able to sign blocks, and a penalty processing execution unit 17 that, based on this signature record, determines which nodes have not been involved in block signing for a certain threshold number N of consecutive times and removes them from the network.
[0049] These configurations will be described below.
[0050] (Signing Node Recording Section) In this embodiment, the node management function unit 7 manages all nodes related to the block signature as lists (lists 1 and 2) (indicated by 14 and 15 in the figure). List 1 is an associative array, and the key is the address of the node. Note that list 1 is a collection of node objects, and these node objects hold the attributes of the nodes as variables.
[0051] (List 1) NodeList[] = { N1, N2, N3, N4,,,}.
[0052] List 2 also manages an array address list that holds the addresses of nodes. The keys of List 2 are numbers ranging from 0 to the number of all nodes minus 1.
[0053] (List 2) NodeAddrList[] = { N1_addr, N2_addr, N3_addr,,,}.
[0054] In this embodiment, the signing of blocks is performed in the order of the consensus list, but when the list is processed sequentially and the last element is reached, the process is repeated from the beginning of the list again, and the process continues in a circular manner as shown in Figure 2. This causes blocks to be generated in order.
[0055] Here, the signature node recording unit of this embodiment records which nodes were able to sign the block when a new block is received from the network and added to the blockchain.
[0056] That is, signature node recording unit 16 executes the process shown in FIG. 4 upon receiving a new block.
[0057] That is, first, the node determines whether the block signature is valid (step S1-2, 1-2). If the signature is valid, the node increments the block signature counter value signedCount (block generation counter value) (step S 1-3). This signedCount value is updated and stored as a variable of the node object mentioned above.
[0058] NodeList[addr].signed_counter++ If the signature is not valid, the signature verification process ends without doing anything (step S1-4).
[0059] (Penalty Execution Department) The penalty execution unit 16 (FIG. 1) also has a signature-unavailable node recording unit 18 and a node deletion processing unit 19. The signature-unavailable node recording unit 19 has a function of checking whether a specific node among the nodes in the list 1 has been able to sign at the timing when a new node is added, and incrementing a counter value indicating that the node has not been signed if the node has not been signed. The node deletion processing unit also has a function of judging whether the counter value indicating that the node has not been signed exceeds a specific threshold at the same timing, and if it is judged that a node exceeds the threshold, deleting the node from the nodes constituting the virtual network.
[0060] That is, when a new block is added to the blockchain, the penalty execution unit first determines an index value to check the block generation status of the node indicated by a specified index (step S2-1).
[0061] Here, the index value indicates the node to be checked in this step, and is the position from the top of the nodes sorted in address order in list 1, and is calculated as follows.
[0062] Index (IDX) = current signed block number / the remainder of the number of total nodes.
[0063] Next, it is checked whether the signedCount of the node indicated by the index value is 0 or more. If the determination is made (steps S2-2 and S2-3), and the value is not equal to or greater than 0, it is determined that the signature was not successful this time, and the signature failure counter value strikeCount is incremented (step S2-4 ). This strikeCount value is also updated and stored as a variable in the node object mentioned above. do.
[0064] addr = NodeAddrList[IDX] NodeList[addr].strike_counter++.
[0065] Next, it is determined whether the node is not a voter and its strikeCount value exceeds a certain threshold N. (steps S2-5, S2-6), and if exceeded, the node is deemed to have ceased functioning and is removed from the node list 1 (step S2-7).
[0066] addr = NodeAddrList[IDX] NodeList.delete(addr).
[0067] Here, the counter exists for each node and is checked every time a new block is added to the blockchain. The check is performed to see if the counter exceeds a specified threshold N (threshold). Judge based on whether or not it is true.
[0068] addr = NodeAddrList[IDX] NodeList[addr].strike_counter >= threshold(N).
[0069] On the other hand, if the signedCount of the node at the index position is 0 or more in step S2-3 above, If so, it is determined whether the strikeCount value of the node is greater than the signedCount value (strikeCount is the Step S2-8, 2-9), if it is larger, the signedCount value is subtracted from the strikeCount value. The value is updated as the strikeCount value (step S2-10), and if it is smaller, the strikeCount value is reset to 0 and initialized (step S2-11).
[0070] addr = NodeAddrList[IDX] NodeList[addr].strike_counter -= NodeList[addr].signed_counter If( NodeList[addr].strike_counter < 0 ) then NodeList[addr].strike_counter = 0 NodeList[addr].signed_counter = 0.
[0071] According to the above process, if a node does not participate in block signing for a certain number of consecutive times (a certain threshold number N), The deleted node is removed from the consensus list. The deleted node will no longer participate in the consensus, and the processing load will be removed from the entire blockchain network.
[0072] Here, the threshold N is 1 or more, but does not have to be an integer. In addition, the method of determining this threshold, for example, if a specific node is offline for a certain number of days and is to be disconnected from the network as a penalty, is as follows. That is, for example, if a block is generated every 5 minutes and the number of nodes in a virtual network is 2000, and a penalty is imposed if the network is offline for 30 days, the penalty is (30*86400) / 300 / 2000=4.32, so if a user is unable to sign approximately 4 times, the user can be considered offline. In this case, the threshold value can be set to 4 to 4.3, etc.
[0073] Furthermore, the method of determining the index value is not limited to that in the above embodiment, and any algorithm that can sequentially check the status of the nodes that make up each network may be used. For example, in the above embodiment, the block number is used to determine the index value, but a method of simply checking the status of the nodes on a list in order may also be used.
[0074] The present invention is not limited to the above-described embodiment, and various other modifications are possible without departing from the spirit and scope of the invention. [Explanation of symbols]
[0075] 1. Blockchain execution server module 3. Consensus algorithm execution unit 4. Blockchain data storage function section 5…Data synchronization function section 6…Network Construction Function Department 7…Node management function section 9. Shared Data 10. Smart contracts 11…Consensus Algorithm 12. Blockchain data 13…Node information 16…Signature node record section 17...Penalty execution processing unit
Claims
1. It is a method of configuring a blockchain network, The computer has a node management process for retaining information on nodes involved in consensus formation for adding data received via a P2P network to a blockchain and determining which nodes should sign based on a consensus algorithm; This node management process includes: A computer manages all the nodes participating in the consensus building and constructs a virtual network in which these nodes are connected in a circular fashion. a signing node recording step in which a computer records which node among the nodes constituting the virtual network was able to sign a block; a penalty step of determining a node that has not been involved in the block signature for a certain threshold number of consecutive times based on the record in the signature node recording step, and deleting the node from the nodes constituting the virtual network; The method according to claim 1, further comprising:
2. 2. The method of claim 1, The penalty step comprises: a signature-unable node recording step in which the computer checks at a predetermined timing whether a predetermined node among the nodes constituting the virtual network has been able to sign, and if the node has not been able to sign, increments a counter value indicating that the node has not been able to sign; a node deletion step of determining, at a predetermined timing, whether the counter value indicating that the signature has not been received of each node constituting the virtual network exceeds a predetermined threshold, and, if it is determined that there is a node whose counter value exceeds a predetermined threshold, deleting the node from the nodes constituting the virtual network; The method according to claim 1, further comprising:
3. 3. The method of claim 2, The predetermined timing is the timing at which a block is generated. A method comprising:
4. 3. The method of claim 2, The signing node recording step increments a counter value of a block signature counter of a node that generated a block every time the block is generated, and records which node was able to sign the block based on the value of the block signature counter. A method comprising:
5. 5. The method of claim 4, The step of recording the signature-disabled node further includes a step of adjusting the signature-disabled counter value by the predetermined node subtracting the signature counter value from the signature-disabled counter value upon confirmation. A method comprising:
6. 2. The method of claim 1, This node management process includes: A computer defines and manages the nodes participating in consensus formation into Voter nodes, which operate in a more stable environment, and Signer nodes, and connects these nodes to each other to build a ring-shaped virtual network. The penalty step is to determine whether the node is a voter node, and if the node is a voter node, not to delete the node from the nodes constituting the virtual network. A method comprising:
7. A computer software program for configuring a blockchain network, The computer is made to execute a node management process of retaining information on nodes involved in consensus formation for adding data received via a P2P network to a blockchain, and determining which nodes should sign based on a consensus algorithm; This node management process includes: A computer manages all the nodes participating in the consensus building and constructs a virtual network in which these nodes are connected in a circular fashion. a signing node recording step in which a computer records which node among the nodes constituting the virtual network was able to sign a block; a penalty step of determining a node that has not been involved in the block signature for a certain threshold number of consecutive times based on the record in the signature node recording step, and deleting the node from the nodes constituting the virtual network; It is to carry out A computer software program comprising:
8. 8. The computer software program of claim 7, further comprising: The penalty step comprises: a signature-unable node recording step in which the computer checks at a predetermined timing whether a predetermined node among the nodes constituting the virtual network has been able to sign, and if the node has not been able to sign, increments a counter value indicating that the node has not been able to sign; a node deletion step of determining, at a predetermined timing, whether the counter value indicating that the signature has not been received of each node constituting the virtual network exceeds a predetermined threshold, and, if it is determined that there is a node whose counter value exceeds a predetermined threshold, deleting the node from the nodes constituting the virtual network; A computer software program for executing the above.
9. 9. The computer software program of claim 8, further comprising: The predetermined timing is the timing at which a block is generated. A computer software program comprising:
10. 9. The computer software program of claim 8, further comprising: The signing node recording step increments a counter value of a block signature counter of a node that generated a block every time the block is generated, and records which node was able to sign the block based on the value of the block signature counter. A computer software program comprising:
11. 11. The computer software program of claim 10, The step of recording the signature-disabled node further includes a step of adjusting the signature-disabled counter value by the predetermined node subtracting the signature counter value from the signature-disabled counter value upon confirmation. A computer software program comprising:
12. 8. The computer software program of claim 7, further comprising: This node management process includes: A computer defines and manages the nodes participating in consensus formation into Voter nodes, which operate in a more stable environment, and Signer nodes, and connects these nodes to each other to build a ring-shaped virtual network. The penalty step is to determine whether the node is a voter node, and if the node is a voter node, not to delete the node from the nodes constituting the virtual network. A computer software program comprising:
Citation Information
Patent Citations
Consensus Methods and Devices
JP2020507142A
Network transaction verification method and system based on multiple nodes, and storage medium
JP2022518960A
Consensus methods and systems in consortium blockchain
US20210328805A1
Blockchain-based data detection method and device, and computer-readable storage medium
WO2021233048A1
