Blockchain-based identity verification method and related device

By storing identity information hash values ​​and public keys on the blockchain and using zero-knowledge proofs for identity verification, the problem of low efficiency in user identity verification transaction processing on the blockchain is solved, achieving a more efficient and energy-saving identity verification process.

CN119814316BActive Publication Date: 2026-06-02CHINA MOBILE INTERNET CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA MOBILE INTERNET CO LTD
Filing Date
2024-11-27
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

User authentication and transaction processing on the blockchain are inefficient, resulting in slow transaction speeds and high energy consumption, especially when using the Proof-of-Work (PoW) mechanism, which has high maintenance costs.

Method used

By obtaining the public and private keys generated by the security module, the identity information is hashed, the hash value of the identity information and the public key are stored in the blockchain, and zero-knowledge proofs are used for identity verification, reducing the transaction burden on the blockchain.

Benefits of technology

It improves the efficiency of identity verification, reduces the energy consumption and maintenance costs of blockchain transaction processing, and ensures the security and privacy protection of identity information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814316B_ABST
    Figure CN119814316B_ABST
Patent Text Reader

Abstract

The application discloses a blockchain-based identity verification method and related equipment, and belongs to the technical field of communication. The method comprises the following steps: in response to a triggering operation on a target application program, obtaining a public key and a private key generated in a security module; performing hash processing on identity information input in the target application program to obtain an identity information hash value; storing the identity information hash value and the public key in a target blockchain; receiving an identity verification request sent by a verifier, determining a zero-knowledge proof according to a challenge code and the private key included in the identity verification request, and sending the zero-knowledge proof to the verifier, so that the verifier verifies the identity information according to the challenge code, the zero-knowledge proof, and the public key and the identity information hash value stored in the target blockchain. In this way, the transaction burden of the target blockchain can be reduced, the identity verification efficiency can be improved, the amount of data stored in the target blockchain can be reduced, and the maintenance cost of the blockchain network can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blockchain technology, and in particular to a blockchain-based authentication method and related equipment. Background Technology

[0002] To ensure the security and authenticity of user information, user identity information is typically recorded and verified on the blockchain. However, as the number of users increases, the amount of data on the blockchain grows rapidly, slowing down transaction processing and impacting user experience. Furthermore, maintaining a blockchain network requires significant computing resources and energy consumption, especially for blockchains employing the Proof-of-Work (PoW) mechanism, which have higher maintenance costs.

[0003] Therefore, how to improve transaction processing speed and reduce energy consumption while ensuring the security and authenticity of user information has become a major challenge for the current development of blockchain technology. Summary of the Invention

[0004] This application provides a blockchain-based identity verification method and related equipment to at least solve the problem of low efficiency in blockchain transaction processing in related identity verification methods.

[0005] To solve the above-mentioned technical problems, this application is implemented as follows:

[0006] In a first aspect, embodiments of this application provide a blockchain-based identity verification method, comprising: in response to a triggering operation on a target application, obtaining a public key and a private key generated in a security module; hashing identity information input in the target application to obtain an identity information hash value; storing the identity information hash value and the public key in a target blockchain; receiving an identity verification request sent by a verifier, determining a zero-knowledge proof based on a challenge code included in the identity verification request and the private key, and sending the zero-knowledge proof to the verifier, so that the verifier verifies the identity information based on the challenge code, the zero-knowledge proof, and the public key and the identity information hash value stored in the target blockchain.

[0007] Secondly, embodiments of this application provide a blockchain-based identity verification method, comprising: sending an identity verification request to a certifier, the identity verification request including a challenge code; obtaining a zero-knowledge proof returned by the certifier, and obtaining the certifier's public key and identity information hash value from a target blockchain; the zero-knowledge proof being determined based on the certifier's private key and the challenge code, wherein the certifier's public key and the certifier's private key correspond; and verifying the certifier's identity information based on the challenge code, the zero-knowledge proof, the certifier's public key, and the identity information hash value.

[0008] Thirdly, embodiments of this application provide a blockchain-based identity verification device, comprising: a first acquisition module, configured to acquire a public key and a private key generated in a security module in response to a trigger operation on a target application; a hash processing module, configured to perform hash processing on identity information input in the target application to obtain an identity information hash value; an information storage module, configured to store the identity information hash value and the public key in a target blockchain; and a first verification module, configured to receive an identity verification request sent by a verifier, determine a zero-knowledge proof based on a challenge code included in the identity verification request and the private key, and send the zero-knowledge proof to the verifier, so that the verifier can verify the identity information based on the challenge code, the zero-knowledge proof, and the public key and the identity information hash value stored in the target blockchain.

