Identity verification method, electronic equipment and computer readable storage medium
Two blockchain addresses are generated through blockchain technology, one is used for identity attribute recording and the other is used for private key management. The verifier can only receive the attribute commitment value, which solves the problem of anonymous login and privacy protection that cannot be achieved in the existing technology. problem, achieving anonymous login and ensuring information security.
Patent Information
- Application Number
- CN202310477638.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-27
- Publication Date
- 2024-10-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing identity verification methods cannot achieve anonymous login of users, and cannot effectively protect the privacy of users' personal information. Especially during the login process between multiple websites, it is easy to leak identity information.
By using blockchain technology, two blockchain addresses are generated, one for identity attribute records and the other for private key management. The verifier can only receive the attribute commitment value but cannot know the specific identity attributes. The user passes the private key After successful verification, identity verification success information is sent to achieve anonymous login and protect privacy.
It achieves the anonymity of user login, effectively protects the privacy of users' personal information, prevents the leakage of identity information, and enhances the security of the login process.
Smart Images

Figure CN118862028A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information security, and in particular to an identity authentication method, an electronic device, and a computer-readable storage medium. Background Art
[0002] In the future digital world, people, objects, and organizations will all need digital identities as the basis for interaction. A physical entity may correspond to one or more digital identities. A digital identity is composed of many identity attributes, including various physical attributes, social attributes, location / time attributes, etc. Different attributes may be obtained through different channels. For example, basic physical identities are issued by the government, social attributes are given by social platforms, and location / time may be obtained from real-time status. These identity attributes must be verifiable, and different attributes may have different verification methods. These verified attributes can be combined into a digital identity.
[0003] In the related art, due to the lack of a unified identity standard, many identity attribute authentications are provided by a few Internet giants. After registering an identity once at a large Internet company, users can use the one-click login function to log in to other websites using this identity without having to register again. However, the above identity login method cannot achieve anonymous login for users, and may also cause the leakage of user identity information, and cannot effectively protect the user's personal privacy. Summary of the invention
[0004] In view of this, the present application provides an identity authentication method that can achieve the anonymity of user login and effectively protect the privacy of the user's personal information.
[0005] The first aspect of the present application provides an identity authentication method, which is applied to an electronic device on the verification side, and the method includes: in response to a user's identity authentication request, when verifying the existence of a target identity attribute, determining a first blockchain address with the target identity attribute, wherein the target identity attribute is an attribute that needs to be verified when the user logs in to the verification party; receiving private key information, and verifying whether the user has the private key of the first blockchain address based on the private key information, wherein the private key information is used to represent a certain private key, the private key information belongs to a second blockchain address, and the second blockchain address is registered for the user; after verifying that the user has the private key of the first blockchain address, sending identity authentication success information.
[0006] Compared with the related art, the embodiments of the present application have at least the following advantages: when the user needs to provide identity proof to the verifier, the electronic device verifies and detects whether there is a target identity attribute that matches the attribute that the verifier needs to verify. Since the target identity attribute belongs to the first blockchain address, the electronic device verifies whether the user has the private key of the first blockchain address based on the private key information belonging to the second blockchain address, thereby being able to verify whether the user has the target identity attribute. When it is detected that the user has the target identity attribute, it indicates that the user's identity verification is successful. Through the above-mentioned identity verification method, since the private key information belongs to the second blockchain address registered by the user, the verifier cannot know the public key that matches the target identity attribute proved by the user, thereby hiding the first blockchain address that actually owns the target identity attribute, while realizing the anonymity of the user login, effectively protecting the user's personal information privacy.
[0007] In some possible implementations, before responding to the user's identity authentication request, it also includes: receiving multiple identity attributes belonging to multiple blockchain addresses, wherein each blockchain address has at least one identity attribute; recording the public key of each blockchain address and the identity attribute of the blockchain address in a preset attribute registration table; and responding to the user's identity authentication request includes: verifying whether there is an identity attribute in the attribute registration table that matches the target identity attribute.
[0008] By adopting this technical solution, the public key and identity attributes of each blockchain can be recorded in the attribute registration table to facilitate subsequent attribute verification.
[0009] In some possible implementations, the receiving multiple identity attributes belonging to multiple blockchain addresses includes: receiving multiple attribute commitment values belonging to multiple blockchain addresses, wherein the attribute commitment values are used to characterize the identity attributes of the user; and recording the public key of each blockchain address and the identity attributes of the blockchain address in a preset attribute registration table includes: recording the public key of each blockchain address and the attribute commitment value of the blockchain address in the attribute registration table.
[0010] In some possible implementations, before verifying whether there is an identity attribute that is the same as the target identity attribute in the attribute registration table, it also includes: the verifier receives a first verification attribute commitment value, wherein the first verification attribute commitment value belongs to the second blockchain address; after the verifier verifies that the first verification attribute commitment value meets the login requirements, the verifier sends the first verification attribute commitment value to the electronic device; verifying whether there is an identity attribute that matches the target identity attribute in the attribute registration table includes: verifying whether there is an attribute commitment value that is the same as the first verification attribute commitment value in the attribute registration table.
[0011] By adopting this technical solution, a method of verifying whether a user has a private key is realized. On the one hand, it can prove that the user has the target attribute commitment value, and on the other hand, it can hide the user's real account identity and protect the user's privacy.
[0012] In some possible implementations, verifying whether the user owns the private key of the first blockchain address based on the private key information includes: the verifier receives the private key information; the verifier sends the private key information to the electronic device; the electronic device determines the private key to be verified owned by the user based on the private key information, and verifies whether the private key to be verified matches the public key corresponding to the first verification attribute commitment value; after verifying that the user owns the private key of the first blockchain address, sending identity authentication success information includes: after verifying that the private key to be verified matches the public key corresponding to the first verification attribute commitment value, sending the identity authentication success information to the verifier.
[0013] In some possible implementations, before verifying whether there is an identity attribute identical to the target identity attribute in the attribute registration table, it also includes: receiving a second verification attribute commitment value, wherein the second verification attribute commitment value belongs to the second blockchain address, and the second verification attribute commitment value is used to characterize the target identity attribute of the user; verifying whether there is an identity attribute matching the target identity attribute in the attribute registration table includes: verifying whether there is a target attribute commitment value in the attribute registration table, wherein the target attribute commitment value is also used to characterize the target identity attribute, and the second verification attribute commitment value is not equal to the target attribute commitment value.
[0014] By adopting this technical solution, on the one hand, it can prove that the user has the target attribute commitment value, and on the other hand, it can hide the user's real account identity and protect the user's privacy.
[0015] In some possible implementations, verifying whether the user owns the private key of the first blockchain address based on the private key information includes: receiving the private key information; determining the private key to be verified owned by the user based on the private key information, and verifying whether the private key to be verified matches the public key corresponding to the target attribute commitment value; sending identity authentication success information after verifying that the user owns the private key of the first blockchain address includes: sending the identity authentication success information after verifying that the private key to be verified matches the public key corresponding to the target attribute commitment value.
[0016] In some possible implementations, after verifying that the private key to be verified matches the public key corresponding to the target attribute commitment value, sending the identity authentication success information includes: after verifying that the private key to be verified matches the public key corresponding to the target attribute commitment value, generating a new non-fungible token according to the second verified attribute commitment value; sending the new non-fungible token to the user, so that the user sends the new non-fungible token to the verifier.
[0017] By adopting this technical solution, users can perform relevant identity authentication and obtain new non-fungible tokens before logging in to the verification party, so that the user's identity attributes can be verified more quickly when logging in to the verification party.
[0018] The second aspect of the present application discloses an identity authentication method, which is applied to a terminal device on the user side, and the method includes: registering a first blockchain address and a second blockchain address; sending identity attributes to an electronic device on the verification side according to the first blockchain address, so that the electronic device records the identity attributes and the first blockchain address; sending private key information to the electronic device according to the second blockchain address, so that the electronic device verifies whether the user has a private key of a target blockchain address according to the private key information, wherein the target blockchain address corresponds to a target identity attribute, and the target identity attribute is an attribute that needs to be verified when the user logs in to the verification party; receiving identity authentication success information, and the identity authentication information is sent after the electronic device verifies that the user has the private key of the target blockchain address.
[0019] The third aspect of the present application discloses an identity authentication method, which is applied to a terminal device on the user side, and the method includes: registering a first blockchain address and a second blockchain address; sending an identity attribute to an electronic device on the verification side according to the first blockchain address, so that the electronic device records the identity attribute and the first blockchain address; sending a target identity attribute and private key information to the verification party according to the second blockchain address, wherein the target identity attribute is an attribute that needs to be verified when the user logs in to the verification party, and after receiving the target identity attribute and the private key information, the verification party forwards the target identity attribute and the private key information to the electronic device, and the electronic device verifies whether the user has the private key of the target blockchain address according to the private key information, and the target blockchain address corresponds to the target identity attribute; receiving identity authentication success information, and the identity authentication information is sent after the electronic device verifies that the user has the private key of the target blockchain address.
[0020] In a fourth aspect, the present application discloses an electronic device, which includes a processor and a memory, wherein the memory is used to store instructions, and the processor is used to call the instructions in the memory so that the electronic device executes the above method.
[0021] A fifth aspect of the present application discloses a computer-readable storage medium, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above method.
[0022] It can be understood that the electronic device of the fourth aspect and the computer-readable storage medium of the fifth aspect provided above both correspond to the method of the first aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A schematic diagram of the functional modules of an identity verification system provided in one embodiment of the present application;
[0024] Figure 2 A flowchart of a method for obtaining user NFT is provided for an embodiment of the present application;
[0025] Figure 3 A flowchart of an identity authentication method provided in one embodiment of the present application;
[0026] Figure 4 A flowchart of an identity authentication method provided in one embodiment of the present application;
[0027] Figure 5 A flowchart of an identity authentication method provided in one embodiment of the present application;
[0028] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the present application is described in detail below in conjunction with the accompanying drawings and specific implementation methods. It should be noted that the implementation methods of the present application and the features in the implementation methods can be combined with each other without conflict.
[0030] In the following description, many specific details are set forth to facilitate a full understanding of the present application. The described implementations are only part of the implementations of the present application, rather than all of the implementations.
[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0032] It should be further noted that, in this article, the terms "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0033] In this application, "at least one" means one or more, and "more than one" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and drawings of this application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0034] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0035] To facilitate understanding, some illustrations of concepts related to the embodiments of the present application are given by way of example for reference.
[0036] A non-fungible token (NFT) is a unique data representation recorded in a blockchain that cannot be copied, replaced, or divided, and is used to verify the authenticity or rights of a specific digital asset. This type of digital encrypted asset is unique, scarce, and cannot be copied. The use cases of NFTs range from digital art, domain names, games, collectibles, and more. NFTs are minted on a blockchain (such as Ethereum) and can be used to verify the ownership of assets. They have the following characteristics: (1) Decentralized ownership: There is no need for a central institution to act as a trusted custodian, and the ownership of assets can be easily transferred on the blockchain, saving time and costs; (2) Enhanced liquidity: Tokenization will enable us to release liquidity from illiquid assets that are difficult to physically divide; (3) Fractional ownership: Each token represents a small portion of the overall value of the asset, which reduces the barrier to investment and allows anyone to own a small piece of the asset; (4) All-day access: Assets can be bought and sold at any time through instant smart contract technology; (5) Fast ownership transfer: Ownership can be transferred instantly.
[0037] A smart contract is a computer protocol designed to communicate, verify or execute contracts in an information-based manner. Smart contracts allow for trusted transactions without a third party, which are traceable and irreversible.
[0038] Blockchain is a chain of blocks, each of which stores certain information. They are connected to form a chain in the order of their generation. Blockchain has the following characteristics: (1) Decentralization. Blockchain technology does not rely on additional third-party management agencies or hardware facilities, and there is no central control. In addition to the self-contained blockchain itself, each node realizes self-verification, transmission and management of information through distributed accounting and storage. (2) Openness. The foundation of blockchain technology is open source. Except for the private information of the transaction parties being encrypted, the data of the blockchain is open to everyone. Anyone can query the blockchain data and develop related applications through public interfaces. (3) Security. As long as you cannot control 51% of all the data nodes of the blockchain, you cannot arbitrarily manipulate and modify the network data. This makes the blockchain itself relatively safe and avoids subjective and artificial data changes. (4) Anonymity. The identity information of each block node does not need to be made public or verified, and information transmission can be anonymous.
[0039] Issuer under the blockchain: an offline certificate issuing center that issues certificates such as identity cards, degree certificates, and driving licenses.
[0040] The issuing authority (V-Issuer) on the blockchain is connected to the blockchain and is a certificate issuing center running on the blockchain. V-Issuer can convert certificates issued by each Issuer into NFT.
[0041] Please refer to Figure 1 , which is a functional module diagram of the identity authentication system provided in the embodiment of the present application. The identity authentication system includes multiple modules, each of which is used to implement different functions. In this embodiment, the identity authentication system includes: a blockchain module 1, a smart contract module 2, and a zero-knowledge proof module 3. It can be understood that the identity authentication system of this embodiment is a system provided on an electronic device, and the electronic device includes but is not limited to any device such as a mobile phone, a smart TV, a smart speaker, a wearable device, a tablet computer, a desktop computer, an all-in-one computer, a handheld computer, a laptop computer, a super mobile personal computer, etc.
[0042] Specifically, the blockchain module 1 is used to record transaction information and ensure the reliability of the records through a distributed consensus algorithm. The blockchain module 1 is specifically a blockchain that can run smart contracts at the bottom layer.
[0043] Smart contract module 2 runs on the blockchain and handles the generation and transfer of NFTs, as well as related operations required for subsequent user identity verification based on the blockchain's trusted mechanism.
[0044] The zero-knowledge proof module 3 is used to process the zero-knowledge proof protocol between the user and the verification party.
[0045] Please refer to Figure 2 , which is a flow chart of the user NFT acquisition method provided in this embodiment. Specifically, there are two ways for users to obtain NFTs, one is from the issuing authority (Issuer) under the blockchain, and the other is from the issuing authority (V-Issuer) on the blockchain.
[0046] The off-chain institution (Issuer) sends a traditional identity certificate (Verifiable Credentials, VC) to the user. After receiving the VC, the user can submit the VC to the smart contract module 2 for signature verification. Since the VC contains the user's identity attributes, the smart contract module 2 generates an NFT corresponding to the identity attributes and sends the NFT to the user. If the user's VC contains the user's height information, weight information, and home address information, the smart contract module 2 will generate an NFT corresponding to the height information, weight information, and home address information.
[0047] The on-chain institution (V-Issuer) directly issues NFTs corresponding to the user's identity attributes to the user. Since the source of NFT issuance can be publicly queried and a signature transaction is also required to be initiated by the on-chain institution, when verifying the user's identity attributes, as long as the source address of the NFT corresponding to the identity attribute is confirmed to be the certificate issuing center, the correctness of the identity attribute can be confirmed. If the on-chain institution determines that the certificate is an ID card issued by the ID card issuing center, then in the NFT issued by the on-chain institution to the user, the identity attributes recorded in the NFT include but are not limited to: the user's ID number, home address, and date of birth.
[0048] After receiving the NFT, the user can use the NFT to prove his or her identity to the verifier. In order to protect privacy, the identity attributes recorded in the NFT are not recorded in plain text, but a commitment value calculated by a one-way function, so that the identity attributes of the user can be proved without exposing the user's attributes.
[0049] For ease of understanding, the following assumes that the user has identity attribute X, the commitment value of identity attribute X calculated by a one-way function is attribute commitment value Y, and the NFT minted by attribute commitment value Y is NFT Z Taking this as an example, how to implement user identity authentication in this embodiment is specifically described:
[0050] Blockchain module 1 generates two different blockchain address IDs A and ID A1 , blockchain address ID A The public key and private key of NFT are public key 1 and private key 1 respectively. Z Send to blockchain address ID A After that, the blockchain address ID A The attribute commitment value Y is sent to the smart contract module 2. The smart contract module 2 has pre-established an attribute registration table and verified the user's blockchain address ID in the smart contract module 2. A NFT Z When the user needs to log in to a verification party, assuming that the verification party needs to verify whether the user has identity attribute X, the user's blockchain address ID is proved by the zero-knowledge proof module 3. A1 With private key one, it can be proved that the user has identity attribute X and can log in to the verification party.
[0051] Please refer to Figure 3 , is a flow chart of an identity authentication method provided in an embodiment of the present application. This embodiment is applied to an electronic device on the verification side of the aforementioned embodiment, such as Figure 3 As shown, the following steps are included:
[0052] Step 101: The electronic device responds to the user's identity authentication request.
[0053] In some embodiments, before the device verifies whether there is a target identity attribute that matches the verification attribute, the electronic device also receives multiple identity attributes belonging to multiple blockchain addresses, wherein each blockchain address has at least one identity attribute; and then records the public key of each blockchain address and the identity attribute of the blockchain address in a preset attribute registration table. In some embodiments, in order to further improve the anonymity of user login and more effectively protect the privacy of the user's personal information, the electronic device does not directly receive the identity attribute, but receives the attribute commitment value, which is used to characterize the user's identity attribute. The electronic device records the public key of each blockchain address and the attribute commitment value of the blockchain address in the attribute registration table.
[0054] Specifically, assuming that a user has a first blockchain address and a second blockchain address, the registration process for the first blockchain address and the second blockchain address is as follows: after receiving a blockchain address registration request sent by a terminal device on the user side, the electronic device generates a private key based on the private key generation algorithm of the blockchain, and then generates a public key matching the private key based on the private key and the public key generation algorithm of the blockchain, and the first blockchain address is the hash value of the public key. It is understandable that when the user registers the second blockchain address in the same way as the above method, there is no connection between the second blockchain address and the first blockchain address.
[0055] The user's identity attributes include the user's specific height information, weight information, education level, date of birth, home address and other information. In order to avoid redundancy, they are not listed here one by one.
[0056] It can be seen from the above embodiments that the attribute commitment value of the user is calculated by the on-chain institution according to the identity attributes of the user. After calculating the attribute commitment value, the on-chain institution converts the attribute commitment value into NFT through the smart contract deployed by the on-chain institution, and then sends the NFT to the user's first blockchain address. Assuming that the attribute commitment value X is calculated based on the user's identity attribute Y, the attribute commitment value X can verify that the user has identity attribute Y, but neither the device nor the verifier can know the specific content of identity attribute Y. The relationship between the attribute commitment value and the identity attribute can be a one-to-one correspondence, a one-to-many relationship, a many-to-one relationship, or a many-to-many relationship. For ease of understanding, the relationship between the above-mentioned attribute commitment value and identity attribute identity information is specifically illustrated below:
[0057] Institution A on the chain uses a one-way function to calculate an attribute commitment value based on the user's educational information. There is a one-to-one correspondence between the attribute commitment value and the identity attribute.
[0058] The on-chain institution B uses a one-way function to calculate an attribute commitment value together with the user's height and weight information. There is a one-to-many relationship between the attribute commitment value and the identity attribute.
[0059] The on-chain institution C uses the user's home address and random number M through a one-way function to calculate the first attribute commitment value. The on-chain institution C then uses the user's home address and random number N through a one-way function to calculate the second attribute commitment value. Since the random number M is not equal to the random number N, the first attribute commitment value is not equal to the second attribute commitment value. However, the first attribute commitment value and the second attribute commitment value are both used to represent the user's home address, so there is a one-to-many relationship between the attribute commitment value and the identity attribute.
[0060] The on-chain institution D uses the user's date of birth, home address and random number P through a one-way function to calculate the third attribute commitment value. The on-chain institution D then uses the user's date of birth, home address and random number Q through a one-way function to calculate the fourth attribute commitment value. Since the random number P is not equal to the random number Q, the third attribute commitment value is not equal to the fourth attribute commitment value. However, the third attribute commitment value and the fourth attribute commitment value are both used to represent the user's date of birth and home address, so there is a many-to-many relationship between the attribute commitment value and the identity attribute.
[0061] In some embodiments, before the electronic device records the user's attribute commitment value and public key in a pre-established attribute registration table, it also includes: receiving the user's attribute commitment value; detecting whether there is a non-fungible token matching the attribute commitment value in the user's first blockchain address; recording the user's attribute commitment value and public key in the pre-established attribute registration table includes: when detecting that there is a non-fungible token matching the attribute commitment value in the first blockchain address, recording the attribute commitment value and the public key in the attribute registration table.
[0062] Specifically, the user's first blockchain address records the user's NFT, and the device pre-establishes an attribute registration table. Assuming that the user needs to register the attribute commitment value A in the attribute registration table, the user sends the attribute commitment value A to the device through the first blockchain address. Since the information of the NFT is public and transparent, and the user's attribute commitment value A is written in the metadata of the NFT, the device can detect whether there is an NFT recording the attribute commitment value A in the user's first blockchain address. When the device detects that there is an NFT recording the attribute commitment value A in the user's first blockchain address, the device records the attribute commitment value A and the public key of the first blockchain address in the attribute registration table.
[0063] It can be understood that each attribute commitment value in the attribute registration table corresponds to a public key. There may be multiple identical attribute commitment values in the attribute registration table, and the public keys corresponding to each attribute commitment value are different. For example, the height of user A and user B are both 180 cm, and the attribute commitment values corresponding to the height information of user A and user B are the same, but the public keys of user A and user B are different; there may also be multiple identical public keys in the attribute registration table, and the attribute commitment values corresponding to each public key are different. For example, if user C registers attribute commitment value one, attribute commitment value two and attribute commitment value three in the attribute registration table, then attribute commitment value one, attribute commitment value two and attribute commitment value three correspond to the same public key.
[0064] In some embodiments, the verification attribute is an attribute that needs to be verified when the user provides identity proof to the verification party. The verification attribute includes but is not limited to the user's age, education level, etc. If the verification party is game A, the user needs to log in to game A, and game A needs to verify the user's age, then the attribute type that game A needs to verify is age.
[0065] How the electronic device specifically responds to the user's identity authentication request is described in detail in the embodiments described later, and will not be described again here to avoid repetition.
[0066] Step 102: When verifying the existence of the target identity attribute, the electronic device determines a first blockchain address having the target identity attribute; the electronic device receives private key information, and verifies whether the user has a private key of the first blockchain address based on the private key information.
[0067] Specifically, the private key information belongs to the second blockchain address, and the second blockchain address is registered by the user.
[0068] Since the first blockchain address has a public key and a private key that match each other, by verifying that the user has the private key of the first blockchain address, it can be verified that the user has the target identity attribute.
[0069] In some embodiments, the private key information is obtained by calculating the private key according to the encryption algorithm in the blockchain module 1. For example, if the user has private key A, the encryption algorithm in the blockchain module 1 calculates private key A to obtain private key information B. In this way, the smart contract module 2 can know that the user has private key A according to private key information B, but the smart contract module 2 cannot know the specific information of private key A, which further protects the privacy security of the user.
[0070] How the device specifically detects whether the user has a private key is described in detail in the embodiments described later, and will not be described again here to avoid repetition.
[0071] Step 103: After verifying that the user has the private key of the first blockchain address, send an identity authentication success message.
[0072] In some embodiments, after the device detects that the user has the private key of the first blockchain address, indicating that the user has the target identity attribute sent by the first blockchain address, the device sends an identity authentication success message to enable the user to successfully log in to the verification party.
[0073] How the device sends the identity authentication success information and the specific content of the identity authentication success information are described in detail in the embodiments described later. In order to avoid repetition, they will not be repeated here.
[0074] Compared with the related art, the embodiments of the present application have at least the following advantages: when the user needs to provide identity proof to the verifier, the electronic device verifies and detects whether there is a target identity attribute that matches the attribute that the verifier needs to verify. Since the target identity attribute belongs to the first blockchain address, the electronic device verifies whether the user has the private key of the first blockchain address based on the private key information belonging to the second blockchain address, thereby being able to verify whether the user has the target identity attribute. When it is detected that the user has the target identity attribute, it indicates that the user's identity verification is successful. Through the above-mentioned identity verification method, since the private key information belongs to the second blockchain address registered by the user, the verifier cannot know the public key that matches the target identity attribute proved by the user, thereby hiding the first blockchain address that actually owns the target identity attribute, while realizing the anonymity of the user login, effectively protecting the user's personal information privacy.
[0075] Please refer to Figure 4 , which is a flow chart of an identity authentication method provided in an embodiment of the present application. This embodiment is an example of the aforementioned embodiment, and specifically illustrates: a method for a device to verify whether there is a target attribute commitment value that matches a first verification attribute commitment value in an attribute registration table, and how an electronic device verifies whether a user possesses a private key under the detection method of the target attribute commitment value.
[0076] The specific process of this embodiment is as follows Figure 4 As shown, the electronic device, the terminal device on the user side and the verification party mentioned in the above embodiment include the following steps:
[0077] Step 201: The electronic device records the public key of each blockchain address and the attribute commitment value of the blockchain address in an attribute registration table.
[0078] Step 202: The terminal device sends a first verification attribute commitment value to the verifier.
[0079] In some embodiments, the identity attribute corresponding to the first verification attribute commitment value is the same as the attribute that needs to be verified when the user logs in to the verification party. Specifically, taking the verification party as recruitment software A as an example, the user's academic information is required when logging in to recruitment software A. Therefore, when the user needs to log in to recruitment software A, the user sends his or her first verification attribute commitment value corresponding to the academic information to recruitment software A.
[0080] Step 203: The verifier receives the first verification attribute commitment value sent by the user, and forwards the first verification attribute commitment value to the electronic device.
[0081] In some embodiments, before the verifier sends the first verification attribute commitment value to the electronic device, the verifier will also detect whether the first verification attribute commitment value meets the login requirements. When the verifier detects that the first verification attribute commitment value meets the login requirements, the first verification attribute commitment value will be sent to the electronic device.
[0082] Specifically, assuming that the verification party is game software B, and game software B requires the user to be over 18 years old when logging in, then after receiving the first verification attribute commitment value sent by the user, game software B will also detect whether the age corresponding to the first verification attribute commitment value is greater than 18 years old. Only when it is detected that the age corresponding to the first verification attribute commitment value is greater than 18 years old, will the first verification attribute commitment value be sent to the electronic device.
[0083] Step 204: The terminal device sends private key information to the verification party.
[0084] The private key information in this embodiment is the same as the private key information mentioned in the previous embodiment. The private key is calculated according to the encryption algorithm in the blockchain module 1 and will not be repeated here.
[0085] The private key information of this embodiment belongs to the second blockchain address, that is, the terminal device sends the private key information to the verifier based on the second blockchain address.
[0086] Step 205: The verifying party receives the private key information sent by the user, and sends the private key information to the device.
[0087] Step 206: The electronic device detects whether there is an attribute commitment value that is the same as the first verification attribute commitment value in the attribute registration table.
[0088] In some embodiments, there may be one or more attribute commitment values in the attribute registration table that are the same as the first verification attribute commitment value.
[0089] Step 207: After an attribute commitment value identical to the first verification attribute commitment value exists in the electronic device verification attribute registration table, the electronic device determines the private key to be verified owned by the user based on the private key information.
[0090] Step 208: The electronic device verifies whether the private key to be verified matches the public key corresponding to the first verification attribute commitment value.
[0091] Step 209: After the device verifies that the private key to be verified matches the public key corresponding to the first verification attribute commitment value, the electronic device sends an identity verification success message to the verifier.
[0092] In some embodiments, after the device has an attribute commitment value that is the same as the first verification attribute commitment value in the verification attribute registration table, and the user has a private key that matches the public key of the blockchain address that sent the first verification attribute commitment value, the device sends an identity authentication success message to the verification party to enable the user to log in to the verification party.
[0093] For ease of understanding, the following specifically describes how to perform identity authentication in this embodiment:
[0094] (1) In response to the blockchain address registration request of the terminal device, the blockchain module 1 calculates two private keys, namely private key 1 and private key 2, and then calculates the public key 1 corresponding to the private key 1 and the public key 2 corresponding to the private key 2 through the blockchain module 1, and then calculates the hash value of the public key 1 and the hash value of the public key 2. The hash value of the public key 1 is the first blockchain address, and the hash value of the public key 2 is the second blockchain address.
[0095] (2) The on-chain institution calculates the user's attribute commitment value based on the user's identity attributes, such as representing the attribute commitment value through a hash value, and then casts the attribute commitment value into an NFT through a smart contract arranged by the on-chain institution. The on-chain institution sends the NFT to the user's first blockchain address.
[0096] (3) The terminal device sends the attribute commitment value to the electronic device through the first blockchain address. The electronic device first detects whether there is an NFT corresponding to the attribute commitment value in the first blockchain address. When it is detected that there is an NFT, the attribute commitment value and the public key are recorded in the attribute registration table one by one.
[0097] (4) When the user needs to provide identity proof to the verifier, the terminal device sends the first verification attribute commitment value and private key information to the verifier through the second blockchain address. The verifier forwards the first verification attribute commitment value and private key information to the electronic device. The electronic device proves that the user has the attribute that the verifier needs to verify through the zero-knowledge proof module 3. The zero-knowledge proof module 3 specifically verifies in the following manner:
[0098] 1. There is an attribute commitment value corresponding to the attribute to be verified in the attribute registration table, and the attribute commitment value meets the login requirements of the verifier.
[0099] 2. The above attribute commitment value corresponds to public key one, and the user has private key one that matches public key one.
[0100] In this way, on the one hand, it can be proved that the user has the attributes that need to be verified, and on the other hand, the verifier cannot know any relevant information about public key one and private key one, which greatly protects the privacy and security of the user. It can be understood that through the above verification method, when the user proves the identity attribute, he can choose the attribute he needs to prove to prove, and when different verifiers log in, he can send private key information through different blockchain addresses, so that when the user logs in to multiple verifiers, multiple verifiers cannot associate the user's identity.
[0101] Compared with the related art, the embodiments of the present application have at least the following advantages: when the user needs to provide proof of identity to the verifier, the device with the smart contract verifies and detects whether there is a target identity attribute that matches the attribute that the verifier needs to verify. Since the target identity attribute is sent through the first blockchain address, the device then verifies whether the user has the private key of the first blockchain address based on the private key information sent by the user through the second blockchain address, thereby being able to verify whether the user has the target identity attribute. When it is detected that the user has the target identity attribute, it also indicates that the user's identity authentication is successful. Through the above-mentioned identity authentication method, since the private key information is sent by the user through the second blockchain address, the verifier cannot know the public key that matches the target identity attribute proved by the user, thereby hiding the blockchain address that actually owns the target identity attribute, while realizing the anonymity of the user login, and effectively protecting the privacy of the user's personal information.
[0102] Please refer to Figure 5 , which is a flowchart of identity authentication provided by an embodiment of the present application. This embodiment is an example of the aforementioned embodiment, and specifically illustrates: another way for a device to verify whether there is a target attribute commitment value that matches a second verification attribute commitment value in an attribute registration table, and how the device verifies whether the user has a private key under the verification method of the target attribute commitment value.
[0103] The specific process of this embodiment is as follows Figure 5 As shown, the electronic device, the terminal device on the user side and the verification party mentioned in the above embodiment include the following steps:
[0104] Step 301: The electronic device records the public key of each blockchain address and the attribute commitment value of the blockchain address in the attribute registration table.
[0105] Step 302: The terminal device sends a second verification attribute commitment value and private key information to the electronic device via the second blockchain address.
[0106] In some embodiments, the identity attribute corresponding to the second verification attribute commitment value is the same as the attribute that needs to be verified when the user logs in to the verification party. For ease of understanding, the difference between the second verification attribute commitment value and the attribute commitment value in the attribute registration table in this embodiment is specifically illustrated below:
[0107] Assume that the user has identity attribute A, identity attribute A and random number M generate attribute commitment value B, identity attribute A and random number N generate attribute commitment value C, random number M and random number N are different, therefore, attribute commitment value B and attribute commitment value C are also different, but attribute commitment value B and attribute commitment value C are both used to represent identity attribute A. Attribute commitment value B is the attribute commitment value recorded in the attribute registration table in step 301, and attribute commitment value C is the second verification attribute commitment value sent by the user in step 302.
[0108] The private key information in this embodiment is the same as the private key information mentioned in the previous embodiment. The private key is calculated according to the encryption algorithm in the blockchain module 1 and will not be repeated here.
[0109] Step 303: The electronic device receives the second verification attribute commitment value and private key information.
[0110] Step 304: The electronic device verifies whether there is a target attribute commitment value for representing the target identity attribute in the attribute registration table.
[0111] As can be seen from the example in step 302, assuming that the target identity attribute is identity attribute A, the electronic device verifies whether there is an attribute commitment value B in the attribute registration table.
[0112] Step 305: When the target attribute commitment value used to characterize the target identity attribute exists in the verification attribute registration table, the electronic device determines the private key to be verified owned by the user based on the private key information, and verifies whether the private key to be verified matches the public key corresponding to the target attribute commitment value.
[0113] In some embodiments, the electronic device can only verify whether it possesses the private key to be verified based on the private key information, but cannot know the specific information of the private key to be verified.
[0114] Step 306: When the electronic device verifies that the private key to be verified matches the public key corresponding to the target attribute commitment value, it generates a new non-fungible token according to the second verification attribute commitment value.
[0115] Step 307: The electronic device sends the new non-fungible token to the terminal device.
[0116] Step 308: The terminal device sends the new non-fungible token to the verifier.
[0117] In some embodiments, after the electronic device has a target attribute commitment value in the verification attribute registration table and the user has a private key that matches the public key corresponding to the target attribute commitment value, the device mints the second verification attribute commitment value into a new non-fungible token and sends the new non-fungible token to the user. The new non-fungible token can represent that the user has the target attribute commitment value, that is, it can represent that the user has the target identity attribute, so the user can directly log in to the verification party based on the new non-fungible token.
[0118] For ease of understanding, the following specifically describes how to perform identity authentication in this embodiment:
[0119] (1) In response to the blockchain address registration request of the terminal device, the blockchain module 1 calculates two private keys, namely private key 1 and private key 2, and then calculates the public key 1 corresponding to the private key 1 and the public key 2 corresponding to the private key 2 through the blockchain module 1, and then calculates the hash value of the public key 1 and the hash value of the public key 2. The hash value of the public key 1 is the first blockchain address, and the hash value of the public key 2 is the second blockchain address.
[0120] (2) The on-chain institution calculates the user's attribute commitment value based on the user's identity attributes, such as representing the attribute commitment value through a hash value, and then casts the attribute commitment value into an NFT through a smart contract deployed by the on-chain institution. The on-chain institution sends the NFT to the user's first blockchain address.
[0121] (3) The terminal device sends the attribute commitment value to the electronic device through the first blockchain address. The electronic device first detects whether there is an NFT corresponding to the attribute commitment value in the user's first blockchain address. When it is detected, the attribute commitment value and the public key are recorded one by one in the attribute registration table.
[0122] (4) When the user needs to provide identity proof to the verifier, the terminal device sends the second verification attribute commitment value and private key information to the electronic device through the second blockchain address. The electronic device proves through the zero-knowledge proof module 3 that the user has the attribute that the verifier needs to verify. The zero-knowledge proof module 3 specifically verifies in the following manner:
[0123] 1. There is a target attribute commitment value corresponding to the target identity attribute in the attribute registration table, but the target attribute commitment value and the second verification attribute commitment value are not equal.
[0124] 2. The target attribute commitment value corresponds to public key one, and the user has private key one that matches public key one.
[0125] (5) After verification by the zero-knowledge proof module 3, the smart contract module 2 casts the new attribute commitment value into a new NFT and sends the new NFT to the user's first blockchain address.
[0126] (6) When the user needs to provide proof of identity to the verifier, the user only needs to prove to the verifier that he or she has the new NFT.
[0127] Through this authentication method, on the one hand, it can be proved that the user has the attributes that need to be verified, and on the other hand, the verifier cannot know any relevant information about public key one and private key one, which greatly protects the privacy and security of the user. It can be understood that the proof mechanism of the above verification method is on the device side. After the user obtains the new NFT, the user can directly authenticate the identity of the verifier based on the new NFT, making the authentication more efficient.
[0128] Compared with the related art, the embodiments of the present application have at least the following advantages: when the user needs to provide proof of identity to the verifier, the device with the smart contract verifies and detects whether there is a target identity attribute that matches the attribute that the verifier needs to verify. Since the target identity attribute is sent through the first blockchain address, the device then verifies whether the user has the private key of the first blockchain address based on the private key information sent by the user through the second blockchain address, thereby being able to verify whether the user has the target identity attribute. When it is detected that the user has the target identity attribute, it also indicates that the user's identity authentication is successful. Through the above-mentioned identity authentication method, since the private key information is sent by the user through the second blockchain address, the verifier cannot know the public key that matches the target identity attribute proved by the user, thereby hiding the blockchain address that actually owns the target identity attribute, while realizing the anonymity of the user login, and effectively protecting the privacy of the user's personal information.
[0129] Please refer to Figure 6 , is a schematic diagram of the hardware structure of the electronic device 1000 provided in the embodiment of the present application. Figure 6 As shown, the electronic device 1000 may include a processor 1001 and a memory 1002. The memory 1002 is used to store one or more computer programs 1003. The one or more computer programs 1003 are configured to be executed by the processor 1001. The one or more computer programs 1003 include instructions, and the above instructions can be used to implement the above method in the electronic device 1000.
[0130] It is understandable that the structure shown in this embodiment does not constitute a specific limitation on the electronic device 1000. In other embodiments, the electronic device 1000 may include more or fewer components than shown, or combine or separate some components, or arrange the components differently.
[0131] The processor 1001 may include one or more processing units, for example, the processor 1001 may include an application processor (AP), a modem, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0132] The processor 1001 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 1001 is a cache memory. The memory may store instructions or data that the processor 1001 has just used or circulated. If the processor 1001 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 1001, and thus improves the efficiency of the system.
[0133] In some embodiments, the processor 1001 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM interface, and / or a USB interface, etc.
[0134] In some embodiments, memory 1002 may include high-speed random access memory and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0135] This embodiment further provides a computer-readable storage medium, in which computer instructions are stored. When the instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the method in the above-mentioned embodiment.
[0136] Among them, the electronic device and computer storage medium provided in this embodiment are used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0137] In practical applications, the above functions can be distributed to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0138] In several embodiments provided in the present application, the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are schematic. For example, the division of the modules or units is a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0139] The unit described as a separate component may or may not be physically separated, and the component shown as a unit may be one physical unit or multiple physical units, that is, it may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
[0140] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0141] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.
[0142] The above description is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application.
Claims
1. An identity verification method, It is characterized in that The electronic device applied to the verification side, the method comprises: In response to the user's identity authentication request, when verifying the existence of a target identity attribute, determining a first blockchain address having the target identity attribute, wherein the target identity attribute is an attribute that needs to be verified when the user logs in to the verification party; Receiving private key information, and verifying whether the user has the private key of the first blockchain address according to the private key information, wherein the private key information belongs to the second blockchain address, and the second blockchain address is registered for the user; After verifying that the user possesses the private key of the first blockchain address, an identity authentication success message is sent.
2. The identity authentication method according to claim 1, It is characterized in that Before responding to the user's identity authentication request, the method further includes: Receiving a plurality of identity attributes attributable to a plurality of blockchain addresses, wherein each blockchain address has at least one identity attribute; Record the public key of each blockchain address and the identity attributes of the blockchain address in a preset attribute registration table; The responding to the user's identity authentication request includes: Verify whether there is an identity attribute matching the target identity attribute in the attribute registration table.
3. The identity authentication method according to claim 2, It is characterized in that The receiving a plurality of identity attributes belonging to a plurality of blockchain addresses includes: Receiving a plurality of attribute commitment values belonging to a plurality of the blockchain addresses, wherein the attribute commitment values are used to represent identity attributes of a user; The public key of each blockchain address and the identity attribute of the blockchain address are recorded in a preset attribute registration table, including: The public key of each blockchain address and the attribute commitment value of the blockchain address are recorded in the attribute registration table.
4. The identity authentication method according to claim 3, It is characterized in that Before verifying whether there is an identity attribute identical to the target identity attribute in the attribute registration table, the method further includes: The verifier receives a first verification attribute commitment value, wherein the first verification attribute commitment value belongs to the second blockchain address; After verifying that the first verification attribute commitment value meets the login requirement, the verifier sends the first verification attribute commitment value to the electronic device; The verifying whether there is an identity attribute matching the target identity attribute in the attribute registration table includes: verifying whether there is an attribute commitment value identical to the first verification attribute commitment value in the attribute registration table.
5. The identity authentication method as claimed in claim 4, It is characterized in that The verifying, according to the private key information, whether the user possesses the private key of the first blockchain address includes: The verification party receives the private key information; The verification party sends the private key information to the electronic device; The electronic device determines the private key to be verified owned by the user according to the private key information, and verifies whether the private key to be verified matches the public key corresponding to the first verification attribute commitment value; After verifying that the user has the private key of the first blockchain address, sending identity authentication success information includes: After verifying that the private key to be verified matches the public key corresponding to the first verification attribute commitment value, the identity authentication success information is sent to the verification party.
6. The identity authentication method according to claim 3, It is characterized in that Before verifying whether there is an identity attribute identical to the target identity attribute in the attribute registration table, the method further includes: receiving a second verification attribute commitment value, wherein the second verification attribute commitment value belongs to the second blockchain address, and the second verification attribute commitment value is used to characterize a target identity attribute of the user; The verifying whether there is an identity attribute matching the target identity attribute in the attribute registration table includes: Verify whether a target attribute commitment value exists in the attribute registration table, wherein the target attribute commitment value is also used to characterize the target identity attribute, and the second verification attribute commitment value is not equal to the target attribute commitment value.
7. The identity authentication method according to claim 6, It is characterized in that The verifying, according to the private key information, whether the user possesses the private key of the first blockchain address includes: Receiving the private key information; Determine the private key to be verified owned by the user according to the private key information, and verify whether the private key to be verified matches the public key corresponding to the target attribute commitment value; After verifying that the user has the private key of the first blockchain address, sending identity authentication success information includes: After verifying that the private key to be verified matches the public key corresponding to the target attribute commitment value, the identity authentication success information is sent.
8. The identity authentication method according to claim 7, It is characterized in that After verifying that the private key to be verified matches the public key corresponding to the target attribute commitment value, sending the identity authentication success information includes: After verifying that the private key to be verified matches the public key corresponding to the target attribute commitment value, generating a new non-fungible token according to the second verification attribute commitment value; The new non-fungible token is sent to the user so that the user sends the new non-fungible token to the validator.
9. An identity verification method, It is characterized in that Applied to a terminal device on a user side, the method comprises: Register the first blockchain address and the second blockchain address; Sending identity attributes to the electronic device on the verification side according to the first blockchain address, so that the electronic device records the identity attributes and the first blockchain address; Sending private key information to the electronic device according to the second blockchain address, so that the electronic device verifies whether the user has a private key of a target blockchain address according to the private key information, wherein the target blockchain address corresponds to a target identity attribute, and the target identity attribute is an attribute that needs to be verified when the user logs in to the verification party; Receive identity authentication success information, which is sent after the electronic device verifies that the user owns the private key of the target blockchain address.
10. An identity verification method, It is characterized in that Applied to a terminal device on a user side, the method comprises: Register the first blockchain address and the second blockchain address; Sending identity attributes to the electronic device on the verification side according to the first blockchain address, so that the electronic device records the identity attributes and the first blockchain address; Sending a target identity attribute and private key information to the verifier according to the second blockchain address, wherein the target identity attribute is an attribute that needs to be verified when the user logs in to the verifier, and after receiving the target identity attribute and the private key information, the verifier forwards the target identity attribute and the private key information to the electronic device, and the electronic device verifies whether the user has a private key of the target blockchain address according to the private key information, and the target blockchain address corresponds to the target identity attribute; Receive identity authentication success information, which is sent after the electronic device verifies that the user owns the private key of the target blockchain address.
11. An electronic device, It is characterized in that The electronic device includes a processor and a memory, the memory is used to store instructions, and the processor is used to call the instructions in the memory, so that the electronic device executes the method described in any one of claims 1 to 8, or the method described in claim 9, or the method described in claim 10.
12. A computer-readable storage medium, It is characterized in that The method comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 8, the method according to claim 9, or the method according to claim 10.
