CN109347632B - Block chain ID generation and use method, device, electronic equipment and storage medium - Google Patents

Block chain ID generation and use method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN109347632B
CN109347632B CN201811237645.1A CN201811237645A CN109347632B CN 109347632 B CN109347632 B CN 109347632B CN 201811237645 A CN201811237645 A CN 201811237645A CN 109347632 B CN109347632 B CN 109347632B
Authority
CN
China
Prior art keywords
public
private key
block chain
target
user
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
CN201811237645.1A
Other languages
Chinese (zh)
Other versions
CN109347632A (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.)
Beijing Kingsoft Internet Security Software Co Ltd
Original Assignee
Beijing Kingsoft Internet Security Software 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 Beijing Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201811237645.1A priority Critical patent/CN109347632B/en
Publication of CN109347632A publication Critical patent/CN109347632A/en
Application granted granted Critical
Publication of CN109347632B publication Critical patent/CN109347632B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • 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/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0876Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0866Generation of secret information including derivation or calculation of cryptographic keys or passwords involving user or device identifiers, e.g. serial number, physical or biometrical information, DNA, hand-signature or measurable physical characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3226Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using a predetermined code, e.g. password, passphrase or PIN

Abstract

The embodiment of the invention provides a block chain ID generation method, a block chain ID generation device, electronic equipment and a storage medium. In the invention, a plurality of groups of public and private key pairs are generated based on a preset layered deterministic algorithm, then a target public and private key pair is selected from the plurality of groups of public and private key pairs, and finally a block chain ID of a user is generated in a mode of coding a public key in the target public and private key pair, so that the block chain ID is used as an identifier of the user in a block chain to represent the user.

Description