[0009] Fourthly, embodiments of this application provide a blockchain-based identity verification device, comprising: a verification request module, configured to send an identity verification request to a certifier, the identity verification request including a challenge code; a second acquisition module, configured to acquire a zero-knowledge proof returned by the certifier, and to acquire the certifier's public key and identity information hash value from a target blockchain; the zero-knowledge proof is determined based on the certifier's private key and the challenge code, the certifier's public key and the certifier's private key corresponding to each other; and a second verification module, configured to verify the certifier's identity information based on the challenge code, the zero-knowledge proof, the certifier's public key, and the identity information hash value.

[0010] Fifthly, embodiments of this application provide an electronic device, including a processor and a memory, wherein the memory stores a program or instructions executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the method described in the first or second aspect above.

[0011] In a sixth aspect, embodiments of this application provide a computer-readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first or second aspect above.

[0012] In a seventh aspect, embodiments of this application provide a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, which, when executed by a computer, cause the computer to perform the steps of the method described in the first or second aspect above.

[0013] In this embodiment, in response to a trigger operation on the target application, the public and private keys generated in the security module are obtained; the identity information input in the target application is hashed to obtain an identity information hash value; the identity information hash value and the public key are stored in the target blockchain; an authentication request sent by a verifier is received, a zero-knowledge proof is determined based on the challenge code and private key included in the authentication request, and the zero-knowledge proof is sent to the verifier. Thus, by using zero-knowledge proofs, the verifier can quickly verify the user's identity without performing complex transactions on the target blockchain, reducing the transaction burden on the target blockchain, improving authentication efficiency, and by storing the identity information hash value and public key in the target blockchain, compared to storing complete identity information in the target blockchain, this method can reduce the amount of data stored on the target blockchain, reducing the maintenance cost of the blockchain network.

[0014] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0016] Figure 1 A schematic diagram of a blockchain-based identity verification method provided in an embodiment of this application is shown.

[0017] Figure 2 This illustration shows another flowchart of the blockchain-based authentication method provided in an embodiment of this application;

[0018] Figure 3 This illustration shows a schematic diagram of information interaction in a blockchain-based identity verification system provided in an embodiment of this application;

[0019] Figure 4 This illustration shows one of the structural schematic diagrams of a blockchain-based identity verification device provided in an embodiment of this application;

[0020] Figure 5 This is a second schematic diagram of the structure of a blockchain-based identity verification device provided in an embodiment of this application;

[0021] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation

[0022] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0023] Figure 1 This illustration shows a flowchart of a blockchain-based identity verification method provided in an embodiment of this application. The executing entity of this method can be a terminal device, such as a personal computer or a mobile terminal device such as a mobile phone or tablet. The terminal device can be a user-used terminal device. This embodiment uses the terminal used by the certifier as an example. As shown in the figure, the blockchain-based identity verification method 100 may include the following steps:

[0024] Step 101: In response to the triggering operation on the target application, obtain the public and private keys generated in the security module.

[0025] In practice, the proving party downloads and installs the target application, such as a digital identity management application (App), on a mobile terminal. In response to the proving party's actions on the target application, such as application launch, user login, or specific function requests, the proving party obtains the public key generated in the security module. PK u and private key SK u This security module can be the security module of the SIM card carried by the mobile terminal.

[0026] Step 102: Hash the identity information input into the target application to obtain the identity information hash value.

[0027] In practice, the proving party enters identity information such as name and ID number into the target application. user info The mobile terminal verifies the identity information entered by the authenticator. user info Perform hash processing to obtain the identity information hash value. Hash info For example, a cryptographic hash function can be used. Hash (·) Identity information of the certifying party user info Process the data to generate an identity information hash value. Hash info Its expression is as follows:

[0028] Hash info = Hash ( user info );

[0029] Step 103: Store the identity information hash value and the public key in the target blockchain.

[0030] In practice, the identity information hash value obtained in the above steps will be used as the basis for the implementation. Hash info and public key PK u Storing it in the target blockchain, compared to storing complete identity information in the target blockchain... user info This application embodiment reduces the amount of data stored on the target blockchain by storing the identity information hash value and public key in the target blockchain, thereby reducing the maintenance cost of the blockchain network and ensuring that identity information is protected, thus reducing the risk of privacy leakage.

[0031] Step 104: Receive the authentication request sent by the verifier, determine the zero-knowledge proof based on the challenge code and the private key included in the authentication request, and send the zero-knowledge proof to the verifier so that the verifier can verify the identity information based on the challenge code, the zero-knowledge proof, the public key and the identity information hash value stored in the target blockchain.

[0032] In practice, the receiving verifier sends an authentication request, which includes a randomly generated challenge code. Challenge According to the challenge code Challenge and private key SK u Determine zero-knowledge proof Proof and zero-knowledge proof Proof The challenge code is sent to the verifier so that the verifier can verify the identity information based on the zero-knowledge proof. Optionally, the verifier can also send the challenge code to the target application. Challenge The response is submitted to the verification party to ensure the dynamism and security of the verification process.

