A method for generating and storing user private keys based on alliance chain

By adopting multi-party encryption on the alliance chain, segmenting and encrypting mnemonics and combining user passwords to encrypt private keys, the problem of insufficient security of user private keys and mnemonics is solved, and a high-security private key management and acquisition process is realized.

CN115622692BActive Publication Date: 2025-08-29ZHONGNONG RONGXIN (BEIJING) TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211095948.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-08
Publication Date
2025-08-29
Estimated Expiration
2042-09-08

AI Technical Summary

Technical Problem

In the prior art, there is a problem of insufficient security in the generation and storage of user private keys, especially when the user saves it on his own, it is easy to lose or steal it. There is a risk of unauthorized use when stewarded by a third-party organization. At the same time, the storage method of mnemonic words is easily lost and the security is not high.

Method used

The alliance chain is used for multi-party encryption. By dividing the mnemonic words into multiple parts, encrypted by the public keys of different organizations, and saved on the alliance chain. The user's private key is encrypted and then turned on the link. When obtaining, multiple parties need to decrypt and cooperate to ensure security and reliability.

Benefits of technology

It improves the security of mnemonic words and private keys, avoids the risk of cracking a single node, solves the problem that users cannot obtain mnemonic words because they forget their passwords, and realizes high security and reliable private key management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115622692B_ABST
    Figure CN115622692B_ABST
Patent Text Reader

Abstract

The present invention provides a method for generating and storing user private keys based on a consortium chain, including: storing user private keys in two situations: when the user already has a private key and when the user does not have a private key; when the user already has a private key, the user imports the private key and mnemonic phrase and requests storage; the user is required to enter a password, which is used to encrypt the private key to generate a data packet; and the data packet is uploaded to the chain; when the user does not have a private key, a second mnemonic phrase is generated; a second private key is derived from the second mnemonic phrase; the user is required to enter a password, which is used to encrypt a second data packet generated by the second private key; and the second data packet is uploaded to the chain. Because a consortium chain is composed of mutually trusting members, the possibility of multiple nodes acting maliciously simultaneously is almost zero, ensuring the security of the mnemonic phrase while avoiding the problem of users being unable to access the mnemonic phrase due to forgetting their password.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of digital encryption, and in particular to a method for generating and storing user private keys based on an alliance chain. Background Art

[0002] Currently, after a user's private key is generated, it is typically stored by the user or entrusted to a third-party for safekeeping. While proper user storage offers the highest level of security, it also comes with significant drawbacks: loss is easily fatal. While third-party custody is less prone to loss, it is also less secure, with the risk of unauthorized use by the third party.

[0003] In the blockchain world, as long as the private key is retained, the account can be unlocked. However, generally speaking, the private key is composed of a 64-bit string. If we want to create 100 accounts, we have to remember 100 private keys. The recording and preservation costs are very high. Moreover, in the process of recording a large number of private keys, there may be problems with the address and private key not matching, or careless writing of the wrong letter when recording, etc. In short, the probability of error is very high. Due to the characteristics of digital currency that only recognizes private keys and not people, these small errors may make it very likely that assets cannot be recovered.

[0004] To address these issues, the BIP39 protocol was proposed. The core of the BIP39 protocol is that accounts are identified by 12 or 24 words (called mnemonics). These words generate a large seed, a number selected from 2 to the power of 256. Because the randomly generated number is large, there is no need to worry about repeated words.

[0005] The accounts generated by these words are fixed, and with these words, countless private keys, public keys, and addresses can be created. By simply remembering these words, we indirectly remember all the assets on the blockchain, just as conveniently and efficiently as real-life ID cards.

[0006] Under this premise, the security of mnemonics becomes crucial. Mnemonics are commonly stored locally or online, but these two methods are prone to loss and theft, making them less secure. To ensure the security of mnemonics, the current solution is to store them on a consortium blockchain. Once the data is on-chain, it cannot be lost or stolen, greatly improving the security of mnemonics.

[0007] The existing storage method is that the user first encrypts the mnemonic with a password, then re-encrypts it using symmetric encryption, and then stores it on the blockchain. However, the drawback of this existing method is that once the user's password is lost, the mnemonic cannot be retrieved. Summary of the Invention

[0008] In view of the above problems, the present invention is proposed to provide a user private key generation and storage method based on a consortium chain that overcomes the above problems or at least partially solves the above problems.

[0009] According to one aspect of the present invention, a method for generating and storing a user private key based on a consortium chain is provided, including: a method for storing a user private key including two cases: a case where the user already has a private key and a case where the user does not have a private key;

[0010] When the user already has a private key, the user imports the private key and mnemonic phrase and requests to store them;

[0011] Require the user to enter a password, and use the password to encrypt the private key to generate a data packet;

[0012] Uploading the data packet to the chain;

[0013] When the user does not have a private key, a second mnemonic is generated;

