Distributed key generation method, distributed signature method and related devices

By using hash tables and polling queues in the blockchain network to manage the ready state of the signed node, the problem of excessive computing load when signing multiple parties is solved, achieving more efficient processing capabilities and reducing node load.

CN119519967APending Publication Date: 2025-02-25AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411742689.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

In multi-party signature scenarios, batches of asynchronous signature requests will cause a single node to bear a large computing load, resulting in excessive working pressure.

Method used

By maintaining a hash table and polling queue that all signature nodes can access, each signature node can quickly determine the number of nodes ready, avoid real-time communication and save computing resources.

Benefits of technology

In the high concurrency scenario of batch asynchronous signatures, the computing load of each signature node is reduced, the excessive load of a single node is avoided, and the system's processing capacity and efficiency are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119519967A_ABST
    Figure CN119519967A_ABST
Patent Text Reader

Abstract

The invention provides a distributed key generation method, a distributed signature method and a related device, and the method comprises the steps: updating a corresponding key generation operation ready node number in a first hash table based on a first key generation operation identifier in a key generation request; based on the polling queue, sequentially obtaining current to-be-polled second key generation operation identifiers; and obtaining a corresponding key generation operation ready node number from the first hash table based on the second key generation operation identifier, and executing a distributed key generation protocol together with other signature nodes when the ready node number is not less than a first preset threshold value to obtain a key. According to the method and the device, each signature node can quickly determine the number of the ready nodes through the hash table and the polling queue, so that computing resources consumed by information interaction of each node are saved, each signature node needs to spend a large amount of computing resources to communicate with other nodes, and a single node does not bear a relatively large load; and the working pressure of each signature node is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of key generation technology, and in particular to a distributed key generation method, a distributed signature method and related devices. Background Art

[0002] Blockchain technology is a decentralized, secure and reliable accounting technology. The reason why blockchain can give the ownership of data to users is largely due to cryptography, especially asymmetric encryption. The public key in asymmetric encryption corresponds to the address of the account, and the asset holder holds the private key. The holder uses the private key to generate a digital signature to use the corresponding digital asset. When the blockchain combines the corresponding public key information and transaction information on the asset to verify the legitimacy of the signature, the transaction can be packaged as a block and recorded on the chain. In general, the private key is the only credential for manipulating the corresponding data on the blockchain; however, once the user's private key is lost or stolen, the control of the data will be completely lost. Therefore, although the blockchain system itself can avoid single point failures, the security of the private key still has a single point problem.

[0003] To this end, a distributed private key management scheme for private keys has also emerged. The distributed private key management scheme in the prior art is based on the threshold signature scheme, which divides a key into multiple parts and distributes them to different participants. Only when a sufficient number of participants cooperate can a valid signature be generated. Therefore, the characteristic of the threshold signature scheme is to ensure the security and reliability of the signature process while avoiding single point failure. But at the same time, the threshold signature scheme is a synchronous and interactive signature scheme. If each key fragment is managed by different entities and multi-party signatures are required, batch asynchronous signature requests will cause a single node to bear a large computing load.

[0004] Therefore, in the scenario where multiple parties sign together, how to reduce the excessive computing load on a single node caused by asynchronous batch signature requests has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] In view of this, the present application provides a distributed key generation method, a distributed signature method and related devices to solve the problem that when multiple parties sign, batch asynchronous signature requests will cause a single node to bear a large computing load.

[0006] To achieve the above objectives, this application provides the following technical solutions:

[0007] In a first aspect, the present application discloses a distributed key generation method, which is applied to any signature node in a blockchain network; the blockchain network includes multiple signature nodes and a state manager; the method includes:

[0008] After making preparations for key generation for the key generation request, updating the number of key generation operation ready nodes corresponding to the first key generation operation identifier in the key generation request in the first hash table;

[0009] Sequentially obtain the second key generation operation identifier to be polled based on the polling queue;

[0010] The first hash table is queried based on the second key generation operation identifier to obtain the number of key generation operation ready nodes corresponding to the second key generation operation identifier; wherein the polling queue is a queue accessible to all signature nodes; each second key generation operation identifier in the polling queue is an identifier written by the initiating node of the key generation request;

[0011] If the number of nodes ready for the key generation operation is greater than or equal to a first preset threshold, a distributed key generation protocol is jointly executed with other signature nodes to obtain a key, and the second key generation operation identifier is cleared from the polling queue.

[0012] Optionally, the method further includes:

[0013] If the signing node does not find a second key generation operation identifier corresponding to the first key generation operation identifier in the polling queue after receiving a key generation request sent by other signing nodes, the first key generation operation identifier is added to the polling queue.

[0014] Optionally, the polling queue further records the request time of each second key generation operation identifier, and the method further includes:

[0015] It is determined whether the request time of the second key generation operation identifier has timed out, and if so, the second key generation operation identifier is deleted from the polling queue.

[0016] The second aspect of the present application discloses a distributed signature method, which is applied to any signature node in a blockchain network; the blockchain network includes multiple signature nodes and a state manager; the method includes:

[0017] After preparing the signature for the signature generation request, updating the number of signature operation ready nodes corresponding to the signature request in the second hash table based on the first signature operation identifier in the signature request;

[0018] If an activation message is received, the corresponding information to be signed is obtained based on the second signature operation identifier in the activation message; wherein the activation message is a message sent by the state management machine to each signature node of the second signature operation when it is determined that the number of signature operation ready nodes corresponding to the second signature operation identifier is greater than the second threshold value;