[0033] In this way, by using zero-knowledge proofs, the verifier can quickly confirm the user's identity without performing complex transactions on the target blockchain, which can reduce the transaction burden of the target blockchain and improve the efficiency of identity verification. At the same time, the prover can prove its identity to the verifier without revealing its private key or identity information, thus enhancing the security of identity verification.

[0034] In one possible implementation, step 101 above, obtaining the public and private keys generated in the security module, includes:

[0035] A key pair is generated by calling the security module using a key derivation algorithm. The key pair includes a public key and a private key, and the public key and the private key correspond to each other. The public key and the private key generated in the security module are then obtained.

[0036] In one exemplary embodiment, the target application can initialize the prover's blockchain account by communicating with the security module (BSIM card) of the SIM card, a process that can be implemented using the SIM card's software development kit (SDK).

[0037] Within the BSIM card, a Key Derivation Algorithm (KDA) is used to generate corresponding public and private key pairs. PK u , SK u ), which is represented as follows:

[0038] PK u , SK u ← KDA ( seed , params );

[0039] in, seed It is a random seed generated by the internal security algorithm of the BSIM card; Params These are algorithm parameters, including key length and encryption algorithm specifications.

[0040] This ensures the security and uniqueness of the key pair, with the public key... PK u Used for identity verification and transaction authentication, while the private key SK u Used for signing and authorization operations, ensuring the security of user transactions and data exchange.

[0041] In one possible implementation, after generating the key pair by calling the security module using the key derivation algorithm, the following is also included:

[0042] Obtain the random seed corresponding to the key pair; encrypt the random seed using a preset recovery password to obtain an encrypted seed; store the encrypted seed in a preset storage area.

