Blockchain-based transaction signature method and device, and electronic device
By using distributed key generation and multi-party computation protocols, the security issues of private keys during the signing process are resolved, ensuring that private keys are not generated completely and improving the security of blockchain transactions.
Patent Information
- Application Number
- CN202410515716.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-26
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2044-04-26
AI Technical Summary
In existing technologies, when signing transactions via secret sharing, it is difficult to guarantee the security of the private key during the splitting and reassembly of the private key.
A distributed key generation method is adopted, in which each participant independently generates a private key fragment and jointly signs it through a multi-party computation protocol (MPC protocol), thus avoiding the generation of a complete private key and ensuring the security of the private key.
During the transaction signing process, the private key is not fully generated, which avoids the risk of private key leakage and improves the security of private keys on the blockchain.
Smart Images

Figure CN118449686B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of blockchain or other related technical fields, in particular, to a transaction signature method and device based on a blockchain, and an electronic device. BACKGROUND
[0002] Unlike traditional centralized services, a blockchain is a decentralized network structure, and no trusted center exists in the blockchain network. An account holder on the blockchain manages and stores an account private key through a wallet. When a user requests to perform a transaction, the transaction needs to be signed by the private key, so as to verify the integrity of the transaction information and the identity of the transaction requester.
[0003] The private key is the only certificate proving that the user owns the digital assets, and therefore the security of the private key is particularly important for the blockchain. In related technologies, when signing a target transaction by a private key, the complete private key is generated by means of secret sharing, and then the private key is split to obtain a plurality of private key fragments, which are then given to multiple parties for storage and use. When signing, the target transaction is signed by splicing the private keys of the multiple parties to obtain the complete private key. The scheme of generating private key fragments based on secret sharing technology for transaction signature generates or splices the complete private key, which is difficult to ensure that the complete private key will not be leaked, and the security of the private key cannot be guaranteed.
[0004] At present, no effective solution has been proposed for the above problems. SUMMARY
[0005] The embodiments of the present application provide a transaction signature method and device based on a blockchain and an electronic device, to at least solve the technical problem that in related technologies, when signing a transaction by means of secret sharing, the complete private key is generated in the process of splitting and splicing the private key, which is difficult to ensure the security of the private key.
[0006] According to an aspect of an embodiment of the present application, a transaction signature method based on a blockchain is provided, including: obtaining a target transaction to be signed, and determining a transaction party based on the target transaction; obtaining a threshold value t, and obtaining t-1 participating parties corresponding to the transaction party based on a time rotation notary group, wherein the time rotation notary group stores t participating parties holding private key fragments, and t is a positive integer; running an MPC protocol based on the private key fragment of the transaction party, the additive share corresponding to the private key fragment of the participating party, the private key fragment of the t-1 participating parties, and the additive share corresponding to the private key fragment of each participating party, and signing the target transaction, wherein the additive share corresponding to the private key fragment is a preconfigured weight value.
[0007] Optionally, before obtaining the target transaction to be signed, further comprising: obtaining a number n of nodes in the blockchain network; and calculating the threshold t based on the number n of nodes.
[0008] Optionally, after calculating the threshold t based on the number n of nodes, further comprising: generating an encryption key pair for a user terminal corresponding to a node in the blockchain network, wherein the encryption key pair comprises a public key and a private key; and sharding the private key in the encryption key pair and storing the private key shards obtained by sharding into the nodes in the blockchain network.
[0009] Optionally, the step of sharding the private key in the encryption key pair and storing the private key shards obtained by sharding into the nodes in the blockchain network comprises: constructing a t-1 order polynomial equation based on the threshold t and solving the t-1 order polynomial equation to obtain a solution; sharding the private key based on the number n of nodes to obtain n private key shards; determining t participants based on the solution and the threshold t to obtain the time-rotating notary group; and storing the n private key shards into the nodes in the blockchain corresponding to the t participants in the time-rotating notary group.
[0010] Optionally, the blockchain-based transaction signature method further comprises: creating a timing task, executing the timing task, and updating the encryption key pair based on a predetermined time point.
[0011] Optionally, before running the MPC protocol based on the transaction party's private key shard, the participant's private key shard corresponding to the additive share, the t-1 participant's private key shard, and the additive share corresponding to each participant's private key shard, further comprising: obtaining the number of times of obtaining the transaction party's private key shard and each participant's private key shard; and in a case where the number of times of obtaining any private key shard of the transaction party's private key shard and each participant's private key shard is greater than a threshold number of times of obtaining, configuring a verification mechanism for the target private key shard that exceeds the threshold number of times of obtaining, wherein the verification mechanism comprises at least one of the following: SMS verification, password verification.
[0012] Optionally, after signing the target transaction, further comprising: broadcasting the target transaction after signing to the blockchain network; and in a case where the target transaction passes verification, executing the target transaction.
[0013] Optionally, the step of running the MPC protocol based on the private key shard of the transaction party, the additive share corresponding to the private key shard of the participant, the private key shards of the t-1 participants, and the additive share corresponding to the private key shard of each participant, and signing the target transaction comprises: the transaction party signs the target transaction based on the private key shard of the transaction party to obtain a transaction party signature shard, and configures a signature shard additive share for the transaction party signature shard based on the additive share corresponding to the private key shard of the transaction party; t-1 participant signature shards are obtained by signing the target transaction based on the private key shards of the participants, and a signature shard additive share is configured for each participant signature shard based on the additive share corresponding to the private key shard of the participant; a target signature is calculated based on the transaction party signature shard, the signature shard additive share of the transaction party signature shard, the participant signature shards, and the signature shard additive shares of the participant signature shards, and the target transaction is signed based on the target signature.
[0014] According to another aspect of the embodiments of the present application, a blockchain-based transaction signature device is also provided, comprising: a determination unit configured to obtain a target transaction to be signed and determine a transaction party based on the target transaction; an acquisition unit configured to obtain a threshold value t and obtain t-1 participants corresponding to the transaction party based on a time rotation notary group, wherein the time rotation notary group stores t participants holding private key shards, and t is a positive integer; and a signature unit configured to run an MPC protocol based on the private key shard of the transaction party, the additive share corresponding to the private key shard of the participant, the private key shards of the t-1 participants, and the additive share corresponding to the private key shard of each participant, and sign the target transaction, wherein the additive share corresponding to the private key shard is a pre-configured weight value.
[0015] Optionally, the blockchain-based transaction signature device further comprises: a first acquisition module configured to acquire a number n of nodes in a blockchain network; and a first calculation module configured to calculate the threshold value t based on the number n of nodes.
[0016] Optionally, the blockchain-based transaction signature device further comprises: a first generation module configured to generate an encryption key pair for a user terminal corresponding to a node in the blockchain network, wherein the encryption key pair comprises a public key and a private key; and a first sharding module configured to shard the private key in the encryption key pair and store the sharded private key shards on the nodes in the blockchain network.
[0017] Optionally, the first fragmentation module comprises: a first construction submodule configured to construct a t-1 order polynomial equation based on the threshold t, and to solve the t-1 order polynomial equation to obtain a solution; a first fragmentation submodule configured to fragment the private key based on the number of nodes n to obtain n private key fragments; a first determination submodule configured to determine t participants based on the solution and the threshold t to obtain the time rotation notary group; and a first storage submodule configured to store the n private key fragments in the nodes corresponding to the t participants in the time rotation notary group.
[0018] Optionally, the blockchain-based transaction signature device further comprises a first execution module configured to create a timing task, execute the timing task, and update the encryption key pair based on a predetermined time point.
[0019] Optionally, the blockchain-based transaction signature device further comprises a second acquisition module configured to acquire the acquisition times of the private key fragments of the transaction party and the private key fragments of each participant; and a first configuration module configured to, in a case where the acquisition times of any one of the private key fragments of the transaction party and the private key fragments of each participant are greater than an acquisition time threshold, configure a verification mechanism for a target private key fragment that exceeds the acquisition time threshold, wherein the verification mechanism comprises at least one of the following: an SMS verification and a password verification.
[0020] Optionally, the blockchain-based transaction signature device further comprises a first broadcast module configured to broadcast the target transaction after signature to a blockchain network; and a second execution module configured to, in a case where the target transaction passes verification, execute the target transaction.
[0021] Optionally, the signature unit comprises: a first signature module configured to, based on the private key fragment of the transaction party, sign the target transaction to obtain a transaction party signature fragment, and based on the additive share corresponding to the private key fragment of the transaction party, configure a signature fragment additive share for the transaction party signature fragment; a second signature module configured to, based on the private key fragments of the participants, sign the target transaction to obtain t-1 participant signature fragments, and based on the additive share corresponding to the private key fragment of each participant, configure a signature fragment additive share for each participant signature fragment; and a third signature module configured to calculate a target signature based on the transaction party signature fragment, the signature fragment additive share of the transaction party signature fragment, the participant signature fragments, and the signature fragment additive shares of the participant signature fragments, and sign the target transaction based on the target signature.
[0022] According to another aspect of the embodiments of the present application, an electronic device is also provided, which includes one or more processors and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any of the above-mentioned blockchain-based transaction signature methods.
[0023] In the present disclosure, the target transaction to be signed is first acquired, and the transaction party is determined based on the target transaction, then the threshold t is acquired, and t-1 participants corresponding to the transaction party are acquired based on the time rotation notary group, wherein the time rotation notary group stores t participants holding private key fragments, t is a positive integer, and finally the MPC protocol is run based on the private key fragments of the transaction party, the additive share corresponding to the private key fragments of the participants, the private key fragments of the t-1 participants, and the additive share corresponding to the private key fragments of each participant, and the target transaction is signed, wherein the additive share corresponding to the private key fragments is a pre-configured weight value.
[0024] In the present disclosure, the private key is divided by the threshold, and when the transaction party initiates the target transaction, the other participants of the private key fragments corresponding to the transaction party are determined, and the MPC protocol is run based on the private key fragments of each party, and then the target transaction is signed, and the complete private key is not generated in the whole process, which ensures the security of the private key, and thus solves the technical problem that in the related art, when the transaction is signed by secret sharing, the complete private key is generated in the splitting and splicing process of the private key, and it is difficult to ensure the security of the private key. BRIEF DESCRIPTION OF DRAWINGS
[0025] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
[0026] Figure 1 is a flowchart of an optional blockchain-based transaction signature method according to an embodiment of the present application;
[0027] Figure 2 is a schematic diagram of an optional private key fragment acquisition method according to an embodiment of the present application;
[0028] Figure 3 is a schematic diagram of an optional blockchain wallet recovery method according to an embodiment of the present application;
[0029] Figure 4 is a schematic diagram of an optional blockchain-based transaction signature device according to an embodiment of the present application;
[0030] Figure 5A hardware structure block diagram of an electronic device (or mobile device) according to an embodiment of a blockchain-based transaction signature method of the present application. DETAILED DESCRIPTION
[0031] In order to make the personnel in the technical field better understand the present application scheme, the technical scheme in the embodiment of the present application will be clearly and completely described below in combination with the drawings in the embodiment of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the present application.
[0032] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological order. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to include those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0033] MPC protocol, an abbreviation of Multi-Party Computation, is a cryptographic protocol that enables multiple participants to jointly compute a specific function while keeping the inputs of these participants secret.
[0034] It should be noted that the blockchain-based transaction signature method and device in the present disclosure can be used in the case of signing a target transaction based on private key fragmentation in the field of blockchain technology, and can also be used in the case of signing a target transaction based on private key fragmentation in any field other than the field of blockchain technology. The application field of the blockchain-based transaction signature method and device in the present disclosure is not limited.
[0035] It should be noted that the related information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present disclosure are information and data authorized by the user or authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of related data comply with relevant laws, regulations and standards in relevant regions, necessary security measures are taken, public order and good customs are not violated, and appropriate operation portals are provided for users to choose authorization or refusal. For example, interfaces are provided between the system and related users or agencies, and before obtaining the related information, the interface needs to send a request to the aforementioned user or agency, and after receiving the consent information feedback from the aforementioned user or agency, the related information is obtained.
[0036] It should be noted that in the present disclosure, when collecting and analyzing customer information, the user is provided with a corresponding operation portal for the user to choose to agree or refuse the automatic decision result; if the user chooses to refuse, the expert decision process is entered.
[0037] The following embodiments of the present application can be applied to various blockchain-based transaction signature systems / applications / devices. The present application directly generates private key fragments of each participant independently in a distributed key manner, and when signing based on the private key fragments, the transaction signature is realized by jointly running the MPC protocol, and there is no complete private key in the entire process, and there is no transmission and sharing of the private key fragments generated by each participant between participants, so there is no problem of leaking the complete private key, and the security of private key storage on the blockchain is improved.
[0038] The present application will be described in detail below in conjunction with various embodiments.
[0039] Embodiment one
[0040] According to an embodiment of the present application, an embodiment of a blockchain-based transaction signature method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.
[0041] Figure 1 is a flowchart of an optional blockchain-based transaction signature method according to an embodiment of the present application, as shown in Figure 1 The method comprises the following steps:
[0042] Step S101, obtaining a target transaction to be signed, and determining a transaction party based on the target transaction;
[0043] In step S102, a threshold t is obtained, and t-1 participants corresponding to the transaction party are obtained based on a time rotation notary group, wherein the time rotation notary group stores t participants holding private key fragments, and t is a positive integer.
[0044] In step S103, an MPC protocol is run based on the private key fragment of the transaction party, the additive share corresponding to the private key fragment of the participant, the private key fragments of the t-1 participants, and the additive share corresponding to the private key fragment of each participant, and the target transaction is signed, wherein the additive share corresponding to the private key fragment is a preconfigured weight value.
[0045] Through the above steps, the target transaction to be signed is obtained first, and the transaction party is determined based on the target transaction, then the threshold t is obtained, and t-1 participants corresponding to the transaction party are obtained based on a time rotation notary group, wherein the time rotation notary group stores t participants holding private key fragments, and t is a positive integer, and finally an MPC protocol is run based on the private key fragment of the transaction party, the additive share corresponding to the private key fragment of the participant, the private key fragments of the t-1 participants, and the additive share corresponding to the private key fragment of each participant, and the target transaction is signed, wherein the additive share corresponding to the private key fragment is a preconfigured weight value.
[0046] In this embodiment, the private key is divided by the threshold, and when the transaction party initiates the target transaction, the other participants of the private key fragment corresponding to the transaction party are determined, and the MPC protocol is run based on the private key fragments of the parties, and then the target transaction is signed. In the entire process, the complete private key is not generated, ensuring the security of the private key, and thus solving the technical problem that in the related art, when the transaction is signed by secret sharing, the complete private key is generated in the splitting and splicing process of the private key, which is difficult to ensure the security of the private key.
[0047] The embodiments of the application will be described in detail below in combination with the above steps.
[0048] It should be noted that the blockchain is a decentralized network structure, and there is no trusted center in the blockchain network. The account private key on the blockchain and the wallet storing the account private key are managed by the account holder himself. If the account holder does not properly manage the wallet, the wallet will be lost, damaged or stolen, and the assets on the account related to the wallet cannot be recovered, causing property loss. Generally, in order to ensure the safety of the wallet, the private key in the wallet is often backed up, and the private key is backed up by a third party or multiple participants, so that the lost wallet can be recovered by the third party or multiple participants when the wallet is lost, which actually ensures the security of the private keys of each blockchain user.
[0049] It should be noted that when the plurality of participants backup the private key, the private key in the blockchain account wallet is split into a plurality of fragments and stored at each node in the network, when the user wallet is lost, a certain number of wallet private key fragments are collected in the blockchain network, and the wallet can be recovered, which can effectively and securely backup the blockchain wallet and protect the security of the blockchain wallet.
[0050] In the embodiment of the application, when the private key is split, a distributed key generation method is adopted, each participant generates a private key fragment based on a certain rule and stores it, and when signing the target transaction of the transaction party, the corresponding private key fragments are used to sign the target transaction respectively, the complete transaction signature is obtained through the signature fragments, and thus the private key can be split and stored without generating a complete private key, and the private key fragments generated by each participant are not transmitted and shared between participants, and the security of the private key in the blockchain is improved.
[0051] Optionally, before the target transaction to be signed is obtained, the number n of nodes in the blockchain network is obtained, and the threshold t is calculated based on the number n of nodes.
[0052] It should be noted that before the transaction is signed, the private key needs to be split and stored, in a blockchain network with a network size of n (n is the number of service nodes in the blockchain network) using Byzantine fault tolerance consensus, the wallet private key is split according to the (t, n) threshold scheme, wherein the threshold t = [n / 3] + 1, therefore, before the target transaction to be signed is obtained, the number n of nodes in the blockchain network is obtained, and then the threshold t is calculated according to the number n of nodes, and the threshold t is used to split the private key.
[0053] Optionally, after the threshold t is calculated based on the number n of nodes, an encryption key pair is generated for the user end corresponding to the node in the blockchain network, wherein the encryption key pair includes a public key and a private key, the private key in the encryption key pair is split, and the split private key fragments are stored on the nodes in the blockchain network.
[0054] It should be noted that in the blockchain network, the private key is stored in the wallet of the user account and is used to sign the transaction initiated by the user, so as to verify the integrity of the transaction information and the authenticity of the transaction, after a new user joins the blockchain network and creates a node, an encryption key pair needs to be constructed for the user, the encryption key pair includes a private key and a public key, the private key is stored by the user himself, and the public key is sent to each transaction party or server in the blockchain network through a message, after obtaining the encryption key pair, the private key in the encryption key pair is split and stored in each node in the blockchain network, so that the user wallet can be quickly recovered according to the private key fragments when the user wallet is lost.
[0055] Optionally, the step of fragmenting the private key in the encryption key pair and storing the fragmented private key fragments on the nodes in the blockchain network comprises: constructing a t-1 order polynomial equation based on the threshold t, and solving the t-1 order polynomial equation to obtain a solution; fragmenting the private key based on the number of nodes n to obtain n private key fragments; determining t participants based on the solution and the threshold t to obtain a time rotation notary group; and storing the n private key fragments on the nodes in the blockchain corresponding to the t participants in the time rotation notary group.
[0056] It should be noted that when the private key in the encryption key pair is fragmented, a t-1 order polynomial equation is constructed based on the pre-computed threshold t, and the polynomial equation is solved to obtain a solution, which is used to fragment the private key. Then, the private key is fragmented based on the number of nodes n in the blockchain network to obtain n private key fragments, and t participants are determined based on the solution and the threshold to obtain a time rotation notary group. The time rotation notary group can be adjusted at any time, including modifying the participants, adding the participants and reducing the participants. Then, the n fragmented private key fragments are stored on the nodes corresponding to the t participants in the time rotation notary group.
[0057] Further, after the private key fragmentation is completed, each participant only has one private key fragment. In order to obtain the real private key, the attacker needs to obtain no less than a preset number of private key fragments to obtain the real private key, thereby ensuring the security of the private key.
[0058] Optionally, the blockchain-based transaction signature method further comprises: creating a timing task, executing the timing task, and updating the encryption key pair based on a predetermined time point.
[0059] It should be noted that in order to further improve security and prevent attackers from using automatic data grabbing tools to attack and steal private key fragments of individual participants to recover the complete private key, the embodiment of the present application adds a timing task for periodically updating the encryption key pair. The key is refreshed every certain period of time, and after refreshing, each participant obtains a new private key fragment, and the old private key fragment is invalidated. This operation can effectively prevent attackers from stealing private key fragments of each participant to recover the private key. Because, after each key refresh, the old private key fragment is invalidated, causing the attacker to lose all previous efforts and have to start over, thereby increasing the difficulty of attack and improving the security of the key.
[0060] In step S101, a target transaction to be signed is obtained, and the transaction parties are determined based on the target transaction.
[0061] It should be noted that when a user initiates a target transaction, the target transaction needs to be signed, thereby ensuring that the participants are the participants stipulated by the target transaction and ensuring the integrity of the transaction data, and the transaction party is determined through the request for initiating the target transaction.
[0062] In step S102, the threshold t is obtained, and t-1 participants corresponding to the transaction party are obtained based on the time rotation notary group.
[0063] It should be noted that after the transaction party is determined, the threshold t is obtained, and t-1 participants corresponding to the transaction party are obtained from the time rotation notary group in which the transaction party is located, thereby determining all participants holding the private key fragments. The time rotation notary group stores t participants holding the private key fragments, and t is a positive integer.
[0064] Optionally, before running the MPC protocol based on the private key fragment of the transaction party, the additive share corresponding to the private key fragment of the participant, the private key fragment of the t-1 participants, and the additive share corresponding to the private key fragment of each participant, the method further comprises: obtaining the acquisition times of the private key fragment of the transaction party and the private key fragments of the participants; and in the case that the acquisition times of any private key fragment of the private key fragment of the transaction party and the private key fragments of the participants are greater than the acquisition times threshold, configuring a verification mechanism for the target private key fragment exceeding the acquisition times threshold, wherein the verification mechanism comprises at least one of the following: SMS verification, password verification.
[0065] It should be noted that in order to further improve the security and prevent the private key fragments from being acquired by multiple automatic data grabbing tools in a short time, the embodiment of the application adds a verification mechanism, limits the acquisition times of the private key fragments of each participant, and adds a verification operation. For example, if the acquisition times of the private key fragments exceed 10 times per minute, the holder of the private key fragments is reminded of the risk of being attacked, and SMS or password verification needs to be increased, thereby further improving the security of the private key.
[0066] In step S103, the MPC protocol is run based on the private key fragment of the transaction party, the additive share corresponding to the private key fragment of the participant, the private key fragment of the t-1 participants, and the additive share corresponding to the private key fragment of each participant, and the target transaction is signed.
[0067] It should be noted that the nodes of the embodiment of the application do not need to reconstruct the complete private key, but generate a signature additive share sigi based on the additive share wi of the private key fragment of the participant, and finally the complete signature can be obtained by accumulating the signature additive shares. The entire process does not involve the generation and transmission of the complete private key, thereby ensuring the security of the private key.
[0068] Optionally, the step of running the MPC protocol based on the transaction party's private key shard, the additive share corresponding to the transaction party's private key shard, the private key shards of the t-1 transaction parties, and the additive share corresponding to each transaction party's private key shard, and signing the target transaction includes: the transaction party signs the target transaction based on the transaction party's private key shard to obtain a transaction party signature shard, and configures a signature shard additive share for the transaction party signature shard based on the additive share corresponding to the transaction party's private key shard; each transaction party signs the target transaction based on the transaction party's private key shard to obtain a transaction party signature shard, and configures a signature shard additive share for the transaction party signature shard based on the additive share corresponding to the transaction party's private key shard; and the target signature is calculated based on the transaction party signature shard, the signature shard additive share of the transaction party signature shard, the transaction party signature shard, and the signature shard additive share of the transaction party signature shard, and the target transaction is signed based on the target signature.
[0069] It should be noted that the embodiments of the present application use the MPC protocol, and each transaction party signs the target transaction based on the private key shard held by the transaction party to obtain a signature shard, and finally obtains a complete signature based on the signature shards of all transaction parties.
[0070] Specifically, the transaction party and the t-1 transaction parties jointly execute the MPC protocol to sign the target transaction in a secure environment, the transaction party signs the target transaction based on the private key shard stored by the transaction party to obtain a transaction party signature shard, and configures a signature shard additive share for the transaction party signature shard according to the pre-configured additive share of the transaction party's private key shard, the additive share corresponding to the private key shard being a pre-configured weight value, each transaction party signing the target transaction based on the private key shard held by the transaction party to obtain a transaction party signature shard, and then configuring an additive share for the transaction party signature shard, and finally calculating a complete target signature based on the signature shards of the transaction party and the transaction parties and the corresponding signature additive shares, and then signing the target transaction to obtain a signed target transaction.
[0071] Optionally, after signing the target transaction, the method further includes: broadcasting the target transaction after signing to a blockchain network; and executing the target transaction if the target transaction passes verification.
[0072] It should be noted that after signing the target transaction, the verification node verifies the signature of the target transaction based on the public key in the encryption key pair, and if the verification is passed, the target transaction is broadcast to the blockchain network to perform a specific transaction business.
[0073] The following will be described in detail in conjunction with another optional specific embodiment.
[0074] Figure 2is a schematic diagram of an optional private key fragment acquisition method according to an embodiment of the present application, as shown in Figure 2 In a blockchain network using Byzantine fault tolerance consensus with a network size of n, the private key is divided according to the network size and the threshold value t = [n / 3] + 1. The user constructs a t-1 order polynomial equation according to the set threshold value, and then divides the private key (sk in the figure) in the wallet into n private key fragments (sk1, sk2, sk3,..., skn in the figure) and stores them on the network nodes corresponding to t participants, to complete the wallet backup. When the user initiates a transaction, the target transaction is signed by the private key fragments of multiple participants, without the need to calculate the complete private key to complete the transaction signature, ensuring the security of the private key. Figure 2 Figure 2
[0075] When the private key is fragmented, the present application adopts a distributed key method to obtain the private key fragments. Compared with the existing scheme of generating private key fragments by secret sharing technology, the existing scheme generates a complete private key, which is then split into several private key fragments and given to multiple parties for storage and use. Since the complete private key is generated first and then split, it is difficult to ensure that the complete private key will not be leaked. The distributed private key fragmentation method of the present application directly generates private key fragments by each participant, and there is no complete private key in the entire process, nor is there a transmission and sharing of private key fragments generated by each participant among the participants, so there is no problem of leaking the complete private key.
[0076] The private key of the user is divided into multiple fragments inside the system, and these private key fragments are distributed in multiple secure locations to reduce the risk.
[0077] Further, after the key fragments are completed, each participant only has one private key fragment. In order to obtain the real private key, an attacker needs to obtain no less than a preset number of private key fragments to recover the real private key, making it more difficult to obtain the private key, reducing the risk of the private key being obtained by the attacker, and improving the security of the private key.
[0078] The steps of the distributed key generation of the embodiment of the present application include:
[0079] First, determine the size n of the time rotation notary group and the value of the threshold t, both n and t are positive integers, and t is less than n.
[0080] Second, generate a public key, each node Pi in the time rotation notary group selects a random number u i, and the generated public key satisfies
[0081] Second, generate a fragment private key, the public key PK and the fragment public key Xi satisfy Common private key SK (i.e., sk) and shard private key x i satisfy The node of the participant does not need to reconstruct the common private key sk, but calculates the complete signature based on the private key shard and its additive share wi and the signature shard and its additive share sigi.
[0082] It should be noted that all nodes in the time rotation notary group have the common public key PK, the shard public key Xi of all nodes, and the shard private key xi of themselves and other nodes.
[0083] After generating the public key and the private key shard, in order to further improve the security, prevent the attacker from stealing the private key shard of each participant for a long time by using the automatic data grabbing tool to recover the complete private key, therefore, the key refresh is performed every certain period of time, after the refresh, each participant obtains a new private key shard, and the old private key shard is completely discarded. This operation can effectively prevent the attacker from stealing the private key shard of each participant to recover the private key, thereby improving the attack difficulty and correspondingly increasing the security of the private key.
[0084] Further, in order to prevent the private key shard from being obtained by multiple automatic data grabbing tools in a short period of time, the number of times of obtaining the private key shard can be limited, and a verification means is added, for example, if the number of times of obtaining exceeds 10 times per minute, the holder of the private key is reminded that there is an attack risk, thereby adding the short message or password verification mechanism for the private key shard.
[0085] When signing the target transaction initiated by the transaction party, the transaction request is transmitted to the distributed private key management system, and only when multiple participants holding the private key shard agree, the target transaction can be signed.
[0086] In order to obtain an effective signature, the MPC multi-signature protocol must be jointly run by a predetermined number of participants, and after the protocol is run, everyone will obtain an identical and effective signature. During the running of the protocol, the private key shard of all participants is not leaked.
[0087] Based on the multi-signature technology of secure multi-party computation, there is only one private key on the chain, and through the cryptography technology, the single-point risk of the private key is completely removed. From beginning to end, the single-point private key does not appear completely. Through multiple private key shards, different participants calculate the final signature through the MPC protocol when signing, and the signature can be verified through the corresponding single public key.
[0088] Further, the multi-party signature technology is optimized. The management of the time rotation notary group includes establishment of the time rotation notary group, joining the time rotation notary group, verification node term management, margin management, signature scheme design, and exit from the time rotation notary group.
[0089] If the term of a node in the current time rotation notary group has arrived, and the node does not have ongoing cross-chain transaction verification work, the node is invalidated, and the node with the highest credit value in the candidate notary group replaces the position of the invalidated node to form a new round of time rotation notary group. When the term of a node in the time rotation notary group has not arrived, but the user end of the node needs to exit the time rotation notary group, the node with the highest credit value in the candidate notary group will replace the verification node that actively exits to form a new round of time rotation notary group.
[0090] After the transaction signature is completed, it is broadcast to the blockchain network for confirmation and execution of the transaction business.
[0091] If a new user joins the blockchain network, a new node will be generated, and the original users in the network need to update the private key shards and re-back up the wallet according to the new number of nodes and the threshold value.
[0092] The blockchain network is a dynamic network. When a new user joins the network, if the threshold value and the user storage private key shards in the blockchain are not updated, as the size of the blockchain network grows, it will not be consistent with the Byzantine fault tolerance consensus mechanism, and the security of the wallet backup cannot be guaranteed. At the same time, new users also need to back up their own wallets. Therefore, when a new user joins the network, the user joining module needs to be run, and the users in the network re-select the threshold value t1 according to the change in the size of the network, t1 is equal to the rounded value of [(n+1) / 3]+1.
[0093] When the rounded value of [(n+1) / 3] is equal to [n / 3], t1=t, that is, the user joining does not trigger the threshold value change. The original users in the network do not need to update the distributed private key shards, and only need to distribute the private key shards to new users according to the original equation, and the new users t-1 construct a polynomial equation and hand over the private key shards to other users in the network for storage.
[0094] When the rounded integer value of [(n+1) / 3] is equal to [(n) / 3]+1, t1=t+1, the new user joining triggers the threshold value change, and the original users in the network need to update the private key shards according to the new threshold value t1, and the new users backup the wallet according to the new threshold value t1.
[0095] When a user exits the blockchain network, the size of the blockchain network is reduced, and if the threshold value and the wallet fragments are not updated, the wallet cannot be recovered as the size of the blockchain network continues to be reduced. Therefore, when a user exits the network, a user exit module needs to be run to obtain a threshold value change caused by the user exit, and the users in the network need to update the threshold value and the private key fragments to ensure the recoverability of the wallet.
[0096] Figure 3 is a schematic diagram of an optional wallet recovery method of a blockchain according to an embodiment of the present application, as shown in Figure 3 When the wallet (i.e., the private key is lost, Figure 3 sk in the figure) of the target user is lost, the target user initiates a private key acquisition request, and in the case that the target user passes the identity verification, private key fragments (sk1, sk2, sk3,..., skn in the figure) from multiple participants related to the target user are collected and spliced with the private key fragments held by the target user to obtain a complete private key, and then the wallet is recovered. Figure 3
[0097] In the embodiment of the present application, each participant independently generates its own private key fragment in a distributed key manner, and when signing based on the private key fragment, the transaction signature is realized by jointly running the MPC protocol, and in the entire process, there is no complete private key, and there is no transmission and sharing of the private key fragments generated by each participant between the participants, so there is no problem of leaking the complete private key, and the security of the private key storage on the blockchain is improved.
[0098] The following will be described in detail in combination with another embodiment.
[0099] Embodiment Two
[0100] The transaction signing device based on the blockchain provided in the embodiment includes a plurality of implementation units, and each implementation unit corresponds to each implementation step in the above-mentioned embodiment one.
[0101] Figure 4 is a schematic diagram of an optional transaction signing device based on the blockchain according to an embodiment of the present application, as shown in Figure 4 The transaction signing device based on the blockchain can include a determination unit 41, an acquisition unit 42, and a signing unit 43, wherein
[0102] The determination unit 41 is configured to acquire a target transaction to be signed and determine a transaction party based on the target transaction.
[0103] The acquisition unit 42 is configured to acquire a threshold t, and acquire t-1 participants corresponding to the transaction party based on a time-rotation notary group, wherein the time-rotation notary group stores t participants holding private key fragments, and t is a positive integer.
[0104] The signature unit 43 is configured to run an MPC protocol based on the private key fragment of the transaction party, the additive share corresponding to the private key fragment of the participant, the private key fragments of the t-1 participants, and the additive share corresponding to the private key fragment of each participant, and sign the target transaction, wherein the additive share corresponding to the private key fragment is a pre-configured weight value.
[0105] The above blockchain-based transaction signature device determines the target transaction to be signed by the determination unit 41, and determines the transaction party based on the target transaction; the acquisition unit 42 acquires a threshold t, and acquires t-1 participants corresponding to the transaction party based on a time-rotation notary group, wherein the time-rotation notary group stores t participants holding private key fragments, and t is a positive integer; the signature unit 43 runs an MPC protocol based on the private key fragment of the transaction party, the additive share corresponding to the private key fragment of the participant, the private key fragments of the t-1 participants, and the additive share corresponding to the private key fragment of each participant, and signs the target transaction, wherein the additive share corresponding to the private key fragment is a pre-configured weight value.
[0106] In this embodiment, the private key is divided by the threshold, and when the transaction party initiates the target transaction, the other participants of the private key fragment corresponding to the transaction party are determined, and the MPC protocol is run based on the private key fragments of each party, and then the target transaction is signed, and the complete private key is not generated in the whole process, which ensures the security of the private key, and solves the technical problem that in the related art, the complete private key is generated in the splitting and splicing process of the private key when the transaction is signed by secret sharing.
[0107] Optionally, the blockchain-based transaction signature device further comprises: a first acquisition module configured to acquire the number n of nodes in the blockchain network; and a first calculation module configured to calculate the threshold t based on the number n of nodes.
[0108] Optionally, the blockchain-based transaction signature device further comprises: a first generation module configured to generate an encryption key pair for a user terminal corresponding to a node in the blockchain network, wherein the encryption key pair comprises a public key and a private key; and a first fragmentation module configured to fragment the private key in the encryption key pair, and store the fragmented private key fragments on the nodes in the blockchain network.
[0109] Optionally, the first splitting module comprises: a first construction submodule configured to construct a t-1 order polynomial equation based on the threshold t, and to solve the t-1 order polynomial equation to obtain a solution; a first splitting submodule configured to split the private key based on the number of nodes n to obtain n private key splits; a first determination submodule configured to determine the t participants based on the solution and the threshold t to obtain the time-rotating notary group; and a first storage submodule configured to store the n private key splits in the nodes corresponding to the t participants in the time-rotating notary group.
[0110] Optionally, the blockchain-based transaction signature device further comprises a first execution module configured to create a timing task, execute the timing task, and update the encryption key pair based on a predetermined time point.
[0111] Optionally, the blockchain-based transaction signature device further comprises a second acquisition module configured to acquire the acquisition times of the private key split of the transaction party and the private key splits of the participants, and a first configuration module configured to, in a case where the acquisition times of any one of the private key splits of the transaction party and the private key splits of the participants are greater than an acquisition time threshold, configure a verification mechanism for a target private key split that exceeds the acquisition time threshold, wherein the verification mechanism comprises at least one of the following: short message verification, password verification.
[0112] Optionally, the blockchain-based transaction signature device further comprises a first broadcast module configured to broadcast the target transaction after signature to a blockchain network, and a second execution module configured to execute the target transaction in a case where the target transaction passes verification.
[0113] Optionally, the signature unit comprises: a first signature module configured to sign the target transaction by the transaction party based on the private key split of the transaction party to obtain a transaction party signature split, and to configure a signature split additive share for the transaction party signature split based on the additive share corresponding to the private key split of the transaction party; a second signature module configured to sign the target transaction based on the private key splits of the participants to obtain t-1 participant signature splits, and to configure a signature split additive share for each participant signature split based on the additive share corresponding to the private key split of the participant; and a third signature module configured to calculate a target signature based on the transaction party signature split, the signature split additive share of the transaction party signature split, the participant signature splits, and the signature split additive shares of the participant signature splits, and to sign the target transaction based on the target signature.
[0114] The blockchain-based transaction signature device described above can further comprise a processor and a memory, and the determination unit 41, the acquisition unit 42, the signature unit 43, etc. are all stored in the memory as program units, and the corresponding functions are realized by the processor executing the program units stored in the memory.
[0115] The processor includes a core, and the core retrieves corresponding program units in the memory. The core can be one or more, and the core parameters are adjusted to sign a blockchain transaction based on a private key fragment.
[0116] The memory can include a non-permanent memory in a computer readable medium, a random access memory (RAM) and / or a non-volatile memory such as a read-only memory (ROM) or a flash RAM, and the memory includes at least one memory chip.
[0117] According to another aspect of the embodiments of the present application, a computer readable storage medium including a stored computer program is also provided, wherein the computer program, when executed, controls a device in which the computer readable storage medium is located to perform the blockchain-based transaction signing method described above.
[0118] According to another aspect of the embodiments of the present application, an electronic device is also provided, including one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the blockchain-based transaction signing method described above.
[0119] The present application also provides a computer program product adapted to execute a program that initializes the following method steps when executed on a data processing device: obtaining a target transaction to be signed, and determining a transaction party based on the target transaction; obtaining a threshold value t, and obtaining t-1 participants corresponding to the transaction party based on a time-rotating notary group, wherein the time-rotating notary group stores t participants holding private key fragments, and t is a positive integer; running an MPC protocol based on the private key fragment of the transaction party, the additive share corresponding to the private key fragment of the participant, the private key fragment of the t-1 participants, and the additive share corresponding to the private key fragment of each participant, and signing the target transaction, wherein the additive share corresponding to the private key fragment is a pre-configured weight value.
[0120] Figure 5 is a hardware structure block diagram of an electronic device (or mobile device) according to a blockchain-based transaction signing method according to an embodiment of the present application. As shown in Figure 5 , the electronic device can include one or more Figure 5The processor 502 (the processor 502 can include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 504 for storing data. In addition, it can also include a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply and / or a camera. Those skilled in the art can understand that Figure 5 The structure shown is only schematic, which does not limit the structure of the above-mentioned electronic device. For example, the electronic device can also include more or less components than Figure 5 The structure shown is only schematic, which does not limit the structure of the above-mentioned electronic device. For example, the electronic device can also include more or less components than Figure 5 The structure shown is only schematic, which does not limit the structure of the above-mentioned electronic device. For example, the electronic device can also include more or less components than
[0121] The above-mentioned embodiment number of the application is only for description, not representing the advantages and disadvantages of the embodiments.
[0122] In the above-mentioned embodiments of the application, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0123] In several embodiments provided in the present application, it should be understood that the disclosed technical content can be implemented by other ways. Among them, the above-mentioned device embodiment is only schematic, for example, the division of the unit can be a logical function division, and actual implementation can have another division way, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the coupling or direct coupling or communication connection between the units or modules shown or discussed can be indirect coupling or communication connection through some interfaces, units or modules, which can be electrical or other forms.
[0124] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or they can be distributed to multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0125] In addition, each functional unit in each embodiment of the application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be realized in the form of hardware or in the form of software functional unit.
[0126] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in other words, the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to make a computer device (which can be a personal computer, a server or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0127] The above description is only the preferred embodiment of the present application, and it should be pointed out that for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.
Claims
1. A blockchain-based transaction signature method, characterized by, The method comprises the following steps: obtaining a target transaction to be signed, and determining a transaction party based on the target transaction; obtaining a threshold t, and obtaining t-1 participants corresponding to the transaction party based on a time-rotating notary group, wherein the time-rotating notary group stores t participants holding private key fragments, and t is a positive integer; running an MPC protocol based on the private key fragment of the transaction party, the additive share corresponding to the private key fragment of the participant, the private key fragments of the t-1 participants, and the additive share corresponding to the private key fragment of each participant, and signing the target transaction, wherein the additive share corresponding to the private key fragment is a pre-configured weight value.
2. The signing method of claim 1, wherein, Before obtaining the target transaction to be signed, the method further comprises the following steps: obtaining the number n of nodes in a blockchain network; calculating the threshold t based on the number n of nodes.
3. The signing method of claim 2, wherein, After calculating the threshold t based on the number n of nodes, the method further comprises the following steps: generating an encryption key pair for a user terminal corresponding to a node in the blockchain network, wherein the encryption key pair comprises a public key and a private key; fragmenting the private key in the encryption key pair, and storing the fragmented private key fragments on the nodes in the blockchain network.
4. The signing method of claim 3, wherein, The step of fragmenting the private key in the encryption key pair and storing the fragmented private key fragments on the nodes in the blockchain network comprises the following steps: constructing a t-1 order polynomial equation based on the threshold t, and solving the t-1 order polynomial equation to obtain a solution; fragmenting the private key based on the number n of nodes to obtain n private key fragments; determining t participants based on the solution and the threshold t to obtain the time-rotating notary group; storing the n private key fragments in the nodes in the blockchain corresponding to the t participants in the time-rotating notary group.
5. The method of signing according to claim 1, wherein, The method further comprises the following steps: creating a timing task, executing the timing task, and updating the encryption key pair based on a predetermined time point.
6. The method of signing of claim 1, wherein, Before running the MPC protocol based on the private key fragment of the transaction party, the additive share corresponding to the private key fragment of the participant, the private key fragments of the t-1 participants, and the additive share corresponding to the private key fragment of each participant, and signing the target transaction, the method further comprises the following steps: obtaining the number of times of obtaining the private key fragment of the transaction party and the private key fragments of the participants; in a case where the number of times of obtaining any one of the private key fragment of the transaction party and the private key fragments of the participants is greater than a threshold number of times of obtaining, configuring a verification mechanism for a target private key fragment that exceeds the threshold number of times of obtaining, wherein the verification mechanism comprises at least one of the following: SMS verification, password verification.
7. The method of signing of claim 1, wherein, After signing the target transaction, the method further comprises the following steps: broadcasting the target transaction after signing to a blockchain network; in a case where the target transaction passes verification, executing the target transaction.
8. The method of signing of claim 1, wherein, The step of running the MPC protocol based on the private key fragment of the transaction party, the additive share corresponding to the private key fragment of the participant, the private key fragments of the t-1 participants, and the additive share corresponding to the private key fragment of each participant, and signing the target transaction comprises the following steps: The transaction party signs the target transaction based on the private key shards of the transaction party to obtain transaction party signature shards, and configures signature shard additive shares for the transaction party signature shards based on the additive shares corresponding to the private key shards of the transaction party; sign the target transaction based on the private key shards of each participant to obtain t-1 participant signature shards, and configure signature shard additive shares for each participant signature shard based on the additive shares corresponding to the private key shards of the participant; calculate a target signature based on the transaction party signature shards, the signature shard additive shares of the transaction party signature shards, the participant signature shards, and the signature shard additive shares of the participant signature shards, and sign the target transaction based on the target signature. 9.A blockchain-based transaction signing apparatus, characterized by comprising: Comprise: A determination unit is configured to obtain a target transaction to be signed, and determine a transaction party based on the target transaction; An acquisition unit is configured to obtain a threshold value t, and obtain t-1 participants corresponding to the transaction party based on a time rotation notary group, wherein the time rotation notary group stores t participants holding private key shards, and t is a positive integer; A signature unit is configured to run an MPC protocol based on the private key shards of the transaction party, the additive shares corresponding to the private key shards of the participants, the private key shards of the t-1 participants, and the additive shares corresponding to the private key shards of each participant, and sign the target transaction, wherein the additive shares corresponding to the private key shards are pre-configured weight values.
10. An electronic device, comprising: One or more processors and a memory, the memory being configured to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the blockchain-based transaction signature method of any one of claims 1-7.
Citation Information
Patent Citations
Digital asset transaction method and device, storage medium and terminal equipment
CN114331438A
Method, system and node for realizing threshold signature
CN117240467A