Block chain ID generation and use method, device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of block chain technologies, and in particular, to a method and an apparatus for generating and using a block chain ID, an electronic device, and a storage medium.
Background
As technology has evolved, more and more users use digital wallets to manage digital currency (e.g., bitcoin and lyte coin, etc.). The digital wallet is a wallet based on a blockchain technology, and a user can create a plurality of virtual wallets based on the digital wallet and implement a user's dominance function on his own assets based on the virtual wallets, such as: transfer of money, payment, collection of money, etc.
The blockchain technique is decentralized, wherein decentralized is a structure in which each node has a highly autonomous feature and the nodes can be freely connected with each other to form a new connection unit. Any node may become a phased hub, but does not have mandatory central control functions. The influence between nodes can form a nonlinear causal relationship through the network.
Since the blockchain technology is decentralized, so that each user can perform transactions, but cannot know which user the user performs the transactions is, a way to characterize each user in the blockchain is urgently needed.
Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, an electronic device, and a storage medium for generating a block chain ID, where the block chain ID is used as an identifier of a user in a block chain to characterize the user. The specific technical scheme is as follows:
the embodiment of the invention provides a block chain ID generation method, which comprises the following steps:
receiving a block chain ID creation request sent by a user, and generating a plurality of groups of public and private key pairs based on a preset hierarchical deterministic algorithm, wherein one group of public and private key pairs comprises a public key and a private key;
selecting a target public and private key pair from the multiple groups of public and private key pairs;
and encoding a public key in the target public and private key pair to generate the block chain ID of the user.
Optionally, the step of generating a plurality of sets of public and private key pairs based on a preset hierarchical deterministic algorithm includes:
obtaining a random number;
generating a master private key based on the random number;
and generating a plurality of groups of public and private key pairs based on the main private key and the plurality of generation paths, wherein different generation paths correspondingly generate different public and private key pairs.
Optionally, the step of selecting a target public-private key pair from the multiple sets of public-private key pairs includes:
and acquiring a public and private key pair corresponding to the target generation path from the plurality of groups of public and private key pairs as a target public and private key pair.
Optionally, after the step of generating the user's blockchain ID, the method further includes:
taking each public key in the remaining public and private key pairs except the target public and private key pair in the plurality of groups of public and private key pairs as the wallet address of the user;
and establishing and storing the corresponding relation between the block chain ID and the wallet address.
The embodiment of the invention also provides a using method of the block chain ID, which comprises the following steps:
receiving information to be authenticated and a blockchain ID, wherein the blockchain ID is obtained by encoding a public key of a target public and private key pair in a plurality of groups of generated public and private key pairs according to a blockchain ID creation request of a user;
acquiring a corresponding target public key according to the block chain ID;
authenticating the information to be authenticated by using a target public key corresponding to the block chain ID;
and if the authentication is successful, judging that the information to be authenticated is the information encrypted by using a target private key corresponding to the block chain ID, and taking the block chain ID as the identity information of the information to be authenticated.
An embodiment of the present invention further provides a device for generating a block chain ID, where the device includes:
the system comprises a first receiving module, a second receiving module and a third receiving module, wherein the first receiving module is used for receiving a block chain ID (identity) creation request sent by a user and generating a plurality of groups of public and private key pairs based on a preset hierarchical deterministic algorithm, and one group of public and private key pairs comprises a public key and a private key;
the selection module is used for selecting a target public and private key pair from the multiple groups of public and private key pairs;
and the generating module is used for encoding the public key in the target public and private key pair to generate the block chain ID of the user.
Optionally, the first receiving module includes:
an obtaining submodule for obtaining a random number;
a master private key generation submodule for generating a master private key based on the random number;
and the public and private key pair generation submodule is used for generating a plurality of groups of public and private key pairs based on the main private key and a plurality of generation paths, wherein different generation paths correspondingly generate different public and private key pairs.
Optionally, the selecting module is specifically configured to:
and acquiring a public and private key pair corresponding to the target generation path from the plurality of groups of public and private key pairs as a target public and private key pair.
Optionally, the apparatus further comprises:
a wallet address determination module for, after the step of generating the user's blockchain ID, taking each public key of the remaining public-private key pairs of the plurality of sets of public-private key pairs except the target public-private key pair as the user's wallet address;
and the establishing module is used for establishing and storing the corresponding relation between the block chain ID and the wallet address.
The embodiment of the invention also provides a device for using the block chain ID, which comprises:
the second receiving module is used for receiving information to be authenticated and the block chain ID, wherein the block chain ID is obtained by encoding a public key of a target public and private key pair in a plurality of groups of generated public and private key pairs according to a block chain ID creation request of a user;
the acquisition module is used for acquiring a corresponding target public key according to the block chain ID;
the authentication module is used for authenticating the information to be authenticated by using a target public key corresponding to the block chain ID; and if the authentication is successful, judging that the information to be authenticated is the information encrypted by using the target private key corresponding to the block chain ID.
Embodiments of the present invention further provide an electronic device, including a processor and a memory, wherein,
a memory for storing a computer program;
and a processor for implementing any one of the above methods for generating and using the blockchain ID when executing the computer program stored in the memory.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements any one of the above methods for generating or using a blockchain ID.
In the embodiment of the invention, a block chain ID creation request sent by a user is received, a plurality of groups of public and private key pairs are generated based on a preset layered deterministic algorithm, wherein one group of public and private key pairs comprises a public key and a private key, a target public and private key pair is selected from the plurality of groups of public and private key pairs, and the public key in the target public and private key pair is encoded to generate the block chain ID of the user. In the invention, a plurality of groups of public and private key pairs are generated based on a preset layered deterministic algorithm, then a target public and private key pair is selected from the plurality of groups of public and private key pairs, and finally a block chain ID of a user is generated in a mode of coding a public key in the target public and private key pair, so that the block chain ID is used as an identifier of the user in a block chain to represent the user.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a first flowchart of a block chain ID generation method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart illustrating a process of generating a plurality of sets of public and private key pairs based on a preset hierarchical deterministic algorithm according to an embodiment of the present invention;
fig. 3 is a second flowchart of a block chain ID generation method according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating a method for using a block chain ID according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a block chain ID generation apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a block chain ID using apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
First, a method for generating a block chain ID according to an embodiment of the present invention is described below.
The block chain ID generation method provided by the embodiment of the invention can be applied to any electronic equipment in a block chain, such as a server, a computer, a mobile terminal and the like.
As shown in fig. 1, a method for generating a block chain ID according to an embodiment of the present invention may include:
s101: and receiving a blockchain ID creation request sent by a user, and generating a plurality of groups of public and private key pairs based on a preset hierarchical deterministic algorithm, wherein one group of public and private key pairs comprises a public key and a private key.
When a user wants to obtain a block chain ID of the user, a block chain ID creation request is sent, where the way for the user to send the block chain ID creation request may be: click on the blockchain ID creation button in the virtual wallet.
After receiving a blockchain ID creation request sent by a user, knowing that the user wants to create a blockchain ID, a plurality of sets of public and private key pairs may be generated based on a predetermined hierarchical deterministic algorithm, where a set of public and private key pairs includes a public key and a private key.
Referring to fig. 2, the generating a plurality of sets of public and private key pairs based on a predetermined hierarchical deterministic algorithm may include:
s1011: a random number is obtained.
In the predetermined hierarchical deterministic algorithm, a random number is used to generate the master private key, i.e. the root private key, which is not different from any private key generated by any bitcoin wallet.
In the embodiment of the invention, a preset random number generation algorithm can be adopted to generate the random number and obtain the random number.
S1012: a master private key is generated based on the random number.
After the random number is obtained, a master private key may be generated based on the random number, where the way of generating the master private key based on the random number may be: and generating a main private key based on the random number according to a BIP32 protocol, wherein the BIP is a Bitcin Improvement protocol.
S1013: and generating a plurality of groups of public and private key pairs based on the main private key and the plurality of generation paths, wherein different generation paths correspondingly generate different public and private key pairs.
After the master private key is generated, multiple sets of public and private key pairs may be generated according to multiple different generation paths, where each generation path generates a different public and private key pair, and the different generation paths may be determined based on currencies, for example, it may be set that each currency corresponds to one generation path.
For example: the bit currency corresponds to a bit currency public and private key generation path, and the ether house corresponds to an ether house public and private key generation path.
For example, the generating path may be determined by: according to the BIP44 protocol, a nonrepeating path is set for each currency, and the nonrepeating path is the generation path of the currency public and private keys.
Therefore, a plurality of groups of public and private key pairs are generated based on the preset layered deterministic algorithm.
S102: from the multiple sets of public and private key pairs, a target public and private key pair is selected.
Since the blockchain ID to be generated is the unique identifier of the user in the blockchain, there is only one blockchain ID for each user, and therefore, in order to generate the blockchain ID for the user, after generating a plurality of sets of public and private key pairs, it is necessary to select a target public and private key pair from the plurality of sets of public and private key pairs, that is, select a set of public and private key pairs from the plurality of sets of public and private key pairs.
In an implementation manner, a public and private key pair corresponding to a target generation path may be obtained from multiple sets of public and private key pairs as a target public and private key pair.
The target generation path may be a randomly selected generation path. The advantage of selecting the target public and private key pair is that the selected target public and private key pair has no regularity and is difficult to crack, and the safety of the target public and private key pair is ensured.
Alternatively, the target generation path may be one selected according to a preset rule.
Or, in another implementation, the target public-private key pair may also be directly selected from multiple sets of public-private key pairs, for example, a certain public-private key pair may be randomly selected, or a certain public-private key pair may be selected according to a preset rule.
S103: and encoding the public key in the target public and private key pair to generate the block chain ID of the user.
In order to generate the blockchain ID, after the target public and private key pair is selected, the public key in the target public and private key pair may be encoded to generate the user blockchain ID, and the private key in the target public and private key also corresponds to the generated blockchain ID, that is, the private key in the target public and private key may be used as the private key of the blockchain ID, and the two may be mutually verified. The encoding method for encoding the public key in the target public-private key pair may be any one, and is not limited herein.
In the embodiment of the invention, a block chain ID creation request sent by a user is received, a plurality of groups of public and private key pairs are generated based on a preset layered deterministic algorithm, wherein one group of public and private key pairs comprises a public key and a private key, a target public and private key pair is selected from the plurality of groups of public and private key pairs, and the public key in the target public and private key pair is encoded to generate the block chain ID of the user. In the invention, a plurality of groups of public and private key pairs are generated based on a preset layered deterministic algorithm, then a target public and private key pair is selected from the plurality of groups of public and private key pairs, and finally a block chain ID of a user is generated in a mode of coding a public key in the target public and private key pair, so that the block chain ID is used as an identifier of the user in a block chain to represent the user.
On the basis of the method shown in fig. 1, after step S103, referring to fig. 3, the method for generating a block chain ID according to the embodiment of the present invention may further include:
s106: and taking each public key in the remaining public and private key pairs except the target public and private key pair in the plurality of groups of public and private key pairs as the wallet address of the user.
Since a user may have multiple virtual wallets, each virtual wallet corresponds to a wallet address, and each user performs transactions based on the respective wallet addresses, in order to enable the user to correspond to a corresponding wallet address after the virtual wallet is created, public and private key pairs in multiple sets of public and private key pairs may be used, and each public key in the remaining public and private key pairs except the target public and private key pair is used as the wallet address of the user.
Of course, the public key in the target public-private key pair, i.e., the public key of the blockchain ID, may also be used as the user's wallet address.
S107: and establishing and storing the corresponding relation between the block chain ID and the wallet address.
Since each generated wallet address is owned by the same user, in order to facilitate management of virtual wallets and transfer of money, and in order to enable other users to know to which user each virtual wallet belongs, a correspondence between a block chain ID and a wallet address needs to be established, and after the correspondence between the block chain ID and the wallet address is established, the established correspondence needs to be stored.
Assuming that the blockchain ID of the user M is A, in the multiple groups of public and private key pairs, the public keys in the remaining public and private key pairs except the target public and private key pair are respectively: B. c and D, then: B. c and D as the wallet address of user M;
the established correspondence between the blockchain ID of the user M and the wallet address can be shown as the following table:
Figure BDA0001838574250000081
therefore, by taking each public key in the remaining public and private key pairs except the target public and private key pair in the multiple groups of public and private key pairs as the wallet address of the user, the corresponding relation between the block chain ID and the wallet address is established and stored, the block chain ID of the user is associated with the wallet address, the user to which each wallet address belongs is determined, and other users can know the user to which each virtual wallet belongs.
It is to be understood that a user may conduct transactions with other users in the blockchain, as well as communicate information with other users in the blockchain.
Generally, after receiving information, a receiving party cannot know which user the information is generated by, that is, cannot judge which user the information interaction is performed with, but according to the block chain ID generation method provided by the embodiment of the present invention, a block chain ID corresponds to a target public and private key pair, and each public and private key pair has a generation path corresponding thereto, that is, a block chain ID may indicate a generating party of the information.
In other words, if the receiving side can know the block chain ID of the received information, that is, which user the received information comes from, the embodiment of the present invention further provides a method for using the block chain ID, which can perform identity authentication on the generating side of the information.
Referring to fig. 4, a flow chart of a method for using a block chain ID according to an embodiment of the present invention is shown, where the method includes:
s401: and receiving the information to be authenticated and the block chain ID.
The information to be authenticated is information obtained by encrypting the information to be transmitted by the generator using a target private key corresponding to the blockchain ID of the generator, for example, the generator calculates by using a hash function to obtain a digest of the information to be transmitted, encrypts the digest of the information to be transmitted using a private key corresponding to the blockchain ID to obtain a generator signature, uses the information to be transmitted and the generator signature as information to be authenticated, and transmits the information to be authenticated and the blockchain ID.
The blockchain ID is obtained by encoding a public key of a target public and private key pair in the generated multiple groups of public and private key pairs according to a blockchain ID creation request of a certain user.
It can be understood that if the information to be authenticated is generated by the user corresponding to the blockchain ID, the information to be authenticated is the encrypted information of the target private key corresponding to the blockchain ID, and if the information to be authenticated is not generated by the user corresponding to the blockchain ID, the information to be authenticated is not the encrypted information of the target private key corresponding to the blockchain ID.
S402: and acquiring a corresponding target public key according to the block chain ID.
After the block chain ID is obtained, the corresponding target public key may be obtained according to the block chain ID.
For example, the corresponding relationship between each block chain ID and the target public key may be obtained in advance, so that after the block chain ID is obtained, the block chain ID may be searched in the obtained corresponding relationship between each block chain ID and the target public key to obtain the corresponding target public key.
Or, the encoding method when generating the block chain ID may be obtained in advance, so that after the block chain ID is obtained, the corresponding decoding method may be determined according to the encoding method obtained in advance, and the block chain ID may be decoded to obtain the target public key corresponding to the block chain ID.
S403: and authenticating the information to be authenticated by using the target public key corresponding to the block chain ID.
After the corresponding target public key is obtained, the target public key may be used to authenticate the information to be authenticated, for example, the target public key may be used to decrypt the signature of the generator to obtain an authentication digest, a hash function is used to calculate a digest of the information to be transmitted by the generator, and if the digest of the information to be transmitted by the generator is consistent with the authentication digest obtained by decryption, it is determined that the target public key may successfully decrypt the information to be authenticated, and the authentication is successful.
S404: and if the authentication is successful, judging that the information to be authenticated is the information encrypted by using a target private key corresponding to the block chain ID, and taking the block chain ID as the identity information of the information to be authenticated.
If the target public key can successfully decrypt the received information to be authenticated, the information to be authenticated is the encrypted information of the target private key corresponding to the block chain ID, in other words, the generator of the information to be authenticated is the user corresponding to the block chain ID. If the decryption fails, it is proved that the information to be authenticated is not the information encrypted by the target private key corresponding to the blockchain ID, that is, the information to be authenticated is not from the user corresponding to the blockchain ID.
Therefore, the purpose of carrying out identity authentication on the information to be authenticated based on the block chain ID is achieved.
As can be seen from the above, the block chain ID using method provided by the present invention is implemented by encrypting, by a generator, a private key corresponding to its own block chain ID, sending the encrypted information to be authenticated to a receiver, enabling the receiver to use the received block chain ID, determining a target public key corresponding to the received block chain ID, authenticating, by using the target public key, the identity of the generator of the information to be authenticated, and determining whether the generator of the information to be authenticated is a user corresponding to the received block chain ID.
Meanwhile, in the related art, if the identity of the generator of the information to be authenticated is required to be determined, the information to be authenticated needs to be decrypted, the decrypted information is analyzed, and the identity information of the generator of the information to be authenticated is extracted from the decrypted information.
With respect to the above method embodiment, referring to fig. 5, an embodiment of the present invention further provides a device for generating a block chain ID, where the device may include:
a first receiving module 501, configured to receive a blockchain ID creation request sent by a user, and generate a plurality of sets of public and private key pairs based on a preset hierarchical deterministic algorithm, where a set of public and private key pairs includes a public key and a private key;
a selecting module 502, configured to select a target public-private key pair from the multiple sets of public-private key pairs;
a generating module 503, configured to encode the public key in the target public-private key pair, and generate the blockchain ID of the user.
In the embodiment of the invention, a block chain ID creation request sent by a user is received, a plurality of groups of public and private key pairs are generated based on a preset layered deterministic algorithm, wherein one group of public and private key pairs comprises a public key and a private key, a target public and private key pair is selected from the plurality of groups of public and private key pairs, and the public key in the target public and private key pair is encoded to generate the block chain ID of the user. In the invention, a plurality of groups of public and private key pairs are generated based on a preset layered deterministic algorithm, then a target public and private key pair is selected from the plurality of groups of public and private key pairs, and finally a block chain ID of a user is generated in a mode of coding a public key in the target public and private key pair, so that the block chain ID is used as an identifier of the user in a block chain to represent the user.
In an implementation manner of the present invention, the first receiving module 501 may include:
an obtaining submodule for obtaining a random number;
a master private key generation submodule for generating a master private key based on the random number;
and the public and private key pair generation submodule is used for generating a plurality of groups of public and private key pairs based on the main private key and a plurality of generation paths, wherein different generation paths correspondingly generate different public and private key pairs.
In an implementation manner of the present invention, the selecting module 502 may be specifically configured to:
and acquiring a public and private key pair corresponding to the target generation path from the multiple groups of public and private key pairs as a target public and private key pair in a random mode.
In one implementation manner of the present invention, the apparatus may further include:
a wallet address determination module for, after the step of generating the user's blockchain ID, taking each public key of the remaining public-private key pairs of the plurality of sets of public-private key pairs except the target public-private key pair as the user's wallet address;
and the establishing module is used for establishing and storing the corresponding relation between the block chain ID and the wallet address.
As shown in fig. 6, an embodiment of the present invention further provides an apparatus for using a block chain ID, where the apparatus includes:
a second receiving module 601, configured to receive information to be authenticated and a blockchain ID, where the blockchain ID is obtained by encoding a public key of a target public-private key pair in a plurality of generated public-private key pairs according to a blockchain ID creation request of a user;
an obtaining module 602, configured to obtain a corresponding target public key according to the block chain ID;
an authentication module 603, configured to authenticate the information to be authenticated by using a target public key corresponding to the block chain ID; and if the authentication is successful, judging that the information to be authenticated is the information encrypted by using a target private key corresponding to the block chain ID, and taking the block chain ID as the identity information of the information to be authenticated.
An embodiment of the present invention further provides an electronic device, as shown in fig. 7, including a processor 701 and a memory 702,
a memory 702 for storing a computer program;
the processor 701 is configured to implement a block chain ID generation method when executing the computer program stored in the memory 702, and the method may include the following steps:
receiving a block chain ID creation request sent by a user, and generating a plurality of groups of public and private key pairs based on a preset hierarchical deterministic algorithm, wherein one group of public and private key pairs comprises a public key and a private key;
selecting a target public and private key pair from the multiple groups of public and private key pairs;
and encoding a public key in the target public and private key pair to generate the block chain ID of the user.
Alternatively, a method for using a blockchain ID is implemented, which may include the steps of:
receiving information to be authenticated and a blockchain ID, wherein the blockchain ID is obtained by encoding a public key of a target public and private key pair in a plurality of groups of generated public and private key pairs according to a blockchain ID creation request of a user;
acquiring a corresponding target public key according to the block chain ID;
authenticating the information to be authenticated by using a target public key corresponding to the block chain ID;
and if the authentication is successful, judging that the information to be authenticated is the information encrypted by using a target private key corresponding to the block chain ID, and taking the block chain ID as the identity information of the information to be authenticated.
In the embodiment of the invention, electronic equipment receives a block chain ID creation request sent by a user, and generates a plurality of groups of public and private key pairs based on a preset hierarchical deterministic algorithm, wherein one group of public and private key pairs comprises a public key and a private key, a target public and private key pair is selected from the plurality of groups of public and private key pairs, and the public key in the target public and private key pair is encoded to generate the block chain ID of the user. In the invention, a plurality of groups of public and private key pairs are generated based on a preset layered deterministic algorithm, then a target public and private key pair is selected from the plurality of groups of public and private key pairs, and finally a block chain ID of a user is generated in a mode of coding a public key in the target public and private key pair, so that the block chain ID is used as an identifier of the user in a block chain to represent the user.
In an implementation manner of the present invention, the step of generating a plurality of sets of public and private key pairs based on a preset hierarchical deterministic algorithm may include:
obtaining a random number;
generating a master private key based on the random number;
and generating a plurality of groups of public and private key pairs based on the main private key and the plurality of generation paths, wherein different generation paths correspondingly generate different public and private key pairs.
In an implementation manner of the present invention, the step of selecting a target public-private key pair from the plurality of sets of public-private key pairs may include:
and acquiring a public and private key pair corresponding to the target generation path from the plurality of groups of public and private key pairs as a target public and private key pair.
In one implementation manner of the present invention, after the step of generating the user's blockchain ID, the method may further include:
taking each public key in the remaining public and private key pairs except the target public and private key pair in the plurality of groups of public and private key pairs as the wallet address of the user;
and establishing and storing the corresponding relation between the block chain ID and the wallet address.
The Memory mentioned in the above electronic device may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the method for generating a block chain ID is implemented, where the method includes:
receiving a block chain ID creation request sent by a user, and generating a plurality of groups of public and private key pairs based on a preset hierarchical deterministic algorithm, wherein one group of public and private key pairs comprises a public key and a private key;
selecting a target public and private key pair from the multiple groups of public and private key pairs;
encoding a public key in the target public and private key pair to generate a blockchain ID of the user;
alternatively, a method for using a blockchain ID is implemented, which may include the steps of:
receiving information to be authenticated and a blockchain ID, wherein the blockchain ID is obtained by encoding a public key of a target public and private key pair in a plurality of groups of generated public and private key pairs according to a blockchain ID creation request of a user;
acquiring a corresponding target public key according to the block chain ID;
authenticating the information to be authenticated by using a target public key corresponding to the block chain ID;
and if the authentication is successful, judging that the information to be authenticated is the information encrypted by using a target private key corresponding to the block chain ID, and taking the block chain ID as the identity information of the information to be authenticated.
In the embodiment of the invention, a computer program is executed by a processor to receive a blockchain ID creation request sent by a user, and generate a plurality of groups of public and private key pairs based on a preset hierarchical deterministic algorithm, wherein one group of public and private key pairs comprises a public key and a private key, a target public and private key pair is selected from the plurality of groups of public and private key pairs, and the public key in the target public and private key pair is encoded to generate the blockchain ID of the user. In the invention, a plurality of groups of public and private key pairs are generated based on a preset layered deterministic algorithm, then a target public and private key pair is selected from the plurality of groups of public and private key pairs, and finally a block chain ID of a user is generated in a mode of coding a public key in the target public and private key pair, so that the block chain ID is used as an identifier of the user in a block chain to represent the user.
In an implementation manner of the present invention, the step of generating a plurality of sets of public and private key pairs based on a preset hierarchical deterministic algorithm may include:
obtaining a random number;
generating a master private key based on the random number;
and generating a plurality of groups of public and private key pairs based on the main private key and the plurality of generation paths, wherein different generation paths correspondingly generate different public and private key pairs.
In an implementation manner of the present invention, the step of selecting a target public-private key pair from the plurality of sets of public-private key pairs may include:
and acquiring a public and private key pair corresponding to the target generation path from the plurality of groups of public and private key pairs as a target public and private key pair.
In one implementation manner of the present invention, after the step of generating the user's blockchain ID, the method may further include:
taking each public key in the remaining public and private key pairs except the target public and private key pair in the plurality of groups of public and private key pairs as the wallet address of the user;
and establishing and storing the corresponding relation between the block chain ID and the wallet address.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the device embodiment, the electronic device embodiment and the storage medium embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A method for generating a blockchain ID, the method comprising:
receiving a block chain ID creation request sent by a user, generating a plurality of groups of public and private key pairs based on a preset layered deterministic algorithm, and generating the plurality of groups of public and private key pairs based on the preset layered deterministic algorithm, wherein the method comprises the following steps: obtaining a random number, generating a main private key based on the random number, and generating a plurality of groups of public and private key pairs based on the main private key and a plurality of generation paths, wherein different generation paths correspondingly generate different public and private key pairs, and one group of public and private key pairs comprises a public key and a private key;
selecting a target public and private key pair from the multiple groups of public and private key pairs;
and encoding a public key in the target public and private key pair to generate a block chain ID of the user, wherein the block chain ID of the user is the encoded public key in the target public and private key pair.
2. The method of claim 1, wherein the step of selecting a target public-private key pair from the plurality of sets of public-private key pairs comprises:
and acquiring a public and private key pair corresponding to the target generation path from the plurality of groups of public and private key pairs as a target public and private key pair.
3. The method of claim 1, wherein after the step of generating the user's blockchain ID, the method further comprises:
taking each public key in the remaining public and private key pairs except the target public and private key pair in the plurality of groups of public and private key pairs as the wallet address of the user;
and establishing and storing the corresponding relation between the block chain ID and the wallet address.
4. A method for using a blockchain ID, the method comprising:
receiving information to be authenticated and a blockchain ID, wherein the blockchain ID is obtained by encoding a public key of a target public and private key pair in a plurality of groups of generated public and private key pairs according to a blockchain ID creation request of a user;
acquiring a corresponding target public key according to the block chain ID;
authenticating the information to be authenticated by using a target public key corresponding to the block chain ID;
and if the authentication is successful, judging that the information to be authenticated is the information encrypted by using a target private key corresponding to the block chain ID, and taking the block chain ID as the identity information of the information to be authenticated.
5. An apparatus for generating a block chain ID, the apparatus comprising:
a first receiving module, configured to receive a block chain ID creation request sent by a user, generate a plurality of sets of public and private key pairs based on a preset hierarchical deterministic algorithm, where the generating of the plurality of sets of public and private key pairs based on the preset hierarchical deterministic algorithm includes: obtaining a random number, generating a main private key based on the random number, and generating a plurality of groups of public and private key pairs based on the main private key and a plurality of generation paths, wherein different generation paths correspondingly generate different public and private key pairs, and one group of public and private key pairs comprises a public key and a private key;
the selection module is used for selecting a target public and private key pair from the multiple groups of public and private key pairs;
and the generating module is used for encoding the public key in the target public and private key pair to generate the block chain ID of the user, wherein the block chain ID of the user is the encoded public key in the target public and private key pair.
6. The apparatus of claim 5, wherein the selection module is specifically configured to:
and acquiring a public and private key pair corresponding to the target generation path from the plurality of groups of public and private key pairs as a target public and private key pair.
7. The apparatus of claim 5, further comprising:
a wallet address determination module for, after the step of generating the user's blockchain ID, taking each public key of the remaining public-private key pairs of the plurality of sets of public-private key pairs except the target public-private key pair as the user's wallet address;
and the establishing module is used for establishing and storing the corresponding relation between the block chain ID and the wallet address.
8. An apparatus for using a block chain ID, the apparatus comprising:
the second receiving module is used for receiving information to be authenticated and the block chain ID, wherein the block chain ID is obtained by encoding a public key of a target public and private key pair in a plurality of groups of generated public and private key pairs according to a block chain ID creation request of a user;
the acquisition module is used for acquiring a corresponding target public key according to the block chain ID;
the authentication module is used for authenticating the information to be authenticated by using a target public key corresponding to the block chain ID; and if the authentication is successful, judging that the information to be authenticated is the information encrypted by using the target private key corresponding to the block chain ID.
9. An electronic device comprising a processor and a memory, wherein,
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 3 or claim 4 when executing the computer program stored on the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-3 or 4.
CN201811237645.1A 2018-10-23 2018-10-23 Block chain ID generation and use method, device, electronic equipment and storage medium Active CN109347632B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811237645.1A CN109347632B (en) 2018-10-23 2018-10-23 Block chain ID generation and use method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811237645.1A CN109347632B (en) 2018-10-23 2018-10-23 Block chain ID generation and use method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109347632A CN109347632A (en) 2019-02-15
CN109347632B true CN109347632B (en) 2022-02-25