[0043] In this embodiment of the application, a key pair can be obtained ( PK u ,SK u The corresponding random seed seed ; via preset recovery password Recovery pwd For random seeds seed Encryption is performed to obtain the encryption seed. Encrypted seed Its expression is as follows:

[0044] Encrypted seed = Encrypt ( seed , Recovery pwd );

[0045] in, Encrypt (·) is the encryption function.

[0046] Furthermore, store encrypted seeds Encrypted seed To a pre-defined storage area, for example, the prover uses the target application to... Encrypted seed Upload it to a secure cloud storage service for backup.

[0047] The method further includes, after storing the encrypted seed in the preset storage area, the following steps:

[0048] In response to the recovery password input in the target application, the recovery password is processed by a preset hash function to obtain a password hash value; the encryption seed in the storage area is decrypted using the password hash value to obtain a decryption seed; and the key pair is recovered based on the decryption seed.

[0049] In this embodiment of the application, the proving party enters the recovery password in the target application. Recovery pwd The password can be recovered using a pre-defined hash function, such as the SHA-256 algorithm. Recovery pwd Processing yields the password hash value. H pwd ; through password hash value H pwd Encryption seeds in the storage area H pwd Perform decryption processing to obtain the decryption seed. Decrypted seed According to the decrypted seed Decrypted seed Recovery key pair PK u and SK u .

[0050] H pwd = SHA-256( Recovery pwd );

[0051] ;

[0052] ;

[0053] in, It is a Gaussian function used to process cryptographic hash values, providing an additional layer of security; Ei (·) is the exponential integral function used to normalize the cryptographic hash value, where It is a normalization coefficient used to ensure the validity of decrypted data; (·) is the information decryption function, used in conjunction with the encryption seed. Encrypted seed and password hash value H pwd Perform data recovery; KGF (·) is the key generation function, used to generate a key using a decryption seed. Decrypted seed Regenerate the provider's key pair.

[0054] In one possible implementation, step 103 above, after storing the identity information hash value and the public key in the target blockchain, further includes:

[0055] Obtain the storage transaction message returned by the target blockchain, the storage transaction message indicating that the identity hash value and the public key have been successfully stored in the target blockchain; query the identity information status corresponding to the storage transaction message in the target blockchain.

[0056] In this embodiment of the application, once the identity information hash value is... Hash info and public key PK u Successfully stored in the target blockchain, retrieve the storage transaction message returned by the target blockchain, which indicates the identity hash value. Hash info and public key PK u The transaction has been successfully stored in the target blockchain. The proving party can query the identity information status corresponding to the stored transaction message through the target application. The identity information status includes the transaction hash and block number.

[0057] This application provides a blockchain-based identity verification method. In response to a trigger operation on a target application, it obtains a public key and a private key generated in a security module; hashes the identity information input in the target application to obtain an identity information hash value; stores the identity information hash value and the public key in the target blockchain; receives an identity verification request sent by a verifier, determines a zero-knowledge proof based on the challenge code and private key included in the identity verification request, and sends the zero-knowledge proof to the verifier. Thus, by using zero-knowledge proofs, the verifier can quickly verify the user's identity without performing complex transactions on the target blockchain, reducing the transaction burden on the target blockchain, improving identity verification efficiency, and by storing the identity information hash value and public key in the target blockchain, compared to storing complete identity information in the target blockchain, this method can reduce the amount of data stored on the target blockchain, lowering the maintenance cost of the blockchain network.

[0058] Figure 2 This illustration shows another flowchart of a blockchain-based authentication method provided in this application embodiment. The execution subject of this method can be a terminal device or a server. The terminal device can be a personal computer or a mobile terminal device such as a mobile phone or tablet computer, and can be a user-used terminal device. The server can be a standalone server or a server cluster composed of multiple servers. Furthermore, the server can be a backend server for a specific business function or a backend server for a platform or application (e.g., a digital authentication system, social media platform, etc.). This application embodiment uses the terminal used by the verification party as an example for illustration. As shown in the figure, the blockchain-based authentication method 200 can include the following steps:

[0059] Step 201: Send an authentication request to the certifier, the authentication request including a challenge code.

[0060] In practice, the verifier (such as a service provider) can send an authentication request to the certifier through its platform. This authentication request includes a randomly generated challenge code. Challenge .

[0061] Step 202: Obtain the zero-knowledge proof returned by the proving party, and obtain the public key and identity information hash value of the proving party from the target blockchain; the zero-knowledge proof is determined based on the private key of the proving party and the challenge code, and the public key of the proving party corresponds to the private key of the proving party.

[0062] Here, the verifier can also obtain the challenge code sent by the prover. Challenge The response ensures the real-time nature of the verification process and prevents replay attacks.

[0063] In specific implementation, such as Figure 3 As shown, the verifier 320 sends an authentication request to the certifier 310. The certifier 310 receives the authentication request through the digital identity management app and confirms the start of the authentication process. The digital identity management app automatically retrieves the certifier's private key from the BSIM card. SK u and public key PK u Proof of the use of private keys in the digital identity management app of Proof 310 SK u and challenge codes Challenge Generating zero-knowledge proofs Proof And send it to verifier 320; at the same time, prover 310 sends the public key. PK u Identity information hash value Hash info Stored in the target blockchain 330; Verifier 320 obtains the zero-knowledge proof returned by Prover 310. Proof And obtain the public key of the prover 310 from the target blockchain 330. PK u Identity information hash value Hash info And smart contract rules C, etc.

[0064] Step 203: Verify the identity information of the proving party based on the challenge code, zero-knowledge proof, the proving party's public key, and the identity information hash value.

[0065] In practice, the verifier uses the challenge code. Challenge Zero-knowledge proof Proof The public key of the proving party PK u and identity information hash value Hash info The identity information of the certifying party is verified.

[0066] In one possible implementation, step 203 above, which verifies the identity information of the proving party based on the challenge code, the zero-knowledge proof, the proving party's public key, and the identity information hash value, includes:

[0067] A verification score is determined based on the challenge code, zero-knowledge proof, the prover's public key, and the hash value of the identity information. The verification score indicates the likelihood of successful identity verification. The prover's identity information is then verified based on the verification score.

[0068] In this embodiment of the application, the verifier can use a challenge code. Challenge Zero-knowledge proof ProofThe public key of the proving party PK u and identity information hash value Hash info A verification score is determined, which indicates the likelihood of successful identity verification. Based on the verification score, the identity information of the certifier is verified.

[0069] In this way, by quantifying the probability of successful identity verification through verification scores, and verifying the identity information of the certifier based on the verification scores, the accuracy of identity verification can be improved.

[0070] The aforementioned determination of the verification score based on the challenge code, zero-knowledge proof, the prover's public key, and the hash value of the identity information includes:

[0071] The public key, identity information hash value, and challenge code of the proving party are input into the verification function to determine the identity accuracy, which characterizes the correctness of the proving party's identity information. The zero-knowledge proof, the proving party's public key, the challenge code, and the preset smart contract rules are input into the information filtering function to determine the matching degree between the zero-knowledge proof and the smart contract rules. Based on the identity accuracy and the matching degree between the zero-knowledge proof and the smart contract rules, a verification score is determined.

[0072] Alternatively, the verification score can be determined in the following ways:

[0073] ;

[0074] in, V s To verify the scores, Z (·) is the verification function. F (·) is the information filtering function. PK u For public key, Hash info For identity information hash value, Challenge For the challenge code, Proof For zero-knowledge proof, C For smart contract rules.

[0075] Here, the verification function Z (·) is used to verify the correctness of the certifying party's identity information; information filtering function. F (·) is used to analyze the effectiveness of zero-knowledge proofs and their degree of conformity with smart contract rules; ProofIt is a proof generated by a zero-knowledge proof algorithm, used to verify that a user controls their public key without revealing the private key or other sensitive information; C represents the rules defined in the smart contract, used in the verification process in blockchain technology.

[0076] In one possible implementation, the verification of the certifier's identity information based on the verification score includes:

[0077] If the deviation between the verification score and the first threshold is less than a preset deviation threshold, the identity information of the certifier is determined to be verified successfully; if the deviation between the verification score and the second threshold is less than the preset deviation threshold, the identity information of the certifier is determined to be verified unsuccessfully.

[0078] The first threshold, the second threshold, and the preset deviation threshold can be selected based on empirical values.

[0079] In one exemplary embodiment, if the verification score V s If the value is close to 1, the verification is successful and the user's identity is confirmed; if... V s A value close to 0 indicates verification failure, requiring re-verification or additional security measures. Successful Proof verification confirms that the user indeed possesses their public key. PK u Corresponding private key SK u This confirms the user's identity.

[0080] This application provides a blockchain-based identity verification method. The method involves sending an identity verification request, including a challenge code, to a certifier; obtaining a zero-knowledge proof returned by the certifier; and retrieving the certifier's public key and identity information hash value from the target blockchain. The zero-knowledge proof is determined based on the certifier's private key and the challenge code, with the certifier's public key corresponding to its private key. The certifier's identity information is verified based on the challenge code, the zero-knowledge proof, the certifier's public key, and the identity information hash value. By using zero-knowledge proofs, the verifier can quickly confirm a user's identity without performing complex transactions on the target blockchain, reducing the transaction burden on the target blockchain and improving identity verification efficiency. Furthermore, by storing the identity information hash value and public key in the target blockchain, compared to storing complete identity information, this method reduces the amount of data stored on the target blockchain, lowering the maintenance cost of the blockchain network.

[0081] Figure 4 This illustration shows one of the structural schematic diagrams of a blockchain-based authentication device provided in an embodiment of this application. This authentication device 400 can achieve, for example... Figure 1The authentication device 400, comprising all or part of the contents shown in the embodiments, includes:

[0082] The first acquisition module 410 is used to acquire the public key and private key generated in the security module in response to a trigger operation on the target application.

[0083] The hash processing module 420 is used to perform hash processing on the identity information input in the target application to obtain the identity information hash value;

[0084] Information storage module 430 is used to store the identity information hash value and the public key into the target blockchain;

[0085] The first verification module 440 is used to receive an identity verification request sent by the verifier, determine a zero-knowledge proof based on the challenge code and the private key included in the identity verification request, and send the zero-knowledge proof to the verifier so that the verifier can verify the identity information based on the challenge code, the zero-knowledge proof, the public key and the identity information hash value stored in the target blockchain.

[0086] In one possible implementation, the first acquisition module 410, when used to acquire the public and private keys generated in the security module, is specifically used for:

[0087] A key pair is generated by calling the security module using a key derivation algorithm. The key pair includes a public key and a private key, and the public key and the private key correspond to each other.

[0088] Obtain the public and private keys generated in the security module.

[0089] In one possible implementation, the first acquisition module 410 is further configured to:

[0090] Obtain the random seed corresponding to the key pair;

[0091] The random seed is encrypted using a preset recovery password to obtain an encrypted seed;

[0092] Store the encrypted seed in a preset storage area.

[0093] In one possible implementation, the authentication device 400 further includes:

[0094] The key pair recovery module is used to respond to the recovery password input in the target application by processing the recovery password through a preset hash function to obtain a password hash value; using the password hash value, decrypting the encryption seed in the storage area to obtain a decryption seed; and recovering the key pair according to the decryption seed.

[0095] In one possible implementation, the information storage module 430 is further used for:

[0096] Obtain the storage transaction message returned by the target blockchain, the storage transaction message being used to indicate that the identity hash value and the public key have been successfully stored in the target blockchain;

[0097] Query the identity information status corresponding to the stored transaction message in the target blockchain.

[0098] This application provides a blockchain-based identity verification device, including a first acquisition module, a hash processing module, an information storage module, and a first verification module. The first acquisition module, in response to a trigger operation on a target application, acquires a public key and a private key generated in a security module. The hash processing module performs hash processing on the identity information input in the target application to obtain an identity information hash value. The information storage module stores the identity information hash value and the public key in the target blockchain. The first verification module receives an identity verification request sent by a verifier, determines a zero-knowledge proof based on the challenge code included in the identity verification request and the private key, and sends the zero-knowledge proof to the verifier, so that the verifier can verify the identity information based on the challenge code, the zero-knowledge proof, and the public key and the identity information hash value stored in the target blockchain. In this way, by using zero-knowledge proofs, the verifier can quickly confirm the user's identity without performing complex transactions on the target blockchain. This reduces the transaction burden on the target blockchain, improves identity verification efficiency, and by storing the identity information hash value and public key in the target blockchain, compared to storing the complete identity information in the target blockchain, this method can reduce the amount of data stored on the target blockchain and lower the maintenance cost of the blockchain network.

[0099] Figure 5 This is a second schematic diagram of the structure of a blockchain-based authentication device provided in an embodiment of this application. This authentication device 500 can achieve the following: Figure 2 The authentication device 500, comprising all or part of the contents shown in the embodiments, includes:

[0100] Verification request module 510 is used to send an authentication request to the certifier, the authentication request including a challenge code;

[0101] The second acquisition module 520 is used to acquire the zero-knowledge proof returned by the prover, and to acquire the public key and identity information hash value of the prover from the target blockchain; the zero-knowledge proof is determined based on the private key of the prover and the challenge code, and the public key of the prover and the private key of the prover correspond to each other;

[0102] The second verification module 530 is used to verify the identity information of the proving party based on the challenge code, zero-knowledge proof, the proving party's public key, and the identity information hash value.

[0103] In one possible implementation, the second verification module 530, when verifying the identity information of the prover based on the challenge code, the zero-knowledge proof, the prover's public key, and the identity information hash value, is specifically used for:

[0104] A verification score is determined based on the challenge code, zero-knowledge proof, the prover's public key, and the identity information hash value. The verification score is used to indicate the probability of successful identity verification.

[0105] The identity information of the certifier is verified based on the verification score.

[0106] In one possible implementation, the second verification module 530, when determining the verification score based on the challenge code, zero-knowledge proof, the prover's public key, and the identity information hash value, is specifically used for:

[0107] The public key, identity information hash value, and challenge code of the proving party are input into the verification function, and the identity accuracy is determined by the verification function. The identity accuracy is used to characterize the correctness of the proving party's identity information.

[0108] The zero-knowledge proof, the prover's public key, the challenge code, and the preset smart contract rules are input into the information filtering function, and the matching degree between the zero-knowledge proof and the smart contract rules is determined by the information filtering function.

[0109] The verification score is determined based on the accuracy of the identity and the degree of matching between the zero-knowledge proof and the smart contract rules.

[0110] The second verification module 530 is used to determine the verification score in the following manner:

[0111] ;

[0112] in, V s To verify the scores, Z (·) is the verification function. F (·) is the information filtering function. PK u For public key, Hash info For identity information hash value, Challenge For the challenge code, Proof For zero-knowledge proof, C For smart contract rules.

[0113] In one possible implementation, the second verification module 530, when verifying the identity information of the certifier based on the verification score, is specifically used for:

[0114] If the deviation between the verification score and the first threshold is less than a preset deviation threshold, it is determined that the identity information of the certifier has been verified.

[0115] If the deviation between the verification score and the second threshold is less than the preset deviation threshold, the verification of the certifying party's identity information is determined to have failed.

[0116] This application provides a blockchain-based identity verification device, including a verification request module, a second acquisition module, and a second verification module. The verification request module sends an identity verification request to a prover, the identity verification request including a challenge code. The second acquisition module acquires the zero-knowledge proof returned by the prover, and obtains the prover's public key and identity information hash value from the target blockchain. The second verification module verifies the prover's identity information based on the challenge code, the zero-knowledge proof, the prover's public key, and the identity information hash value. Thus, by using zero-knowledge proofs, the verifier can quickly confirm the user's identity without performing complex transactions on the target blockchain, reducing the transaction burden on the target blockchain and improving identity verification efficiency. Furthermore, by storing the identity information hash value and public key in the target blockchain, compared to storing complete identity information in the target blockchain, this method reduces the amount of data stored on the target blockchain, lowering the maintenance cost of the blockchain network.

[0117] Figure 6 This diagram illustrates the hardware structure of an electronic device implementing the embodiments of this application. Referring to the diagram, at the hardware level, the electronic device 600 includes a processor 610, and optionally includes an internal bus 620, a network interface 630, and a memory 640. The memory 640 may include main memory 641, such as high-speed random-access memory (RAM), and may also include non-volatile memory 642, such as at least one disk storage device. Of course, the electronic device 600 may also include other hardware required for other services.

[0118] The processor 610, network interface 630, and memory can be interconnected via an internal bus 620. This internal bus 620 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be categorized as an address bus, data bus, control bus, etc. For ease of illustration, only a single bidirectional arrow is used in this diagram, but this does not imply that there is only one bus or one type of bus.

[0119] Memory 640 stores programs. Specifically, the program may include program code, which includes computer operation instructions. Memory 640 may include main memory 641 and non-volatile memory 642, and provides instructions and data to processor 610.

[0120] The processor 610 reads the corresponding computer program from the non-volatile memory 642 into memory and then runs it, forming a device for locating the target user at the logical level. The processor 610 executes the program stored in memory and specifically performs the following: Figure 1 or Figure 2 The methods disclosed in the embodiments shown achieve the functions and beneficial effects of the methods described in the preceding method embodiments, and will not be repeated here.

[0121] The above is as stated in this application. Figure 1 or Figure 2The methods disclosed in the illustrated embodiments can be applied to or implemented by processor 610. Processor 610 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above methods can be completed by integrated logic circuits in the hardware or by instructions in software form within processor 610. Processor 610 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0122] The computer device can also execute the methods described in the preceding method embodiments and achieve the functions and beneficial effects of the methods described in the preceding method embodiments, which will not be repeated here.

