Identity verification method based on block chain and related equipment
By using zero-knowledge proof and hash value storage in blockchain authentication, the problems of low efficiency of blockchain transaction processing and high maintenance costs are solved, efficient authentication is achieved and maintenance costs of blockchain networks are reduced.
Patent Information
- Application Number
- CN202411714921.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-11-27
AI Technical Summary
Blockchain transaction processing is not efficient, which affects the user experience. The maintenance of blockchain network requires a large amount of computing resources and energy consumption, especially blockchains that use the Proof of Work (PoW) mechanism, which have a high maintenance cost.
By obtaining the public and private keys generated by the security module in the target application, hashing the identity information, storing the hash value and public keys into the blockchain, and using zero-knowledge proof for identity verification, reducing the transaction burden on the blockchain.
It improves the efficiency of identity verification, reduces the burden of blockchain transactions, reduces the maintenance cost of blockchain networks, and enhances the security of identity verification.
Smart Images

Figure CN119814316A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a blockchain-based identity authentication method and related equipment. Background Art
[0002] In order to ensure the security and authenticity of user information, the user's identity information is usually recorded and verified on the blockchain. However, as the number of users increases, the amount of data on the blockchain grows rapidly, which slows down transaction processing and affects user experience. In addition, the maintenance of the blockchain network requires a lot of computing resources and energy consumption, especially for blockchains that use the Proof of Work (PoW) mechanism, which has a high maintenance cost.
[0003] Therefore, how to improve transaction processing speed and reduce energy consumption while ensuring the security and authenticity of user information has become an important challenge in the current development of blockchain technology. Summary of the invention
[0004] The embodiments of the present application provide a blockchain-based identity authentication method and related equipment to at least solve the problem of low efficiency of blockchain transaction processing in related identity authentication methods.
[0005] In order to solve the above technical problems, this application is implemented as follows: In a first aspect, an embodiment of the present application provides a blockchain-based identity authentication method, comprising: in response to a trigger operation on a target application, obtaining a public key and a private key generated in a security module; hashing the 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 authentication request sent by a verifier, determining a zero-knowledge proof based on a challenge code and the private key included in the identity authentication request, 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.
[0006] In the second aspect, an embodiment of the present application provides a blockchain-based identity authentication method, including: sending an identity authentication request to a prover, the identity authentication request including a challenge code; obtaining a zero-knowledge proof returned by the prover, and obtaining 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 corresponds to the private key of the prover; and verifying the identity information of the prover based on the challenge code, zero-knowledge proof, the public key of the prover and the identity information hash value.
[0007] In the third aspect, an embodiment of the present application provides a blockchain-based identity authentication device, including: a first acquisition module, used to obtain 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, used to perform hash processing on the identity information input in the target application to obtain an identity information hash value; an information storage module, used to store the identity information hash value and the public key in a target blockchain; a first verification module, used to receive an identity authentication request sent by a verifier, determine a zero-knowledge proof based on a challenge code and the private key included in the identity authentication request, and send 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.
[0008] In a fourth aspect, an embodiment of the present application provides a blockchain-based identity authentication device, including: a verification request module, used to send an identity authentication request to a prover, the identity authentication request including a challenge code; a second acquisition module, used to obtain the zero-knowledge proof returned by the prover, and to 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 private key of the prover and the challenge code, and the public key of the prover corresponds to the private key of the prover; a second verification module, used to verify the identity information of the prover based on the challenge code, zero-knowledge proof, the public key of the prover and the identity information hash value.
[0009] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect or the second aspect above are implemented.
[0010] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect or the second aspect above are implemented.
[0011] In the seventh aspect, an embodiment of the present application provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the steps of the method described in the first or second aspect above.
[0012] In an embodiment of the present application, in response to a trigger operation on a target application, a public key and a private key generated in a 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 identity authentication request sent by a verifier is received, a zero-knowledge proof is determined based on the challenge code and the private key included in the identity authentication request, and the zero-knowledge proof is sent to the verifier. In this way, by using zero-knowledge proof, the verifier can quickly confirm the identity of the user without having to perform complex transactions on the target blockchain, which can reduce the transaction burden of the target blockchain and improve the efficiency of identity authentication. Moreover, by storing the identity information hash value and the 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 reduce the maintenance cost of the blockchain network. It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0014] Figure 1 A schematic diagram of a process of a blockchain-based identity authentication method provided in an embodiment of the present application is shown; Figure 2 Another schematic diagram of a blockchain-based identity authentication method provided in an embodiment of the present application is shown; Figure 3 A schematic diagram of information interaction of a blockchain-based identity authentication system provided in an embodiment of the present application is shown; Figure 4 One of the structural schematic diagrams of the blockchain-based identity authentication device provided in an embodiment of the present application is shown; Figure 5 The second structural diagram of the blockchain-based identity authentication device provided in the embodiment of the present application is shown; Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0015] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0016] Figure 1 A flowchart of a blockchain-based identity authentication method provided in an embodiment of the present application is shown. The execution subject of the method may be a terminal device, which may be a device such as a personal computer, or a mobile terminal device such as a mobile phone or a tablet computer, and the terminal device may be a terminal device used by a user. In the embodiment of the present application, the execution subject is taken as an example to illustrate the terminal used by the prover. As shown in the figure, the blockchain-based identity authentication method 100 may include the following steps: Step 101: In response to a triggering operation on a target application, a public key and a private key generated in a security module are obtained.
[0017] In a specific implementation, the proving party downloads and installs the target application on the mobile terminal, such as a digital identity management application (Application, App), and obtains the public key generated in the security module in response to the proving party's triggering operation on the target application, such as application startup, user login, or specific function request. PK u and private key SK u , the security module may be a security module of a SIM card carried by the mobile terminal.
[0018] Step 102: Perform hash processing on the identity information input in the target application to obtain a hash value of the identity information.
[0019] In the specific implementation, the proving party enters identity information such as name and ID number in the target application user info , the mobile terminal receives 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 and generate identity information hash value Hash info , which is expressed as follows: Hash info = Hash ( user info ); Step 103: Store the identity information hash value and the public key in the target blockchain.
[0020] In the specific implementation, the identity information hash value obtained in the above steps isHash info and the public key PK u Stored in the target blockchain, so that compared to storing the complete identity information in the target blockchain user info The embodiment of the present application can reduce the amount of data stored on the target blockchain and reduce the maintenance cost of the blockchain network by storing the identity information hash value and the public key in the target blockchain. At the same time, it can ensure that the identity information is protected and reduce the risk of privacy leakage.
[0021] Step 104: Receive an identity authentication request sent by a verifier, determine a zero-knowledge proof based on a challenge code and the private key included in the identity authentication request, and send 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.
[0022] In a specific implementation, an identity authentication request is received from a verifier, and the identity authentication request includes a randomly generated challenge code. Challenge , according to the challenge code Challenge and private key SK u Determining zero-knowledge proofs Proof , and zero-knowledge proof Proof The challenge code is sent to the verification party so that the verification party verifies the identity information according to the zero-knowledge proof. Optionally, the verification party can also send the challenge code to the target application. Challenge The response is submitted to the verifier to ensure the dynamic and security of the verification process.
[0023] In this way, by using zero-knowledge proof, 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 identity authentication efficiency. At the same time, the prover can prove his identity to the verifier without leaking private keys or identity information, thereby enhancing the security of identity authentication.
[0024] In a possible implementation, in the above step 101, obtaining the public key and the private key generated in the security module includes: A key pair is generated by calling a security module using a key derivation algorithm, wherein the key pair includes a public key and a private key, and the public key corresponds to the private key; and the public key and the private key generated in the security module are obtained.
[0025] In an exemplary embodiment, the target application can initialize the blockchain account of the prover by communicating with the security module of the SIM card (BSIM card), and this process can be implemented through the Software Development Kit (SDK) of the SIM card.
[0026] Inside the BSIM card, a key derivation algorithm (KDA) is used to generate a corresponding public and private key pair ( PK u , SK u ), which is expressed as follows: PK u , SK u ← KDA ( seed , params ); 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.
[0027] In this way, the security and uniqueness of the key pair can be ensured. PK u Used for identity identification and transaction verification, while private keys SK u Used for signature and authorization operations, ensuring the security of user transactions and data exchanges.
[0028] In a possible implementation, after the above-mentioned step of generating a key pair by calling a security module and using a key derivation algorithm, the method further includes: Obtain a random seed corresponding to the key pair; encrypt the random seed using a preset recovery password to obtain an encrypted seed; and store the encrypted seed in a preset storage area.
[0029] In this embodiment of the present application, a key pair can be obtained ( PK u , SK u ) corresponds to the random seed seed ; Through the preset recovery password Recovery pwd , for random seeds seed Perform encryption to obtain an encrypted seed Encrypted seed , which is expressed as follows: Encrypted seed =Encrypt ( seed , Recovery pwd ); in, Encrypt (·) is the encryption function.
[0030] Furthermore, the encrypted seed is stored Encrypted seed to a preset storage area, for example, the prover uses the target application to Encrypted seed Upload to a secure cloud storage service for backup.
[0031] Wherein, after storing the encrypted seed in the preset storage area, the method further includes: In response to a recovery password input in the target application, the recovery password is processed by a preset hash function to obtain a password hash value; the encrypted seed in the storage area is decrypted by the password hash value to obtain a decrypted seed; and the key pair is restored according to the decrypted seed.
[0032] In the embodiment of the present application, the prover enters the recovery password in the target application. Recovery pwd , through the preset hash function, such as SHA-256 algorithm, to recover the password Recovery pwd Process and get the password hash value H pwd ; By password hash H pwd , for the encrypted seed in the storage area H pwd Perform decryption processing to obtain the decryption seed Decrypted seed ; According to the decryption seed Decrypted seed , recover the key pair PK u and SK u .
[0033] H pwd = SHA-256( Recovery pwd ); ; ; in, is a Gaussian function used to process password hashes, providing an extra layer of security; Ei(·) is an exponential integral function, which is used to normalize the password hash value. is the normalization coefficient, used to ensure the validity of the decrypted data; (·) is the information decryption function, used to combine the encryption seed Encrypted seed and password hashes H pwd Perform data recovery; KGF (·) is the key generation function used to decrypt the seed Decrypted seed Regenerate the prover's key pair.
[0034] In a possible implementation, in the above step 103, after storing the identity information hash value and the public key in the target blockchain, the step further includes: Obtain a storage transaction message returned by the target blockchain, where the storage transaction message is used to indicate that the identity hash value and the public key have been successfully stored in the target blockchain; and query the target blockchain for an identity information status corresponding to the storage transaction message.
[0035] In this embodiment of the present application, once the identity information hash value Hash info and the public key PK u After the data is successfully stored in the target blockchain, the storage transaction message returned by the target blockchain is obtained. The storage transaction message is used to indicate the identity hash value. Hash info and the public key PK u It has been successfully stored in the target blockchain; the prover 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.
[0036] The embodiment of the present application provides a blockchain-based identity authentication method, which responds to the trigger operation of the target application, obtains the public key and private key generated in the security module; hashes the identity information input in the target application to obtain the identity information hash value; stores the identity information hash value and the public key in the target blockchain; receives the identity authentication request sent by the verification party, determines the zero-knowledge proof according to the challenge code and private key included in the identity authentication request, and sends the zero-knowledge proof to the verification party. In this way, by using zero-knowledge proof, the verification party 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 authentication. Moreover, by storing the identity information hash value and the public key in the target blockchain, compared with storing the complete identity information in the target blockchain, this method can reduce the amount of data stored on the target blockchain and reduce the maintenance cost of the blockchain network.
[0037] Figure 2 Another flowchart of the blockchain-based identity authentication method provided in an embodiment of the present application is shown. The execution subject of the method may be a terminal device or a server, wherein the terminal device may be a device such as a personal computer, or a mobile terminal device such as a mobile phone or a tablet computer, and the terminal device may be a terminal device used by a user. The server may be an independent server or a server cluster composed of multiple servers, and the server may be a background server of a certain business, or a background server of a certain platform or application (for example, a digital identity authentication system, a social media platform, etc.). In the embodiment of the present application, the execution subject is taken as an example to illustrate the terminal used by the verifier. As shown in the figure, the blockchain-based identity authentication method 200 may include the following steps: Step 201: Send an identity authentication request to a proving party, wherein the identity authentication request includes a challenge code.
[0038] In a specific implementation, the verifier (such as a service provider) can send an identity authentication request to the prover through its platform, and the identity authentication request includes a randomly generated challenge code. Challenge .
[0039] Step 202: 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 according to the private key of the prover and the challenge code, and the public key of the prover corresponds to the private key of the prover.
[0040] Here, the verifier can also obtain the challenge code sent by the prover. Challenge response to ensure the real-time nature of the verification process and prevent replay attacks.
[0041] In the specific implementation, Figure 3 As shown in , the verifier 320 sends an identity authentication request to the prover 310, and the prover 310 receives the identity authentication request through the digital identity management App and confirms to start the identity authentication process. The digital identity management App automatically obtains the prover's private key from the BSIM card. SK u and the public key PK u ; The digital identity management app of the proving party 310 uses the private key SK u and challenge code Challenge Generating a zero-knowledge proof Proof , and sent to the verification party 320; at the same time, the proving party 310 sends the public key PK u , Identity information hash value Hash info Stored in the target blockchain 330; the verifier 320 obtains the zero-knowledge proof returned by the 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 rule C, etc. Step 203: Verify the identity information of the proving party according to the challenge code, zero-knowledge proof, the public key of the proving party and the hash value of the identity information.
[0042] In the specific implementation, the verifier Challenge , Zero-knowledge proof Proof , the public key of the prover PK u and the identity information hash value Hash info , verify the identity information of the prover.
[0043] In a possible implementation, in the above step 203, the identity information of the proving party is verified according to the challenge code, the zero-knowledge proof, the public key of the proving party, and the identity information hash value, including: A verification score is determined based on the challenge code, zero-knowledge proof, the public key of the prover and the hash value of the identity information, and the verification score is used to indicate the possibility of passing the identity authentication; based on the verification score, the identity information of the prover is verified.
[0044] In the embodiment of the present application, the verifier can Challenge , Zero-knowledge proof Proof , the public key of the prover PK uand the identity information hash value Hash info A verification score is determined, where the verification score is used to indicate the possibility of identity authentication being passed, and the identity information of the proving party is verified based on the verification score.
[0045] In this way, the possibility of identity authentication passing is quantified by the verification score, and the identity information of the prover is verified according to the verification score, which is conducive to improving the accuracy of identity information verification.
[0046] The above-mentioned step of determining the verification score according to the challenge code, the zero-knowledge proof, the public key of the prover, and the identity information hash value includes: The public key, identity information hash value and challenge code of the prover are input into the verification function, and the identity accuracy is determined through the verification function, and the identity accuracy is used to characterize the correctness of the identity information of the prover; the zero-knowledge proof, the public key of the prover, 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 through the information filtering function; the verification score is determined according to the identity accuracy and the matching degree between the zero-knowledge proof and the smart contract rules.
[0047] Optionally, the verification score may be determined in the following manner: ; in, V s To verify the score, Z (·) is the verification function, F (·) is the information filtering function, PK u is the public key, Hash info is the hash value of the identity information, Challenge is the challenge code, Proof For zero-knowledge proof, C Smart contract rules.
[0048] Here, the verification function Z (·) Used to verify the correctness of the identity information of the proving party; information filtering function F (·) Used to analyze the validity of zero-knowledge proofs and their matching degree with smart contract rules; Proof It is a proof generated by a zero-knowledge proof algorithm, which is 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, which is used in the verification process in blockchain technology.
[0049] In a possible implementation, the verifying of the identity information of the prover according to the verification score includes: When the deviation between the verification score and the first threshold is less than the preset deviation threshold, it is determined that the identity information verification of the prover has passed; when the deviation between the verification score and the second threshold is less than the preset deviation threshold, it is determined that the identity information verification of the prover has failed.
[0050] Among them, the first threshold, the second threshold and the preset deviation threshold can be selected according to empirical values.
[0051] In an exemplary embodiment, if the verification score V s Close to 1, the verification is successful and the user's identity is confirmed; if V s If the value is close to 0, the verification fails and needs to be re-verified or other security measures are taken. If the Proof verification succeeds, it means that the user does have the public key. PK u The corresponding private key SK u , thereby confirming the user's identity.
[0052] The embodiment of the present application provides a blockchain-based identity authentication method, which sends an identity authentication request to the prover, and the identity authentication request includes a challenge code; obtains 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 zero-knowledge proof is determined based on the prover's private key and the challenge code, and the prover's public key corresponds to the prover's private key; the prover's identity information is verified based on the challenge code, zero-knowledge proof, the prover's public key and the identity information hash value. In this way, by using zero-knowledge proof, the verifier can quickly confirm the user's identity without having to perform complex transactions on the target blockchain, which can reduce the transaction burden of the target blockchain and improve the efficiency of identity authentication. In addition, the prover can reduce the amount of data stored on the target blockchain 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, and reduce the maintenance cost of the blockchain network.
[0053] Figure 4 One of the structural diagrams of the blockchain-based identity authentication device provided in the embodiment of the present application is shown. The identity authentication device 400 can be implemented as follows: Figure 1 In the embodiment shown, all or part of the content, the identity verification device 400 includes: A first acquisition module 410, 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 420, configured to perform hash processing on the identity information input in the target application to obtain a hash value of the identity information; An information storage module 430, used to store the identity information hash value and the public key in a target blockchain; The first verification module 440 is used to receive an identity authentication request sent by a verifier, determine a zero-knowledge proof based on a challenge code and the private key included in the identity authentication request, and send 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.
[0054] In a possible implementation, the first acquisition module 410, when used to acquire the public key and the private key generated in the security module, is specifically used to: Generate a key pair by calling a security module and using a key derivation algorithm, the key pair comprising a public key and a private key, the public key corresponding to the private key; Obtain the public key and private key generated in the security module.
[0055] In a possible implementation, the first acquisition module 410 is further configured to: Obtaining a random seed corresponding to the key pair; The random seed is encrypted using a preset recovery password to obtain an encrypted seed; The encrypted seed is stored in a preset storage area.
[0056] In a possible implementation, the identity verification device 400 further includes: The key pair recovery module is used to respond to the recovery password input in the target application, process the recovery password through a preset hash function to obtain a password hash value; decrypt the encrypted seed in the storage area through the password hash value to obtain a decrypted seed; and recover the key pair according to the decrypted seed.
[0057] In a possible implementation, the information storage module 430 is further used to: Obtaining a storage transaction message returned by the target blockchain, wherein the storage transaction message is used to indicate that the identity hash value and the public key have been successfully stored in the target blockchain; The target blockchain is queried for an identity information status corresponding to the stored transaction message.
[0058] An embodiment of the present application provides a blockchain-based identity authentication device, including a first acquisition module, a hash processing module, an information storage module and a first verification module; the first acquisition module obtains the public key and private key generated in the security module in response to a trigger operation on a target application; 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 a target blockchain; the first verification module receives an identity authentication request sent by a verifier, determines a zero-knowledge proof according to a challenge code and the private key included in the identity authentication request, and sends 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, by using zero-knowledge proof, the verifier can quickly confirm the user's identity without having to perform complex transactions on the target blockchain, which can reduce the transaction burden of the target blockchain and improve identity authentication efficiency. 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 reduce the maintenance cost of the blockchain network.
[0059] Figure 5 The second structural diagram of the blockchain-based identity authentication device provided in the embodiment of the present application is shown. The identity authentication device 500 can be implemented as follows: Figure 2 In the embodiment shown, all or part of the content, the identity verification device 500 includes: A verification request module 510, configured to send an identity verification request to a proving party, wherein the identity verification request includes a challenge code; The second acquisition module 520 is used to 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 according to the private key of the prover and the challenge code, and the public key of the prover corresponds to the private key of the prover; The second verification module 530 is used to verify the identity information of the proving party according to the challenge code, the zero-knowledge proof, the public key of the proving party and the identity information hash value.
[0060] In a possible implementation, the second verification module 530, when used to verify the identity information of the proving party according to the challenge code, the zero-knowledge proof, the public key of the proving party, and the identity information hash value, is specifically used to: Determine a verification score based on the challenge code, the zero-knowledge proof, the public key of the prover, and the hash value of the identity information, wherein the verification score is used to indicate the possibility of passing the identity authentication; The identity information of the prover is verified according to the verification score.
[0061] In a possible implementation, the second verification module 530, when used to determine the verification score according to the challenge code, the zero-knowledge proof, the public key of the prover, and the identity information hash value, is specifically used to: Inputting the public key, identity information hash value and challenge code of the prover into a verification function, and determining the identity accuracy through the verification function, wherein the identity accuracy is used to characterize the correctness of the identity information of the prover; Inputting the zero-knowledge proof, the prover's public key, the challenge code and the preset smart contract rules into an information filtering function, and determining the matching degree between the zero-knowledge proof and the smart contract rules through the information filtering function; A verification score is determined based on the identity accuracy and the match between the zero-knowledge proof and the smart contract rules.
[0062] The second verification module 530 is used to determine the verification score in the following manner: ; in, V s To verify the score, Z (·) is the verification function, F (·) is the information filtering function, PK u is the public key, Hash info is the hash value of the identity information, Challenge is the challenge code, Proof For zero-knowledge proof, C Smart contract rules.
[0063] In a possible implementation, the second verification module 530, when used to verify the identity information of the prover according to the verification score, is specifically used to: When the degree of deviation between the verification score and the first threshold is less than a preset degree of deviation threshold, determining that the identity information of the certifying party has been verified; When the degree of deviation between the verification score and the second threshold is less than the preset degree of deviation threshold, it is determined that the identity information verification of the prover has failed.
[0064] The embodiment of the present application provides an identity authentication device based on blockchain, including a verification request module, a second acquisition module and a second verification module; the verification request module sends an identity authentication request to the prover, and the identity authentication request includes a challenge code; the second acquisition module obtains the zero-knowledge proof returned by the prover, and obtains the public key and identity information hash value of the prover from the target blockchain; the second verification module verifies the identity information of the prover according to the challenge code, zero-knowledge proof, the public key of the prover and the identity information hash value. In this way, by using zero-knowledge proof, the verifier can quickly confirm the identity of the user without performing complex transactions on the target blockchain, which can reduce the transaction burden of the target blockchain and improve the efficiency of identity authentication. In addition, the prover stores the identity information hash value and public key in the target blockchain. Compared with storing the complete identity information in the target blockchain, this method can reduce the amount of data stored on the target blockchain and reduce the maintenance cost of the blockchain network.
[0065] Figure 6 The hardware structure diagram of the electronic device provided by the embodiment of the present application is shown. Referring to the figure, 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. Among them, the memory 640 may include a memory 641, such as a high-speed random access memory (Random-Access Memory, RAM), and may also include a non-volatile memory 642 (non-volatile memory), such as at least one disk storage, etc. Of course, the electronic device 600 may also include hardware required for other services.
[0066] The processor 610, the network interface 630 and the memory may be interconnected via an internal bus 620, which may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0067] The memory 640 stores programs. Specifically, the programs may include program codes, and the program codes include computer operation instructions. The memory 640 may include a memory 641 and a non-volatile memory 642, and provide instructions and data to the processor 610.
[0068] The processor 610 reads the corresponding computer program from the non-volatile memory 642 into the 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 the memory and specifically performs: Figure 1 or Figure 2 The method disclosed in the illustrated embodiment realizes the functions and beneficial effects of each method described in the foregoing method embodiments, which will not be described in detail here.
[0069] The above application Figure 1 or Figure 2 The method disclosed in the illustrated embodiment can be applied to the processor 610 or implemented by the processor 610. The processor 610 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 610. The above 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 gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0070] The computer device can also execute the methods described in the foregoing method embodiments, and realize the functions and beneficial effects of the methods described in the foregoing method embodiments, which will not be repeated here.
[0071] Of course, in addition to software implementation, the electronic device 600 of the present application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0072] The embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable medium stores one or more programs, and when the one or more programs are executed by an electronic device including multiple application programs, the electronic device executes Figure 1 or Figure 2 The method disclosed in the illustrated embodiment realizes the functions and beneficial effects of each method described in the foregoing method embodiments, which will not be described in detail here.
[0073] The computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0074] Furthermore, an embodiment of the present application also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, and when the program instructions are executed by a computer, the following process is implemented: Figure 1 or Figure 2 The method disclosed in the illustrated embodiment realizes the functions and beneficial effects of each method described in the foregoing method embodiments, which will not be described in detail here.
[0075] The embodiments of the present application can be applied to various electronic device collaboration or interconnection scenarios, including: collaboration and interconnection between mobile phones and laptops / tablet computers; collaboration and interconnection between mobile terminals and smart TVs / displays; collaboration and interconnection between mobile phones or tablet computers and in-car entertainment systems; collaboration and interconnection between mobile terminals and smart conference systems, etc., so as to meet the needs of users in various scenarios such as smart homes, smart offices, and smart travel.
[0076] In short, the above is only a preferred embodiment of the present application and does not limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0077] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0078] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. 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 technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0079] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0080] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
Claims
1. A blockchain-based identity authentication method, characterized in that: include: In response to a triggering operation on a target application, obtaining a public key and a private key generated in a security module; Performing hash processing on the identity information input in the target application to obtain a hash value of the identity information; Storing the identity information hash value and the public key in the target blockchain; Receive an identity authentication request sent by a verifier, determine a zero-knowledge proof according to a challenge code and the private key included in the identity authentication request, and send 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.
2. The method according to claim 1, characterized in that The obtaining of the public key and the private key generated in the security module includes: Generate a key pair by calling a security module and using a key derivation algorithm, the key pair comprising a public key and a private key, the public key corresponding to the private key; Obtain the public key and private key generated in the security module.
3. The method according to claim 2, characterized in that After the key pair is generated by calling the security module using the key derivation algorithm, the method further includes: Obtaining a random seed corresponding to the key pair; The random seed is encrypted using a preset recovery password to obtain an encrypted seed; The encrypted seed is stored in a preset storage area.
4. The method according to claim 3, characterized in that: After storing the encrypted seed in a preset storage area, the method further includes: In response to a recovery password input in the target application, the recovery password is processed by a preset hash function to obtain a password hash value; Decrypting the encrypted seed in the storage area using the cryptographic hash value to obtain a decrypted seed; The key pair is recovered according to 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: Obtaining a storage transaction message returned by the target blockchain, wherein the storage transaction message is used to indicate that the identity hash value and the public key have been successfully stored in the target blockchain; The target blockchain is queried for an identity information status corresponding to the stored transaction message.
6. A blockchain-based identity authentication method, characterized in that: include: Sending an identity authentication request to a proving party, wherein the identity authentication request includes 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 according to the private key of the prover and the challenge code, and the public key of the prover corresponds to the private key of the prover; The identity information of the proving party is verified according to the challenge code, the zero-knowledge proof, the public key of the proving party and the hash value of the identity information.
7. The method according to claim 6, characterized in that The verifying the identity information of the proving party according to the challenge code, the zero-knowledge proof, the public key of the proving party and the identity information hash value includes: Determine a verification score based on the challenge code, the zero-knowledge proof, the public key of the prover, and the hash value of the identity information, wherein the verification score is used to indicate the possibility of passing the identity authentication; The identity information of the prover is verified according to the verification score.
8. The method according to claim 7, characterized in that The step of determining the verification score according to the challenge code, the zero-knowledge proof, the public key of the prover, and the identity information hash value includes: Inputting the public key, identity information hash value and challenge code of the prover into a verification function, and determining the identity accuracy through the verification function, wherein the identity accuracy is used to characterize the correctness of the identity information of the prover; Inputting the zero-knowledge proof, the prover's public key, the challenge code and the preset smart contract rules into an information filtering function, and determining the matching degree between the zero-knowledge proof and the smart contract rules through the information filtering function; A verification score is determined based on the identity accuracy and the match between the zero-knowledge proof and the smart contract rules.
9. The method according to claim 8, characterized in that The verification score is determined by: ; in, V s To verify the score, Z (·) is the verification function, F (·) is the information filtering function, PK u is the public key, Hash info is the hash value of the identity information, Challenge is the challenge code, Proof For zero-knowledge proof, C Smart contract rules.
10. The method according to claim 7, characterized in that The verifying the identity information of the prover according to the verification score includes: When the degree of deviation between the verification score and the first threshold is less than a preset degree of deviation threshold, determining that the identity information of the certifying party has been verified; When the degree of deviation between the verification score and the second threshold is less than the preset degree of deviation threshold, it is determined that the identity information verification of the prover has failed.
11. An identity verification device based on blockchain, characterized in that: include: 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, used to perform hash processing on the identity information input in the target application to obtain a hash value of the identity information; An information storage module, used to store the identity information hash value and the public key in a target blockchain; The first verification module is used to receive an identity authentication request sent by a verifier, determine a zero-knowledge proof according to a challenge code and the private key included in the identity authentication request, and send 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.
12. An identity verification device based on blockchain, characterized in that: include: A verification request module, used to send an identity authentication request to a proving party, wherein the identity authentication request includes a challenge code; A second acquisition module is used to obtain the zero-knowledge proof returned by the prover, and to obtain the public key and identity information hash value of the prover from the target blockchain; The zero-knowledge proof is determined according to the private key of the prover and the challenge code, and the public key of the prover corresponds to the private key of the prover; The second verification module is used to verify the identity information of the proving party according to the challenge code, the zero-knowledge proof, the public key of the proving party and the identity information hash value.
13. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method according to any one of claims 1 to 10 are implemented.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
15. A computer program product, characterized in that The computer program product comprises a computer program stored on a non-transitory computer-readable storage medium, wherein the computer program comprises program instructions, and when the program instructions are executed by a computer, the computer is caused to perform the steps of the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Blockchain private data management method and system based on zero knowledge proof
CN110958110A
Crowdsourcing task allocation method and system with privacy protection and storage medium
CN114168921A
Identity verification method and device based on block chain, equipment, medium and product
CN116975901A
Internet of Things identity authentication method based on block chain
CN118214552A
Identity authentication method and system based on block chain and zero-knowledge proof
CN118646540A