Block chain-based private key rotation method and system
By defining the key, encryption protection and sharding private key processing in the blockchain, and combining verified sharding strategy and promise value verification, dynamic rotation of private keys is achieved, solving the problem of the inability to dynamically rotate private keys in the existing technology. The problem has significantly improved the security of blockchain.
Patent Information
- Application Number
- CN202510031721.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-02-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, the private keys of the blockchain cannot be dynamically rotated, which affects the security effect of the blockchain.
By defining the key according to the user's password and key derivation function in the blockchain, and encrypting and protecting the private key and sharding. Use private key sharding, verified sharding strategy and promised value verification to trigger security verification of private key sharding, collect transaction nodes to recover private keys, and define the private key rotation mechanism based on the private key, attacker's attack difficulty and update time. , realize dynamic rotation of private keys.
This greatly improves the security effect of blockchain and enhances the security and reliability of private keys through dynamic rotation mechanism.
Smart Images

Figure CN119442289A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of blockchain, and in particular to a private key rotation method and system based on blockchain. Background Art
[0002] With the development of science and technology, blockchain is applied in people's lives. Blockchain involves users' personal accounts and corresponding transaction nodes, and keeps the personal accounts and corresponding transaction nodes confidential. In the existing technology, a single encryption protection is performed based on the personal accounts and corresponding transaction nodes of users, and the private key is finalized, so that the private key cannot be dynamically rotated, affecting the security effect of the blockchain. Summary of the invention
[0003] The purpose of the present invention is to overcome the shortcomings of the prior art. The present invention provides a private key rotation method and system based on blockchain. In the blockchain, the key is defined according to the user's password and key derivation function; the corresponding private key is output based on the privacy management of the key, and the private key is encrypted for protection; the private key is sharded and multiple private key shards are output; the security verification of the private key shard is triggered according to the private key sharding, the verifiable sharding strategy and the commitment value verification, thereby ensuring the subsequent processing of the private key sharding.
[0004] Furthermore, the transaction nodes in the blockchain are collected, and the recovery of the private key is triggered based on the transaction nodes and a large number of private key shares. The private key rotation mechanism of the blockchain is defined based on the private key, the attack difficulty of the attacker, and the update time. The private key is dynamically rotated according to the private key rotation mechanism of the blockchain, which greatly improves the security effect of the blockchain.
[0005] The embodiment of the present invention provides a private key rotation method based on blockchain, which is applied to a private key rotation scenario based on blockchain; The blockchain-based private key rotation method comprises: In the blockchain, keys are defined based on the user’s password and key derivation function; Output the corresponding private key based on the private control of the key, and encrypt and protect the private key; Shard the private key and output multiple private key shards; Trigger security verification of private key sharding based on private key sharding, verifiable sharding strategy, and commitment value verification; Collect transaction nodes in the blockchain and trigger private key recovery based on the transaction nodes and a large number of private key shares; The private key rotation mechanism of the blockchain is defined according to the private key, the difficulty of the attacker's attack, and the update time, and the private key is dynamically rotated according to the private key rotation mechanism of the blockchain.
[0006] Optionally, in the blockchain, defining a key according to a user's password and a key derivation function includes: Positioning blockchain; In the blockchain, collect the user's password; Associate the user's password and key derivation function; The corresponding key is defined based on multiple interactions of the user's password and the key derivation function.
[0007] Optionally, the outputting of the corresponding private key based on the privacy control of the key and encrypting and protecting the private key includes: freeze key; Privately manage keys; Output the corresponding private key according to the privacy control of the key; Freeze private key; Asymmetric encryption is performed on the private key to encrypt and protect the private key.
[0008] Optionally, the sharding of the private key and outputting of multiple private key shards includes: Freeze private key; Associated private keys and sharding mechanisms; Trigger the sharding of the private key according to the private key and the sharding mechanism to shard the private key; Based on the sharding process of the private key, a plurality of private key shards are output.
[0009] Optionally, the security verification of triggering private key sharding according to private key sharding, verifiable sharding strategy, and commitment value verification includes: Freeze private key sharding; Sharding based on private key can verify sharding strategy and commitment value verification; Perform preliminary processing on each private key shard and verifiable shard strategy, and output the processed features; Secondary processing is performed based on the processed features and commitment value verification, and security verification of private key sharding is triggered.
[0010] Optionally, collecting transaction nodes in the blockchain and triggering recovery of private keys according to the transaction nodes and a large number of private key shares include: Freeze-frame blockchain; Define the node space based on the traversal of the blockchain; The corresponding transaction node is defined according to the node space and transaction information.
[0011] Optionally, the collecting of transaction nodes in the blockchain and triggering recovery of private keys according to the transaction nodes and a large number of private key shares further includes: Collect transaction nodes in the blockchain; Associate this transaction node, a large number of private key shares; Based on this transaction node, a large number of private key shares trigger the recovery of the private key.
[0012] Optionally, defining a private key rotation mechanism of the blockchain according to the private key, the difficulty of the attacker's attack, and the update time, and dynamically rotating the private key according to the private key rotation mechanism of the blockchain, includes: Monitor the blockchain in real time and collect corresponding attack information; The difficulty of the attacker's attack is defined based on the attack information and the protection level of the blockchain.
[0013] Optionally, the step of defining a private key rotation mechanism of the blockchain according to the private key, the difficulty of the attacker's attack, and the update time, and dynamically rotating the private key according to the private key rotation mechanism of the blockchain, further includes: Multiple interactions on private keys, difficulty of attack for attackers, and update time; Define the blockchain's private key rotation mechanism based on multiple interactions of private keys, difficulty of attack by attackers, and update time; The private key rotation mechanism of the associated blockchain; The private keys are dynamically rotated according to the private key rotation mechanism of the blockchain.
[0014] In addition, an embodiment of the present invention further provides a blockchain-based private key rotation system, and the blockchain-based private key rotation system includes: The key module is used to define the key in the blockchain based on the user's password and key derivation function; An encryption protection module, used to output the corresponding private key based on the privacy control of the key, and encrypt and protect the private key; Sharding module, used to shard the private key and output multiple private key shards; A security verification module, used to trigger the security verification of private key sharding according to private key sharding, verifiable sharding strategy and commitment value verification; The recovery module is used to collect transaction nodes in the blockchain and trigger the recovery of private keys based on the transaction nodes and a large number of private key shares; The dynamic rotation module is used to define the private key rotation mechanism of the blockchain according to the private key, the difficulty of the attacker's attack and the update time, and dynamically rotate the private key according to the private key rotation mechanism of the blockchain.
[0015] In an embodiment of the present invention, through the method in the embodiment of the present invention, in the blockchain, the key is defined according to the user's password and key derivation function; the corresponding private key is output based on the privacy management of the key, and the private key is encrypted for protection; the private key is sharded, and multiple private key shards are output; the security verification of the private key shard is triggered according to the private key sharding, the verifiable sharding strategy and the commitment value verification, thereby ensuring the subsequent processing of the private key sharding.
[0016] Furthermore, the transaction nodes in the blockchain are collected, and the recovery of the private key is triggered based on the transaction nodes and a large number of private key shares. The private key rotation mechanism of the blockchain is defined based on the private key, the attack difficulty of the attacker, and the update time. The private key is dynamically rotated according to the private key rotation mechanism of the blockchain, which greatly improves the security effect of the blockchain. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 is a flowchart of a private key rotation method based on blockchain in an embodiment of the present invention; Figure 2 It is a flowchart of S11 in the blockchain-based private key rotation method in an embodiment of the present invention; Figure 3 is a schematic diagram of the process of S12 in the blockchain-based private key rotation method in an embodiment of the present invention; Figure 4 is a schematic diagram of the process of S13 in the blockchain-based private key rotation method in an embodiment of the present invention; Figure 5 is a flow chart of S14 in the blockchain-based private key rotation method in an embodiment of the present invention; Figure 6 It is a schematic diagram of the process of S15 in the blockchain-based private key rotation method in an embodiment of the present invention; Figure 7 It is a flowchart of S16 in the blockchain-based private key rotation method in an embodiment of the present invention; Figure 8 Schematic diagram of the structure of a blockchain-based private key rotation system in an embodiment of the present invention; Fig. 9 The figure is a hardware diagram of an electronic device according to an exemplary embodiment.
[0019] Reference numerals: Key module 21, encryption protection module 22, sharding module 23, security verification module 24, recovery module 25, dynamic rotation module 26; Electronic device 40 , processing unit 41 , storage unit 42 , random access memory unit (RAM) 421 , cache memory unit 422 , read-only memory unit (ROM) 423 , utility 424 , program module 425 , bus 43 . DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] See also Figures 1 to 9 , a blockchain-based private key rotation method is applied to a blockchain-based private key rotation scenario; the blockchain-based private key rotation method includes: Step S11: In the blockchain, a key is defined based on the user's password and a key derivation function; Step S12: outputting the corresponding private key based on the privacy control of the key, and encrypting and protecting the private key; Step S13: Slice the private key and output multiple private key slices; Step S14: triggering security verification of private key sharding according to private key sharding, verifiable sharding strategy and commitment value verification; Step S15: Collect transaction nodes in the blockchain, and trigger private key recovery based on the transaction nodes and a large number of private key shares; Step S16: Define the private key rotation mechanism of the blockchain according to the private key, the difficulty of the attacker's attack, and the update time, and dynamically rotate the private key according to the private key rotation mechanism of the blockchain.
[0022] In an embodiment of the present invention, through the method in the embodiment of the present invention, in the blockchain, the key is defined according to the user's password and key derivation function; the corresponding private key is output based on the privacy management of the key, and the private key is encrypted for protection; the private key is sharded, and multiple private key shards are output; the security verification of the private key shard is triggered according to the private key sharding, the verifiable sharding strategy and the commitment value verification, thereby ensuring the subsequent processing of the private key sharding.
[0023] Furthermore, the transaction nodes in the blockchain are collected, and the recovery of the private key is triggered based on the transaction nodes and a large number of private key shares. The private key rotation mechanism of the blockchain is defined based on the private key, the attack difficulty of the attacker, and the update time. The private key is dynamically rotated according to the private key rotation mechanism of the blockchain, which greatly improves the security effect of the blockchain.
[0024] refer to Figure 2 , in step S11, in the blockchain, a key is defined according to the user's password and a key derivation function; In the specific implementation process of the present invention, the specific steps may be: S111: Positioning blockchain; S112: Collect the user's password in the blockchain; S113: Associate the user's password and key derivation function; S114: Define corresponding keys based on multiple interactions of the user's password and key derivation functions.
[0025] In the embodiments of the present application, the blockchain is located and controlled. At the same time, the user's password is collected in the blockchain; the user's password and key derivation function are associated; the corresponding key is defined based on multiple interactions of the user's password and key derivation function, thereby realizing multiple interactions of the user's password and key derivation function and ensuring the accuracy of the key.
[0026] refer to Figure 3 In step S12, the corresponding private key is output based on the privacy control of the key, and the private key is encrypted for protection; In the specific implementation process of the present invention, the specific steps may be: S121: freeze key; S122: perform private control on the key; S123: Outputting the corresponding private key according to the privacy control of the key; S124: freeze private key; S125: Perform asymmetric encryption on the private key to encrypt and protect the private key.
[0027] In the embodiment of the present application, the key is fixed, the key is introduced, and the key is further controlled. At this time, the key is privately controlled; the corresponding private key is output according to the private control of the key, which is compatible with the private control of the key and ensures the accuracy of the private key.
[0028] Therefore, the private key is frozen; asymmetric encryption is performed on the private key to encrypt and protect the private key, thereby achieving encryption protection of the private key.
[0029] refer to Figure 4, in step S13, the private key is fragmented and a plurality of private key fragments are output; In the specific implementation process of the present invention, the specific steps may be: S131: freeze private key; S132: Associated private key and sharding mechanism; S133: triggering sharding of the private key according to the private key and the sharding mechanism, so as to perform sharding on the private key; S134: Output multiple private key fragments based on the fragmentation processing of the private key.
[0030] In the embodiments of the present application, the private key is frozen, and a private key and a sharding mechanism are introduced to perform overall control over the private key and the sharding mechanism.
[0031] Therefore, the private key and the sharding mechanism are associated; the sharding processing of the private key is triggered according to the private key and the sharding mechanism to shard the private key; multiple private key shards are output based on the sharding processing of the private key, the sharding processing of the private key is realized, and multiple private key shards are guaranteed to facilitate further control of multiple private key shards.
[0032] At this point, the private key sharding strategy covers RSA asymmetric encryption technology, specifically using a password-based symmetric encryption method to encrypt and protect the RSA private key. It also incorporates Pederson's verifiable sharding strategy and commitment value verification process to ensure the security and verifiability of private key sharding.
[0033] Optional, private key encryption phase based on asymmetric encryption technology RSA: 1) Key generation: Choose two different prime numbers p and q, calculate , where n is the modulus. Calculate the Euler function φ(n)=(p-1)*(q-1), and choose an integer e less than φ(n) such that (That is, e and φ(n) are relatively prime.) Calculate the modular inverse d of e with respect to φ(n), that is, find an integer d such that . The public key is (e, n) and the private key is (d, n).
[0034] 2) Encryption process: Convert the user's private key SK to a non-negative integer less than n. Calculate the ciphertext .
[0035] 3) Decryption process: Calculate the user private key using the RSA private key (d, n) .
[0036] RSA private key encryption phase based on password symmetric encryption The user needs to provide a memorable password. Here, a key derivation function (KDF) is used to extract the key from the password provided by the user, such as PBKDF2. PBKDF2 requires a hash function (such as SHA-256), a pseudo-random function (PRF, usually an instance of HMAC), a password, a salt value, the number of iterations, and an expected output key length. By increasing the number of iterations, PBKDF2 can make brute force password cracking more difficult because each attempt requires a lot of calculations. PBKDF2 strengthens the password through multiple iterations (that is, the set number of iterations). In each iteration, it uses the result of the previous iteration as input and combines the salt value and the password to calculate a new HMAC value. After a sufficient number of iterations, PBKDF2 will output a key.
[0037] The key extracted from the password is used to symmetric encrypt the RSA private key generated in the asymmetric encryption phase. This is used to protect the stored RSA private key that can decrypt the user's real private key. Since the key derivation function extracts the key from the password, the same key can be generated through the same salt value, password, and number of iterations. Therefore, the user only needs to remember and store the password.
[0038] Optionally, after the user joins the blockchain network and applies for a certificate and private key from the certificate authority (CA), the private key in the wallet is first extracted from the wallet and asymmetric encrypted based on RSA. Then, the asymmetric encrypted private key is split into n private key shards using Shamir's (t, n) threshold secret sharing scheme. The client constructs a t-1 order polynomial F(x), and the constant term of the polynomial is the secret S to be shared, as follows: The secret holder chooses n different non-zero integers x_1, x_2, …, x_n as the participant’s identifiers and calculates the corresponding y values: , thus obtaining n private key shards.
[0039] refer to Figure 5 , S14: triggering security verification of private key sharding according to private key sharding, verifiable sharding strategy and commitment value verification; In the specific implementation process of the present invention, the specific steps may be: S141: freeze private key shard; S142: Verify the sharding strategy and commitment value based on private key sharding association; S143: Perform preliminary processing on each private key shard and verifiable shard strategy, and output the processed features; S144: Perform secondary processing based on the processed features and commitment value verification, and trigger security verification of the private key shard.
[0040] In an embodiment of the present application, in a blockchain, a key is defined based on a user's password and a key derivation function; a corresponding private key is output based on the privacy management of the key, and the private key is encrypted for protection; the private key is sharded, and a plurality of private key shards are output; security verification of the private key shard is triggered based on the private key sharding, a verifiable sharding strategy, and a commitment value verification, thereby ensuring subsequent processing of the private key shards.
[0041] At this point, private key sharding is frozen and introduced, so that the verifiable sharding strategy and commitment value verification are associated with private key sharding, which is compatible with the overall control of private key sharding, verifiable sharding strategy and commitment value verification, and realizes the multi-dimensional control of private key sharding, verifiable sharding strategy and commitment value verification, ensuring the multiple processing of private key sharding.
[0042] Therefore, each private key shard and verifiable shard strategy is initially processed, and the processed features are output; secondary processing is performed based on the processed features and commitment value verification, and the security verification of the private key shard is triggered, ensuring the subsequent processing of the private key shard.
[0043] Optionally, the shadow private key is calculated using the Pedersen ((t, k)) threshold secret sharing technique for Shamir's (t, n) threshold secret sharing scheme to generate n private key fragments.
[0044] In order to generate a random number share associated with the secret, construct another t-1 order polynomial G(x), where the constant term T of the polynomial is a random number, as follows: For each participant P_i, its secret share S_i and the corresponding random value are obtained by calculating the value of the polynomial F(x) at x=i, as follows: At this time, the commitment value of the secret S and the random number T is made public , and the commitment values for the polynomial coefficients ,in , and then send the secret share and the corresponding commitment value to the peer nodes that have publicly disclosed their identities and participated in the blockchain network :
[0045] In elliptic curve cryptography, two specific points G and H are selected as generators, and the core formula of Pedersen commitment is: Where C is the generated commitment value, r is the blinding factor, and v is the original information. After receiving the secret share and the corresponding random value, the commitment is calculated Then verify it.
[0046] Participants can calculate the values of polynomials F(x) and G(x) at x=i through Lagrange interpolation, which is only used for verification and does not require the reconstruction of the complete polynomial. The commitment values of these polynomial coefficients are mainly used for higher-level verification. For example, when participants suspect the behavior of the secret distributor, they can use these commitment values to verify whether the construction of the polynomial is correct.
[0047] In the normal share verification process, the commitment values of these polynomial coefficients do not directly correspond to the share commitment values calculated by the participants. Instead, the Pedersen commitment formula is used to calculate the received share and random number: Participants compare their own calculated commitment values with the corresponding commitment values published by the secret distributor to verify the authenticity of the share.
[0048] refer to Figure 6 ,S15: collect transaction nodes in the blockchain and trigger the recovery of the private key according to the transaction nodes and a large number of private key shares; In the specific implementation process of the present invention, the specific steps may be: S151: Freeze Blockchain; S152: defining a node space based on the traversal of the blockchain; S153: Define a corresponding transaction node according to the node space and transaction information; S154: Collect transaction nodes in the blockchain; S155: associate the transaction node and a large number of private key shares; S156: Triggering recovery of the private key based on the transaction node and a large number of private key shares.
[0049] In an embodiment of the present application, the blockchain is frozen, and the blockchain is traversed, so that the node space is defined based on the traversal of the blockchain, and the node space is introduced to further control the node space.
[0050] Therefore, the corresponding transaction node is defined according to the node space and transaction information; the transaction nodes in the collected blockchain are associated with the transaction node and a large number of private key shares; the recovery of the private key is triggered based on the transaction node and a large number of private key shares, which is compatible with the overall consideration of the transaction node and a large number of private key shares, realizes the multi-dimensional control of the transaction node and a large number of private key shares, and realizes the recovery of the private key.
[0051] Optionally, the client node C1 sends a request RESTORE(ID, MSPID, AFFILIATION) to the node to collect the secret shares stored by at least k peer nodes ( ).
[0052] Network peer nodes Verify the client identity and send the locally stored private key share back to the client node C1 through the user identity index.
[0053] The client node C1 uses the Pedersen commitment calculation to verify whether the secret shares and random number shares collected are consistent with the public commitment value, thereby determining whether the secret shares provided by each peer node are valid.
[0054] When client node C1 collects a threshold number of private key shares When , the Lagrange interpolation method is used to reconstruct the key:
[0055] at this time, is the final interpolation function; is the function value at the ith point, is the Lagrange basis function; the numerator is ( ), which means the current independent variable x minus the x coordinates of all points except the i-th point; the denominator is ( ), which means the x-coordinate of the ith point minus the x-coordinates of other points; To recover the secret number ( ), we substitute (x=0) into the interpolation formula and obtain:
[0056] At this point, S is the secret value we want to recover; It is the share shared to each participant node; is the public value assigned to each participant node; k is the minimum number of people required to recover the secret; Use the key extracted from the user password to decrypt the key generated based on RSA to obtain the private key :
[0057] at this time, represents the key obtained after decryption (i.e., the private key); D represents the decryption function / operation; Ciphertext is the ciphertext (encrypted data); Is the private key used for decryption; Client nodes use private keys Decrypt the key reconstructed from the secret share to obtain the final user private key:
[0058] At this point, Su is the final user private key; D represents the decryption function / operation; S is the ciphertext part (the data to be decrypted); SRSA is the RSA private key obtained by decryption (obtained from the previous step); pub is the public key parameter.
[0059] After obtaining the user's final private key, the private key is used to sign the transactions generated by the user, and the subsequent process of the blockchain network transaction is executed. At the same time, the threshold of the Pedersen secret sharing scheme and the storage share of the peer node in the key recovery strategy are updated.
[0060] refer to Figure 7 ,S16: define the private key rotation mechanism of the blockchain according to the private key, the attack difficulty of the attacker and the update time, and dynamically rotate the private key according to the private key rotation mechanism of the blockchain; In the specific implementation process of the present invention, the specific steps may be: S161: monitor the blockchain in real time and collect corresponding attack information; S162: defining the difficulty of the attacker's attack based on each attack information and the protection level of the blockchain; S163: Multiple interactions on private keys, difficulty of attack by attackers, and update time; S164: Define the private key rotation mechanism of the blockchain based on multiple interactions of private keys, the difficulty of attack by attackers, and update time; S165: Private key rotation mechanism for associated blockchain; S166: Dynamically rotate the private key according to the private key rotation mechanism of the blockchain.
[0061] In the specific implementation process of the present invention, the transaction nodes in the blockchain are collected, and the recovery of the private key is triggered according to the transaction nodes and a large number of private key shares; the private key rotation mechanism of the blockchain is defined according to the private key, the attack difficulty of the attacker and the update time, and the private key is dynamically rotated according to the private key rotation mechanism of the blockchain, which greatly improves the security effect of the blockchain.
[0062] At this time, the blockchain is monitored in real time and the corresponding attack information is collected; the attack difficulty of the attacker is defined based on the various attack information and the protection level of the blockchain, which is compatible with the overall consideration of the protection level of each attack information and the blockchain, and realizes the multi-dimensional control of the protection level of each attack information and the blockchain, ensuring the accuracy of the attacker's attack difficulty.
[0063] Therefore, multiple interactions are performed on the private key, the difficulty of the attacker, and the update time; the private key rotation mechanism of the blockchain is defined based on the multiple interactions of the private key, the difficulty of the attacker, and the update time, which realizes the multiple interactions of the private key, the difficulty of the attacker, and the update time, and ensures the accuracy of the private key rotation mechanism of the blockchain.
[0064] Furthermore, the private key rotation mechanism of the associated blockchain is used to dynamically rotate the private key according to the private key rotation mechanism of the blockchain. At this time, the private key rotation mechanism of the blockchain is defined according to the private key, the difficulty of the attacker's attack and the update time, and the private key is dynamically rotated according to the private key rotation mechanism of the blockchain, which greatly improves the security effect of the blockchain.
[0065] Regular updates Regularly updating the threshold can make it more difficult for attackers to attack. Due to the change in the threshold, even if the attacker obtains some or all of the old shares, it is difficult for them to reconstruct the secret under the new threshold conditions. This effectively reduces the risk of long-term attacks because the attacker needs to constantly adapt to the new threshold and shares.
[0066] 1) Initial stage 1. Choose a random number generator that is cryptographically secure and can resist attacks such as prediction attacks and backtracking attacks, such as the crypto module. The randomBytes() method in this module is an encrypted random number generator based on an entropy pool, which ensures that the generated randomness meets encryption standards.
[0067] 2. Set a reasonable time interval for regularly updating secret shares and thresholds. This time interval should not be too frequent, nor should it reduce security due to sparsity.
[0068] 2) Regularly update the process 1. Start the timer and set a fixed time interval.
[0069] 2. When the timer reaches the set time interval, the random number generator is triggered to generate a new set of random numbers, which will be used to update the secret share and threshold.
[0070] 3. Use the newly generated random number to update the threshold. In the Pedersen secret sharing scheme, n represents the total number of participants, and t represents the minimum number of shares required to reconstruct the secret.
[0071] t should be large enough to make it difficult for an attacker to collect enough shares to reconstruct the secret. If t is too small, it may be easier for an attacker to crack the secret by collecting a small number of shares. At the same time, t cannot be too large, so that the secret cannot be reconstructed when some participants cannot provide their shares. In this study, when setting the initial threshold t, an integer value greater than n / 2 and less than 2n / 3 is selected to ensure the rationality of the key.
[0072] 4. Randomly select new coefficients to construct a polynomial, use the Pedersen secret sharing scheme to split the private key to obtain the secret share, and calculate the Pedersen commitment value for the secret share and distribute it to the participant nodes with legitimate identities.
[0073] 5. After updating the secret share and threshold, restart the timer to trigger the update process again when the next time interval arrives.
[0074] 2. Emergency Update The consortium chain has the characteristics of partial decentralization, with a limited number of nodes and requires identity verification to join. It is a typical permissioned chain. Compared with the public chain, the transaction speed of the consortium chain is faster. Therefore, if the secret shares stored by the participant nodes are not updated in real time, the following problems will occur: a. Increased risk of single point failures causes loss of secret shares. The consortium chain has strong controllability. Data is not publicly accessible by default. Only users with identity certificates have access rights, and channel permissions are strictly divided. However, this controllability means an increase in the risk of single point failures. If there is a problem with the control node, it may affect the security of the entire network. If some nodes fail, the secret shares stored in the node may not be obtained by the requesting node, and the threshold number required by the Pedersen secret sharing scheme is not reached, resulting in the inability to reconstruct the private key.
[0075] b. It is vulnerable to collusion attacks by malicious nodes, resulting in a large number of private key shares being leaked. A collusion attack refers to multiple malicious nodes joining together to try to undermine the integrity, security, and availability of the network. Because the nodes of the alliance chain are usually pre-selected and limited in number, this increases the possibility of collusion. In this solution, if some nodes act in concert and tamper with the secret shares stored locally on the node, the user will not be able to request the correct secret share and cannot reconstruct the key. For incorrect secret shares, the client node needs to re-request again, resulting in a waste of data interaction resources.
[0076] 1) Initial stage 1. Determine the nodes and secret shares that need to be updated.
[0077] 2. Prepare the parameters of the new Pedersen secret sharing scheme, including the new random polynomial, new secret share, etc.
[0078] 2) Emergency update process 1. Stop node services: First, you need to stop the services of the nodes that need to be updated to ensure data consistency during the update process.
[0079] 2. Secret share revocation and update: a. The client node first publishes a new random polynomial and generates a new secret share based on this polynomial.
[0080] b. Send the new secret shares to the participant nodes that need to be updated.
[0081] c. After receiving the new secret share, the participant node uses the commitment value of the Pedersen secret sharing scheme to confirm the validity of the share.
[0082] 3. Node configuration update: After verifying that the new secret share is valid, the node replaces the original secret share with it and updates the relevant configuration of the node to ensure that the new secret share is used correctly.
[0083] 4. Restart the node service: After completing the above update operations, restart the node service to rejoin the alliance chain network.
[0084] 3. Random updates With fixed updates in the event dimension, due to the fixed time interval, in a network with a gradually increasing user scale, as the number of transactions increases, attackers may take advantage of the fixed time interval update feature and send a large number of false update requests when the update cycle is about to start, causing the update of normal nodes to be delayed. In this way, attackers have the opportunity to obtain and use old secret shares for malicious operations before the system is updated. Secondly, if the attacker intercepts the previous valid update information and replays this information in the next update cycle, the system may not be able to recognize this attack and mistakenly accept the outdated update. Therefore, random updates based on fixed time intervals are an important means to prevent such attacks.
[0085] 1) Initial stage 1. Get the current timestamp based on the Unix timestamp and use this timestamp as the seed for the random number generator in the next step.
[0086] 2. Use the hash function SHA-256 to convert the input timestamp into a hash value of fixed length.
[0087] 3. Use the hash value generated in the previous step as the seed of the random number generator (RNG) to generate a random number. This random number can represent a certain period of time from the current time point, thereby determining the specific update time point.
[0088] 4. Select a random number r as a blinding factor or transformation parameter through a random number generator.
[0089] 2) Random update process Since Pedersen commitment has the property of additive homomorphism, that is, for two secrets a and b, their commitments can be added to get the commitment of a+b. Using this property, the secret shares stored locally by the participant nodes can be randomly transformed:
[0090] This results in a new, randomly transformed secret share As the secret share changes, the corresponding Pedersen commitment value should also be updated. The new commitment value is calculated with the original public commitment parameters (generators g, h) for subsequent validity verification.
[0091] In an embodiment of the present invention, through the method in the embodiment of the present invention, in the blockchain, the key is defined according to the user's password and key derivation function; the corresponding private key is output based on the privacy management of the key, and the private key is encrypted for protection; the private key is sharded, and multiple private key shards are output; the security verification of the private key shard is triggered according to the private key sharding, the verifiable sharding strategy and the commitment value verification, thereby ensuring the subsequent processing of the private key sharding.
[0092] Furthermore, the transaction nodes in the blockchain are collected, and the recovery of the private key is triggered based on the transaction nodes and a large number of private key shares. The private key rotation mechanism of the blockchain is defined based on the private key, the attack difficulty of the attacker, and the update time. The private key is dynamically rotated according to the private key rotation mechanism of the blockchain, which greatly improves the security effect of the blockchain.
[0093] The scheme is divided into three stages of distribution, recovery and update in terms of private key protection. The user's private key is encrypted and cut and distributed to the peer nodes of the blockchain network. When used, it is restored and signed using the reconstruction scheme. At the same time, the private key shards are protected to a certain extent through multiple update strategies. In terms of public key rotation, the public key is bound to the user's unique ID using an infinite one-way hash chain to ensure the security of user assets during the key rotation stage and effectively prevent the ID from being stolen.
[0094] This section conducts experimental analysis on the security of the key rotation scheme, the impact of the number of shards and reconstruction threshold on execution efficiency, and the impact of key length on sharding, verification and reconstruction performance. First, the experimental environment and related parameter settings are introduced.
[0095] Experimental environment This paper improves Fabric-CA based on GO language, and implements private key sharding, commitment and reconstruction services through NodeJS language and connects Fabric SDK to simulate the actual application environment. The experiment uses a server with a 4-core CPU, 16G running memory, and an operating system of Ubuntu Linux (64-bit). The prototype system is developed and implemented using IntelliJIDEA2023.1 version programming software, and the perf_hooks component and postman test tool are used for relevant performance testing and analysis, as shown in Table 1.
[0096] Table 1 Experimental environment Security Analysis
[0097] Assuming that an attacker attacks and obtains the private key shares stored in the blockchain network nodes through certain means, the problems he needs to face are as follows: 1) The attacker obtains part of the private key share of a blockchain user through attack means, but the threshold of the Pedersen secret sharing scheme is not a public number, and when the threshold is updated through an emergency update, the attacker may not be able to obtain the required threshold number of private key shares and thus cannot reconstruct the key.
[0098] 2) The attacker obtains the real threshold number through the attack. He must obtain the corresponding number of private key shares within the effective time. Otherwise, the fixed time interval update and random update of this scheme may overwrite the old private key shares stored in the node, causing the attacker to obtain the secret shares constructed by different polynomials and unable to reconstruct the key.
[0099] 3) The attacker knows the real threshold number and obtains enough private key shares to reconstruct the key. However, the user private key of this scheme is asymmetric encrypted based on RSA. The attacker also needs to attack the asymmetric encrypted master key, otherwise the real private key cannot be recovered.
[0100] 4) The attacker knows the real threshold number and obtains enough private key shares to reconstruct the key. At the same time, the attacker steals the user's asymmetric private key, but the user's asymmetric private key is encrypted by the key generated by the user's own mnemonic password. The attacker needs to obtain a series of parameters such as the user's password, encryption function, salt value, and number of iterations to decrypt the attribute private key, otherwise the real private key cannot be restored.
[0101] Assuming that an attacker steals the ID value of the blockchain network node communication and the identity entry on the chain through certain means, the problem he needs to face is that the attacker obtains the current element value of the current identity entry of a blockchain user through the attack method in order to obtain the next element value for ID stealing. However, the element of the hash chain is the value obtained by hashing the next element. A key feature of the hash function is its unidirectionality, that is, the hash value cannot be reversed to the original input. Therefore, the attacker cannot steal the ID by taking the attack method of obtaining elements through hash collision.
[0102] This article classifies the various methods of current alliance chains in key storage and wallet management, which are mainly divided into the following three types: Common method: This method is based on blockchain software, and its key certificates are hosted by a third party or stored on a distributed server. However, this method has poor security performance in the private key protection link and weak anti-attack capabilities against malicious nodes. In the alliance chain environment (such as Hyperledger Fabric), it does not provide the ability to regularly rotate keys and recover assets after key loss. Once the key is lost, it means that the unique ID under the account will be unusable. Therefore, the ID anti-theft performance of this method is relatively weak.
[0103] Trustzone solution: This solution proposes a secure and lightweight wallet based on blockchain, and designs the unspent transaction output set (UTXO) and transaction signature verification mechanism under the blockchain. It implements the protection mechanism of private keys and wallet addresses, and effectively solves the problem that user information may be stolen or replaced. However, this solution does not provide the function of regular rotation and update of keys. The loss or forgetting of private keys and wallets still leads to the inability to retrieve user information, and the proportion of actual cases continues to change. Therefore, this solution does not completely solve the problem of forgotten and lost keys.
[0104] Key rotation scheme: This scheme shards and encrypts the private key, verifies it with a commitment value and stores it on the blockchain node. The method of reconstructing the key by setting a certain threshold has a high value in terms of key security. At the same time, the public key and ID are bound and rotated multiple times in combination with a one-way hash chain, which not only solves the problem of asset freezing caused by key forgetting or loss, but also performs well in ID theft prevention.
[0105] See also Figure 8 , Figure 8 It is a schematic diagram of the structural composition of a blockchain-based private key rotation system in an embodiment of the present invention.
[0106] like Figure 8 As shown, a private key rotation system based on blockchain, the private key rotation system based on blockchain includes: A key module 21, used to define a key in the blockchain according to a user's password and a key derivation function; The encryption protection module 22 is used to output the corresponding private key based on the privacy management of the key and encrypt and protect the private key; A sharding module 23, used for sharding the private key and outputting a plurality of private key shards; A security verification module 24, used to trigger security verification of private key sharding according to private key sharding, verifiable sharding strategy and commitment value verification; The recovery module 25 is used to collect transaction nodes in the blockchain and trigger the recovery of private keys based on the transaction nodes and a large number of private key shares; The dynamic rotation module 26 is used to define the private key rotation mechanism of the blockchain according to the private key, the attack difficulty of the attacker and the update time, and dynamically rotate the private key according to the private key rotation mechanism of the blockchain.
[0107] See also Fig. 9 , refer to the following Fig. 9 The electronic device 40 according to this embodiment of the present invention will be described. Fig. 9 The electronic device 40 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0108] like Fig. 9 As shown, the electronic device 40 is in the form of a general computing device. The components of the electronic device 40 may include but are not limited to: at least one processing unit 41, at least one storage unit 42, and a bus 43 connecting different system components (including the storage unit 42 and the processing unit 41).
[0109] The storage unit stores program codes, which can be executed by the processing unit 41, so that the processing unit 41 executes the steps according to various exemplary embodiments of the present invention described in the above “Embodiment Method” section of this specification.
[0110] The storage unit 42 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 421 and / or a cache memory unit 422 , and may further include a read-only memory unit (ROM) 423 .
[0111] The storage unit 42 may also include a utility 424 having a set (at least one) of program modules 425, such program modules 425 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.
[0112] Bus 43 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0113] The electronic device 40 may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 40, and / or any device that enables the electronic device 40 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 44. Furthermore, the electronic device 40 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 45. Fig. 9 As shown, the network adapter 45 communicates with other modules of the electronic device 40 via the bus 43. It should be understood that although Fig. 9 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 40, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup planning systems.
[0114] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0115] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium can include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. In addition, it stores computer program instructions, and when the computer program instructions are executed by a computer, the computer executes the above method.
[0116] In addition, the blockchain-based private key rotation method and system provided in the embodiments of the present invention are introduced in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A private key rotation method based on blockchain, characterized in that: Applied to blockchain-based private key rotation scenarios; The blockchain-based private key rotation method comprises: In the blockchain, keys are defined based on the user’s password and key derivation function; Output the corresponding private key based on the private control of the key, and encrypt and protect the private key; Shard the private key and output multiple private key shards; Trigger security verification of private key sharding based on private key sharding, verifiable sharding strategy, and commitment value verification; Collect transaction nodes in the blockchain and trigger private key recovery based on the transaction nodes and a large number of private key shares; The private key rotation mechanism of the blockchain is defined according to the private key, the difficulty of the attacker's attack, and the update time, and the private key is dynamically rotated according to the private key rotation mechanism of the blockchain.
2. The blockchain-based private key rotation method according to claim 1, characterized in that: In the blockchain, the key is defined according to the user's password and the key derivation function, including: Positioning blockchain; In the blockchain, collect the user's password; Associate the user's password and key derivation function; The corresponding key is defined based on multiple interactions of the user's password and the key derivation function.
3. The method for rotating private keys based on blockchain according to claim 1, characterized in that: The outputting of the corresponding private key based on the privacy control of the key and encrypting and protecting the private key include: freeze key; Privately manage keys; Output the corresponding private key according to the privacy control of the key; Freeze private key; Asymmetric encryption is performed on the private key to encrypt and protect the private key.
4. The method for rotating private keys based on blockchain according to claim 3, characterized in that: The sharding of the private key and outputting of multiple private key shards include: Freeze private key; Associated private keys and sharding mechanisms; Trigger the sharding of the private key according to the private key and the sharding mechanism to shard the private key; Based on the sharding process of the private key, a plurality of private key shards are output.
5. The blockchain-based private key rotation method according to claim 4, characterized in that: The security verification of triggering private key sharding according to private key sharding, verifiable sharding strategy and commitment value verification includes: Freeze private key sharding; Sharding based on private key can verify sharding strategy and commitment value verification; Perform preliminary processing on each private key shard and verifiable shard strategy, and output the processed features; Secondary processing is performed based on the processed features and commitment value verification, and security verification of private key sharding is triggered.
6. The method for rotating private keys based on blockchain according to claim 5, characterized in that: The collecting of transaction nodes in the blockchain and triggering the recovery of private keys according to the transaction nodes and a large number of private key shares include: Freeze-frame blockchain; Define the node space based on the traversal of the blockchain; The corresponding transaction node is defined according to the node space and transaction information.
7. The blockchain-based private key rotation method according to claim 6, characterized in that: The collecting of transaction nodes in the blockchain and triggering recovery of private keys according to the transaction nodes and a large number of private key shares also includes: Collect transaction nodes in the blockchain; Associate this transaction node, a large number of private key shares; Based on this transaction node, a large number of private key shares trigger the recovery of the private key.
8. The blockchain-based private key rotation method according to claim 7, characterized in that: The private key rotation mechanism of the blockchain is defined according to the private key, the difficulty of the attacker's attack, and the update time, and the private key is dynamically rotated according to the private key rotation mechanism of the blockchain, including: Monitor the blockchain in real time and collect corresponding attack information; The difficulty of the attacker's attack is defined based on the attack information and the protection level of the blockchain.
9. The blockchain-based private key rotation method according to claim 8, characterized in that: The method further includes defining a private key rotation mechanism of the blockchain according to the private key, the difficulty of the attacker's attack, and the update time, and dynamically rotating the private key according to the private key rotation mechanism of the blockchain, and further includes: Multiple interactions on private keys, difficulty of attack for attackers, and update time; Define the blockchain's private key rotation mechanism based on multiple interactions of private keys, difficulty of attack by attackers, and update time; The private key rotation mechanism of the associated blockchain; The private keys are dynamically rotated according to the private key rotation mechanism of the blockchain.
10. A private key rotation system based on blockchain, characterized in that: The blockchain-based private key rotation system is applied to the blockchain-based private key rotation method as described in any one of claims 1 to 9, and the blockchain-based private key rotation system includes: The key module is used to define the key in the blockchain based on the user's password and key derivation function; An encryption protection module, used to output the corresponding private key based on the privacy control of the key, and encrypt and protect the private key; Sharding module, used to shard the private key and output multiple private key shards; A security verification module, used to trigger the security verification of private key sharding according to private key sharding, verifiable sharding strategy and commitment value verification; The recovery module is used to collect transaction nodes in the blockchain and trigger the recovery of private keys based on the transaction nodes and a large number of private key shares; The dynamic rotation module is used to define the private key rotation mechanism of the blockchain according to the private key, the difficulty of the attacker's attack and the update time, and dynamically rotate the private key according to the private key rotation mechanism of the blockchain.
Citation Information
Patent Citations
Block chain key trusteeship and recovery method and device based on secrecy sharing technology
CN107623569A
Pedersen secret sharing multi-party aggregation access control method based on block chain
CN115733607A
Secure multi-party computing collusion attack defending method based on alliance chain
CN116980117A
Transaction signature method and device based on block chain, and electronic equipment
CN118449686A
Distributed key updating and recovering mechanism using method for security of Internet of Things
CN118802139A