[0123] Of course, in addition to software implementation, the electronic device 600 of this application does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0124] This application also proposes a computer-readable storage medium that stores one or more programs, which, when executed by an electronic device including multiple applications, cause the electronic device to perform... Figure 1 or Figure 2 The methods disclosed in the embodiments shown achieve the functions and beneficial effects of the methods described in the preceding method embodiments, and will not be repeated here.

[0125] The computer-readable storage medium mentioned above includes read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc.

[0126] Furthermore, embodiments of this application also provide a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, which, when executed by a computer, implement the following process: Figure 1 or Figure 2 The methods disclosed in the embodiments shown achieve the functions and beneficial effects of the methods described in the preceding method embodiments, and will not be repeated here.

[0127] The embodiments of this application can be applied to various scenarios of electronic device collaboration or interconnection, including: collaboration and interconnection between mobile phones and laptops / tablets; collaboration and interconnection between mobile terminals and smart TVs / monitors; collaboration and interconnection between mobile phones or tablets and in-vehicle entertainment systems; collaboration and interconnection between mobile terminals and smart conferencing systems, etc. This satisfies users' diverse needs in smart home, smart office, and smart travel scenarios.

[0128] In summary, the above description is merely a preferred embodiment of this application and does not limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

[0129] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0130] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can store information accessible to a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0131] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0132] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