[0019] For the information to be signed, a distributed signature protocol is jointly executed with other signing nodes based on the generated key to complete the signing of the information to be signed; wherein the key is the key generated by the above-mentioned distributed key generation method.

[0020] Optionally, the acquiring corresponding information to be signed based on the second signature operation identifier in the activation message includes:

[0021] Based on the second signature operation identifier, obtain the information to be signed corresponding to the second signature identifier from the local hash table.

[0022] The third aspect of the present application discloses a distributed key generation device, which is applied to any signature node in a blockchain network; the blockchain network includes multiple signature nodes and a state manager; the device includes:

[0023] A first updating unit is used to update the number of key generation operation ready nodes corresponding to the first key generation operation identifier in the first hash table based on the first key generation operation identifier in the key generation request after preparing the key generation for the key generation request;

[0024] A polling unit, configured to sequentially obtain the second key generation operation identifier to be polled based on the polling queue; and configured to query the first hash table based on the second key generation operation identifier to obtain the number of key generation operation ready nodes corresponding to the second key generation operation identifier; wherein the polling queue is a queue accessible to all signature nodes; each second key generation operation identifier in the polling queue is an identifier written by the initiating node of the key generation request;

[0025] The key generation unit is used to execute the distributed key generation protocol together with other signature nodes to obtain the key if the number of nodes ready for the key generation operation is greater than or equal to a first preset threshold, and clear the second key generation operation identifier from the polling queue.

[0026] Optionally, the device further comprises:

[0027] An adding unit is configured to add the first key generation operation identifier to the polling queue if a second key generation operation identifier corresponding to the first key generation operation identifier is not found in the polling queue after receiving a key generation request sent by another signing node.

[0028] Optionally, the polling queue further records the request time of each second key generation operation identifier;

[0029] Accordingly, the device further comprises:

[0030] A timeout judgment unit is used to judge whether the request time of the second key generation operation identifier has timed out, and if so, delete the second key generation operation identifier from the polling queue.

[0031] In a fourth aspect, the present application discloses a distributed signature device, which is applied to any signature node in a blockchain network; the blockchain network includes multiple signature nodes and a state manager; the device includes:

[0032] A second updating unit is used to update the number of signature operation ready nodes corresponding to the signature request in the second hash table based on the first signature operation identifier in the signature request after preparing the signature for the signature generation request;

[0033] The activation unit, if receiving the activation message, obtains the corresponding information to be signed based on the second signature operation identifier in the activation message; wherein the activation message is a message sent by the state management machine to each signature node of the second signature operation when determining that the number of signature operation ready nodes corresponding to the second signature operation identifier is greater than the second threshold value;

[0034] The signing unit is used to execute a distributed signature protocol with other signing nodes based on the generated key for the information to be signed, so as to complete the signing of the information to be signed; wherein the key is a key generated by the above-mentioned distributed key generation method.

[0035] A fifth aspect of the present application discloses an electronic device, comprising:

[0036] one or more processors;

[0037] a storage device having one or more programs stored thereon;

[0038] When the one or more programs are executed by the one or more processors, the one or more processors implement the distributed key generation method as described above, and / or implement the distributed signature method as described above.

[0039] In a sixth aspect, the present application discloses a computer storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the distributed key generation method as described above is implemented, and / or the distributed signature method as described above is implemented.

[0040] It can be seen from the above technical scheme that a distributed key generation method, a distributed signature method and related devices provided by the present application, when preparing for key generation regarding a key generation request, update the number of key generation operation ready nodes corresponding to the first key generation operation identifier in the first hash table based on the first key generation operation identifier in the key generation request; obtain the second key generation operation identifier to be polled in sequence based on the polling queue; query the first hash table based on the second key generation operation identifier to obtain the number of key generation operation ready nodes corresponding to the second key generation operation identifier; if the number of key generation operation ready nodes is greater than or equal to the first preset threshold, jointly execute the distributed key generation protocol with other signature nodes to obtain the key, and clear the second key generation operation identifier from the polling queue. This application maintains a hash table and polling queue that all signature nodes can access. Each signature node can quickly determine the number of nodes that are ready based on the polling queue and hash table. There is no need to determine whether other nodes are ready one by one through real-time communication, which saves the computing resources consumed by the information exchange of each node. Therefore, in the scenario of high concurrency of batch asynchronous signatures, each signature node does not need to spend a lot of computing resources to communicate with other nodes, which will not cause a single node to bear a large load, reducing the working pressure of each signature node. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0042] Figure 1 A flowchart of a distributed key generation method disclosed in an embodiment of the present application;

[0043] Figure 2 A flowchart of a distributed key generation method disclosed in another embodiment of the present application;

[0044] Figure 3 A flowchart of a distributed key generation method disclosed in another embodiment of the present application;

[0045] Figure 4 A flowchart of a distributed signature method disclosed in another embodiment of the present application;

[0046] Figure 5 A schematic diagram of a distributed key generation device disclosed in another embodiment of the present application;

[0047] Figure 6 A schematic diagram of a distributed signature device disclosed in another embodiment of the present application;

[0048] Figure 7 A schematic diagram of a distributed key generation process disclosed in another embodiment of the present application;

[0049] Figure 8 A schematic diagram of a distributed signature process disclosed in another embodiment of the present application;