[0014] Derived a second private key based on the second mnemonic;

[0015] Require the user to enter a password, and use the password to encrypt a second data packet generated by the second private key;

[0016] The second data packet is uploaded to the link.

[0017] Optionally, when the user already has a private key, the storage method further includes: if the user has not imported the mnemonic, generating a private key mnemonic for the private key;

[0018] Encrypting a private key using the private key mnemonic to generate a private key data packet;

[0019] Put the private key data package on the chain.

[0020] Optionally, the mnemonic is encrypted on-chain by multiple parties, specifically including:

[0021] Cross-segmentation of mnemonics increases the difficulty of cracking a single node;

[0022] Cross-split to form a Metadata array and save it to the organization information item;

[0023] Each organization encrypts its own segmented words using its public key Pk to obtain the Data array;

[0024] Save the Data array to the encrypted data item;

[0025] Encode the mnemonic information in JSON, because JSON and structure can be converted to each other, and then encode the JSON in base64;

[0026] Base64 encoding generates data packets;

[0027] Data packets are uploaded to the chain.

[0028] Optionally, the generating and storing method further includes:

[0029] The user requests to obtain personal private key;

[0030] Return data packet;

[0031] The user is required to enter a password and obtain the private key after decryption;

[0032] If the user forgets the password, he / she can request the mnemonic and the mnemonic data packet will be returned.

[0033] The present invention provides a method for generating and storing user private keys based on a consortium chain, including: storing user private keys in two situations: when the user already has a private key and when the user does not have a private key; when the user already has a private key, the user imports the private key and mnemonic phrase and requests storage; the user is required to enter a password, which is used to encrypt the private key to generate a data packet; and the data packet is uploaded to the chain; when the user does not have a private key, a second mnemonic phrase is generated; a second private key is derived from the second mnemonic phrase; the user is required to enter a password, which is used to encrypt a second data packet generated by the second private key; and the second data packet is uploaded to the chain. Because a consortium chain is composed of mutually trusting members, the possibility of multiple nodes acting maliciously simultaneously is almost zero, ensuring the security of the mnemonic phrase while avoiding the problem of users being unable to access the mnemonic phrase due to forgetting their password.

[0034] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 any creative work.

[0036] Figure 1 A flowchart of storing a private key provided by an embodiment of the present invention;

[0037] Figure 2 A flowchart of obtaining a private key provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0038] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0039] The terms "comprises" and "comprising" and any variations thereof in the description, embodiments, claims and drawings of the present invention are intended to cover non-exclusive inclusions, for example, including a series of steps or units.

[0040] The technical solution of the present invention is further described in detail below with reference to the accompanying drawings and embodiments.

[0041] This invention uses a consortium chain to store private keys. Instead of using a user password to encrypt the mnemonic, the storage method uses segmented encryption across multiple nodes within the consortium chain. Twelve words are divided into four parts, each encrypted by four nodes. To retrieve the mnemonic, four nodes are also required to decrypt each part separately. After decryption, the four parts are concatenated to obtain the mnemonic. Because the consortium chain is composed of mutually trusting members, the possibility of multiple nodes acting maliciously simultaneously is virtually zero. This ensures the security of the mnemonic and avoids the problem of users being unable to retrieve the mnemonic due to forgetting their passwords.

[0042] Principle: password encryption + multi-party encryption.

[0043] The private key is encrypted (symmetrically) using a password and stored on the blockchain. The encryption / decryption process is performed in the user's APP.

[0044] Multiple members use their respective public keys to encrypt the mnemonic (asymmetric) and save it on the blockchain. The encryption process is performed in the personal APP, but the decryption process is performed separately at the member nodes.

[0045] Principles: 1. The private key is encrypted (symmetric) using a password and stored on the blockchain. 2. The mnemonic is encrypted (asymmetric) by multiple parties and stored on the blockchain. 3. If the mnemonic cannot be used to derive the private key, the private key is encrypted (symmetric) again using the mnemonic and stored on the blockchain.

[0046] There are two situations where the mnemonic cannot be used to derive the private key: 1. The user imports both the private key and the mnemonic. 2. The user only imports the private key and generates a new mnemonic.

[0047] The process of storing the private key of the present invention is as follows: Figure 1 As shown, the user already has a private key

[0048] The user only imports the private key (and mnemonic, optional) through the APP and requires storage.

[0049] The user is required to enter a password and the private key is encrypted using the password (symmetric) to generate a data packet.

[0050] Data packets are uploaded to the blockchain. KEY: "PW_" + ID card.

[0051] If the user has not imported a mnemonic, generate a mnemonic for the private key.

[0052] Generate another data packet using the mnemonic (symmetric) encrypted private key

[0053] Another data packet is uploaded to the blockchain. KEY: "MN_" + ID.

[0054] A~H, the mnemonic words are encrypted on the chain by multiple parties.