Claims

1. A blockchain-based identity verification method, characterized in that, include: In response to a triggering operation on the target application, obtain the public and private keys generated in the security module; The identity information input into the target application is hashed to obtain the identity information hash value; The identity information hash value and the public key are stored in the target blockchain; The system receives an authentication request from the verifier, determines a zero-knowledge proof based on the challenge code and the private key included in the authentication request, and sends the zero-knowledge proof to the verifier so that the verifier can verify the identity information based on the challenge code, the zero-knowledge proof, the public key stored in the target blockchain, and the identity information hash value. The verifier determines a verification score based on the challenge code, zero-knowledge proof, the prover's public key, and the identity information hash value. The verification score indicates the likelihood of successful identity verification. Based on the verification score, the verifier verifies the prover's identity information. Specifically, the verifier inputs the prover's public key, identity information hash value, and challenge code into a verification function to determine identity accuracy, which characterizes the correctness of the prover's identity information. The verifier also inputs the zero-knowledge proof, the prover's public key, the challenge code, and preset smart contract rules into an information filtering function to determine the matching degree between the zero-knowledge proof and the smart contract rules. The verification score is determined based on the accuracy of the identity and the matching degree between the zero-knowledge proof and the smart contract rules; If the deviation between the verification score and the first threshold is less than a preset deviation threshold, the identity information of the certifier is determined to be verified successfully; if the deviation between the verification score and the second threshold is less than the preset deviation threshold, the identity information of the certifier is determined to be verified unsuccessfully.