[0050] Fig. 9 A schematic diagram of an electronic device disclosed in another embodiment of the present application. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0052] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0053] Furthermore, in this document, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0054] For data encryption on the blockchain, the existing technology uses a threshold signature scheme to divide the key originally managed by one user into multiple parts and distribute them to different participants, so that when the number of participants is greater than the set threshold value, a valid signature can be generated, thereby effectively avoiding the problem of losing control of the data after the key in the hands of a single participant is lost. However, the original threshold signature scheme also brings new technical problems. In the threshold signature scheme, when each participant (i.e., signature node) generates a key, it needs to communicate with other signature nodes in real time to count the number of signature nodes that have been prepared in real time, so that the corresponding key can be generated when the number of ready nodes for the key is greater than the threshold value. However, in a high-concurrency scenario, hundreds, thousands, or even tens of thousands of signatures may need to be performed simultaneously in the blockchain. At this time, for each signature node, timed communication is required for each signature node, resulting in excessive computing load for each signature node.

[0055] At the same time, multi-party signatures in blockchain networks are based on multi-party signature protocols, which consist of two main parts: distributed key generation and distributed signatures. These two parts each have their own focus: in distributed key generation, the generated key needs to be synchronized to the user; and the timeout mechanism set by the distributed signature makes it possible to use an asynchronous method to complete the signature without the need to synchronize the result after the user completes the signature. Therefore, this application optimizes the distributed key generation and distributed signature processes by means of polling queues and transaction caches, respectively. Thus, a distributed key generation method and a distributed signature method are provided to solve the problem of batch asynchronous signature requests causing a single node to bear a large computing load when multi-party signatures are needed; to reduce the computing load of asynchronous batch signatures on each signature node.

[0056] Before introducing this solution, let’s first explain the relevant terms:

[0057] Blockchain technology: Blockchain technology is a distributed database technology that uses a series of interconnected data blocks to store data records and uses encryption technology to ensure data security and integrity. The core features of blockchain technology include distributed storage, decentralization, immutability, transparency and smart contracts.

[0058] Signature: Signature is a cryptographic method in blockchain to verify the authenticity and integrity of transactions or messages. Signature generates a digital signature by processing specific data using an encryption algorithm. The digital signature is associated with a specific private key. Verifying this digital signature requires the corresponding public key, and only users with the corresponding private key can generate the correct signature.

[0059] Elliptic Curve Digital Signature Algorithm: ECDSA is an asymmetric cryptographic signature algorithm used by mainstream blockchains. In a digital signature, the sender signs the data with a private key to prove the integrity of the data and the identity of the sender. The receiver can verify the signature with the sender's public key to confirm that the data has not been tampered with. The elliptic signature algorithm is superior to other digital signature algorithms, such as RSA, in many ways because it is more secure and computationally efficient.

[0060] Secure Multiparty Computation: Secure Multiparty Computation (SMC) is a cryptographic protocol designed to allow multiple participants to perform computations without disclosing private data. In secure multiparty computation, participants can perform computations together, but each participant can only access the data they hold and cannot directly access the data of other participants.

[0061] An embodiment of the present application also discloses a distributed key generation method, which is applied to any signature node in a blockchain network;

[0062] The blockchain network includes multiple signature nodes, each of which can execute the distributed key generation method in this embodiment, so that the multiple signature nodes cooperate with each other to complete the signature.

[0063] It should be noted that the blockchain network is also provided with a first hash table, which is a public hash table, and all signature nodes can read the data in the first hash table through a read function, and write to the first hash table through a write function. Among them, the first hash table records the correspondence between the key generation operation identifier and the number of nodes ready for the key generation operation.

[0064] Optionally, a state manager may be provided in the blockchain network to maintain the first hash table.

[0065] The distributed signature generation method provided in this embodiment is as follows: Figure 1 As shown, including:

[0066] S101. Based on a first key generation operation identifier in the key generation request, update the number of key generation operation ready nodes corresponding to the first key generation operation identifier in a first hash table.

[0067] In step S101, the key generation request is a request initiated by any signing node in the blockchain network. The initiating node of the request can send the request to the remaining signing nodes in the blockchain network by broadcasting or other communication methods.

[0068] It should be noted that, including the initiating node of the key generation request, each signature node starts to execute step S101 after determining that it is ready for key generation for the key generation request. In other words, after initiating the request, the initiating node of the key generation request will also be regarded as ready. Therefore, the initiating node also needs to update the number of key generation operation ready nodes corresponding to the first key generation operation identifier in the first hash table based on the first key generation operation identifier corresponding to the key generation request. As for the remaining signature nodes of the participating parties, after receiving the key generation request and preparing for key generation for the key generation request, they also need to start executing step S101.

[0069] The key generation request includes the key generation operation identifier of this key generation operation. The key generation operation identifier is the universally unique identifier (UUID) of this key generation operation. In order to distinguish it from the signature operation identifier, the key generation operation identifier is referred to as the first UUID.

[0070] It should be noted that after receiving the key generation request, the signing node reads the value (number) of the mapping position corresponding to the first UUID in the first hash table through the first UUID in the request. If the value is empty, 1 is written to the mapping position; otherwise, (number+1) is written to the mapping position.

[0071] It should also be noted that for batch signature scenarios, each signature node needs to participate in multiple distributed key generation. Therefore, the signature node can sequentially determine the identifier first UUIDi corresponding to the i-th distributed key; and for each first UUIDi read, read the value number corresponding to the mapping position of the first UUIDi in the hash table H. i , and according to number i Update the number of participants in the currently prepared distributed key generation in the hash table. The specific update method can be, if number i If it is empty, write 1 to the mapping position of the first UUIDi in the hash table H; otherwise, write number i +1.

[0072] It should also be noted that for the initiating node, after preparing for the key generation request, it is also necessary to add the first UUID to the polling queue so that when traversing the polling queue to poll the status of each request, the status corresponding to the first UUID can be queried.

[0073] Optionally, in another embodiment of the present application, the above-mentioned distributed key generation method may further include:

[0074] If the signing node does not find a second key generation operation identifier corresponding to the first key generation operation identifier in the polling queue after receiving a key generation request sent by other signing nodes, the first key generation operation identifier is added to the polling queue.

[0075] The initiating node may fail to successfully add the first UUID corresponding to the key generation request it initiated to the polling queue due to a failure or jam. At this time, the remaining nodes, as participants in the key generation operation, need to re-add the first UUID to the polling queue to avoid the key generation request being missed during polling.

[0076] It should be noted that step S201 may be performed simultaneously with the operation of updating the first hash table in step S101, or may be performed before or after the operation, which is not specifically limited here.

[0077] S102: sequentially obtain the second key generation operation identifier to be polled based on the polling queue.

[0078] The polling queue may include multiple elements, and each element has a corresponding second UUID. Therefore, the second UUID corresponding to each element can be obtained by accessing each element in the polling queue in turn. j The second UUID of the corresponding element j That is, it is the second key generation operation identifier to be polled currently.

[0079] It should be noted that the same key generation operation has only one universal unique identifier UUID. The "first" and "second" in the first UUID and the second UUID are only used to distinguish the source of the UUID read by the signature node, that is, the first UUID indicates that the UUID is obtained from the key generation request, and the second UUID indicates that the UUID is obtained from the polling queue; the second key generation operation identifier is the second UUID.

[0080] S103: query the first hash table based on the second key generation operation identifier to obtain the number of key generation operation ready nodes corresponding to the second key generation operation identifier.

[0081] The polling queue is a queue accessible to all signature nodes; each second key generation operation identifier in the polling queue is an identifier written by the initiating node of the key generation request.

[0082] After the second UUID is obtained from the polling queue, the number of nodes for which the key generation operation corresponding to the second UUID is ready needs to be read again from the first hash table.

[0083] It should also be noted that for batch signature scenarios, the polling queue contains the UUIDs of different key generation operations, so the elements Q in the queue can be accessed in sequence. j , get the UUIDj of the corresponding element.

[0084] Optionally, in another embodiment of the present application, the above-mentioned distributed key generation method, such as Figure 2 As shown, it may also include:

[0085] S201. Determine whether the request time of the second key generation operation identifier has timed out. If so, delete the second key generation operation identifier from the polling queue.

[0086] The polling queue not only records the UUID corresponding to each request, but also records the request time corresponding to the UUID. Therefore, it is possible to determine whether the request has timed out by combining the request time of each key generation request in the polling queue with the current time. If the request has timed out, the key generation request will no longer be processed, and the UUID corresponding to the request will be deleted from the queue. Optionally, if the difference between the current time and the previously recorded time is ≥ T, the request is determined to have timed out, and the corresponding identifier is removed from the queue; T is the preset timeout threshold.

[0087] S104: If the number of nodes ready for the key generation operation is greater than or equal to a first preset threshold, jointly execute a distributed key generation protocol with other signature nodes to obtain a key, and clear the second key generation operation identifier from the polling queue.

[0088] For requests that have not timed out, after obtaining the number of ready nodes for the key generation operation corresponding to the second UUID, it can be determined based on the number whether the key generation operation corresponding to the second UUID meets the key generation condition. When number is greater than or equal to the first preset threshold n, the current signing node will execute the distributed key generation protocol with other nodes to obtain the key DKG j It should be noted that the first preset threshold is the threshold value for key generation.

[0089] It should also be noted that if the polling queue is empty, it indicates that all keys in the batch distributed key generation have been generated. Otherwise, it is necessary to continue to execute steps S102-S104 for each element in the polling queue.

[0090] The present application provides a distributed key generation method. When key generation preparation is completed for a key generation request, based on a first key generation operation identifier in the key generation request, the number of key generation operation ready nodes corresponding to the first key generation operation identifier in a first hash table is updated; based on a polling queue, the second key generation operation identifier to be polled is obtained in sequence; based on the second key generation operation identifier, the first hash table is queried to obtain the number of key generation operation ready nodes corresponding to the second key generation operation identifier; if the number of key generation operation ready nodes is greater than or equal to a first preset threshold, a distributed key generation protocol is jointly executed with other signature nodes to obtain a key, and the second key generation operation identifier is cleared from the polling queue. This application maintains a hash table and polling queue that are accessible to all signature nodes. Each signature node can quickly determine the number of nodes that are ready based on the polling queue and hash table. There is no need to determine whether other nodes are ready one by one through real-time communication, which saves the computing resources consumed by the information exchange of each node. Therefore, in the scenario of high concurrency of batch asynchronous signatures, each signature node does not need to spend a lot of computing resources to communicate with other nodes, which will not cause a single node to bear a large load, reducing the working pressure of each signature node.

[0091] Optionally, in another embodiment of the present application, the above-mentioned distributed key generation method, such as Figure 3 As shown, it may also include:

[0092] S105: Sign the data using the generated key.

[0093] After the key is generated, the key is used to sign the corresponding data to be signed as soon as possible. At this time, there is no need to re-count the number of signature nodes that have already signed with the key. In other words, by counting the number of ready nodes once, the key generation operation and the operation of signing with the generated key can be performed simultaneously. This can further save the computing resources spent on information exchange of each node in the multi-party signature process and reduce the work pressure of the signature node.

[0094] Another embodiment of the present application also discloses a distributed signature method, which is applied to any signature node in the blockchain network;

[0095] It should be noted that the blockchain network applied to the distributed signature method in this embodiment may be the blockchain network applied to the distributed key generation method in any of the above embodiments; that is, the blockchain network includes multiple signature nodes and a state manager.