[0055] Situations where the user does not have the private key include:

[0056] Generate mnemonics; derive private keys from mnemonics;

[0057] The user is required to enter a password and the private key is encrypted using the password (symmetric) to generate a data packet.

[0058] Data packets are uploaded to the blockchain. KEY: "PW_" + ID card.

[0059] A~H, the mnemonic words are encrypted on the chain by multiple parties.

[0060] A~H multi-party encryption on-chain process:

[0061] Cross-segmenting the mnemonics increases the difficulty of cracking a single node. Assume there are 12 mnemonics: torch saladozone describe craft salute nut school umbrella engine obscure assault

[0062] There is information about four organizations: org1 org2 org3 org4, including the public key Pk.

[0063] organize word Serial number org1 torch craft umbrella 1,5,9 org2 salad salute engine 2,6,10 org3 ozone nut obscure 3,7,11 org4 describe school assault 4,8,12

[0064] The cross-segmentation forms a Metadata array and is saved to the organization information item.

[0065] Each organization encrypts its own segmented word using its public key Pk. org1 is stored in Data[0], the corresponding org2 is stored in Data[1], org3 is stored in Data[2], and org4 is stored in Data[3]. The Data array is stored in the encrypted data item.

[0066] Encode the mnemonic information in JSON, as JSON and structure can be converted to each other, and then encode the JSON in Base64. The Base64 encoding generates a data package.

[0067] Data packets are uploaded to the blockchain. KEY: "MP_" + ID.

[0068] The private key storage process is carried out on the user's mobile phone, ensuring that only the user himself or the selected organization agrees to obtain the private key.

[0069] The process of obtaining the private key is as follows Figure 2 As shown, the user requests to obtain the personal private key. KEY: "PW_" + ID card ID.

[0070] Returns the data packet.

[0071] The user is asked to enter a password. After decryption (symmetric), the private key is obtained.

[0072] If the user forgets the password, he / she can request the mnemonic and the mnemonic data packet will be returned.

[0073] Unpack to obtain base64 encoding.

[0074] The base64 encoding is converted to JSON encoding and then converted into a mnemonic information structure.

[0075] Get access to encrypted data and organizational information.

[0076] Multi-party decryption. The decryption process occurs not on the user's phone, but on each consortium chain node. The node performs a security check on the decrypted data to see if it complies with the BIP39 protocol format, preventing malicious users from transmitting private data that their node can decrypt. If the check passes, each part is encrypted using the private key and returned to the user's phone.

[0077] The decrypted results are assembled to obtain the four-part mnemonic phrase. These four parts are then restored. The complete mnemonic phrase is returned. If the mnemonic phrase can be used to derive the private key, the private key is generated and the process ends.

[0078] If the mnemonic cannot be used to derive the private key, use the key "MN_" + ID to retrieve the data packet. The data packet is returned. The mnemonic is decrypted (symmetrically) to obtain the private key, and the process ends.

[0079] Beneficial effect: Because the consortium chain is composed of members who trust each other, the possibility of multiple nodes acting maliciously at the same time is almost zero, which not only ensures the security of the mnemonic words, but also avoids the problem of users being unable to obtain the mnemonic words due to forgetting the password.

[0080] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for generating and storing user private keys based on a consortium chain, characterized in that: The generation and storage method includes: a user private key storage method including two cases where the user already has a private key and the user does not have a private key; When the user already has a private key, the user imports the private key and mnemonic phrase and requests to store them; Require the user to enter a password, and use the password to encrypt the private key to generate a data packet; Uploading the data packet to the chain; When the user already has a private key, the storage method further includes: if the user has not imported the mnemonic, generating a private key mnemonic for the private key; Encrypting a private key using the private key mnemonic to generate a private key data packet; Put the private key data packet on the chain; When the user does not have a private key, a second mnemonic is generated; Derived a second private key according to the second mnemonic; Require the user to enter a password, and use the password to encrypt a second data packet generated by the second private key; Uploading the second data packet to the link; The mnemonics are encrypted on-chain by multiple parties, specifically including: Cross-segmentation of mnemonics increases the difficulty of cracking a single node; Cross-split to form a Metadata array and save it to the organization information item; Each organization encrypts its own segmented words using its public key Pk to obtain the Data array; Save the Data array to the encrypted data item; Encode the mnemonic information in JSON, because JSON and structure can be converted to each other, and then encode the JSON in base64; Base64 encoding generates data packets; Data packets are uploaded to the chain.

2. A method for generating and storing user private keys based on a consortium chain according to claim 1, characterized in that: The generating and storing method further comprises: The user requests to obtain personal private key; Return data packet; The user is required to enter a password and obtain the private key after decryption; If the user forgets the password, he / she can request the mnemonic and the mnemonic data packet will be returned.

Citation Information

Patent Citations

  • Blockchain biological fingerprint identification method and system

    CN112688994A