2. The method according to claim 1, characterized in that, The process of obtaining the public and private keys generated in the security module includes: A key pair is generated by calling the security module using a key derivation algorithm. The key pair includes a public key and a private key, and the public key and the private key correspond to each other. Obtain the public and private keys generated in the security module.

3. The method according to claim 2, characterized in that, After generating the key pair by calling the security module using the key derivation algorithm, the method further includes: Obtain the random seed corresponding to the key pair; The random seed is encrypted using a preset recovery password to obtain an encrypted seed; Store the encrypted seed in a preset storage area.

4. The method according to claim 3, characterized in that, After storing the encrypted seed in the preset storage area, the method further includes: In response to the recovery password entered in the target application, the recovery password is processed by a preset hash function to obtain the password hash value; The encrypted seed in the storage area is decrypted using the password hash value to obtain the decrypted seed; The key pair is recovered based on the decryption seed.

5. The method according to claim 1, characterized in that, After storing the identity information hash value and the public key in the target blockchain, the method further includes: Obtain the storage transaction message returned by the target blockchain, the storage transaction message being used to indicate that the identity hash value and the public key have been successfully stored in the target blockchain; Query the identity information status corresponding to the stored transaction message in the target blockchain.

6. A blockchain-based identity verification method, characterized in that, include: Send an authentication request to the certifier, the authentication request including a challenge code; Obtain the zero-knowledge proof returned by the prover, and obtain the public key and identity information hash value of the prover from the target blockchain; The zero-knowledge proof is determined based on the prover's private key and the challenge code, wherein the prover's public key corresponds to the prover's private key; The identity information of the proving party is verified based on the challenge code, zero-knowledge proof, the proving party's public key, and the hash value of the identity information. The step of verifying the identity information of the proving party based on the challenge code, zero-knowledge proof, the proving party's public key, and the hash value of the identity information includes: A verification score is determined based on the challenge code, zero-knowledge proof, the prover's public key, and the hash value of their identity information. This verification score indicates the likelihood of successful identity verification. The prover's identity information is then verified based on the verification score. The step of determining the verification score based on the challenge code, zero-knowledge proof, the prover's public key, and the hash value of their identity information includes: The public key, identity information hash value, and challenge code of the proving party are input into a verification function to determine the identity accuracy, which characterizes the correctness of the proving party's identity information. The zero-knowledge proof, the proving party's public key, challenge code, and preset smart contract rules are input into an information filtering function to determine the matching degree between the zero-knowledge proof and the smart contract rules. A verification score is determined based on the identity accuracy and the matching degree between the zero-knowledge proof and the smart contract rules. The step of verifying the identity information of the certifier based on the verification score includes: If the deviation between the verification score and the first threshold is less than a preset deviation threshold, the identity information of the certifier is determined to be verified successfully; if the deviation between the verification score and the second threshold is less than the preset deviation threshold, the identity information of the certifier is determined to be verified unsuccessfully.