[0096] It should be noted that the blockchain network is also provided with a second hash table, which is also a public hash table. All signature nodes can read the data in the second hash table through the read function and write to the second hash table through the write function. The difference is that the first hash table records the correspondence between the key generation operation identifier and the number of nodes ready for the key generation operation, while the second hash table records the correspondence between the signature operation identifier and the number of nodes ready for the signature operation.

[0097] Optionally, the two corresponding relationships may be recorded separately in the same hash table. In this case, the first hash table and the second hash table are the same hash table.

[0098] The distributed signature generation method provided in this application is as follows: Figure 4 As shown, including:

[0099] S401. Update the number of signature operation ready nodes corresponding to the signature request in the second hash table based on the first signature operation identifier in the signature request.

[0100] In step S401, the signature request is a request initiated by any signature node in the blockchain network. The initiating node of the request can send the request to the remaining signature nodes in the blockchain network by broadcasting or other communication methods.

[0101] It should be noted that, including the initiating node of the signature request, each signature node starts executing step S401 after determining that it is ready to sign the signature request. In other words, after the initiating node of the signature request initiates the request, it will also be deemed that the initiating node is ready. Therefore, the initiating node also needs to update the number of signature operation ready nodes corresponding to the signature request in the second hash table based on the first signature operation identifier in the signature request. As for the remaining signature nodes of the participating parties, after receiving the signature request and preparing to sign the signature request, they also need to start executing step S401.

[0102] The signature request includes the signature operation identifier of this signature operation, which is the universal unique identifier of this signature operation. For the convenience of distinction, the first signature operation identifier is referred to as the third UUID.

[0103] It should be noted that after the signing node receives the signature request and prepares to sign the signature request, it reads the value (number) of the mapping position corresponding to the third UUID in the second hash table through the third UUID in the request. If the value is empty, write 1 to the mapping position; otherwise, write (number+1) to the mapping position.

[0104] It should also be noted that for batch signature scenarios, each signature node needs to participate in multiple distributed signatures. Therefore, the signature node can sequentially determine the identifier third UUIDi corresponding to the i-th distributed key; and for each third UUIDi read, read the value number corresponding to the mapping position of the third UUIDi in the hash table H. i , and according to number i Update the number of the currently ready i-th distributed signature participants in the hash table. The specific update method can be, if number i If it is empty, write 1 to the third UUIDi mapping position in the hash table H; otherwise, write number i +1.

[0105] It should be noted that the first signature operation identifier and the first key generation operation identifier can be the same UUID or different UUIDs; that is, the same UUID can be used to first identify the key generation operation, and then identify the subsequent signature operation using the generated key to sign; the specific selection can be based on actual needs and is not specifically limited here.

[0106] Optionally, in another embodiment of the present application, the above-mentioned distributed signature method may further include:

[0107] The information to be signed corresponding to the signature request of the first signature operation identifier is written into the mapping location of the first signature operation identifier in the local hash table.

[0108] The method for obtaining the information to be signed corresponding to the signature request may be a method used in the prior art. In this embodiment, after the signature node receives the signature request and determines that it is ready to sign, it obtains the information to be signed corresponding to the signature request, and the information to be signed is stored in a local hash table of the signature node in correspondence with the first signature operation identifier in the signature request.

[0109] S402. If an activation message is received, the corresponding information to be signed is obtained based on the second signature operation identifier in the activation message; wherein the activation message is a message sent by the state management machine to each signature node of the second signature operation when it is determined that the number of signature operation ready nodes corresponding to the second signature operation identifier is greater than a second threshold.

[0110] Unlike the distributed key generation method, the distributed signature process no longer requires each signature node to poll the queue. Each signature node only needs to wait for the activation message from the state manager. The state manager will determine whether the corresponding signature operation meets the signature condition based on the number of signature operation ready nodes corresponding to each signature operation identifier UUID in the second hash table. If the condition is met, the signature identifier is sent to the corresponding signature node. For example, if the state manager determines that the number of signature operation ready nodes corresponding to the third UUIDi is greater than the second preset threshold, it is determined that the third UUIDi meets the signature condition, and an activation message is sent to the signature node corresponding to the third UUIDi. It should be noted that the second preset threshold is the threshold value of the signature operation. Among them, the second preset threshold may be the same as the first preset threshold, or it may be different.

[0111] It should be noted that the activation message includes an activation instruction, an activation node identifier, and a signature operation identifier of the activated signature operation. The activation message may be (ACT, Pj, UUIDh), where ACT is an activation instruction, Pj is an activated node identifier, and UUIDh is an identifier of the activated signature operation. The state manager may send an activation message to all signature nodes involved in the signature (including ready signature nodes and unready signature nodes) to trigger the ready signature nodes to start executing the signature operation, while the unready nodes will not respond to the activation message; or the activation message may be sent only to the ready activation nodes. Accordingly, each signature node, while updating the number of ready nodes for signature operation in the second hash table, also needs to write its own node identifier in other blank mapping positions of the third UUID, so that the state manager can accurately obtain the identifier of the ready signature node. After receiving the activation message, the signature operation identifier can be read from the activation message. For easy distinction, the signature operation identifier read from the activation request is called the second signature operation identifier, referred to as the fourth UUID.

[0112] Optionally, in another embodiment of the present application, the specific implementation process of step S402 is:

[0113] Based on the second signature operation identifier, obtain the to-be-signed information corresponding to the second signature operation identifier from the local hash table.

[0114] The local hash table is a hash table stored by the signature node and located locally at the signature node, and the local hash table stores the information to be signed and the second signature operation identifier correspondingly.