Family

ID=65311215

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811237645.1A Active CN109347632B (en) 2018-10-23 2018-10-23 Block chain ID generation and use method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109347632B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109743185B (en) * 2019-03-19 2020-12-01 全链通有限公司 Group communication method based on domain name block chain, block chain link point and medium
CN110474775B (en) * 2019-07-04 2020-09-01 阿里巴巴集团控股有限公司 User creating method, device and equipment in block chain type account book
US10791122B2 (en) 2019-07-04 2020-09-29 Alibaba Group Holding Limited Blockchain user account data
US11387978B2 (en) * 2019-09-23 2022-07-12 Live Nation Entertainment, Inc. Systems and methods for securing access rights to resources using cryptography and the blockchain
CN110705985B (en) * 2019-10-21 2020-09-29 北京海益同展信息科技有限公司 Method and apparatus for storing information
CN111556124B (en) * 2020-04-14 2023-06-16 深圳市启迪网络科技有限公司 Safe block chain wallet service system
CN112887160B (en) * 2021-04-29 2021-07-30 杭州链城数字科技有限公司 Block chain all-in-one machine, multi-node deployment method and device thereof, and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104821880A (en) * 2015-05-05 2015-08-05 九江学院 Certificate-free generalized proxy signcryption method
CN105959307A (en) * 2016-06-30 2016-09-21 中国科学院计算技术研究所 Existence certification and authentication service method and system based on block chain technology
CN106788985A (en) * 2016-11-25 2017-05-31 中国电子科技集团公司第三十研究所 The stealthy address implementation method that a kind of third party can supervise
CN106790253A (en) * 2017-01-25 2017-05-31 中钞信用卡产业发展有限公司北京智能卡技术研究院 Authentication method and device based on block chain
CN107222312A (en) * 2017-06-20 2017-09-29 无锡井通网络科技有限公司 Assets digitizing solution based on block chain technology
CN107276754A (en) * 2017-07-10 2017-10-20 北京云知科技有限公司 A kind of method and device that private key is largely generated based on block chain
WO2018183307A1 (en) * 2017-03-31 2018-10-04 Madisetti Vijay Method and system for identity and access management for blockchain interoperability

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160098730A1 (en) * 2014-10-01 2016-04-07 The Filing Cabinet, LLC System and Method for Block-Chain Verification of Goods
EP3955146A1 (en) * 2015-05-05 2022-02-16 Ping Identity Corporation Identity management service using a block chain
CN107341676A (en) * 2017-07-17 2017-11-10 深圳天净喔溯源科技有限公司 False proof mark and the method for tracing to the source

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104821880A (en) * 2015-05-05 2015-08-05 九江学院 Certificate-free generalized proxy signcryption method
CN105959307A (en) * 2016-06-30 2016-09-21 中国科学院计算技术研究所 Existence certification and authentication service method and system based on block chain technology
CN106788985A (en) * 2016-11-25 2017-05-31 中国电子科技集团公司第三十研究所 The stealthy address implementation method that a kind of third party can supervise
CN106790253A (en) * 2017-01-25 2017-05-31 中钞信用卡产业发展有限公司北京智能卡技术研究院 Authentication method and device based on block chain
WO2018183307A1 (en) * 2017-03-31 2018-10-04 Madisetti Vijay Method and system for identity and access management for blockchain interoperability
CN107222312A (en) * 2017-06-20 2017-09-29 无锡井通网络科技有限公司 Assets digitizing solution based on block chain technology
CN107276754A (en) * 2017-07-10 2017-10-20 北京云知科技有限公司 A kind of method and device that private key is largely generated based on block chain