7. The method according to claim 6, characterized in that, The verification score is determined in the following manner: ; in, V s To verify the scores, Z (·) is the verification function. F (·) is the information filtering function. PK u For public key, Hash info For identity information hash value, Challenge For the challenge code, Proof For zero-knowledge proof, C For smart contract rules.

8. A blockchain-based identity verification device, characterized in that, include: The first acquisition module is used to acquire the public and private keys generated in the security module in response to a trigger operation on the target application. The hash processing module is used to perform hash processing on the identity information input in the target application to obtain the identity information hash value; An information storage module is used to store the identity information hash value and the public key into the target blockchain; The first verification module is used to receive an identity verification request sent by the verifier, determine a zero-knowledge proof based on the challenge code and the private key included in the identity verification request, and send the zero-knowledge proof to the verifier so that the verifier can verify the identity information based on the challenge code, the zero-knowledge proof, the public key and the identity information hash value stored in the target blockchain; The verifier determines a verification score based on the challenge code, zero-knowledge proof, the prover's public key, and the identity information hash value. The verification score indicates the likelihood of successful identity verification. Based on the verification score, the verifier verifies the prover's identity information. Specifically, the verifier inputs the prover's public key, identity information hash value, and challenge code into a verification function to determine identity accuracy, which characterizes the correctness of the prover's identity information. The verifier also inputs the zero-knowledge proof, the prover's public key, the challenge code, and preset smart contract rules into an information filtering function to determine the matching degree between the zero-knowledge proof and the smart contract rules. The verification score is determined based on the accuracy of the identity and the matching degree between the zero-knowledge proof and the smart contract rules; If the deviation between the verification score and the first threshold is less than a preset deviation threshold, the identity information of the certifier is determined to be verified successfully; if the deviation between the verification score and the second threshold is less than the preset deviation threshold, the identity information of the certifier is determined to be verified unsuccessfully.

9. A blockchain-based identity verification device, characterized in that, include: The verification request module is used to send an authentication request to the certifier, the authentication request including a challenge code; The second acquisition module is used to acquire the zero-knowledge proof returned by the prover, and to acquire the public key and identity information hash value of the prover from the target blockchain; The zero-knowledge proof is determined based on the prover's private key and the challenge code, wherein the prover's public key corresponds to the prover's private key; The second verification module is used to verify the identity information of the proving party based on the challenge code, zero-knowledge proof, the proving party's public key, and the identity information hash value. The second verification module, when used to verify the identity information of the prover based on the challenge code, zero-knowledge proof, the prover's public key, and the identity information hash value, is specifically used for: A verification score is determined based on the challenge code, zero-knowledge proof, the prover's public key, and the hash value of their identity information. This verification score indicates the likelihood of successful identity verification. The prover's identity information is then verified based on the verification score. The second verification module, when determining the verification score based on the challenge code, zero-knowledge proof, the prover's public key, and the hash value of the identity information, is specifically used for: The public key, identity information hash value, and challenge code of the proving party are input into the verification function, and the identity accuracy is determined by the verification function. The identity accuracy is used to characterize the correctness of the identity information of the proving party. The zero-knowledge proof, the public key of the proving party, the challenge code, and the preset smart contract rules are input into the information filtering function, and the matching degree between the zero-knowledge proof and the smart contract rules is determined by the information filtering function. The verification score is determined based on the accuracy of the identity and the matching degree between the zero-knowledge proof and the smart contract rules; The second verification module, when used to verify the identity information of the certifier based on the verification score, is specifically used for: If the deviation between the verification score and the first threshold is less than a preset deviation threshold, the identity information of the certifier is determined to be verified successfully; if the deviation between the verification score and the second threshold is less than the preset deviation threshold, the identity information of the certifier is determined to be verified unsuccessfully.

10. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the method according to any one of claims 1 to 7.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 7.

12. A computer program product, characterized in that, The computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions that, when executed by a computer, cause the computer to perform the steps of the method according to any one of claims 1 to 7.