[0115] S403: For the information to be signed, execute a distributed signature protocol together with other signing nodes based on the generated key to complete the signing of the information to be signed.

[0116] The key is a key generated by the distributed key generation method in any one of the above embodiments.

[0117] The present application provides a distributed signature method. When the key generation preparation for a signature request is completed, based on the first signature operation identifier in the signature request, the number of signature operation ready nodes corresponding to the first signature operation identifier in the second hash table is updated; and the information to be signed corresponding to the first signature operation identifier is saved in the local hash table. When the activation message is received, the corresponding information to be signed is obtained based on the second signature operation identifier in the activation message; then, for the information to be signed, the distributed signature protocol is jointly executed with other signature nodes based on the generated key to complete the signing of the information to be signed. A distributed signature method based on transaction cache under a message notification mechanism is adopted. For each node participating in the signature, when the distributed signature is carried out in batches, the cost of maintaining the preparation state is relatively small. From the user's point of view, once the operation is approved, there is no need to participate in the subsequent process, and it does not affect the initiation of a new signature, thus achieving asynchrony.

[0118] Another embodiment of the present application further discloses a distributed key generation device, which can be installed in any signature node in the blockchain network, so that the signature node can execute the distributed key generation method in the above embodiment; or, directly use the distributed key generation device as a signature node in the blockchain network.

[0119] It should be noted that the blockchain network includes a state manager and multiple signature nodes;

[0120] The distributed key generation device, such as Figure 5 As shown, including:

[0121] A first updating unit 501 is used to update the number of key generation operation ready nodes corresponding to the first key generation operation identifier in the key generation request in the first hash table after preparing for key generation for the key generation request;

[0122] The polling unit 502 is used to sequentially obtain the second key generation operation identifier to be polled based on the polling queue; and to query the first hash table based on the second key generation operation identifier to obtain the number of key generation operation ready nodes corresponding to the second key generation operation identifier; wherein the polling queue is a queue accessible to all signature nodes; each second key generation operation identifier in the polling queue is an identifier written by the initiating node of the key generation request;

[0123] The key generation unit 503 is used to execute the distributed key generation protocol together with other signature nodes to obtain the key if the number of nodes ready for the key generation operation is greater than or equal to the first preset threshold, and clear the second key generation operation identifier from the polling queue.

[0124] In this embodiment, the specific execution process of the first updating unit 501, the polling unit 502 and the key generating unit 503 can be referred to in the corresponding Figure 1 The content of the method embodiment will not be repeated here.

[0125] The present application provides a distributed key generation device, which, through a first updating unit 501, updates the number of key generation operation ready nodes corresponding to the first key generation operation identifier in the key generation request in a first hash table based on the first key generation operation identifier in the key generation request after preparing for key generation for the key generation request; then, through a polling unit 502, sequentially obtains the second key generation operation identifier to be polled based on the polling queue; queries the first hash table based on the second key generation operation identifier to obtain the number of key generation operation ready nodes corresponding to the second key generation operation identifier; finally, through the key generation unit 503, when the number of key generation operation ready nodes is greater than or equal to a first preset threshold, jointly executes a distributed key generation protocol with other signature nodes to obtain a key, and clears the second key generation operation identifier from the polling queue. This application maintains a hash table and polling queue that are accessible to all signature nodes. Each signature node can quickly determine the number of nodes that are ready based on the polling queue and hash table. There is no need to determine whether other nodes are ready one by one through real-time communication, which saves the computing resources consumed by the information exchange of each node. Therefore, in the scenario of high concurrency of batch asynchronous signatures, each signature node does not need to spend a lot of computing resources to communicate with other nodes, which will not cause a single node to bear a large load, reducing the working pressure of each signature node.

[0126] Optionally, in another embodiment of the present application, the above-mentioned distributed key generation device may further include:

[0127] An adding unit is configured to add the first key generation operation identifier to the polling queue if a second key generation operation identifier corresponding to the first key generation operation identifier is not found in the polling queue after receiving a key generation request sent by another signing node.

[0128] For the initiating node of the request, the adding unit is also used to: after updating the number value of the mapping position corresponding to the first UUID in the first hash table, the first UUID needs to be added to the polling queue so that when traversing the polling queue to poll the status of each request, the status corresponding to the first UUID can be queried.

[0129] In this embodiment, the specific execution process of the adding unit can refer to the corresponding method embodiment content above, which will not be repeated here.

[0130] Optionally, in another embodiment of the present application, the above-mentioned distributed key generation device may further include:

[0131] A timeout judgment unit is used to judge whether the request time of the second key generation operation identifier has timed out, and if so, delete the second key generation operation identifier from the polling queue.

[0132] The request time is the request time of each second key generation operation identifier recorded in the polling queue.

[0133] In this embodiment, the specific execution process of the timeout determination unit can be found in the corresponding method embodiment described above, and will not be repeated here.

[0134] Another embodiment of the present application further discloses a distributed signature device, which can be installed in any signature node in the blockchain network, so that the signature node can execute the distributed key generation method in the above embodiment; or, directly use the distributed key generation device as a signature node in the blockchain network.

[0135] It should be noted that the blockchain network includes a state manager and multiple signature nodes;

[0136] The distributed signature device, such as Figure 6 As shown, including:

[0137] The second updating unit 601 is used to update the number of signature operation ready nodes corresponding to the signature request in the second hash table based on the first signature operation identifier in the signature request after preparing the signature for the signature request;