Also Published As

Publication number Publication date
CN109347632A (en) 2019-02-15

Similar Documents

Publication Publication Date Title
CN109347632B (en) Block chain ID generation and use method, device, electronic equipment and storage medium
CN110086608B (en) User authentication method, device, computer equipment and computer readable storage medium
JP6547079B1 (en) Registration / authorization method, device and system
CN109067801B (en) Identity authentication method, identity authentication device and computer readable medium
CN104065653B (en) A kind of interactive auth method, device, system and relevant device
CN109687959B (en) Key security management system, key security management method, key security management medium, and computer program
CN111079128A (en) Data processing method and device, electronic equipment and storage medium
KR20180114182A (en) Secure personal devices using elliptic curve cryptography for secret sharing
CN105099673A (en) Authorization method, authorization requesting method and devices
WO2015072203A1 (en) Information delivery system
CN105553648A (en) Quantum key distribution, privacy amplification and data transmission methods, apparatuses, and system
KR20170057549A (en) Large simultaneous digital signature service system based on hash function and method thereof
CN101815091A (en) Cipher providing equipment, cipher authentication system and cipher authentication method
JP5506704B2 (en) Decryption system, key device, decryption method, and program
CN107920052B (en) Encryption method and intelligent device
CN102782694A (en) Transaction auditing for data security devices
Xie et al. Cryptanalysis and security enhancement of a robust two‐factor authentication and key agreement protocol
CN113067699B (en) Data sharing method and device based on quantum key and computer equipment
CN110599342B (en) Block chain-based identity information authorization method and device
KR20160045752A (en) Identity authentication system, apparatus, and method, and identity authentication request apparatus
US20160021101A1 (en) Method for backing up a user secret and method for recovering a user secret
CN109962777A (en) The key in block catenary system is permitted to generate, obtain the method and apparatus of key
CN101944216A (en) Two-factor online transaction safety authentication method and system
CN108121904B (en) Unlocking method, device, electronic equipment and server
CN115276978A (en) Data processing method and related device

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