Threshold signature method, device, electronic device and readable storage medium
By synergistically generating signatures between multiple nodes, intermediate data is verified, and malicious nodes are identified using zero-knowledge proof and commitment mechanisms, the problem of failure to identify malicious nodes in the existing technology has been solved, and signature accuracy is achieved Sex and effectiveness.
Patent Information
- Application Number
- CN202011039445.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-28
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2040-09-28
AI Technical Summary
The existing threshold signature algorithm cannot recognize malicious nodes, resulting in signature failure and cannot guarantee the accuracy of the signature.
By verifying the generated intermediate data in the process of co-generating signatures between multiple nodes, the zero-knowledge proof and commitment mechanism are used to identify malicious nodes to ensure the accuracy of the signature.
Accurately identify malicious nodes, ensure the accuracy and validity of signatures, and avoid signature failures caused by malicious nodes.
Smart Images

Figure CN114338028B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of information technology, and in particular to a threshold signature method, device, electronic device, and readable storage medium. Background Art
[0002] Secret sharing means that a key is split into multiple shard keys and shared by multiple nodes. Any node with less than a threshold number cannot recover the key based on the shared shard key, while nodes with a threshold number can recover the key based on the shared shard key. Secret sharing avoids the problem of key forgery when the central node holds the key.
[0003] In the current threshold signature algorithm, if a threshold number of nodes are reached among multiple nodes and they sign according to the sharding keys they hold, the signature is valid. However, if there are malicious nodes among the threshold number of nodes, and they intentionally provide incorrect signature data, the signature will fail. However, the current signature algorithm cannot identify malicious nodes, which will cause the signature to continue to fail. Therefore, in the threshold signature algorithm, a solution to identify malicious nodes is urgently needed. Summary of the invention
[0004] The embodiments of the present application provide a threshold signature method, device, electronic device and readable storage medium, which can verify the intermediate data of the signature to be generated, accurately identify malicious nodes, and ensure the accuracy of the signature.
[0005] In the first aspect, the embodiment of the present application provides a threshold signature method, which can be applied to the first node among n nodes, and can also be applied to the chip in the first node. It should be understood that the first node can be all nodes among the n nodes, that is, each of the n nodes can perform the action of the first node. The method is described below by taking the application to the first node as an example. In this method, the first node can send the zero-knowledge proof and the first commitment of the first node to the other t-1 nodes. Correspondingly, when the first node receives the zero-knowledge proof and the first commitment from each of the other t-1 nodes, the zero-knowledge proof and the first commitment of each node can be verified. Wherein, t is a threshold value, t is an integer greater than or equal to 2 and less than or equal to n, and the zero-knowledge proof of the first node is related to the first commitment of the first node.
[0006] Among them, if the zero-knowledge proof and the first commitment of each node in the other t-1 nodes are verified, the first node obtains the first part of the signature according to the first commitment of the first node and the first commitment of each node. And the first node obtains the second commitment of each node in the t nodes according to the fragments of the second part of the signature of the first node and the fragments of the second part of the signature from each node, and verifies the fragments of the second part of the signature of each node in the t nodes according to the second commitment of each node in the t nodes. If there is a fragment of the second part of the signature of the second node in the t nodes that fails to pass the verification, the first node determines that the second node is a malicious node.
[0007] In the threshold signature method provided in the embodiment of the present application, multiple nodes can collaborate to generate a signature, and in the process of multiple nodes collaboratively generating a signature, the nodes can verify the intermediate data of the signature to be generated, such as verifying the zero-knowledge proof of the first part of the generated signature and the sharding of the second part of the signature, and then the node that provides erroneous intermediate data can be regarded as a malicious node, and the malicious node can be accurately identified. In the embodiment of the present application, when the intermediate data passes the verification, a signature can be generated, thereby ensuring the accuracy of the signature.
[0008] It should be understood that the first node can select a target random number, and generate a first commitment of the first node based on the target random number and the base point of the elliptic curve; the first node obtains the zero-knowledge proof of the first node based on the first commitment of the first node and the target random number, and sends the zero-knowledge proof of the first node to other t-1 nodes. The target random number is a random number selected by the first node from the preset random numbers.
[0009] Optionally, the first node may add the first commitment of the first node and the first commitment of each of the other t-1 nodes to obtain the first part of the signature. The process of the first node generating the fragment of the second part of the signature according to the first part of the signature may be: the first node generates a derived value according to the first part of the signature, the public key and the object to be signed; the first node obtains the first coefficient of the first node according to the identity information of each of the t nodes; the first node obtains the second private key fragment according to the first coefficient and the first private key fragment held by the first node; the first node generates the fragment of the second part of the signature of the first node according to the derived value, the second private key fragment and the target random number, and the target random number is a random number selected by the first node from the preset random number. The fragment of the second part of the signature of the first node is generated at the first node, and the fragment of the second part of the signature of the first node can be sent to the other t-1 nodes, so that the first node can obtain the fragment of the second part of the signature from each of the other t-1 nodes.
[0010] In one possible implementation, the first node can obtain the second commitment of the first node based on the shards of the second part of the signature of the first node and the base points of the elliptic curve; the first node obtains the second commitment of each of the other t-1 nodes based on the shards of the second part of the signature of each node in the other t-1 nodes and the base points of the elliptic curve to obtain the second commitment of each of the t nodes.
[0011] The first node may verify the second part of the signature of each of the t nodes in a sharding manner as follows: for a third node among the t nodes, the third node is any node among the t nodes, wherein:
[0012] The first node obtains the fifth commitment of the third node, and the fifth commitment is related to the first private key shard of the third node. The first node obtains the first coefficient of the third node according to the identity information of each of the t nodes; the first node obtains the third commitment of the third node according to the fifth commitment and the first coefficient of the third node; the first node obtains the fourth commitment of the third node according to the derived value and the third commitment of the third node; correspondingly, if the second commitment of the third node is equal to the sum of the first commitment of the third node and the fourth commitment of the third node, the first node determines that the shard of the second part of the signature of the third node passes the verification.
[0013] In an embodiment of the present application, in addition to verifying the first commitment, zero-knowledge proof, and the sharding of the second part of the signature, the first node can also verify the third commitment of each of the t nodes to more accurately determine the accuracy of the intermediate data. Among them, if the third commitment of each of the t nodes passes the verification, the first node verifies the sharding of the second part of the signature of each of the t nodes. It should be understood that the first node can obtain the sum of the third commitments of each of the t nodes; if the sum of the third commitments is equal to the public key, the first node determines that the third commitment of each of the t nodes passes the verification.
[0014] In a possible implementation, after determining that the second node is a malicious node, the first node may output the identity information of the second node. For example, the first node may output the identity information of the second node to other n-1 nodes.
[0015] In one possible implementation, if the fragments of the second part of the signature of each of the t nodes pass verification, the first node obtains the second part of the signature based on the fragments of the second part of the signature of each of the t nodes; the first node generates a signature based on the first part of the signature and the second part of the signature; if the signature is valid, the first node outputs the signature.
[0016] The above description is the signing phase of the threshold signature method, and the following description is the startup phase of the threshold signature method. In the startup phase, n nodes can collaboratively generate a public key. Among them, the first node obtains the first private key fragment of the first node; the first node generates a public key based on the first private key fragment of the first node. The following describes the process of generating a public key through two feasible implementation methods:
[0017] The first method: the first node selects a target polynomial from a preset t-1th order polynomial, and substitutes the identity information of each of the n nodes into the target polynomial to obtain a shared key shard corresponding to each of the n nodes; the first node sends a corresponding shared key shard to each of the other n-1 nodes; when the first node receives a shared key shard from each of the other n-1 nodes, the first node adds up the shared key shards from the n nodes to obtain a first private key shard of the first node.
[0018] Furthermore, the first node generates the fifth commitment of the first node according to the first private key shard of the first node; the first node sends the fifth commitment of the first node to other n-1 nodes; the first node verifies the first private key shard of each of the n nodes according to the fifth commitment of the n nodes; if the first private key shard of each of the n nodes passes the verification, a public key is generated according to the fifth commitment of each of the n nodes. The first node generates the fifth commitment of the first node according to the first private key shard of the first node and the base point of the elliptic curve.
[0019] It should be noted that in the embodiment of the present application, the first node verifies the first private key shard of each of the n nodes according to the fifth commitment of the n nodes, which may include the following steps:
[0020] A. The first node randomly selects t fifth commitments from n fifth commitments;
[0021] B. the first node obtains the second coefficient of the node corresponding to each of the t fifth commitments according to the identity identifier of the node corresponding to each of the t fifth commitments;
[0022] C. The first node obtains a public key to be verified according to the second coefficient of the node corresponding to each fifth commitment in the t fifth commitments and the fifth commitment of the node corresponding to each fifth commitment in the t fifth commitments;
[0023] D. Repeat steps A, B, and C for a preset number of times to obtain a preset number of public keys to be verified;
[0024] E. If each of the preset number of public keys to be verified is the same, the first node determines that the first private key fragment of each of the n nodes passes the verification;
[0025] The first node uses any public key to be verified as a public key.
[0026] The second method: the first node selects the first private key shard of the first node from the preset first private key shard. In this method, the first node can obtain the first public key shard of the first node and the zero-knowledge proof of the first public key shard of the first node according to the first private key shard of the first node; the first node generates the sixth commitment of the first node according to the zero-knowledge proof of the first public key shard of the first node, and sends the sixth commitment of the first node, the first public key shard of the first node, and the zero-knowledge proof of the first public key shard of the first node to other n-1 nodes; the first node verifies the sixth commitment and the zero-knowledge proof of the first public key shard from each of the n nodes; if the sixth commitment and the zero-knowledge proof of the first public key shard of each of the n nodes are verified, the first node generates a public key according to the first public key shard of each of the n nodes. Among them, the first node uses the sum of the first public key shards of each of the n nodes as the public key.
[0027] In a second aspect, an embodiment of the present application provides a threshold signature device, which may be the first node of the first aspect. The threshold signature device may include:
[0028] The transceiver module is used to receive the zero-knowledge proof and the first commitment from each of the other t-1 nodes.
[0029] A processing module is used to verify the zero-knowledge proof and the first commitment of each of the other t-1 nodes when receiving the zero-knowledge proof and the first commitment of each node, t is a threshold value, t is an integer greater than or equal to 2 and less than or equal to n, and the zero-knowledge proof of the first node is related to the first commitment of the first node.
[0030] Among them, if the zero-knowledge proof and the first commitment of each node are verified, the processing module is also used to obtain the first part of the signature according to the first commitment of the first node and the first commitment of each node, and obtain the second commitment of each of the t nodes according to the fragments of the second part of the signature of the first node and the fragments of the second part of the signature from each node, and verify the fragments of the second part of the signature of each of the t nodes according to the second commitment of each of the t nodes; if there is a fragment of the second part of the signature of a second node among the t nodes that fails to pass the verification, it is determined that the second node is a malicious node.
[0031] In a possible implementation, the processing module is specifically configured to add the first commitment of the first node and the first commitment of each of the other t-1 nodes to obtain the first part of the signature.
[0032] In a possible implementation, the processing module is specifically configured to cause the first node to generate a fragment of the second part of the signature of the first node according to the first part of the signature. The transceiver module is further configured to send the fragment of the second part of the signature of the first node to other t-1 nodes.
[0033] In one possible implementation, the processing module is specifically used to generate a derived value based on the first part of the signature, the public key and the object to be signed; obtain the first coefficient of the first node based on the identity information of each node in the t nodes; obtain the second private key shard based on the first coefficient and the first private key shard held by the first node; generate a shard of the second part of the signature of the first node based on the derived value, the second private key shard and the target random number, and the target random number is a random number selected by the first node from the preset random numbers.
[0034] In one possible implementation, the processing module is specifically used to obtain a second commitment of the first node based on the shards of the second part of the signature of the first node and the base point of the elliptic curve; obtain a second commitment of each of the other t-1 nodes based on the shards of the second part of the signature of each node in the other t-1 nodes and the base point of the elliptic curve, so as to obtain a second commitment of each of the t nodes.
[0035] In one possible implementation, for a third node among the t nodes, the third node is any one of the t nodes, wherein: a processing module is specifically used to obtain a fifth commitment of the third node, the fifth commitment of the third node is related to the first private key shard of the third node, and obtains a first coefficient of the third node according to the identity information of each node among the t nodes; obtains a third commitment of the third node according to the fifth commitment and the first coefficient of the third node; obtains a fourth commitment of the third node according to the derived value and the third commitment of the third node; if the second commitment of the third node is equal to the sum of the first commitment of the third node and the fourth commitment of the third node, then the first node determines that the shard of the second part of the signature of the third node passes the verification.
[0036] In one possible implementation, the processing module is also used to verify the third commitment of each of the t nodes; if the third commitment of each of the t nodes passes the verification, then verify the shard of the second part of the signature of each of the t nodes.
[0037] In one possible implementation, the processing module is specifically used to obtain the sum of the third commitments of each of the t nodes; if the sum of the third commitments is equal to the public key, it is determined that the third commitment of each of the t nodes has passed the verification.
[0038] In a possible implementation, the processing module is further used to select a target random number, and generate a first commitment of the first node according to the target random number and the base point of the elliptic curve; and obtain the zero-knowledge proof of the first node according to the first commitment of the first node and the target random number. The transceiver module is also used to send the zero-knowledge proof of the first node to other n-1 nodes.
[0039] In a possible implementation, the processing module is further configured to obtain a first private key fragment of the first node; and generate a public key according to the first private key fragment of the first node.
[0040] In a possible implementation, the processing module is specifically used to select a target polynomial from a preset t-1 degree polynomial, and substitute the identity information of each of the n nodes into the target polynomial to obtain a shared key shard corresponding to each of the n nodes. The transceiver module is used to send a corresponding shared key shard to each of the other n-1 nodes, and receive a shared key shard from each of the other n-1 nodes. The processing module is also used to add the shared key shards from the n nodes when receiving a shared key shard from each of the other n-1 nodes to obtain a first private key shard of the first node.
[0041] In a possible implementation, the processing module is specifically configured to generate the fifth commitment of the first node according to the first private key shard of the first node. The transceiver module is further configured to send the fifth commitment of the first node to other n-1 nodes. The processing module is specifically configured to verify the first private key shard of each of the n nodes according to the fifth commitment of the n nodes; if the first private key shard of each of the n nodes passes the verification, then generate a public key according to the fifth commitment of each of the n nodes.
[0042] In a possible implementation, the processing module is specifically configured to generate a fifth commitment of the first node according to the first private key shard of the first node and a base point of the elliptic curve.
[0043] In a possible implementation, the processing module is specifically configured to perform the following steps:
[0044] A. Randomly select t fifth commitments from n fifth commitments;
[0045] B. obtaining, according to the identity identifier of the node corresponding to each of the t fifth commitments, a second coefficient of the node corresponding to each of the t fifth commitments;
[0046] C. Obtain a public key to be verified according to the second coefficient of the node corresponding to each fifth commitment in the t fifth commitments and the fifth commitment of the node corresponding to each fifth commitment in the t fifth commitments;
[0047] D. Repeat steps A, B, and C for a preset number of times to obtain a preset number of public keys to be verified;
[0048] E. If each of the preset number of public keys to be verified is the same, determining that the first private key fragment of each of the n nodes passes the verification;
[0049] Take any public key to be verified as the public key.
[0050] In a possible implementation manner, the processing module is specifically configured to select the first private key shard of the first node from a preset first private key shard.
[0051] In one possible implementation, the processing module is specifically used to obtain the first public key shard of the first node and the zero-knowledge proof of the first public key shard of the first node based on the first private key shard of the first node; and generate the sixth commitment of the first node based on the zero-knowledge proof of the first public key shard of the first node.
[0052] The transceiver module is also used to send the sixth commitment of the first node, the first public key fragment of the first node, and the zero-knowledge proof of the first public key fragment of the first node to other n-1 nodes.
[0053] The processing module is specifically used to verify the sixth commitment from each of the n nodes and the zero-knowledge proof of the first public key shard; if the sixth commitment from each of the n nodes and the zero-knowledge proof of the first public key shard are verified, then a public key is generated according to the first public key shard of each of the n nodes.
[0054] In a possible implementation, the processing module is specifically configured to take the sum of the first public key fragments of each of the n nodes as the public key.
[0055] In a possible implementation manner, the transceiver module is further configured to output the identity information of the second node.
[0056] In one possible implementation, the processing module is further used to obtain the second part of the signature according to the fragments of the second part of the signature of each of the t nodes if the fragments of the second part of the signature of each of the t nodes pass verification; generate a signature according to the first part of the signature and the second part of the signature; and output the signature if the signature is valid.
[0057] The implementation principle and technical effect of the threshold signature device provided in the embodiment of the present application are similar to those of the first aspect above, and will not be repeated here.
[0058] In a third aspect, an embodiment of the present application provides an electronic device, which can be the first node in the first aspect. The electronic device includes: a processor, a memory, and a transceiver; the transceiver is coupled to the processor, and the processor controls the transceiver's transceiver action; wherein the memory is used to store computer executable program code, and the program code includes instructions; when the processor executes the instructions, the instructions cause the electronic device to perform the method provided in the first aspect.
[0059] In a fourth aspect, an embodiment of the present application provides an electronic device, including a unit, module or circuit for executing the method provided by the possible design of the first aspect above. The electronic device is a first node, or a module applied to the first node, for example, a chip applied to the first node.
[0060] In a fifth aspect, an embodiment of the present application provides a chip having a computer program stored thereon, and when the computer program is executed by the chip, the method provided in the first aspect is implemented.
[0061] In a sixth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method in the first aspect above.
[0062] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes the method in the above-mentioned first aspect.
[0063] The embodiment of the present application provides a threshold signature method, device, electronic device and readable storage medium. In the method, in the process of multiple nodes collaboratively generating signatures, the nodes in the embodiment of the present application can verify the intermediate data of the signature to be generated, such as verifying the zero-knowledge proof of the first part of the generated signature and the fragmentation of the second part of the signature, and then the node that provides wrong intermediate data can be regarded as a malicious node, and the malicious node can be accurately identified. And in the embodiment of the present application, when the intermediate data passes the verification, the signature can be generated, thereby ensuring the accuracy of the signature. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 A schematic diagram of a scenario in which the threshold signature method provided in an embodiment of the present application is applied;
[0065] Figure 2 A flowchart of an embodiment of a threshold signature method provided in an embodiment of the present application;
[0066] Figure 3 A schematic diagram of the process of nodes collaboratively generating signatures in an embodiment of the present application;
[0067] Figure 4 A flowchart of another embodiment of the threshold signature method provided in the embodiment of the present application;
[0068] Figure 5 A flowchart of another embodiment of the threshold signature method provided in the embodiment of the present application;
[0069] Figure 6 A flowchart of another embodiment of the threshold signature method provided in the embodiment of the present application;
[0070] Figure 7 A schematic diagram of the stages of the threshold signature method provided in the embodiment of the present application;
[0071] Figure 8 A flowchart of another embodiment of the threshold signature method provided in the embodiment of the present application;
[0072] Fig. 9 A flowchart of another embodiment of the threshold signature method provided in the embodiment of the present application;
[0073] Fig.10 A flowchart of another embodiment of the threshold signature method provided in the embodiment of the present application;
[0074] Fig.11 A schematic diagram of the structure of a threshold signature device provided in an embodiment of the present application;
[0075] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0076] Secret sharing can avoid the problem of key forgery caused by the central node holding the key, but the current secret sharing has the following disadvantages: when the node uses the key to sign, the key must be restored according to the key shard, so there is a risk of the key being stolen when it is restored. The biggest feature of the threshold signature algorithm is "the key is available but invisible". For example, in the threshold signature algorithm, the private key is shared by multiple nodes, and each node holds a private key shard in the private key. Each node can generate a signature without restoring the private key and exposing the private key shard. Therefore, the threshold signature algorithm provides key security while also providing key availability, making the key "available but invisible".
[0077] Blockchain is a decentralized or multi-centralized system, and it has a demand for threshold keys in scenarios such as consensus mechanisms, joint payments, and voting. At present, most blockchains use elliptic curve digital signature algorithms (ECDSA) or elliptic curve public key cryptography algorithms SM2, but the threshold schemes of these two algorithms have high computational complexity and communication complexity, while the Edwards-curve digital signature algorithm (EdDSA) algorithm has low computational complexity and communication complexity, so the blockchain industry is considering shifting from SM2 and signature algorithms ECDSA signature algorithms to EdDSA signature algorithms. The threshold signature method provided in the embodiment of the present application is applied to EdDSA, which has the characteristics of high performance and high security compared to other signature algorithms. The Edwards curve algorithm in the embodiment of the present application may include but is not limited to Ed25519 algorithm or Ed448. It should be noted that the operations involved in the embodiments of the present application, such as addition, point multiplication, etc., are four arithmetic operations, and can also be operations specified by the elliptic curve point group under the EdDSA standard. It should be understood that the threshold signature method in the embodiment of the present application can be applied to but not limited to scenarios such as collaborative authentication, joint payment, blockchain consensus and anonymous voting.
[0078] In the current threshold signature algorithm, if there are n nodes participating in the signature, then t of the n nodes can interact to generate a signature. However, in the current threshold signature algorithm, the central node (pre-set or decided by n nodes) among the n nodes has the original private key. The central node may issue a signature in the name of the full-slice holder's node, and the outside world cannot identify the central node as a malicious node. Therefore, in the scheme where the central node holds the original private key, there is a risk that the central node forges the signature.
[0079] In order to solve the problem of the central node holding the original private key, the current technical solution provides a solution for n nodes participating in the signature to jointly generate a private key, and each node holds a private key shard of the private key, thereby avoiding the risk of the central node forging the signature. However, in the current technical solution, when t nodes out of n nodes sign according to the private key shard, there is still a problem that the node provides wrong signature data, resulting in signature failure. However, the current technical solution cannot identify malicious nodes that provide wrong signature data, so the signature will continue to fail.
[0080] In order to identify malicious nodes that provide erroneous signature data during the threshold signature process, an embodiment of the present application provides a threshold signature algorithm that can verify the intermediate data of each node when generating a signature (such as a partial fragment of the signature). If the intermediate data fails the verification, it can be determined that the node providing the intermediate data is a malicious node, thereby achieving the purpose of identifying malicious nodes and ensuring the smooth progress of the signature.
[0081] Figure 1 Schematic diagram of a scenario in which the threshold signature method provided in the embodiment of the present application is applied. Figure 1 As shown, the scenario may include n nodes, of which t nodes can complete the signature according to the private key. In the following embodiments, any node in the dotted box is used as an example to illustrate the execution subject of the threshold signature method. Wherein n is an integer greater than 1, and t is the threshold value. It should be understood that the nodes in the embodiments of the present application can be electronic devices such as terminal devices, servers or robots. The terminal devices in the embodiments of the present application can be called terminal Terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), etc. The terminal device can be a mobile phone, a tablet computer (pad), a computer with wireless transceiver function, a personal digital assistant (PDA), a handheld device with wireless communication function, a computer or other processing device, a wearable device (watch, sports bracelet, sports anklet, etc.), a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in a smart home, a terminal device in a 5G network, or a terminal device in a future evolved public land mobile communication network (PLMN), etc., and the embodiments of the present application are not limited to this.
[0082] The threshold signature method of the embodiment of the present application is described in detail below in conjunction with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. Figure 2 This is a flow chart of an embodiment of the threshold signature method provided in the present application. Figure 2 As shown, the threshold signature method provided in the embodiment of the present application may include:
[0083] S201, when the first node receives the zero-knowledge proof and the first commitment from each of the other t-1 nodes, it verifies the zero-knowledge proof and the first commitment of each node, where t is a threshold value, t is an integer greater than or equal to 2 and less than or equal to n, and the zero-knowledge proof of the first node is related to the first commitment of the first node.
[0084] S202, if the zero-knowledge proof and the first commitment of each node are verified, the first node obtains the first part of the signature according to the first commitment of the first node and the first commitment of each node.
[0085] S203, the first node obtains the second commitment of each of the t nodes based on the shards of the second part of the signature of the first node and the shards of the second part of the signature from each node, and verifies the shards of the second part of the signature of each of the t nodes based on the second commitment of each of the t nodes.
[0086] S204: If there is a fragment of the second part of the signature of the second node among the t nodes that fails to pass the verification, the first node determines that the second node is a malicious node.
[0087] In the above S201, the first node is any node among the n nodes, and each of the n nodes in the embodiment of the present application can perform the action of the first node, and the first node is a plurality of nodes among the n nodes. In the process of node collaboratively generating signatures, the first node can send the zero-knowledge proof (zero-knowledge proof) and the first commitment of the first node to other t-1 nodes. Among them, the zero-knowledge proof means that the first node can determine that the data from the first node is correct without providing any useful information to other nodes. Zero-knowledge proof is essentially a protocol involving two or more parties, that is, the steps required to be taken when two or more parties complete the signature, and the specific description can be referred to the relevant description in the current technical solution. The first node can transmit data based on the commitment mechanism. Among them, the operation process of the commitment mechanism includes three stages: generation, opening and verification. In the generation stage, the sender can generate a corresponding commitment to the content to be committed using a preset algorithm, and send the generated commitment to the recipient. The commitment can play a unique identification and concealment role for the content it commits. Optionally, the commitment to a certain content can be the hash value of the content. In the opening stage, the sender sends the committed content to the recipient. In the verification phase, the recipient generates a commitment based on the content of the received commitment, and compares the generated commitment with the received commitment. If the comparison result is consistent, the commitment verification is passed. It should be understood that the way the first node verifies the first commitment in the embodiment of the present application can refer to the current technical solution.
[0088] In an embodiment of the present application, the zero-knowledge proof of the first node may be generated by the first node. The zero-knowledge proof of the first node is related to the first commitment of the first node. Optionally, the first node may generate a zero-knowledge proof based on the first commitment, such as the zero-knowledge proof is a zero-knowledge proof of the first commitment, specifically a zero-knowledge proof of the discrete logarithm of the first commitment. Among them, the first commitment may be that the first node generates a corresponding first commitment for the content of the required commitment (such as a target random number, or a point multiplication result of a target random number and a parameter of an elliptic curve, etc.). It should be understood that the method for each of the n nodes to generate a zero-knowledge proof of the node and a first commitment is the same as the method for the first node to generate a zero-knowledge proof of the node and a first commitment. The actions of the first node in the following embodiments may be applicable to each of the n nodes.
[0089] It should be understood that after the first node generates the first commitment and zero-knowledge proof, it can send the first commitment and zero-knowledge proof of the first node to other t-1 nodes. The first commitment and zero-knowledge proof can be carried in one message and sent, or sent separately. In the embodiment of the present application, each node sends the first commitment and zero-knowledge proof to the other t-1 nodes, so the first node can at least receive the zero-knowledge proof and first commitment from each of the other t-1 nodes. When the first node receives the zero-knowledge proof from each of the other t-1 nodes, plus the zero-knowledge proof of the first node, the first node can obtain the zero-knowledge proof of t nodes, and then the first node can perform the signing operation. In the embodiment of the present application, t is a threshold value, t can be greater than or equal to 2 and less than or less than n. In a possible implementation, t can be equal to n. The following embodiment is illustrated by taking t as an example.
[0090] Among them, the first node can verify the zero-knowledge proof and the first commitment of each of the other t-1 nodes. It should be understood that the way to verify the zero-knowledge proof can be to verify whether the zero-knowledge proof is valid, such as verifying whether the node that sends the first commitment and the zero-knowledge proof knows the discrete logarithm of the first commitment. Optionally, the first node in the embodiment of the present application can store the identity information of the other n-1 nodes, such as the node's identity document ID (identity document ID), Internet protocol (internet protocol, IP) address, etc. The way the first node verifies the first commitment can refer to the relevant description of the above-mentioned verification stage.
[0091] Optionally, if when the first node receives zero-knowledge proofs from other t-1 nodes, it determines that there are zero-knowledge proofs and / or the first commitment that have not passed verification, the first node may perform a signing operation based on the verified zero-knowledge proofs and first commitment from the other (nt) nodes. Figure 3 Schematic diagram of the process of nodes collaboratively generating signatures in the embodiment of the present application. Figure 3 As shown, if the first commitment and zero-knowledge proof of t nodes out of n nodes are verified, then the t nodes can collaboratively (jointly) generate signatures. Figure 3 The example of t being less than n is used for explanation.
[0092] In the above S202, in the embodiment of the present application, if the zero-knowledge proof and the first commitment of each of the other t-1 nodes are verified, the first node can obtain the first part of the signature according to the first commitment of the t nodes. Among them, the first commitment of the t nodes may include the first commitment of the first node and the first commitment of each of the other t-1 nodes, and then the first node can generate the first part of the signature according to the first commitment of the t nodes. It should be understood that a preset random number may be pre-stored in the first node, and the first node may select a target random number from the preset random numbers. The parameters of the elliptic curve may be the base point of the elliptic curve, the order of the base point, etc. The base point G of the elliptic curve is a constant, wherein the base point of the elliptic curve may be pre-set.
[0093] Optionally, a possible implementation manner for the first node to generate the first part of the signature is: the first node adds the first commitment of the first node and the first commitment of each node to obtain the first part of the signature.
[0094] In the above S203, after generating the first part of the signature of the first node, the first node can generate a fragment of the second part of the signature of the first node. Among them, each of the t nodes can generate a fragment of the second part of the corresponding signature. In a possible implementation, the first node can generate a fragment of the second part of the signature in a manner similar to the above-mentioned generation of the first commitment (such as making the commitment equivalent to the fragment of the second part of the signature). In a possible implementation, in order to improve the accuracy and relevance of the naming, in an embodiment of the present application, the fragment of the second part of the signature of the first node can be generated according to the first part of the signature. Optionally, the first node can generate a fragment of the second part of the signature according to the preset fragment generation algorithm based on the first part of the signature and the object to be signed. Among them, the object to be signed can be data such as files, photos, tables, etc. Among them, after the first node generates the fragment of the second part of the signature, the fragment of the second part of the signature of the first node can be sent to other t-1 nodes, and then the first node can obtain at least the fragment of the second part of the signature of t nodes.
[0095] The first node can obtain the second commitment of each of the t nodes according to the shards of the second part of the signature of the first node and the shards of the second part of the signature from each node (the shards of the second part of the signature of t nodes). Among them, the first node can obtain the second commitment of each of the t nodes according to the shards of the second part of the signature of each node in the t nodes. Exemplarily, here, the first node obtains the second commitment of the first node according to the shards of the second part of the signature of the first node as an example. In a possible implementation, the first node can take the point multiplication of the shards of the second part of the signature of the first node and the parameters of the elliptic curve as the second commitment of the first node. In a possible implementation, the first node can take the point multiplication of the shards of the second part of the signature of the first node and the preset coefficient (preset value) as the second commitment of the first node.
[0096] After obtaining the second commitment of each of the t nodes, the first node can verify the second part of the fragment of the signature of each of the t nodes according to the second commitment of each of the t nodes. The first node can verify the second part of the fragment of the signature of each of the t nodes in the following manner: because the first part of the signature of the node can be the same, if the second part of the fragment of the signature of each of the t nodes is the same, it can be determined that the second part of the fragment of the signature of each of the t nodes is correct, that is, the second part of the fragment of the signature of each of the t nodes has passed the verification. If the second part of the fragment of the signature of a node is different from the second part of the fragment of the signature of another node, it can be determined that the second part of the fragment of the signature of the node is wrong, and the second part of the fragment of the signature of the node cannot pass the verification.
[0097] In the above S204, in an embodiment of the present application, the first node fragments the second part of the signature of each of the t nodes. If there is a fragment of the second part of the signature of the second node among the t nodes that fails to pass the verification, the first node can determine that the fragment of the second part of the signature provided by the second node is wrong, and the second node is a malicious node.
[0098] The threshold signature method provided in the embodiment of the present application includes: when the first node receives the zero-knowledge proof from each of the other t-1 nodes, verify the zero-knowledge proof of each node; if the zero-knowledge proof of each node is verified, the first node obtains the first part of the signature according to the first commitment of the first node and the first commitment of each node; the first node obtains the second commitment of each of the t nodes according to the fragmentation of the second part of the signature of the first node and the fragmentation of the second part of the signature from each node, and verifies the fragmentation of the second part of the signature of each of the t nodes according to the second commitment of each of the t nodes; if there is a fragmentation of the second part of the signature of the second node in the t nodes that fails to pass the verification, the first node determines that the second node is a malicious node. In the embodiment of the present application, in the process of multiple nodes collaboratively generating signatures, the node can verify the intermediate data of the signature to be generated, such as verifying the zero-knowledge proof of the first part of the generated signature and the fragmentation of the second part of the signature, and then the node that provides the wrong intermediate data can be regarded as a malicious node, and the malicious node can be accurately identified. And in the embodiment of the present application, when the intermediate data is verified, the signature can be generated, thereby ensuring the accuracy of the signature.
[0099] Based on the above embodiments, the process of generating the first part of the signature, slicing the second part of the signature, and verifying the intermediate data in the threshold signature method provided in the embodiment of the present application is described in detail below. Figure 4 This is a flow chart of another embodiment of the threshold signature method provided in the present application. Figure 4 As shown, the threshold signature method provided in the embodiment of the present application may include:
[0100] S401, the first node selects a target random number, and uses the point multiplication of the target random number and the base point of the elliptic curve as the first commitment, and sends the first commitment of the first node to other t-1 nodes.
[0101] S402: The first node generates a zero-knowledge proof of the discrete logarithm of the first commitment based on the first commitment, and sends the zero-knowledge proof of the discrete logarithm of the first commitment to other t-1 nodes.
[0102] S403, when the first node receives the zero-knowledge proof and the first commitment from each of the other t-1 nodes, verify the zero-knowledge proof and the first commitment of each node.
[0103] S404: If the zero-knowledge proof and the first commitment of each node are verified, the first node adds the first commitment of the first node and the first commitment of each node to obtain the first part of the signature.
[0104] S405: The first node generates a derived value according to the first part of the signature, the public key and the object to be signed.
[0105] S406: The first node obtains a first coefficient of the first node according to the identity information of each node in the t nodes.
[0106] S407: The first node obtains a second private key shard according to the first coefficient and the first private key shard held by the first node.
[0107] S408, the first node generates a fragment of the second part of the signature of the first node based on the derived value, the second private key fragment and the target random number, and sends the fragment of the second part of the signature of the first node to other t-1 nodes. The target random number is a random number selected by the first node from the preset random numbers.
[0108] S409, the first node obtains a second commitment of the first node according to the shards of the second part of the signature of the first node and the base point of the elliptic curve.
[0109] S410, the first node obtains the second commitment of each of the other t-1 nodes based on the sharding of the second part of the signature of each of the other t-1 nodes and the base point of the elliptic curve to obtain the second commitment of each of the t nodes.
[0110] S411, the first node verifies the shard of the second part of the signature of each of the t nodes according to the second commitment of each of the t nodes.
[0111] S412: If there is a fragment of the second part of the signature of the second node among the t nodes that fails to pass the verification, the first node determines that the second node is a malicious node.
[0112] It should be understood that S403 and S412 in the embodiments of the present application may refer to the relevant descriptions in the above embodiments S201 and S204.
[0113] In the above S401, the random number may be preset, and the first node randomly selects a random number from the preset random numbers as the target random number k. i , and calculate the point product of the target random number and the parameter of the elliptic curve, and use the result of the point product as the first commitment. The parameter of the elliptic curve can be the base point of the elliptic curve, the order of the base point, etc. i is used to identify the first node. In the embodiment of the present application, the point product of the target random number and the base point of the elliptic curve is used as the first commitment, that is, the first commitment R i =k i *G.
[0114] In the above S402, after generating the first commitment, the first node can calculate the zero-knowledge proof of the discrete logarithm of the first commitment, and after generating the zero-knowledge proof of the discrete logarithm of the first commitment, the zero-knowledge proof of the discrete logarithm of the first commitment can be sent to other t-1 nodes. It should be understood that the process of generating zero-knowledge proof can refer to the current technical solution. It should be understood that the above S401-S402 can be executed as a step, that is, the above S401-S402 can be replaced by S401': the first node selects a target random number, and multiplies the target random number by the base point of the elliptic curve as the first commitment, and generates a zero-knowledge proof of the discrete logarithm of the first commitment based on the first commitment, and sends the zero-knowledge proof of the discrete logarithm of the first commitment and the first commitment to other t-1 nodes.
[0115] In the above S404, in the embodiment of the present application, when the zero-knowledge proof of each of the t nodes passes the verification, the first node can add up the first commitments of the t nodes to obtain the first part of the signature. That is, the first part of the signature R = R1 + R2 + ... + R t It should be noted that after the first node generates the first part of the signature, the first part of the signature may be encoded to obtain the encoded first part R~ of the signature.
[0116] It should be understood that S405-S408 is the process of the first node generating the second part of the signature. In S405, the public key may be pre-agreed, or the public key may be generated by n nodes in collaboration (for details, refer to the following Figure 8-Figure 10 ), wherein the public key generated collaboratively by n nodes has higher security. The object to be signed may be data such as files and photos to be signed. In an embodiment of the present application, the first node may generate a derived value based on the first part of the signature, the public key and the object to be signed. Optionally, in an embodiment of the present application, the first node may generate a derived value based on the first part of the encoded signature, the public key and the object to be signed, such as a derived value e=H(R~, A~, M). Wherein H is a preset hash function, and the derived value is the result obtained by performing a hash operation on R~, A~, and M, A~ is the encoded public key, and M is the object to be signed.
[0117] It should be understood that there is no order distinction between S405 and S406, and the two can be executed simultaneously. In the above S406, the first node can obtain the first coefficient of the first node based on the identity information of each node in the t nodes. The identity information of the first node can be the ID of the first node, and the first coefficient can be the Lagrange coefficient lambda. The first node can obtain the first coefficient of the first node based on the ID of each node in the t nodes. i , get the first Lagrangian coefficient lambda of the first node iIt should be understood that the first first node among the n nodes can substitute the ID of each node among the t nodes into the preset function 1 to obtain the first coefficient of the first first node. The second first node can substitute the ID of each node among the t nodes into the preset function 2 to obtain the first coefficient of the second first node. The function for each first node to obtain the corresponding first coefficient may be different.
[0118] In the above S407, the first node obtains the second private key shard according to the first coefficient and the first private key shard held by the first node. The first private key shard held by the first node may be generated by the first node (for details, please refer to Figure 8-Figure 10 ). Optionally, the first node may use the product of the first coefficient and the first private key shard held by the first node as the second private key shard. i =p(ID i )·lambda i , p(ID i ) is the first private key shard held in the first section.
[0119] In the above S408, after the first node obtains the derived value and the second private key fragment, it can generate the second part of the first node's signature fragment according to the derived value, the second private key fragment and the target random number. i =k i +e·sign_sk i Generate a fragment S of the second part of the signature of the first node at the first node i Afterwards, the fragment of the second part of the signature of the first node can be sent to the other n-1 nodes.
[0120] In S409, the first node may obtain the second commitment of the first node according to the shard of the second part of the signature of the first node and the base point of the elliptic curve. The first node may multiply the shard of the second part of the signature of the first node and the base point of the elliptic curve as the second commitment S of the first node. i ·G.
[0121] In the above S410, because the first node can receive the second part of the signature from the other t-1 nodes, the second commitment of the t-1 node can be calculated respectively, that is, the second commitment of the t-1 node is the result of the dot product of the second part of the signature of each node and the base point of the elliptic curve. There is no distinction between S409 and S410, and the two can be executed at the same time.
[0122] The above S411 is a process in which the first node verifies the second part of the sharding of the signature of each of the t nodes according to the second commitment. Wherein, S411 may include:
[0123] S4111, the first node obtains the fifth commitment of the third node, and the fifth commitment of the third node is related to the first private key shard of the third node.
[0124] S4112, obtaining a first coefficient of a third node according to the identity information of each node in the t nodes.
[0125] S4113, the first node obtains the third commitment of the third node according to the fifth commitment of the third node and the first coefficient.
[0126] S4114, the first node obtains the fourth commitment of the third node based on the derived value and the third commitment of the third node.
[0127] S4115, if the second commitment of the third node is equal to the sum of the first commitment of the third node and the fourth commitment of the third node, the first node determines that the shard of the second part of the signature of the third node passes the verification.
[0128] In the embodiment of the present application, in order to facilitate the description of the process of the first node verifying the second part of the sharding of the signature of each of the t nodes, the nodes in the t nodes are all regarded as the third node. It should be understood that the first node can verify the second part of the sharding of the signature of the first node, wherein the process can also be regarded as the first node verifying the second part of the sharding of the signature of the third node. Therefore, for the third node in the t nodes, the third node is any node in the t nodes and can perform the steps in S4111-S4114 above.
[0129] In the above S4111, the fifth commitment of the third node may be related to the first private key shard of the third node, wherein the third node may generate the fifth commitment of the third node according to the first private key shard of the third node, and send the fifth commitment of the third node to the other n-1 nodes (for details, refer to the following Figure 8 ), so that the first node can obtain the fifth commitment of each of the t nodes (the third node).
[0130] In the above S4112, the first node can obtain the first coefficient of the third node according to the identity information of each node in the t nodes. Among them, the first node can calculate the first Lagrangian coefficient of the third node according to the ID of each node in the t nodes. The calculation process can refer to the relevant description of the first node calculating the first coefficient of the first node. That is to say, in the embodiment of the present application, the first node can calculate the lambda of the third node. iThe step S4111 may be executed simultaneously with the step S406.
[0131] In the above S4113, the first node can generate the third commitment of the third node according to the fifth commitment of the third node and the first coefficient. The first coefficient will be the third commitment of the third node according to the dot product result of the fifth commitment of the third node and the first coefficient. For example, the third commitment is Q i =lambda i ·(P(Id i )·G). Among them, P(Id i )·G is the fifth commitment of the third node.
[0132] In the above S4114, the first node may obtain the fourth commitment of the third node according to the derived value and the third commitment of the third node. The first node may take the product of the derived value and the third commitment of the third node as the fourth commitment of the third node, and the derived value may be the derived value of the first node, that is, the fourth commitment of the third node may be e·Qi.
[0133] In the above S4115, the first node verifies the second part of the fragment of the signature of the third node, which can verify whether the second commitment of the third node is equal to the sum of the first commitment of the third node and the fourth commitment of the third node. If the second commitment of the third node is equal to the sum of the first commitment of the third node and the fourth commitment of the third node, the first node determines that the second part of the fragment of the signature of the third node passes the verification. That is, if R i +e·Q i =S i G, the first node determines that the second part of the fragment of the signature of the third node passes the verification. It should be understood that since sign_sk_i = lambda i ·p(Id i ), in principle, the two ends of the above equation are equal when reducing the fraction, where S i The first private key fragment included in can refer to the following Figure 8-Figure 10 Related description in .
[0134] In an embodiment of the present application, the node can use a commitment mechanism to verify the fragments of the second part of the signature in combination with the intermediate data generated during the signing process, thereby ensuring the accuracy of the intermediate data. If there is a fragment of the second part of the signature provided by the second node that fails the verification, it can be determined that the second node is a malicious node, and the fragment of the second part of the signature provided by the second node is not used to generate the signature, thereby ensuring the accuracy of the signature.
[0135] In the above Figure 4On the basis of the illustrated embodiment, in an embodiment of the present application, the first node may also verify the second commitment from other t-1 nodes to more comprehensively verify the intermediate data in the signing process and further improve the accuracy of the signature. Figure 5 This is a flow chart of another embodiment of the threshold signature method provided in the present application. Figure 5 As shown, after the above S410, S413 may be included: the first node verifies the third commitment of each of the t nodes. Wherein, when the third commitment of each of the t nodes passes the verification, the first node verifies the second part of the shard of the signature of each of the t nodes according to the second commitment of each of the t nodes, that is, executes the above S411.
[0136] It should be understood that in the embodiment of the present application, the first node verifies the third commitment of each of the t nodes as follows: the first node obtains the sum of the third commitments of each of the t nodes, that is, (Q1+Q2+…Q t ), if the sum of the third commitments of t nodes is equal to the public key (A), that is (Q1+Q2+…Q t )=A, then the first node determines that the third commitment of each of the t nodes has passed the verification. It should be understood that the public key is also generated by the n nodes in collaboration, and the details can be referred to as follows Figure 8-Figure 10 Related description in .
[0137] Based on the above embodiments, the embodiments of the present application are Figure 2 The following is an explanation based on the following. Figure 6 This is a flow chart of another embodiment of the threshold signature method provided in the present application. Figure 6 As shown, the threshold signature method provided in the embodiment of the present application may include:
[0138] S601, when the first node receives the zero-knowledge proof and the first commitment from each of the other t-1 nodes, verify the zero-knowledge proof and the first commitment of each node.
[0139] S602: If the zero-knowledge proof and the first commitment of each node are verified, the first node obtains the first part of the signature according to the first commitment of the first node and the first commitment of each node.
[0140] S603, the first node obtains the second commitment of each of the t nodes based on the shards of the second part of the signature of the first node and the shards of the second part of the signature from each node, and verifies the shards of the second part of the signature of each of the t nodes based on the second commitment of each of the t nodes.
[0141] S604: If there is a fragment of the second part of the signature of the second node among the t nodes that fails to pass the verification, the first node determines that the second node is a malicious node.
[0142] S605: The first node outputs the identity information of the second node.
[0143] S606: If the fragments of the second part of the signature of each of the t nodes pass the verification, the first node obtains the second part of the signature according to the fragments of the second part of the signature of each of the t nodes.
[0144] S607, the first node generates a signature according to the first part of the signature and the second part of the signature, and outputs the signature if the signature is valid.
[0145] It should be understood that S601-S604 in the embodiment of the present application can refer to the relevant description in the above S201-S204. "S606-S608" and "S604-S605" are steps to be performed one by one.
[0146] In the above S605, when the first node determines that the second node is a malicious node, it can output the malicious node. Exemplarily, the first node can send the identity information of the second node to other verified nodes so that other nodes can obtain the malicious node, which can avoid other nodes from receiving erroneous data provided by the second node when participating in the signature.
[0147] In the above S606, in the embodiment of the present application, the first node can obtain the second part of the signature according to the fragments of the second part of the signature of each of the t nodes. The first node can add up the fragments of the second part of the signature of each of the t nodes to obtain the second part of the signature. For example, the second part of the signature S = S1 + S2 ... + S t .
[0148] In the above S607, in the embodiment of the present application, the signature can be obtained according to the first part of the signature and the second part of the signature. Among them, the first part of the signature is R. In the embodiment of the present application, the first part of the signature can be encoded to obtain the first part R~ of the encoded signature, and the second part S of the signature can be encoded to obtain the second part S~ of the encoded signature, and then the signature can be obtained according to the first part R~ of the encoded signature and the second part S~ of the encoded signature. For example, the signature Sig = (R~, S~).
[0149] After the signature is generated, the validity of the signature can be verified. In the embodiment of the present application, the signature can be verified according to the encoded public key A~. If the signature verification passes, it is determined that the signature is valid, and the signature is output.
[0150] In an embodiment of the present application, a signature can be generated based on the second part of the verified signature and the first part of the signature, thereby obtaining an accurate signature, thereby improving the accuracy and security of the signature.
[0151] Figure 7 This is a schematic diagram of the stages of the threshold signature method provided in the embodiment of the present application. Figure 7 As shown, the process of the threshold signature method is divided into a startup phase and a signature phase. The above embodiment describes the signature phase, and the following embodiment describes the startup phase. In the startup phase, n nodes can collaboratively generate a public key. Figure 8 This is a flow chart of another embodiment of the threshold signature method provided in the present application. Figure 8 As shown, the threshold signature method provided in the embodiment of the present application may include:
[0152] S801: A first node obtains a first private key shard of the first node.
[0153] S802: The first node generates a public key according to the first private key shards of the first node.
[0154] In the embodiment of the present application, the process of generating the public key is described from the following two possible implementations. In the first possible implementation, the first node in S801 first generates the first private key fragment of the first node. In the embodiment of the present application, a preset t-1 degree polynomial can be pre-set, and the first node can select the target polynomial f from the preset t-1 degree polynomial. i (), and substitute the identity information of each node in the n nodes into the target polynomial to obtain the shared key fragment corresponding to each node in the n nodes. i (), get multiple shared key fragments f i (ID1), f i (ID2),…,f i (ID n ), where f i (ID1), f i (ID2),…,f i (ID n ) correspond to one of the n nodes respectively.
[0155] The first node sends the corresponding shared key fragment to each of the other n-1 nodes. i (ID1) is sent to the node corresponding to ID1, and f i(ID2) is sent to the node corresponding to ID2... and so on. Similarly, the first node can also obtain the shared key fragment corresponding to the first node sent by each of the other n-1 nodes. When the first node receives the shared key fragment from each of the other n-1 nodes, it adds the shared key fragments from the n nodes to obtain the first private key fragment of the first node. For example, the first private key fragment of the first node can be p(ID i )=f1(ID i )+f2(ID i )+…+f n (ID i ).
[0156] Fig. 9 This is a flow chart of another embodiment of the threshold signature method provided in the present application. Fig. 9 As shown, the above S802 can be replaced by S802'-S804'.
[0157] S802', the first node generates a fifth commitment of the first node, and sends the fifth commitment of the first node to other n-1 nodes.
[0158] S803', the first node verifies the first private key shard of each of the n nodes according to the fifth commitment of each of the n nodes.
[0159] S804', if the first private key fragment of each of the n nodes passes the verification, the first node obtains the public key according to the fifth commitment of each of the n nodes.
[0160] In the above S802', after generating the first private key shard, the first node can generate the fifth commitment of the first node according to the first private key shard of the first node. The first node can use the dot product of the first private key shard and the base point of the elliptic curve as the fifth commitment of the first node. For example, the fifth commitment T i =p(ID i )·G. After the first node generates the fifth commitment, the fifth commitment of the first node may be sent to other n-1 nodes.
[0161] In the above S803', based on the above, the first node can obtain the fifth commitment of each of the n nodes, and the first commitment can verify the first private key shard of each of the n nodes according to the fifth commitment of the n nodes. When the first private key shard of each of the n nodes is verified, the first node can obtain the public key according to the fifth commitment of each of the n nodes. In the embodiment of the present application, the first private key shard of each node can be verified, and the public key is generated when the verification is passed, thereby ensuring the accuracy of the private key shard and the public key.
[0162] In the embodiment of the present application, the method in which the first node verifies the first private key shard of each of the n nodes may include the following steps:
[0163] A. The first node randomly selects t fifth commitments from n fifth commitments.
[0164] B. The first node obtains the second coefficient of the node corresponding to each of the t fifth commitments based on the identity identifier of the node corresponding to each of the t fifth commitments.
[0165] C. The first node obtains a public key to be verified based on the second coefficient of the node corresponding to each fifth commitment in the t fifth commitments and the fifth commitment of the node corresponding to each fifth commitment in the t fifth commitments.
[0166] D. Repeat steps A, B, and C for a preset number of times to obtain a preset number of public keys to be verified.
[0167] E. If each of the preset number of public keys to be verified is the same, the first node determines that the first private key shard of each of the n nodes passes the verification.
[0168] In step A, because the first node can receive fifth commitments from other n-1 nodes, the first node can randomly select t fifth commitments from the n fifth commitments. For example, the first node selects T1, T2, ..., T t .
[0169] In step B, the first node can obtain the second coefficient of each node corresponding to the t fifth commitments according to the identity identifier of the node corresponding to each fifth commitment in the t fifth commitments. The second coefficient can be a Lagrangian coefficient, and the method for obtaining the second coefficient can be the same as the method for obtaining the first coefficient mentioned above. The difference is that in the embodiment of the present application, the second coefficient of the node corresponding to the selected t fifth commitments is obtained according to the first node. Exemplarily, the nodes corresponding to the t fifth commitments are ID1, ID2...ID t Among them, the first node can ID1, ID2...ID t Substitute into the preset function 1 to get the second coefficient m 11 , the first node can be ID1, ID2...ID t Substitute into the preset function 2 to get the second coefficient m 12 , the first node can be ID1, ID2...ID t Substitute into the preset function 3 to get the second coefficient m 13 Therefore, the first node can obtain the second coefficient m according to the ID of the node corresponding to the t fifth commitments. 11 、m 12,…m 1t .
[0170] In step C, the first node obtains a public key to be verified based on the second coefficient of each node corresponding to the fifth commitment in the t fifth commitments and the fifth commitment of each node corresponding to the fifth commitment in the t fifth commitments. For example, the first node can multiply the fifth commitment of each node by the second coefficient to obtain the sum, and use the sum as a public key to be verified, that is, the public key to be verified can be PK1=m 11 ·T1+m 12 ·T2+…+m 1t ·T t .
[0171] In step D, the verification times can be preset in the embodiment of the present application, and the verification times are used as the preset times. Then, steps A, B, and C are repeated for the preset times to obtain a preset number of public keys to be verified. If PK2=m 12 ·T2+m 13 ·T3+…+m 1(t+1) ·T (t+1) , PK3=m 13 ·T3+m 14 ·T4+…+m 1(t+2) ·T (t+2) wait.
[0172] In step E, when verifying the first private key shard of each of the n nodes in the embodiment of the present application, it is verified whether each of the preset number of public keys to be verified is the same, wherein, if each of the preset number of public keys to be verified is the same, the first node determines that the first private key shard of each of the n nodes has passed the verification.
[0173] In the above S804', in the embodiment of the present application, when the first private key fragment of each node in the n nodes passes the verification, any of the above public keys to be verified can be used as the public key. It should be understood that after executing the above S804, the t nodes in the n nodes can generate signatures, that is, execute the above embodiment. Figure 2 , Figure 4 , Figure 5 and Figure 6 Steps in .
[0174] In the embodiment of the present application, the private key is not stored at the central node, which avoids the problem of the central node holding the original private key being unsafe. In addition, in the embodiment of the present application, the public key is jointly generated by n nodes, and the intermediate data for generating the public key, such as the first private key shard or the sixth commitment and the zero-knowledge proof of the first public key shard, is verified, thereby ensuring the accuracy of the generated public key and further ensuring the accuracy of the generated signature.
[0175] In a second possible implementation manner, in the above S801, a preset first private key shard may be pre-set in the embodiment of the present application, and the first node may select the first private key shard of the first node from the preset first private key shard.
[0176] Fig.10 This is a flow chart of another embodiment of the threshold signature method provided in the present application. Fig.10 As shown, the above S802 can be replaced by S802"-S805".
[0177] S802", the first node obtains the first public key shard of the first node and the zero-knowledge proof of the first public key shard of the first node according to the first private key shard of the first node.
[0178] S803", the first node generates the sixth commitment of the first node based on the zero-knowledge proof of the first public key shard of the first node, and sends the sixth commitment of the first node, the first public key shard of the first node, and the zero-knowledge proof of the first public key shard of the first node to other n-1 nodes.
[0179] S804", the first node verifies the sixth commitment, the first public key shard, and the zero-knowledge proof of the first public key shard from each of the n nodes.
[0180] S805”, if the sixth commitment, the first public key shard and the zero-knowledge proof of the first public key shard of each of the n nodes are all verified, the first node generates a public key according to the first public key shard of each of the n nodes.
[0181] In the above S802", the first node can generate the first public key shard of the first node and the zero-knowledge proof of the first public key shard of the first node according to the selected first private key shard. The first node can multiply the first private key shard with the base point of the elliptic curve as the first public key shard of the first node. For example, the first public key shard of the first node can be pk_ i =sk_ i *G, where sk_ i The first private key shard of the first node. After the first node obtains the first public key shard, it can calculate the zero-knowledge proof of the first public key shard, and the zero-knowledge proof of the first public key shard can be the zero-knowledge proof of the discrete logarithm of the first public key shard.
[0182] In the above S803", the first node can generate the sixth commitment of the first node based on the zero-knowledge proof of the discrete logarithm of the first public key shard, that is, the first node uses the commitment mechanism to generate the public key, which can ensure the accuracy of the public key. After the first node generates the sixth commitment of the first node, the sixth commitment of the first node, the first public key shard of the first node, and the zero-knowledge proof of the first public key shard of the first node can be sent to other n-1 nodes.
[0183] It should be noted that, optionally, after the first node generates the sixth commitment of the first node, the sixth commitment of the first node may be sent to the other n-1 nodes. After the first node receives the sixth commitment from the other n-1 nodes, the first public key fragment of the first node and the zero-knowledge proof of the first public key fragment of the first node may be sent to the other n-1 nodes.
[0184] In the above "S804", the first node verifies the sixth commitment, the first public key shard and the zero-knowledge proof of the first public key shard from each of the n nodes, wherein the verification of the sixth commitment and the zero-knowledge proof of the first public key shard can refer to the verification process of the first commitment in the above embodiment, as well as the verification process of the zero-knowledge proof of the discrete logarithm of the first commitment, which will not be repeated here.
[0185] In the above S805", if the sixth commitment of each of the n nodes and the zero-knowledge proof of the first public key shard are verified, the first node can generate a public key according to the first public key shard of each of the n nodes. The first node can add the first public key shards of the n nodes to obtain the public key. For example, the public key PK = pk_1 + pk_2 + … +pk_n.
[0186] The embodiment of the second possible implementation has the same technical effect as the first possible implementation, and compared with the first possible implementation, the second possible implementation has less communication and calculation volume in the startup phase and higher efficiency in generating public keys.
[0187] Above Figure 8-Figure 10What is described in the text is a technical solution in which n nodes collaboratively generate a public key. In a possible implementation method, the public key can also be generated by the central node in the embodiment of the present application. The following description takes the central node as the first node as an example. What is different from the above embodiment is that the first node is one of the n nodes. The method for the first node to generate a public key can be to select a private key for the first node, and generate a public key based on the private key. In the embodiment of the present application, multiple private keys to be selected can be pre-set, and the central node (first node) selects a private key from the multiple private keys to be selected, and then generates a public key based on the private key selected by the first node. Exemplarily, if the private key selected by the first node is SK, the public key can be the dot product of the private key and the base point of the elliptic curve, that is, A=SK·G.
[0188] Optionally, in a possible implementation, the first node may send the first private key shard to n nodes according to the method for distributing private key shards in the current technical solution. Exemplarily, the first node may send the first private key shard to n nodes by using a method of selecting a target polynomial or a method of selecting a target random number.
[0189] In the embodiment of the present application, although the public key is generated by the central node, the startup phase in the embodiment of the present application and the signature phase in the above embodiment are combined into a complete threshold signature algorithm, which has the same Figure 2 , Figure 4 , Figure 5 and Figure 6 The same technical effects as those of the embodiments in the present invention will not be described in detail here.
[0190] Fig.11 Schematic diagram of the structure of the threshold signature device provided in the embodiment of the present application. The threshold signature device can be the first node in the above embodiment, and the first node is any one of the n nodes. The threshold signature device is used to execute the action of the first node in the above method embodiment. Fig.11 As shown, the first node 1100 may include: a transceiver module 1101 and a processing module 1102.
[0191] The transceiver module 1101 is used to receive the zero-knowledge proof and the first commitment from each of the other t-1 nodes.
[0192] Processing module 1102 is used to verify the zero-knowledge proof and first commitment of each node when receiving the zero-knowledge proof and first commitment from each of the other t-1 nodes, where t is a threshold value, t is an integer greater than or equal to 2 and less than or equal to n, and the zero-knowledge proof of the first node is related to the first commitment of the first node.
[0193] Among them, if the zero-knowledge proof and the first commitment of each node are verified, the processing module 1102 is also used to obtain the first part of the signature according to the first commitment of the first node and the first commitment of each node, and obtain the second commitment of each of the t nodes according to the fragments of the second part of the signature of the first node and the fragments of the second part of the signature from each node, and verify the fragments of the second part of the signature of each of the t nodes according to the second commitment of each of the t nodes; if there is a fragment of the second part of the signature of the second node in the t nodes that fails to pass the verification, the second node is determined to be a malicious node.
[0194] In a possible implementation, the processing module 1102 is specifically configured to add the first commitment of the first node and the first commitment of each of the other t-1 nodes to obtain the first part of the signature.
[0195] In a possible implementation, the processing module 1102 is specifically configured for the first node to generate a fragment of the second part of the signature of the first node according to the first part of the signature. The transceiver module 1101 is also configured to send the fragment of the second part of the signature of the first node to other t-1 nodes.
[0196] In one possible implementation, the processing module 1102 is specifically used to generate a derived value based on the first part of the signature, the public key and the object to be signed; obtain the first coefficient of the first node based on the identity information of each node in the t nodes; obtain the second private key shard based on the first coefficient and the first private key shard held by the first node; generate a shard of the second part of the signature of the first node based on the derived value, the second private key shard and the target random number, the target random number being a random number selected by the first node from the preset random numbers.
[0197] In one possible implementation, processing module 1102 is specifically used to obtain a second commitment of the first node based on the shards of the second part of the signature of the first node and the base points of the elliptic curve; obtain a second commitment of each of the other t-1 nodes based on the shards of the second part of the signature of each node in the other t-1 nodes and the base points of the elliptic curve, so as to obtain a second commitment of each of the t nodes.
[0198] In a possible implementation, for a third node among t nodes, the third node is any node among the t nodes, wherein: processing module 1102 is specifically used to obtain the fifth commitment of the third node, and the fifth commitment of the third node is related to the first private key shard of the third node. According to the identity information of each node among the t nodes, the first coefficient of the third node is obtained; according to the fifth commitment of the third node and the first coefficient, the third commitment of the third node is obtained; according to the derived value and the third commitment of the third node, the fourth commitment of the third node is obtained; if the second commitment of the third node is equal to the sum of the first commitment of the third node and the fourth commitment of the third node, then the first node determines that the shard of the second part of the signature of the third node passes the verification.
[0199] In one possible implementation, processing module 1102 is further used to verify the third commitment of each of the t nodes; if the third commitment of each of the t nodes passes the verification, then verify the shard of the second part of the signature of each of the t nodes.
[0200] In one possible implementation, processing module 1102 is specifically used to obtain the sum of the third commitments of each of the t nodes; if the sum of the third commitments is equal to the public key, it is determined that the third commitment of each of the t nodes has passed the verification.
[0201] In a possible implementation, the processing module 1102 is further used to select a target random number, and generate a first commitment of the first node according to the target random number and the base point of the elliptic curve; and obtain the zero-knowledge proof of the first node according to the first commitment of the first node. The transceiver module 1101 is further used to send the zero-knowledge proof of the first node to other t-1 nodes.
[0202] In a possible implementation, the processing module 1102 is further configured to obtain a first private key fragment of the first node; and generate a public key according to the first private key fragment of the first node.
[0203] In one possible implementation, the processing module 1102 is specifically used to select a target polynomial from a preset t-1 degree polynomial, and substitute the identity information of each of the n nodes into the target polynomial to obtain a shared key shard corresponding to each of the n nodes. The transceiver module 1101 is used to send a corresponding shared key shard to each of the other n-1 nodes, and receive a shared key shard from each of the other n-1 nodes. The processing module 1102 is also used to add the shared key shards from the n nodes when receiving a shared key shard from each of the other n-1 nodes to obtain a first private key shard of the first node.
[0204] In a possible implementation, the processing module 1102 is specifically used to generate the fifth commitment of the first node according to the first private key shard of the first node. The transceiver module 1101 is also used to send the fifth commitment of the first node to other n-1 nodes. The processing module 1102 is specifically used to verify the first private key shard of each of the n nodes according to the fifth commitment of the n nodes; if the first private key shard of each of the n nodes passes the verification, then generate a public key according to the fifth commitment of each of the n nodes.
[0205] In a possible implementation, the processing module 1102 is specifically configured to generate a fifth commitment of the first node according to the first private key shard of the first node and a base point of the elliptic curve.
[0206] In a possible implementation, the processing module 1102 is specifically configured to perform the following steps:
[0207] A. Randomly select t fifth commitments from n fifth commitments;
[0208] B. Obtaining a second coefficient of a node corresponding to each of the t fifth commitments according to an identity identifier of the node corresponding to each of the t fifth commitments;
[0209] C. Obtain a public key to be verified according to the second coefficient of the node corresponding to each fifth commitment in the t fifth commitments and the fifth commitment of the node corresponding to each fifth commitment in the t fifth commitments;
[0210] D. Repeat steps A, B, and C for a preset number of times to obtain a preset number of public keys to be verified;
[0211] E. If each of the preset number of public keys to be verified is the same, then determine that the first private key shard of each node in the n nodes passes the verification;
[0212] Take any public key to be verified as the public key.
[0213] In a possible implementation, the processing module 1102 is specifically configured to select a first private key shard of a first node from a preset first private key shard.
[0214] In one possible implementation, processing module 1102 is specifically used to obtain a first public key shard of the first node and a zero-knowledge proof of the first public key shard of the first node based on the first private key shard of the first node; and generate a sixth commitment of the first node based on the zero-knowledge proof of the first public key shard of the first node.
[0215] The transceiver module 1101 is also used to send the sixth commitment of the first node, the first public key fragment of the first node, and the zero-knowledge proof of the first public key fragment of the first node to other n-1 nodes.
[0216] Processing module 1102 is specifically used to verify the sixth commitment from each of the n nodes and the zero-knowledge proof of the first public key shard; if the sixth commitment from each of the n nodes and the zero-knowledge proof of the first public key shard are verified, then a public key is generated according to the first public key shard of each of the n nodes.
[0217] In a possible implementation, the processing module 1102 is specifically configured to take the sum of the first public key fragments of each of the n nodes as the public key.
[0218] In a possible implementation, the transceiver module 1101 is further configured to output the identity information of the second node.
[0219] In one possible implementation, the processing module 1102 is further used to obtain the second part of the signature according to the fragments of the second part of the signature of each of the t nodes if the fragments of the second part of the signature of each of the t nodes are verified; generate a signature according to the first part of the signature and the second part of the signature; and output the signature if the signature is valid.
[0220] The implementation principle and technical effect of the threshold signature device provided in the embodiment of the present application are similar to those of the first node in the above embodiment, and will not be repeated here.
[0221] It should be noted that the above processing module can be implemented in the form of software called by a processing element; it can also be implemented in the form of hardware. For example, the processing module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The functions of the above processing module. In addition, all or part of the above units can be integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed by an integrated logic circuit of hardware in a processor element or an instruction in the form of software. For example, the above units can be one or more integrated circuits configured to implement the above method, such as: one or more application specific integrated circuits (ASIC), or one or more microprocessors (DSP), or one or more field programmable gate arrays (FPGA). For example, when a certain module above is implemented in the form of a processing element scheduling program code, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0222] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.12 The electronic device shown may be the first node in the above embodiment. Fig.12As shown, the electronic device may include: a processor 1201, a memory 1202 and a transceiver 1203; the memory 1202 may include a high-speed random access memory (random-access memory, RAM), and may also include a non-volatile memory (non-volatile memory, NVM), such as at least one disk storage, and the memory 1202 may store various instructions for completing various processing functions and implementing the method steps of the present application. The transceiver 1203 can be coupled to the processor 1201, and the processor 1201 can control the transmission and reception of information between other nodes. When the processor 1201 executes the instruction, the instruction causes the processor 1201 of the electronic device to perform the processing action of the electronic device in the above method embodiment, and causes the transceiver 1203 to perform the transmission and reception action of the electronic device in the above method embodiment. Optionally, the electronic device involved in the present application may also include: a power supply 1204, a communication bus 1205, and a communication port 1206. The communication bus 1205 is used to realize the communication connection between components. The above-mentioned communication port 1206 is used to realize the connection and communication between the electronic device and other peripherals. In the embodiment of the present application, the above-mentioned memory 1202 is used to store computer executable program code, and the program code includes instructions.
[0223] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instruction can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integration. Available media can be magnetic media, (e.g., floppy disk, hard disk, tape), optical media (e.g., DVD), or semiconductor media (e.g., solid-state hard disk Solid State Disk (SSD)), etc.
[0224] The term "plurality" in this article refers to two or more than two. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the previous and next associated objects are in an "or" relationship; in a formula, the character " / " indicates that the previous and next associated objects are in a "division" relationship.
[0225] It is to be understood that the various digital numbers involved in the embodiments of the present application are only for the convenience of description and are not used to limit the scope of the embodiments of the present application. It is to be understood that in the embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. The above is only a specific implementation method of the present application, but the protection scope of the present application is not limited thereto, and any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A threshold signature method, characterized in that: Applied to a first node among n nodes, where n is an integer greater than 1, the method comprises: When the first node receives the zero-knowledge proof and the first commitment from each of the other t-1 nodes, verify the zero-knowledge proof and the first commitment of each node, where t is a threshold value, t is an integer greater than or equal to 2 and less than or equal to n, and the zero-knowledge proof of the first node is related to the first commitment of the first node; If the zero-knowledge proof and the first commitment of each node are both verified, the first node obtains the first part of the signature according to the first commitment of the first node and the first commitment of each node; The first node obtains the second commitment of each of the t nodes according to the fragment of the second part of the signature of the first node and the fragment of the second part of the signature from each of the nodes, and verifies the fragment of the second part of the signature of each of the t nodes according to the second commitment of each of the t nodes; If there is a fragment of the second part of the signature of the second node among the t nodes that fails to pass the verification, the first node determines that the second node is a malicious node.
2. The method according to claim 1, characterized in that The first node obtains a first part of the signature according to the first commitment of the first node and the first commitment of each node, including: The first node adds the first commitment of the first node and the first commitment of each of the other t-1 nodes to obtain the first part of the signature.
3. The method according to claim 1 or 2, characterized in that: Before obtaining the second commitment of each of the t nodes, the method further includes: The first node generates a fragment of the second part of the signature of the first node based on the first part of the signature, and sends the fragment of the second part of the signature of the first node to other t-1 nodes.
4. The method according to claim 3, characterized in that The first node generates a fragment of the second part of the signature of the first node according to the first part of the signature, including: The first node generates a derived value according to the first part of the signature, the public key and the object to be signed; The first node obtains a first coefficient of the first node according to the identity information of each node in the t nodes; The first node obtains a second private key shard according to the first coefficient and a first private key shard held by the first node; The first node generates a fragment of the second part of the signature of the first node according to the derived value, the second private key fragment and a target random number, where the target random number is a random number selected by the first node from preset random numbers.
5. The method according to any one of claims 1 to 2 and 4, characterized in that: The first node obtains a second commitment of each of the t nodes according to the shard of the second part of the signature of the first node and the shard of the second part of the signature of each node, including: The first node obtains a second commitment of the first node according to the shard of the second part of the signature of the first node and the base point of the elliptic curve; The first node obtains the second commitment of each of the other t-1 nodes based on the shard of the second part of the signature of each of the other t-1 nodes and the base point of the elliptic curve to obtain the second commitment of each of the t nodes.
6. The method according to claim 4, characterized in that The method further includes: for a third node among the t nodes, the third node is any node among the t nodes, wherein: The first node obtains a fifth commitment of the third node, where the fifth commitment is related to a first private key shard of the third node; The first node obtains the first coefficient of the third node according to the identity information of each node in the t nodes; The first node obtains a third commitment of the third node according to the fifth commitment of the third node and the first coefficient; The first node obtains a fourth commitment of the third node according to the derived value and the third commitment of the third node; The verifying the second part of the shard of the signature of each of the t nodes according to the second commitment of each of the t nodes comprises: If the second commitment of the third node is equal to the sum of the first commitment of the third node and the fourth commitment of the third node, the first node determines that the fragment of the second part of the signature of the third node passes the verification.
7. The method according to claim 6, characterized in that After obtaining the third commitment of the third node, the method further includes: The first node verifies the third commitment of each of the t nodes; The verifying the second part of the signature of each of the t nodes comprises: If the third commitment of each of the t nodes passes verification, the first node verifies the shard of the second part of the signature of each of the t nodes.
8. The method according to claim 7, characterized in that The verifying the third commitment of each of the t nodes comprises: The first node obtains the sum of the third commitments of each of the t nodes; If the sum of the third commitments is equal to the public key, the first node determines that the third commitment of each of the t nodes passes verification.
9. The method according to any one of claims 1-2, 4, 6-8, characterized in that: Before the first node receives the zero-knowledge proof and the first commitment from each of the other t-1 nodes, the process further includes: The first node selects a target random number, and generates a first commitment of the first node according to the target random number and a base point of an elliptic curve; The first node obtains the zero-knowledge proof of the first node according to the first commitment of the first node and the target random number, where the target random number is a random number selected by the first node from preset random numbers; The first node sends the zero-knowledge proof of the first node to other t-1 nodes.
10. The method according to any one of claims 1-2, 4, 6-8, characterized in that: Before the first node receives the zero-knowledge proof and the first commitment from each of the other t-1 nodes, the process further includes: The first node obtains a first private key shard of the first node; The first node generates a public key according to the first private key shard of the first node.
11. The method according to claim 10, characterized in that The first node obtains a first private key shard of the first node, including: The first node selects a target polynomial from a preset t-1 degree polynomial, and substitutes the identity information of each of the n nodes into the target polynomial, to obtain a shared key shard corresponding to each of the n nodes; The first node sends a corresponding shared key fragment to each of the other t-1 nodes; When the first node receives the shared key fragment from each of the other t-1 nodes, the shared key fragments from the n nodes are added together to obtain the first private key fragment of the first node.
12. The method according to claim 10, characterized in that The first node generates a public key according to the first private key shard of the first node, including: The first node generates a fifth commitment of the first node according to the first private key shard of the first node; The first node sends the fifth commitment of the first node to other n-1 nodes; The first node verifies the first private key shard of each of the n nodes according to the fifth commitment of each of the n nodes; If the first private key shard of each of the n nodes passes the verification, a public key is generated according to the fifth commitment of each of the n nodes.
13. The method according to claim 12, characterized in that The first node generates a fifth commitment of the first node according to the first private key shard of the first node, including: The first node generates a fifth commitment of the first node according to the first private key shard of the first node and a base point of the elliptic curve.
14. The method according to claim 12 or 13, characterized in that The first node verifies the first private key shard of each of the n nodes according to the fifth commitment of each of the n nodes, including: A. The first node randomly selects t fifth commitments from n fifth commitments; B. the first node obtains the second coefficient of the node corresponding to each of the t fifth commitments according to the identity identifier of the node corresponding to each of the t fifth commitments; C. The first node obtains a public key to be verified according to the second coefficient of the node corresponding to each fifth commitment in the t fifth commitments and the fifth commitment of the node corresponding to each fifth commitment in the t fifth commitments; D. Repeat steps A, B, and C for a preset number of times to obtain a preset number of public keys to be verified; E. If each of the preset number of public keys to be verified is the same, the first node determines that the first private key fragment of each of the n nodes passes the verification; The generating a public key according to the first private key shard of each node in the n nodes includes: The first node uses any public key to be verified as a public key.
15. The method according to claim 10, characterized in that The first node obtains a first private key shard of the first node, including: The first node selects the first private key shard of the first node from the preset first private key shards.
16. The method according to claim 15, characterized in that The first node generates a public key according to the first private key shard of the first node, including: The first node obtains, according to the first private key shard of the first node, a first public key shard of the first node and a zero-knowledge proof of the first public key shard of the first node; The first node generates a sixth commitment of the first node according to the zero-knowledge proof of the first public key shard of the first node, and sends the sixth commitment of the first node, the first public key shard of the first node, and the zero-knowledge proof of the first public key shard of the first node to other n-1 nodes; The first node verifies the sixth commitment from each of the n nodes and the zero-knowledge proof of the first public key shard; If the sixth commitment of each of the n nodes and the zero-knowledge proof of the first public key shard are both verified, the first node generates a public key based on the first public key shard of each of the n nodes.
17. The method according to claim 16, characterized in that The first node generates a public key according to the first public key sharding of each of the n nodes, including: The first node uses the sum of the first public key fragments of each of the n nodes as the public key.
18. The method according to any one of claims 1-2, 6-8, 11-13, 15-17, characterized in that: After the first node determines that the second node is a malicious node, the method includes: The first node outputs the identity information of the second node.
19. The method according to any one of claims 1-2, 6-8, 11-13, 15-17, characterized in that: The method further comprises: If the fragments of the second part of the signature of each of the t nodes pass the verification, then obtaining the second part of the signature according to the fragments of the second part of the signature of each of the t nodes; generating a signature based on the first part of the signature and the second part of the signature; If the signature is valid, the signature is output.
20. A threshold signature device, characterized in that: The device is applied to a first node among n nodes, where n is an integer greater than 1, and comprises: A transceiver module, used to receive the zero-knowledge proof and the first commitment from each of the other t-1 nodes; a processing module, configured to, upon receiving a zero-knowledge proof and a first commitment from each of the other t-1 nodes, verify the zero-knowledge proof and the first commitment of each node, where t is a threshold value, t is an integer greater than or equal to 2 and less than or equal to n, and the zero-knowledge proof of the first node is related to the first commitment of the first node; Among them, if the zero-knowledge proof and the first commitment of each node are verified, the processing module is also used to obtain the first part of the signature according to the first commitment of the first node and the first commitment of each node, and obtain the second commitment of each of the t nodes according to the fragments of the second part of the signature of the first node and the fragments of the second part of the signature from each node, and verify the fragments of the second part of the signature of each of the t nodes according to the second commitment of each of the t nodes; if there is a fragment of the second part of the signature of a second node among the t nodes that fails to pass the verification, the second node is determined to be a malicious node.
21. An electronic device, characterized in that: include: memory, processors, and transceivers; The processor is used to couple with the memory, read and execute instructions in the memory, so as to implement the method according to any one of claims 1 to 19; The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
22. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1 to 19.
23. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a computer, cause the computer to perform the method according to any one of claims 1 to 19.
Citation Information
Patent Citations
Threshold signing method based on SM2 signing algorithm
CN109547212A
Digital signature method for secret key distributed generation
CN110061847A