[0138] The activation unit 602, if receiving the activation message, obtains the corresponding information to be signed based on the second signature operation identifier in the activation message; wherein the activation message is a message sent by the state management machine to each signature node of the second signature operation when determining that the number of signature operation ready nodes corresponding to the second signature operation identifier is greater than the second threshold value;

[0139] The signing unit 603 is used to execute a distributed signature protocol with other signing nodes based on the generated key for the information to be signed, so as to complete the signing of the information to be signed.

[0140] The key used for signing is a key generated by the distributed key generation method in any one of the above embodiments.

[0141] In this embodiment, the specific execution process of the second update unit 601, the activation unit 602 and the signature unit 603 can be found in the corresponding Figure 4 The content of the method embodiment will not be repeated here.

[0142] The present application provides a distributed signature device, which updates the number of signature operation ready nodes corresponding to the first signature operation identifier in the second hash table based on the first signature operation identifier in the signature request through the second update unit 601 when the key generation preparation for a signature request is completed; and the information to be signed corresponding to the first signature operation identifier is saved through the local hash table. The activation unit 602 obtains the corresponding information to be signed based on the second signature operation identifier in the activation message when receiving the activation message; finally, the signature unit 603 executes the distributed signature protocol with other signature nodes based on the generated key for the information to be signed to complete the signing of the information to be signed. The distributed signature method based on transaction cache under the message notification mechanism is adopted. For each node participating in the signature, when the distributed signature is carried out in batches, the cost of maintaining the preparation state is relatively small. From the user's point of view, once the operation is approved, there is no need to participate in the subsequent process, and it does not affect the initiation of new signatures, thus achieving asynchrony.

[0143] In some embodiments, the distributed key generation method and the distributed signature method process are as follows:

[0144] The multi-party signature protocol consists of two main parts: distributed key generation and distributed signature. These two parts each have their own focus: in distributed key generation, the generated key needs to be synchronized to the user; and the timeout mechanism set by the distributed signature means that after the user completes the signature, there is no need to synchronize the result, and it can be completed using an asynchronous method. Therefore, the distributed key generation and distributed signature processes are optimized by polling queues and transaction caches respectively.

[0145] (1) Distributed key generation based on polling queue:

[0146] The process of distributed key generation is as follows: Figure 7 As shown, the MPC node is a secure multi-party computing node (Secure Multi-Party Computation, MPC for short).

[0147] When a signature node (i.e., MPC node) initiates multiple distributed key generation requests, these key generation requests all include polling operations, and thus may be blocked at this step. Therefore, all polling operation identifiers can be stored in a queue, and the state manager of these requests can be polled by traversing the queue. Let the state manager be N, maintain the hash table H, the key generation request timeout period be T, and for any threshold signature participant P who wants to perform a distributed key generation operation i , the hash table H can be read or written through the read function and the write function. Suppose the circular queue Q is composed of all the signature participants P i Initialization is performed, and the key generation operation of each signing participant is uniquely identified by UUID. The process is as follows.

[0148] 1. Obtain the number of participants in the currently prepared distributed key generation for the ith time in turn, and read the value number of the corresponding mapping position of UUIDi in the hash table H i , if number i If it is empty, write 1 to the UUIDi mapping position in the hash table H; otherwise, write number i +1;

[0149] Then, add the corresponding UUID to the circular queue Q and record the time ti at this time.

[0150] 2. Access the elements Qj in the queue in sequence and obtain the UUID of the corresponding element j and read the UUID again from the hash table H j The number of nodes that are ready j If number j = n, and the request has not timed out, Pj and other nodes execute the distributed key generation protocol to obtain DKG j , the corresponding identifier is dequeued; if the request times out, that is, the difference between the current time and the previously recorded time ≥ T, the corresponding identifier is dequeued.

[0151] 3. If the queue Q is empty, it indicates that the K-time distributed key generation is completed; otherwise, return to step 2.

[0152] The polling queue stores identifiers corresponding to key generation operations and replaces multi-threaded polling operations by traversing the queue in a loop. Therefore, once the polling queue is traversed and all parties of a key generation request are ready, the protocol can be executed immediately to realize the request and execution of multiple distributed key generation operations.

[0153] (2) Distributed signature based on transaction cache:

[0154] The process of distributed signature is as follows Figure 8 As shown in the figure. Since the distributed signature process needs to be asynchronous, the management machine uses a message notification mechanism. When the number reaches the threshold, the previously prepared distributed signature parties are notified. Therefore, each party does not poll the state manager during the signature preparation stage, and saves the transactions that need to be signed to the buffer, waiting for the state manager to activate.

[0155] Let P i For the participants of the distributed signature, the public information mi will be signed during the i-th signature operation, and each party initializes a hash table Hi locally. For any distributed signature participant Pj, the process is as follows:

[0156] 1. Obtain the number of participants number ready for the i-th distributed signature operation DSi at this time i , if number i If it is empty, write 1 to the UUIDi mapping position in the public hash table H; otherwise, write number i +1. At the same time, the information mi to be signed is saved through the local hash table Hj, and the information mi to be signed is written into the UUIDi mapping of Hj.

[0157] 2. Once the activation message (ACT, Pj, UUIDh) is received, obtain the message to be signed and the UUID corresponding to the message: mh = Hj (UUIDh).

[0158] If mh is empty at this time, Pj and other participants execute the distributed signature protocol to obtain the signature: sigmah = DS (mh, sk1, ..., skj, ..skn).

[0159] if Then the K signature requests are completed and ended.

