CN109146481B - Method, medium and device for automatically importing account private key of blockchain wallet and blockchain system - Google Patents

Method, medium and device for automatically importing account private key of blockchain wallet and blockchain system Download PDF

Info

Publication number
CN109146481B
CN109146481B CN201810967546.2A CN201810967546A CN109146481B CN 109146481 B CN109146481 B CN 109146481B CN 201810967546 A CN201810967546 A CN 201810967546A CN 109146481 B CN109146481 B CN 109146481B
Authority
CN
China
Prior art keywords
wallet
private key
account
user side
key
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810967546.2A
Other languages
Chinese (zh)
Other versions
CN109146481A (en
Inventor
吴胜文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ke'an Xiamen Technology Co ltd
Original Assignee
Tailian Xiamen Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tailian Xiamen Technology Co ltd filed Critical Tailian Xiamen Technology Co ltd
Priority to CN201810967546.2A priority Critical patent/CN109146481B/en
Publication of CN109146481A publication Critical patent/CN109146481A/en
Application granted granted Critical
Publication of CN109146481B publication Critical patent/CN109146481B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/36Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes
    • G06Q20/367Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes involving electronic purses or money safes
    • G06Q20/3674Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes involving electronic purses or money safes involving authentication

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Engineering & Computer Science (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Security & Cryptography (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention discloses an account private key automatic importing method, medium and device of a block chain wallet and a block chain system, wherein the method comprises the following steps: when a block chain wallet program is run; receiving a wallet private key, signing an inquiry task according to the wallet private key, acquiring a wallet public key according to the wallet private key, sending the signed inquiry task and the wallet public key to a block chain system, acquiring a wallet address according to the wallet public key when the task is a wallet searching task, and searching an account encryption private key table stored in the system according to the wallet address to obtain all account encryption private keys corresponding to the wallet address; broadcasting all account encryption private keys corresponding to the wallet addresses so as to send all account encryption private keys corresponding to the wallet addresses to the user side; therefore, the private key of the user of the block chain system is automatically imported, and the convenience of using the block chain system by the user of the block chain system is improved; meanwhile, information leakage caused by private key storage of a user of the block chain system is avoided.

Description

Method, medium and device for automatically importing account private key of blockchain wallet and blockchain system
Technical Field
The invention relates to the technical field of a block chain, in particular to an account private key automatic importing method, medium, device and block chain system of a block chain wallet.
Background
The block chain is a technical scheme for maintaining a reliable database in a decentralized and distrust-free mode, and is widely applied due to the decentralized and distrust-free mode and the characteristic that data is difficult to tamper.
In the existing blockchain system, one wallet can not be used at multiple places, namely when private keys on the wallet need to be used by other terminals after the wallet is created locally and a plurality of private keys of personal accounts are imported, the private keys corresponding to the personal accounts need to be imported again; in such a way, the user often needs to additionally store the private key, so that the safety of the block chain system is reduced; and at the same time, makes it extremely inconvenient for the user to use the private key.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the art described above. Therefore, one objective of the present invention is to provide an automatic importing method for an account private key of a blockchain wallet, which can automatically import a private key of a user of a blockchain system, and improve convenience of the user of the blockchain system in using the blockchain system; meanwhile, information leakage caused by private key storage of a user of the block chain system is avoided.
A second object of the invention is to propose a computer-readable storage medium.
The third purpose of the invention is to provide an automatic account private key importing device for a blockchain wallet.
A fourth objective of the present invention is to provide a block chain system.
In order to achieve the above object, an embodiment of a first aspect of the present invention provides an automatic importing method of an account private key of a blockchain wallet, including the following steps: when any user terminal runs the block chain wallet program, establishing a connection relation between the user terminal and any node in the block chain system; receiving a wallet private key through the user side, signing an inquiry task according to the wallet private key, acquiring a wallet public key according to the wallet private key, and sending the signed inquiry task and the wallet public key to the block chain system through the connection relation between the user side and any one node; analyzing the signed inquiry task by adopting the wallet public key to acquire that the inquiry task is a wallet searching task, acquiring a wallet address according to the wallet public key, and searching an account encryption private key table stored in the block chain system according to the wallet address to acquire all account encryption private keys corresponding to the wallet address, wherein each account encryption private key is obtained by encrypting each account private key by the wallet private key; broadcasting all account encryption private keys corresponding to the wallet addresses in the blockchain system so as to send all account encryption private keys corresponding to the wallet addresses to the user side through the connection relationship between the user side and any one node; and at the user side, decrypting each account encryption private key by using the wallet private key to obtain all account private keys, and storing all account private keys to realize that all account private keys are led into the user side from the initial user side.
According to the method for automatically importing the account private key of the block chain wallet, firstly, when a block chain wallet program is operated by any user side, a connection relation between the user side and any node in a block chain system is established; then, receiving the wallet private key through the user side, signing the inquiry task according to the wallet private key, acquiring the wallet public key according to the wallet private key, and sending the signed inquiry task and the wallet public key to the block chain system through the connection relation between the user side and any one node; then, when the signed inquiry task is analyzed by adopting the wallet public key to know that the inquiry task is a wallet searching task, acquiring a wallet address according to the wallet public key, and searching an account encryption private key table stored in the block chain system according to the wallet address to obtain all account encryption private keys corresponding to the wallet address, wherein each account encryption private key is obtained by encrypting each account private key by the wallet private key; then, broadcasting all account encryption private keys corresponding to the wallet addresses in the block chain system so as to send all account encryption private keys corresponding to the wallet addresses to the user side through the connection relationship between the user side and any one node; then, at the user side, decrypting each account encryption private key by adopting a wallet private key to obtain all account private keys, and storing all account private keys to realize that all account private keys are led into the user side from the initial user side; therefore, the private key of the user of the block chain system is automatically imported, and the convenience of using the block chain system by the user of the block chain system is improved; meanwhile, information leakage caused by private key storage of a user of the block chain system is avoided.
In addition, the automatic importing method of the account private key of the blockchain wallet proposed by the above embodiment of the present invention may further have the following additional technical features:
optionally, when the blockchain system is constructed and normally operates, if the initial user receives an instruction to create a wallet, the initial user runs a blockchain wallet program to generate a wallet public key, a corresponding wallet private key and a wallet address, and sends the wallet public key and the wallet address to the blockchain system when the initial user establishes a connection with any one node in the blockchain system.
Optionally, when the initiating user side receives an instruction to create an account, a blockchain wallet program is run by the initiating user side to generate an account public key, a corresponding account private key and an account address, the account private key is symmetrically encrypted by using the wallet private key to obtain an account encryption private key, a request of the account encryption private key and a request of recording the account encryption private key are signed by using the wallet private key to obtain request information, and the request information and the wallet public key are sent to the blockchain system.
Optionally, when the any node in the blockchain system receives the request information and the wallet public key, obtaining the wallet address according to the wallet public key, and determining whether a corresponding item of the wallet address exists in the account encryption private key table, wherein if the corresponding item of the wallet address exists, the account encryption private key is added to the corresponding item of the wallet address; if not, creating a corresponding item of the wallet address in the account encryption private key table, and adding the account encryption private key in the corresponding item of the wallet address.
In order to achieve the above object, a second embodiment of the present invention provides a computer-readable storage medium, on which an account private key automatic importing program of a blockchain wallet is stored, where the account private key automatic importing program of the blockchain wallet, when executed by a processor, implements the above account private key automatic importing method of the blockchain wallet.
In order to achieve the above object, a third embodiment of the present invention provides an automatic importing apparatus of an account private key of a blockchain wallet, including: the connection module is used for establishing a connection relation between the user side and any node in the block chain system when the block chain wallet program is operated by any user side; the signing module is used for receiving a wallet private key through the user side, signing an inquiry task according to the wallet private key, acquiring a wallet public key according to the wallet private key, and sending the signed inquiry task and the wallet public key to the block chain system through the connection relation between the user side and any one node; the analysis module is used for adopting the wallet public key to analyze the signed inquiry task so as to acquire that the inquiry task is a wallet searching task, acquiring a wallet address according to the wallet public key, and searching an account encryption private key table stored in the block chain system according to the wallet address so as to acquire all account encryption private keys corresponding to the wallet address, wherein each account encryption private key is obtained by encrypting each account private key by the wallet private key; the broadcast module is used for broadcasting all account encryption private keys corresponding to the wallet addresses in the block chain system so as to send all account encryption private keys corresponding to the wallet addresses to the user side through the connection relationship between the user side and any one node; and the import module is used for decrypting each account encryption private key by adopting the wallet private key at the user side to obtain all account private keys and storing all account private keys so as to realize the import of all account private keys from the initial user side to the user side.
According to the automatic account private key importing device of the block chain wallet, the connection module is used for establishing the connection relationship between the user side and any node in the block chain system when the block chain wallet program is operated by any user side; the signing module is used for receiving the wallet private key through the user side, signing the inquiry task according to the wallet private key, acquiring the wallet public key according to the wallet private key, and sending the signed inquiry task and the wallet public key to the block chain system through the connection relation between the user side and any one node; the analysis module is used for analyzing the signed inquiry task by adopting the wallet public key so as to acquire the wallet address according to the wallet public key when the inquiry task is a wallet searching task, and searching an account encryption private key table stored in the block chain system according to the wallet address so as to acquire all account encryption private keys corresponding to the wallet address, wherein each account encryption private key is obtained by encrypting each account private key by using the wallet private key; the broadcast module is used for broadcasting all account encryption private keys corresponding to the wallet addresses in the block chain system so as to send all account encryption private keys corresponding to the wallet addresses to the user side through the connection relationship between the user side and any one node; the import module is used for decrypting each account encryption private key by adopting a wallet private key at the user side to obtain all account private keys and storing all account private keys so as to realize the import of all account private keys from the initial user side to the user side; therefore, the private key of the user of the block chain system is automatically imported, and the convenience of using the block chain system by the user of the block chain system is improved; meanwhile, information leakage caused by private key storage of a user of the block chain system is avoided.
In addition, the automatic account private key importing device for the blockchain wallet provided by the embodiment of the invention may further have the following additional technical features:
optionally, the system further includes a creating module, configured to, when the blockchain system is completely built and runs normally, if the initial user side receives an instruction to create a wallet, run a blockchain wallet program through the initial user side to generate a wallet public key, a corresponding wallet private key, and a wallet address, and send the wallet public key and the wallet address to the blockchain system when the initial user side establishes a connection with any one node in the blockchain system.
Optionally, the creating module is further configured to, when the initiating user side receives an instruction to create an account, run a blockchain wallet program through the initiating user side to generate an account public key and a corresponding account private key and an account address, symmetrically encrypt the account private key by using the wallet private key to obtain an account encryption private key, sign a request for the account encryption private key and a record of the account encryption private key by using the wallet private key to obtain request information, and send the request information and the wallet public key to the blockchain system.
Optionally, the parsing module is further configured to, when the any node in the blockchain system receives the request information and the wallet public key, obtain the wallet address according to the wallet public key, and determine whether a corresponding item of the wallet address exists in the account encryption private key table, where if the corresponding item of the wallet address exists, the account encryption private key is added to the corresponding item of the wallet address; if not, creating a corresponding item of the wallet address in the account encryption private key table, and adding the account encryption private key in the corresponding item of the wallet address.
In order to achieve the above object, a fourth aspect of the present invention provides a blockchain system, which includes the above apparatus for automatically importing an account private key of a blockchain wallet.
Drawings
Fig. 1 is a flowchart illustrating an account private key automatic importing method of a blockchain wallet according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a method for storing an account private key during an initial wallet and account creation process according to an embodiment of the present invention;
fig. 3 is a block diagram illustrating an apparatus for automatically importing an account private key of a blockchain wallet according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
In the existing blockchain system, one wallet can not be used at multiple places, namely when private keys on the wallet need to be used by other terminals after the wallet is created locally and a plurality of private keys of personal accounts are imported, the private keys corresponding to the personal accounts need to be imported again; in such a way, the user often needs to additionally store the private key, so that the safety of the block chain system is reduced; meanwhile, the user is very inconvenient in the process of using the private key; the method for automatically importing the account private key of the block chain wallet comprises the steps that firstly, when any user side runs a block chain wallet program, a connection relation between the user side and any node in a block chain system is established; then, receiving the wallet private key through the user side, signing the inquiry task according to the wallet private key, acquiring the wallet public key according to the wallet private key, and sending the signed inquiry task and the wallet public key to the block chain system through the connection relation between the user side and any one node; then, when the signed inquiry task is analyzed by adopting the wallet public key to know that the inquiry task is a wallet searching task, acquiring a wallet address according to the wallet public key, and searching an account encryption private key table stored in the block chain system according to the wallet address to obtain all account encryption private keys corresponding to the wallet address, wherein each account encryption private key is obtained by encrypting each account private key by the wallet private key; then, broadcasting all account encryption private keys corresponding to the wallet addresses in the block chain system so as to send all account encryption private keys corresponding to the wallet addresses to the user side through the connection relationship between the user side and any one node; then, at the user side, decrypting each account encryption private key by adopting a wallet private key to obtain all account private keys, and storing all account private keys to realize that all account private keys are led into the user side from the initial user side; therefore, the private key of the user of the block chain system is automatically imported, and the convenience of using the block chain system by the user of the block chain system is improved; meanwhile, information leakage caused by private key storage of a user of the block chain system is avoided.
In order to better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
Fig. 1 is a flowchart illustrating an automatic importing method of an account private key of a blockchain wallet according to an embodiment of the present invention, as shown in fig. 1, the automatic importing method of an account private key of a blockchain wallet includes the following steps:
s101, when any user terminal runs a block chain wallet program, a connection relation between the user terminal and any node in a block chain system is established.
That is, when a user of the blockchain system runs the blockchain system wallet program through any user terminal, the connection relationship between the user terminal and any node in the blockchain system is established, so as to link the user terminal into the blockchain system.
Wherein, the user side includes: cell-phone, computer, panel computer and other intelligent terminal equipment.
S102, receiving the private key of the wallet through the user side, signing the query task according to the private key of the wallet, obtaining the public key of the wallet according to the private key of the wallet, and sending the signed query task and the public key of the wallet to the block chain system through the connection relation between the user side and any one node.
That is to say, the blockchain system obtains the private wallet key through the user side, signs the query task according to the received private wallet key, obtains the public wallet key according to the private wallet key, and sends the signed query task and the public wallet key to the blockchain system through the connection relationship between the user side and any one node.
As an example, firstly, a user runs a blockchain wallet program on a new mobile phone, that is, a connection between the new mobile phone and any one node in a blockchain system is established, and then, after the blockchain system is connected with the new mobile phone, the blockchain system receives a wallet private key input by the user through the new mobile phone and signs a query task through the wallet private key so as to encrypt the query task; and calculating a wallet public key corresponding to the wallet private key according to the wallet private key input by the user, and sending the signed inquiry task and the wallet public key to the blockchain system through the connection with any node in the blockchain system.
And S103, when the signed inquiry task is analyzed by adopting the wallet public key to know that the inquiry task is a wallet searching task, acquiring a wallet address according to the wallet public key, and searching an account encryption private key table stored in the block chain system according to the wallet address to obtain all account encryption private keys corresponding to the wallet address, wherein each account encryption private key is obtained by encrypting each account private key by the wallet private key.
That is, after receiving a signed query task and a wallet public key sent by a user side, the block chain system analyzes the signed query task by using the wallet public key to acquire that the task is a wallet searching task, acquires a wallet address according to the wallet public key, namely calculates according to the wallet public key to acquire the wallet address corresponding to the wallet public key, and searches an account encryption private key table stored in the block chain system according to the acquired wallet address to acquire all account encryption private keys corresponding to the wallet address; wherein, each account encryption private key is obtained by encrypting each account private key by the wallet private key.
For example, a query identifier is configured for the query task, and before the query task is signed by using a private key, the query identifier and the query task are packaged together to form a request packet, so that the block chain system can judge the type of the task after analyzing the request packet.
For example, when a wallet creating instruction of a user is obtained, a storage item corresponding to the wallet public key is established in the account encryption private key table, when a subsequent user creates an account, the account private key is encrypted through the wallet private key to form an account encryption private key, the account encryption private key is associated with the wallet public key, and the wallet public key and the account encryption private key are stored in the account encryption private key table, so that the subsequent user can import the private key through the account encryption private key table.
There are various ways to encrypt the account private key with the wallet private key. For example, the DES symmetric key algorithm converts a 64-bit plaintext input block into a 64-bit ciphertext output block, wherein 8 bits are parity bits and 56 bits are the length of the cipher. Or, the RC4 symmetric key algorithm, the principle of the RC4 algorithm is "scrambling", which includes two major parts, namely an initialization algorithm and a pseudo-random sub-cipher generation algorithm, in the initialization process, the key has the main function of randomly scrambling an initial 256-byte cluster, different sub-key sequences can be obtained after different clusters are processed by the pseudo-random sub-cipher generation algorithm, and the obtained sub-key sequences and a plaintext are subjected to exclusive-or (XOR) operation to obtain a ciphertext.
And S104, broadcasting all account encryption private keys corresponding to the wallet addresses in the blockchain system so as to send all account encryption private keys corresponding to the wallet addresses to the user side through the connection relationship between the user side and any one node.
That is, after obtaining all the account encryption private keys corresponding to the wallet address, the blockchain system broadcasts all the account encryption private keys corresponding to the wallet address within the blockchain system, so that a user sending a query request can obtain all the account encryption private keys corresponding to the wallet address through the broadcast.
And S105, at the user side, decrypting each account encryption private key by using the wallet private key to obtain all account private keys, and storing all account private keys to realize that all account private keys are imported from the initial user side to the user side.
That is to say, after receiving all the account encryption private keys corresponding to the wallet addresses broadcasted by the blockchain system through the user side, the users of the blockchain system decrypt each account encryption private key through the wallet private key to obtain all the account private keys, and store all the decrypted account private keys, so as to import all the account private keys from the originating user side to the user side.
In summary, according to the method for automatically importing the account private key of the blockchain wallet of the embodiment of the present invention, first, when any user runs a blockchain wallet program, a connection relationship between the user and any node in the blockchain system is established; then, receiving the wallet private key through the user side, signing the inquiry task according to the wallet private key, acquiring the wallet public key according to the wallet private key, and sending the signed inquiry task and the wallet public key to the block chain system through the connection relation between the user side and any one node; then, when the signed inquiry task is analyzed by adopting the wallet public key to know that the inquiry task is a wallet searching task, acquiring a wallet address according to the wallet public key, and searching an account encryption private key table stored in the block chain system according to the wallet address to obtain all account encryption private keys corresponding to the wallet address, wherein each account encryption private key is obtained by encrypting each account private key by the wallet private key; then, broadcasting all account encryption private keys corresponding to the wallet addresses in the block chain system so as to send all account encryption private keys corresponding to the wallet addresses to the user side through the connection relationship between the user side and any one node; then, at the user side, decrypting each account encryption private key by adopting a wallet private key to obtain all account private keys, and storing all account private keys to realize that all account private keys are led into the user side from the initial user side; therefore, the private key of the user of the block chain system is automatically imported, and the convenience of using the block chain system by the user of the block chain system is improved; meanwhile, information leakage caused by private key storage of a user of the block chain system is avoided.
As shown in fig. 2, in the method for automatically importing an account private key of a blockchain wallet provided by the embodiment of the present invention, when a wallet of a user in a blockchain system is initially created, the method for storing the account private key in the creation process of the initial wallet and an account includes the following steps:
s201, when the block chain system is constructed and normally runs, if the initial user side receives an instruction of creating the wallet, the initial user side runs a block chain wallet program to generate a wallet public key, a corresponding wallet private key and a wallet address, and the wallet public key and the wallet address are sent to the block chain system when the initial user side is connected with any one node in the block chain system.
As an example, when the blockchain system is constructed and normally runs, a blockchain system user runs a blockchain wallet program through an initial user side of the blockchain system user and clicks a create wallet button to initiate a create wallet instruction, and after receiving the create wallet instruction, the initial user side generates a wallet public key, a corresponding wallet private key and a wallet address through the blockchain wallet program, wherein the wallet private key is a certificate which needs the blockchain system user to keep private, and the security of a user account of the blockchain system is influenced by the leakage of the private key; then, when the initial user end establishes connection with any node in the blockchain system, the wallet public key and the wallet address are sent to the blockchain system, so that the blockchain system performs corresponding storage or operation according to the wallet public key and the wallet address.
S202, when the initial user side receives an instruction for creating an account, the initial user side runs a block chain wallet program to generate an account public key, a corresponding account private key and an account address, the account private key is symmetrically encrypted by using the wallet private key to obtain an account encryption private key, a request for the account encryption private key and the record account encryption private key is signed by using the wallet private key to obtain request information, and the request information and the wallet public key are sent to a block chain system.
That is, after the user of the blockchain system creates the wallet through the initial user side, when the operation of creating the account is performed through the initial user side, the initial user side receives an instruction of creating the account, generates an account public key, a corresponding account private key and an account address through a blockchain wallet program, symmetrically encrypts the account private key by using the wallet private key to obtain an account encryption private key, signs a request for the account encryption private key and the record account encryption private key by using the wallet private key to obtain request information, and sends the request information and the wallet public key to the blockchain system.
As an example, after the user of the block chain system creates a wallet through the initial user side, a wallet private key wprvk, a wallet public key wpubk and a corresponding wallet address waddr are obtained; when an account is created, an initial user side receives an instruction of creating the account, and generates an account public key pubk, an account private key prvk and a corresponding account address addr through a blockchain wallet program; symmetrically encrypting the account private key prvk by adopting a wallet private key wprvk to obtain an account encryption private key prvkEC; and signing the account encryption private key prvkEC and the request for recording the account encryption private key by using the wallet private key wprvk so as to encrypt the request, and sending the request information and the wallet public key wpubk to the block chain system.
S203, when any node in the blockchain system receives the request information and the wallet public key, acquiring a wallet address according to the wallet public key, and judging whether a corresponding item of the wallet address exists in the account encryption private key table, wherein if the corresponding item of the wallet address exists, the account encryption private key is added in the corresponding item of the wallet address; if not, a corresponding item of the wallet address is created in the account encryption private key table, and the account encryption private key is added to the corresponding item of the wallet address.
That is, when the blockchain system receives the request information and the wallet public key, the calculation is performed according to the wallet public key to obtain a wallet address, and whether the wallet address has a corresponding item stored in the account encryption private key table is judged; if the wallet address is the corresponding item of the wallet address, the account encryption private key in the request information is added, if the wallet address is the corresponding item of the wallet address, the corresponding item of the wallet address is created in the account encryption private key table, and the account encryption private key is added in the corresponding item of the wallet address, so that the account encryption private key corresponding to the wallet address can be stored, and a subsequent user can conveniently retrieve and import the account encryption private key through the wallet address.
In summary, according to the initial wallet and the method for storing an account private key during the process of creating an account according to the embodiments of the present invention, first, when the block chain system is constructed and normally operates, if the initial client receives an instruction to create a wallet, the initial client runs a block chain wallet program to generate a wallet public key, a corresponding wallet private key and a wallet address, and sends the wallet public key and the wallet address to the block chain system when the initial client establishes a connection with any one node in the block chain system; then, when the initial user side receives an instruction for creating an account, a block chain wallet program is operated by the initial user side to generate an account public key, a corresponding account private key and an account address, the account private key is symmetrically encrypted by adopting the wallet private key to obtain an account encryption private key, a request for the account encryption private key and a request for recording the account encryption private key is signed by using the wallet private key to obtain request information, and the request information and the wallet public key are sent to a block chain system; then, when any node in the blockchain system receives the request information and the wallet public key, acquiring a wallet address according to the wallet public key, and judging whether a corresponding item of the wallet address exists in the account encryption private key table, wherein if the corresponding item of the wallet address exists, the account encryption private key is added in the corresponding item of the wallet address; if the wallet address does not exist, a corresponding item of the wallet address is created in the account encryption private key table, and the account encryption private key is added in the corresponding item of the wallet address; therefore, the account private key of the user of the blockchain system is stored in the blockchain system, and the user of the blockchain system can conveniently and automatically import the private key through the blockchain system.
In order to implement the above embodiments, an embodiment of the present invention provides a computer-readable storage medium, on which an account private key automatic importing program of a blockchain wallet is stored, where the account private key automatic importing program of the blockchain wallet implements the above account private key automatic importing method of the blockchain wallet when executed by a processor.
In order to implement the foregoing embodiment, an embodiment of the present invention provides an automatic importing apparatus of an account private key of a blockchain wallet, including: a connection module 10, a signing module 20, a parsing module 30, a broadcasting module 40 and an importing module 50.
The connection module 10 is configured to establish a connection relationship between any one user side and any one node in the blockchain system when the blockchain wallet program is run by the user side.
And the signing module 20 is configured to receive the wallet private key through the user side, sign the query task according to the wallet private key, obtain the wallet public key according to the wallet private key, and send the signed query task and the wallet public key to the block chain system through a connection relationship between the user side and any one node.
The parsing module 30 is configured to parse the signed query task by using the wallet public key to obtain a wallet address according to the wallet public key when the query task is a wallet searching task, and search an account encryption private key table stored in the blockchain system according to the wallet address to obtain all account encryption private keys corresponding to the wallet address, where each account encryption private key is obtained by encrypting each account private key by using the wallet private key.
And the broadcasting module 40 is configured to broadcast all the account encryption private keys corresponding to the wallet addresses in the blockchain system, so as to send all the account encryption private keys corresponding to the wallet addresses to the user side through a connection relationship between the user side and any one node.
And the importing module 50 is configured to, at the user side, decrypt each account encryption private key by using the wallet private key to obtain all account private keys, and store all account private keys to enable all account private keys to be imported from the initiating user side to the user side.
In summary, according to the apparatus for automatically importing an account private key of a blockchain wallet in an embodiment of the present invention, the connection module is configured to establish a connection relationship between any user side and any node in a blockchain system when a blockchain wallet program is run by the user side; the signing module is used for receiving the wallet private key through the user side, signing the inquiry task according to the wallet private key, acquiring the wallet public key according to the wallet private key, and sending the signed inquiry task and the wallet public key to the block chain system through the connection relation between the user side and any one node; the analysis module is used for analyzing the signed inquiry task by adopting the wallet public key so as to acquire the wallet address according to the wallet public key when the inquiry task is a wallet searching task, and searching an account encryption private key table stored in the block chain system according to the wallet address so as to acquire all account encryption private keys corresponding to the wallet address, wherein each account encryption private key is obtained by encrypting each account private key by using the wallet private key; the broadcast module is used for broadcasting all account encryption private keys corresponding to the wallet addresses in the block chain system so as to send all account encryption private keys corresponding to the wallet addresses to the user side through the connection relationship between the user side and any one node; the import module is used for decrypting each account encryption private key by adopting a wallet private key at the user side to obtain all account private keys and storing all account private keys so as to realize the import of all account private keys from the initial user side to the user side; therefore, the private key of the user of the block chain system is automatically imported, and the convenience of using the block chain system by the user of the block chain system is improved; meanwhile, information leakage caused by private key storage of a user of the block chain system is avoided.
In some embodiments, the apparatus for automatically importing an account private key of a blockchain wallet according to an embodiment of the present invention further includes a creating module (this module is not shown in the drawings), where the creating module is configured to, when the blockchain system is completely built and operates normally, if the initial user receives an instruction to create a wallet, run a blockchain wallet program through the initial user to generate a wallet public key, a corresponding wallet private key, and a wallet address, and send the wallet public key and the wallet address to the blockchain system when the initial user establishes a connection with any one node in the blockchain system.
In some embodiments, in the apparatus for automatically importing an account private key of a blockchain wallet proposed in the embodiments of the present invention, the creating module 30 is further configured to, when the initial user side receives an instruction to create an account, run a blockchain wallet program through the initial user side to generate an account public key, a corresponding account private key, and an account address, perform symmetric encryption on the account private key by using the wallet private key to obtain an account encryption private key, sign a request for the account encryption private key and the record account encryption private key by using the wallet private key to obtain request information, and send the request information and the wallet public key to the blockchain system.
In some embodiments, in the apparatus for automatically importing an account private key of a blockchain wallet proposed in the embodiments of the present invention, the parsing module is further configured to, when the any node in the blockchain system receives the request information and the wallet public key, obtain a wallet address according to the wallet public key, and determine whether a corresponding item of the wallet address exists in the account encryption private key table, where if the corresponding item of the wallet address exists, add the account encryption private key to the corresponding item of the wallet address; if not, a corresponding item of the wallet address is created in the account encryption private key table, and the account encryption private key is added to the corresponding item of the wallet address.
It should be noted that the above description about the method for automatically importing the account private key of the blockchain wallet in fig. 1 is also applicable to the device for automatically importing the account private key of the blockchain wallet, and is not repeated herein.
In order to implement the foregoing embodiment, an embodiment of the present invention further provides a blockchain system, including the above apparatus for automatically importing an account private key of a blockchain wallet.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
In the description of the present invention, it is to be understood that the terms "first", "second" and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
In the present invention, unless otherwise expressly stated or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; either directly or indirectly through intervening media, either internally or in any other relationship. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the present invention, unless otherwise expressly stated or limited, the first feature "on" or "under" the second feature may be directly contacting the first and second features or indirectly contacting the first and second features through an intermediate. Also, a first feature "on," "over," and "above" a second feature may be directly or diagonally above the second feature, or may simply indicate that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature may be directly under or obliquely under the first feature, or may simply mean that the first feature is at a lesser elevation than the second feature.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above should not be understood to necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (10)

1. An account private key automatic importing method of a blockchain wallet is characterized by comprising the following steps:
when any user terminal runs the block chain wallet program, establishing a connection relation between the user terminal and any node in the block chain system;
receiving a wallet private key through the user side, signing an inquiry task according to the wallet private key, acquiring a wallet public key according to the wallet private key, and sending the signed inquiry task and the wallet public key to the block chain system through the connection relation between the user side and any one node;
analyzing the signed inquiry task by adopting the wallet public key to acquire that the inquiry task is a wallet searching task, acquiring a wallet address according to the wallet public key, and searching an account encryption private key table stored in the block chain system according to the wallet address to acquire all account encryption private keys corresponding to the wallet address, wherein each account encryption private key is obtained by encrypting each account private key by the wallet private key;
broadcasting all account encryption private keys corresponding to the wallet addresses in the blockchain system so as to send all account encryption private keys corresponding to the wallet addresses to the user side through the connection relationship between the user side and any one node;
and at the user side, decrypting each account encryption private key by using the wallet private key to obtain all account private keys, and storing all account private keys to realize that all account private keys are led into the user side from the initial user side.
2. The method of claim 1, wherein when the blockchain system is constructed and operating normally, if the initial user receives an instruction to create a wallet, a blockchain wallet program is run by the initial user to generate a wallet public key, a corresponding wallet private key and a wallet address, and the wallet public key and the wallet address are sent to the blockchain system when the initial user establishes a connection with any one node in the blockchain system.
3. The method as claimed in claim 2, wherein when the primary user receives an instruction to create an account, the primary user runs a blockchain wallet program to generate an account public key, a corresponding account private key and an account address, the account private key is symmetrically encrypted by the wallet private key to obtain an account encryption private key, and the request of the account encryption private key and the record account encryption private key is signed by the wallet private key to obtain request information, and the request information and the wallet public key are sent to the blockchain system.
4. The method of claim 3, wherein when the request message and the wallet public key are received by any node in the blockchain system, the wallet address is obtained according to the wallet public key, and whether a corresponding item of the wallet address exists in the account encryption private key table is determined, wherein,
if the account encryption private key exists, adding the account encryption private key to a corresponding item of the wallet address;
if not, creating a corresponding item of the wallet address in the account encryption private key table, and adding the account encryption private key in the corresponding item of the wallet address.
5. A computer-readable storage medium, on which an account private key automatic importing program of a blockchain wallet is stored, the account private key automatic importing program of the blockchain wallet implementing the account private key automatic importing method of the blockchain wallet as recited in any one of claims 1 to 4 when executed by a processor.
6. An automatic account private key importing device for a blockchain wallet, comprising:
the connection module is used for establishing a connection relation between the user side and any node in the block chain system when the block chain wallet program is operated by any user side;
the signing module is used for receiving a wallet private key through the user side, signing an inquiry task according to the wallet private key, acquiring a wallet public key according to the wallet private key, and sending the signed inquiry task and the wallet public key to the block chain system through the connection relation between the user side and any one node;
the analysis module is used for adopting the wallet public key to analyze the signed inquiry task so as to acquire that the inquiry task is a wallet searching task, acquiring a wallet address according to the wallet public key, and searching an account encryption private key table stored in the block chain system according to the wallet address so as to acquire all account encryption private keys corresponding to the wallet address, wherein each account encryption private key is obtained by encrypting each account private key by the wallet private key;
the broadcast module is used for broadcasting all account encryption private keys corresponding to the wallet addresses in the block chain system so as to send all account encryption private keys corresponding to the wallet addresses to the user side through the connection relationship between the user side and any one node;
and the import module is used for decrypting each account encryption private key by adopting the wallet private key at the user side to obtain all account private keys and storing all account private keys so as to realize the import of all account private keys from the initial user side to the user side.
7. The apparatus of claim 6, further comprising a creation module configured to run a blockchain wallet program through the initial user side to generate a wallet public key, a corresponding wallet private key and a wallet address if the initial user side receives an instruction to create a wallet when the blockchain system is constructed and normally runs, and to send the wallet public key and the wallet address to the blockchain system when the initial user side establishes a connection with any node in the blockchain system.
8. The apparatus as claimed in claim 7, wherein the creating module is further configured to run a blockchain wallet program through the primary user side to generate an account public key, a corresponding account private key and an account address when the primary user side receives an instruction to create an account, symmetrically encrypt the account private key with the wallet private key to obtain an account encryption private key, sign a request for the account encryption private key and a record account encryption private key with the wallet private key to obtain request information, and send the request information and the wallet public key to the blockchain system.
9. The apparatus as claimed in claim 8, wherein the parsing module is further configured to, when the any node in the blockchain system receives the request message and the wallet public key, obtain the wallet address according to the wallet public key, and determine whether a corresponding item of the wallet address exists in the account encryption private key table, wherein,
if the account encryption private key exists, adding the account encryption private key to a corresponding item of the wallet address;
if not, creating a corresponding item of the wallet address in the account encryption private key table, and adding the account encryption private key in the corresponding item of the wallet address.
10. A blockchain system comprising an account private key automatic importing apparatus of a blockchain wallet of any one of claims 6 to 9.
CN201810967546.2A 2018-08-23 2018-08-23 Method, medium and device for automatically importing account private key of blockchain wallet and blockchain system Active CN109146481B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810967546.2A CN109146481B (en) 2018-08-23 2018-08-23 Method, medium and device for automatically importing account private key of blockchain wallet and blockchain system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810967546.2A CN109146481B (en) 2018-08-23 2018-08-23 Method, medium and device for automatically importing account private key of blockchain wallet and blockchain system

Publications (2)

Publication Number Publication Date
CN109146481A CN109146481A (en) 2019-01-04
CN109146481B true CN109146481B (en) 2020-09-08

Family

ID=64791083

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810967546.2A Active CN109146481B (en) 2018-08-23 2018-08-23 Method, medium and device for automatically importing account private key of blockchain wallet and blockchain system

Country Status (1)

Country Link
CN (1) CN109146481B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110086607B (en) * 2019-03-13 2021-08-17 深圳壹账通智能科技有限公司 Method and device for rapidly switching deployment key, computer equipment and storage medium
CN110048847A (en) * 2019-03-13 2019-07-23 上海七印信息科技有限公司 A kind of quick barcode scanning endorsement method based on block chain technology
CN109961292B (en) * 2019-03-22 2022-04-01 杭州复杂美科技有限公司 Block chain verification code application method, equipment and storage medium
CN109978536A (en) * 2019-04-03 2019-07-05 上海中商网络股份有限公司 A kind of method, apparatus, storage medium and equipment by data deposit block chain
CN110086612B (en) * 2019-04-26 2022-03-04 山大地纬软件股份有限公司 Block chain public and private key backup and lost recovery method and system
CN110336832B (en) * 2019-07-24 2023-11-03 深圳传音控股股份有限公司 Information encryption and decryption methods, devices and terminals
CN111178875A (en) * 2019-12-23 2020-05-19 杭州复杂美科技有限公司 Wallet account configuration method, wallet account application method, device and storage medium
CN111191262B (en) * 2019-12-30 2023-04-18 中山大学 Block chain wallet client private key protection method based on two-party signature
US11626997B2 (en) * 2020-03-06 2023-04-11 Vaultie, Inc. System and method for authenticating digitally signed documents
CN111598555A (en) * 2020-05-13 2020-08-28 楚天龙股份有限公司 Multi-terminal hardware wallet adapting method and system
CN112200565A (en) * 2020-10-26 2021-01-08 成都商通时代数字科技有限公司 Application method and application system of usbKey in block chain digital liquor certificate wallet
CN113034139B (en) * 2021-03-15 2023-12-26 中国人民大学 Block chain multi-coin wallet based on living organism biological characteristic authentication and implementation method thereof

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107453870A (en) * 2017-09-12 2017-12-08 京信通信系统(中国)有限公司 Mobile terminal authentication management method, device and corresponding mobile terminal based on block chain
JP2018014622A (en) * 2016-07-21 2018-01-25 株式会社日立製作所 Signature verification system, signature verification method and program
CN108021821A (en) * 2017-11-28 2018-05-11 北京航空航天大学 Multicenter block chain transaction intimacy protection system and method
WO2018114585A1 (en) * 2016-12-22 2018-06-28 Itext Group Nv Improved blockchain-based method for registration and verification of a file
CN108369697A (en) * 2015-10-16 2018-08-03 科因普拉格株式会社 Recognized certificate based on block chain signs and issues system and method and recognized certificate Verification System and method based on block chain

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108369697A (en) * 2015-10-16 2018-08-03 科因普拉格株式会社 Recognized certificate based on block chain signs and issues system and method and recognized certificate Verification System and method based on block chain
JP2018014622A (en) * 2016-07-21 2018-01-25 株式会社日立製作所 Signature verification system, signature verification method and program
WO2018114585A1 (en) * 2016-12-22 2018-06-28 Itext Group Nv Improved blockchain-based method for registration and verification of a file
CN107453870A (en) * 2017-09-12 2017-12-08 京信通信系统(中国)有限公司 Mobile terminal authentication management method, device and corresponding mobile terminal based on block chain
CN108021821A (en) * 2017-11-28 2018-05-11 北京航空航天大学 Multicenter block chain transaction intimacy protection system and method

Also Published As

Publication number Publication date
CN109146481A (en) 2019-01-04

Similar Documents

Publication Publication Date Title
CN109146481B (en) Method, medium and device for automatically importing account private key of blockchain wallet and blockchain system
US8122487B2 (en) Method and apparatus for checking proximity between devices using hash chain
CN108809953B (en) Anonymous identity authentication method and device based on block chain
JP2009529714A (en) Method and system for decryptable and searchable encryption
CN105610793B (en) A kind of outsourcing data encryption storage and cryptogram search system and its application process
CN107135080B (en) SM9 decryption method and device
CN104836784B (en) A kind of information processing method, client and server
CN106817358B (en) Encryption and decryption method and device for user resources
CN113128999B (en) Block chain privacy protection method and device
CN107196919B (en) Data matching method and device
CN109754226B (en) Data management method, device and storage medium
US8422673B2 (en) Method and system for protecting against unity keys
CN107315967B (en) Data matching method and device and computer readable storage medium
CN105282167A (en) Searchable certificateless public key encryption method
CN112019541A (en) Data transmission method and device, computer equipment and storage medium
CN106789008B (en) Method, device and system for decrypting sharable encrypted data
CN110505066A (en) A kind of data transmission method, device, equipment and storage medium
CN115603907A (en) Method, device, equipment and storage medium for encrypting storage data
CN111405082B (en) Device connection method, electronic device, terminal and storage medium
CN107872312B (en) Method, device, equipment and system for dynamically generating symmetric key
CN114979253A (en) Data push decision-making method and device
CN116305013A (en) Electronic file adding method and device of traceability information, electronic equipment and medium
CN115242464A (en) Service processing method, system, device and equipment
CN113569295A (en) Blacklist data sharing method and obtaining method
CN106533674B (en) The sharing method of encryption data, apparatus and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 361000 B1F-065, Zone A, Huaxun Building, Software Park, Xiamen Torch Hi-tech Zone, Huli District, Xiamen City, Fujian Province

Patentee after: Ke'an (Xiamen) Technology Co.,Ltd.

Address before: B1f-065, zone a, Huaxun building, software park, torch hi tech Zone, Xiamen City, Fujian Province, 361000

Patentee before: TAILIAN (XIAMEN) TECHNOLOGY Co.,Ltd.