[0160] The distributed signature method based on transaction cache under the message notification mechanism is adopted. For each node participating in the signature, when the distributed signature is carried out in batches, the cost of maintaining the preparation state is relatively low. From the user's perspective, once the operation is approved, there is no need to participate in the subsequent process, and it does not affect the initiation of new signatures, thus achieving asynchrony.

[0161] Another embodiment of the present application further provides an electronic device, such as Fig. 9 As shown, including:

[0162] One or more processors 901;

[0163] A storage device 902 having one or more programs stored thereon;

[0164] When the one or more programs are executed by the one or more processors 901, the one or more processors 901 implement the distributed key generation method as described in any one of the above embodiments, and / or implement the distributed signature method as described in any one of the above embodiments.

[0165] Another embodiment of the present application further provides a computer storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the distributed key generation method described in any one of the above embodiments is implemented, and / or the distributed signature method described in any one of the above embodiments is implemented.

[0166] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.

[0167] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0168] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A distributed key generation method, characterized in that: Applied to any signature node in a blockchain network; the blockchain network includes multiple signature nodes; the method includes: After making preparations for key generation for the key generation request, updating the number of key generation operation ready nodes corresponding to the first key generation operation identifier in the key generation request in the first hash table; Sequentially obtain the second key generation operation identifier to be polled based on the polling queue; The first hash table is queried based on the second key generation operation identifier to obtain the number of key generation operation ready nodes corresponding to the second key generation operation identifier; wherein the polling queue is a queue accessible to all signature nodes; each second key generation operation identifier in the polling queue is an identifier written by the initiating node of the key generation request; If the number of nodes ready for the key generation operation is greater than or equal to a first preset threshold, a distributed key generation protocol is jointly executed with other signature nodes to obtain a key, and the second key generation operation identifier is cleared from the polling queue.

2. The method according to claim 1, characterized in that The method further comprises: If the signing node does not find a second key generation operation identifier corresponding to the first key generation operation identifier in the polling queue after receiving a key generation request sent by other signing nodes, the first key generation operation identifier is added to the polling queue.

3. The method according to claim 1, characterized in that: The polling queue further records the request time of each second key generation operation identifier, and the method further includes: It is determined whether the request time of the second key generation operation identifier has timed out, and if so, the second key generation operation identifier is deleted from the polling queue.

4. A distributed signature method, characterized in that: Applied to any signature node in a blockchain network; the blockchain network includes multiple signature nodes and a state manager; the method includes: After the signing preparation for the signature request is completed, the number of signature operation ready nodes corresponding to the signature request in the second hash table is updated based on the first signature operation identifier in the signature request; If an activation message is received, the corresponding information to be signed is obtained based on the second signature operation identifier in the activation message; wherein the activation message is a message sent by the state management machine to each signature node of the second signature operation when it is determined that the number of signature operation ready nodes corresponding to the second signature operation identifier is greater than the second threshold value; For the information to be signed, a distributed signature protocol is jointly executed with other signing nodes based on the generated key to complete the signing of the information to be signed; wherein the key is a key generated by the distributed key generation method according to any one of claims 1-3.

5. The method according to claim 4, characterized in that The acquiring corresponding information to be signed based on the second signature operation identifier in the activation message includes: Based on the second signature operation identifier, obtain the information to be signed corresponding to the second signature identifier from the local hash table.

6. A distributed key generation device, characterized in that: Applied to any signature node in a blockchain network; the blockchain network includes multiple signature nodes; the device includes: A first updating unit is used to update the number of key generation operation ready nodes corresponding to the first key generation operation identifier in the first hash table based on the first key generation operation identifier in the key generation request after preparing the key generation for the key generation request; A polling unit, configured to sequentially obtain the second key generation operation identifier to be polled based on the polling queue; and configured to query the first hash table based on the second key generation operation identifier to obtain the number of key generation operation ready nodes corresponding to the second key generation operation identifier; wherein the polling queue is a queue accessible to all signature nodes; each second key generation operation identifier in the polling queue is an identifier written by the initiating node of the key generation request; The key generation unit is used to execute the distributed key generation protocol together with other signature nodes to obtain the key if the number of nodes ready for the key generation operation is greater than or equal to a first preset threshold, and clear the second key generation operation identifier from the polling queue.

7. The device according to claim 6, characterized in that The device also includes: An adding unit is configured to add the first key generation operation identifier to the polling queue if a second key generation operation identifier corresponding to the first key generation operation identifier is not found in the polling queue after receiving a key generation request sent by another signing node.

8. A distributed signature device, characterized in that: Applied to any signature node in a blockchain network; the blockchain network includes multiple signature nodes and a state manager; the device includes: A second updating unit is used to update the number of signature operation ready nodes corresponding to the signature request in the second hash table based on the first signature operation identifier in the signature request after preparing the signature for the signature generation request; The activation unit, if receiving the activation message, obtains the corresponding information to be signed based on the second signature operation identifier in the activation message; wherein the activation message is a message sent by the state management machine to each signature node of the second signature operation when determining that the number of signature operation ready nodes corresponding to the second signature operation identifier is greater than the second threshold value; A signing unit is used to execute a distributed signature protocol with other signing nodes based on the generated key for the information to be signed, so as to complete the signing of the information to be signed; wherein the key is a key generated by the distributed key generation method according to any one of claims 1 to 3.

9. An electronic device, characterized in that: include: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the distributed key generation method as described in any one of claims 1 to 3, and / or implement the distributed signature method as described in any one of claims 4 to 5.

10. A computer storage medium, characterized in that: A computer program is stored thereon, wherein when the computer program is executed by a processor, it implements the distributed key generation method as described in any one of claims 1 to 3, and / or implements the distributed signature method as described in any one of claims 4 to 5.