Blockchain account verification method, device, computer equipment and storage medium
By using DID contracts in the blockchain account system to reset the private key, the problem of account unavailability caused by private key loss is solved, and the reliability and user experience of the blockchain are improved.
Patent Information
- Application Number
- CN202210344237.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-31
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2042-03-31
AI Technical Summary
The existing blockchain account system cannot be restored when the private key is lost, resulting in the account being unavailable and reducing the reliability of the blockchain.
By using DID contracts as the underlying system contract, users use DID contract accounts as the underlying blockchain account to reset the private key, solve the problem of private key loss, and improve the reliability of the blockchain.
It realizes account recovery in case of private key loss, improving the reliability and user experience of the blockchain.
Smart Images

Figure CN114844629B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and specifically to a blockchain account verification method, device, computer equipment and storage medium. Background Art
[0002] With the continuous development of the Internet, blockchain technology has emerged. Specifically, the essence of blockchain technology is a decentralized and distributed data storage, transmission and certification method, which replaces the current Internet's reliance on central servers with data blocks, so that all data changes or transaction items are recorded on a cloud system. Blockchain technology is an Internet database technology with the characteristics of decentralization, openness and transparency. For example, the technology of digital identity distributed identity identification (Decentralized Identifiers, DID) in the blockchain field has the characteristics of distribution, autonomous control, and cross-chain reuse.
[0003] At present, in the existing blockchain account system, a public-private key pair is usually used. The public key is derived from the private key based on the algorithm, and the address is derived from the public key. The blockchain account is controlled by the only private key, and the private key is the only proof of account verification. Therefore, when the user's private key is lost, the user cannot retrieve his or her blockchain account, and will lose all the rights and interests under the current account, resulting in low reliability when using the blockchain. Summary of the invention
[0004] The embodiments of the present application provide a blockchain account verification method, apparatus, computer equipment, and storage medium. By using a DID contract as the underlying system contract and a user using the DID contract account as the underlying blockchain account, it is possible to reset the private key, solve the problem of private key loss, and improve the reliability of the blockchain.
[0005] The present application provides a blockchain account verification method, the method comprising:
[0006] Receive a transaction request initiated by the controller to be verified corresponding to the target user, wherein the transaction request carries a transaction body, which includes transaction data, target DID account, signature information of the controller to be verified, and private key information of the controller to be verified;
[0007] Obtain controller public key information of multiple account controllers in the DID account contract corresponding to the target DID account, and obtain multiple controller public key information;
[0008] Determine the public key information to be verified of the controller to be verified based on the signature information of the controller to be verified and the private key information of the controller to be verified;
[0009] Searching among the multiple controller public keys whether there is controller public key information matching the public key information to be verified, and determining a verification result;
[0010] If the verification result is successful, the transaction is determined to be valid, and the transaction is performed in the blockchain network based on the transaction body.
[0011] Accordingly, the embodiment of the present application also provides a blockchain account verification device, the device comprising:
[0012] A receiving unit, configured to receive a transaction request initiated by a controller to be verified corresponding to a target user, wherein the transaction request carries a transaction body, and the transaction body includes transaction data, a target DID account, signature information of the controller to be verified, and private key information of the controller to be verified;
[0013] An acquisition unit, used to acquire controller public key information of multiple account controllers in the DID account contract corresponding to the target DID account, and obtain multiple controller public key information;
[0014] A first determining unit, configured to determine the public key information to be verified of the controller to be verified based on the signature information of the controller to be verified and the private key information of the controller to be verified;
[0015] A second determination unit is used to search among the multiple controller public keys whether there is controller public key information matching the public key information to be verified, and determine a verification result;
[0016] The third determination unit is used to determine that the transaction is valid if the verification result is successful, and perform the transaction in the blockchain network based on the transaction body.
[0017] In some embodiments, the apparatus further comprises:
[0018] A first receiving subunit is configured to receive an account registration request sent by a first controller corresponding to the target user, wherein the account registration request carries attribute information of the first controller, and the attribute information of the first controller includes first private key information of the first controller, first public key information of the first controller, and a first controller address of the first controller;
[0019] A first generating unit, configured to generate a target contract address in an account system contract deployed on the blockchain network based on the first controller attribute information, wherein the account system contract is used to manage DID accounts;
[0020] A second generating unit, configured to generate a target DID account based on the target contract address and preset identification information;
[0021] The first processing unit is used to save the target DID account in the account system contract, and send the target DID account to the target user, so that the controller corresponding to the target user obtains the control authority of the target DID account.
[0022] In some embodiments, the apparatus further comprises:
[0023] A creation unit, used to create a DID account contract in the account system contract;
[0024] The third generating unit is used to write the first controller attribute information into the DID account contract, and generate a target contract address corresponding to the DID account contract based on the first controller attribute information.
[0025] In some embodiments, the apparatus further comprises:
[0026] The fourth generating unit is used to sequentially concatenate the DID prefix, the DID method identifier and the target contract address to generate a target DID account.
[0027] In some embodiments, the apparatus further comprises:
[0028] A second receiving subunit is configured to receive an adding request from an initiating controller among multiple candidate controllers of the target user to a controller to be added, wherein the adding request carries a target DID account of the target user and attribute information of a second controller of the controller to be added, and the attribute information of the second controller includes second public key information of the controller to be added and an address of the second controller of the controller to be added;
[0029] An adding unit is used to add the controller to be added as a target controller of the target DID account based on the target DID account and the second controller attribute information, wherein the target controller has control authority over the target DID account.
[0030] In some embodiments, the apparatus further comprises:
[0031] The second processing unit is used to save the second controller attribute information into the DID account contract corresponding to the target DID account, so as to add the controller to be added as the target controller of the target DID account.
[0032] In some embodiments, the apparatus further comprises:
[0033] A determination unit, used to determine whether the initiating controller is the controller of the target DID account;
[0034] The third processing unit is used for:
[0035] If yes, save the attribute information of the second controller to the DID account contract corresponding to the target DID account;
[0036] If not, the controller to be added will not be added as the controller of the DID account.
[0037] In some embodiments, the apparatus further comprises:
[0038] A third receiving subunit is configured to receive a deletion request from an initiating controller among multiple candidate controllers of the target user to a controller to be deleted, wherein the deletion request carries a target DID account corresponding to the initiating controller and a controller address of the controller to be deleted;
[0039] The deleting unit is used to delete the controller address of the controller to be deleted from the DID account contract corresponding to the target DID account, so as to release the control authority of the controller to be deleted over the DID account.
[0040] In some embodiments, the apparatus further comprises:
[0041] A fourth receiving subunit, configured to receive a DID account statistics request sent by the target user;
[0042] A statistics unit, configured to count the number of all DID accounts through the account system contract deployed on the blockchain network based on the DID account statistics request;
[0043] A returning unit is used to return the number of accounts to the target user.
[0044] Correspondingly, an embodiment of the present application also provides a computer device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of any one of the blockchain account verification methods described above are implemented.
[0045] In addition, an embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the blockchain account verification methods described above are implemented.
[0046] The embodiment of the present application provides a blockchain account verification method, device, computer equipment and storage medium, receiving a transaction request initiated by a controller to be verified corresponding to a target user; obtaining the controller public key information of multiple account controllers in the DID account contract corresponding to the target DID account, and obtaining multiple controller public key information; determining the public key information to be verified of the controller to be verified based on the signature information of the controller to be verified and the private key information of the controller to be verified; finding out whether there is a controller public key information matching the public key information to be verified from the multiple controller public keys, and determining the verification result; if the verification result is successful, it is determined that the transaction is valid, and the transaction is conducted in the blockchain network based on the transaction body. The embodiment of the present application uses the DID contract as the underlying system contract, and the user uses the DID contract account as the underlying blockchain account, which can achieve the reset of the private key, solve the problem of private key loss, and improve the reliability of the blockchain. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0048] Figure 1 It is a flow chart of the distributed identity identification and verifiable declaration model provided in the embodiment of the present application.
[0049] Figure 2 This is a flowchart of a blockchain account verification method provided in an embodiment of the present application.
[0050] Figure 3 This is a scenario diagram of a blockchain account verification method provided in an embodiment of the present application.
[0051] Figure 4 It is a structural diagram of a blockchain account verification device provided in an embodiment of the present application.
[0052] Figure 5 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0054] In the prior art, users first need to register an account on the platform. First, the user generates a pair of public and private keys, and generates a corresponding address account based on the public key. The user submits the address account to initiate the account registration process. The blockchain system will automatically generate a random account and bind it to the address account corresponding to the public key and store it on the blockchain. In the account registration process, the private key is generated off-chain and kept by the user. The registration process only puts the public key on the chain. When the user's private key is lost, the user cannot retrieve his or her blockchain account, and will lose all rights and interests under the current account, resulting in low reliability when using the blockchain.
[0055] Based on this, the embodiment of the present application provides a verification method, device, computer equipment and storage medium for a blockchain account. Specifically, the embodiment of the present application provides a verification method for a blockchain account of a verification device applicable to a blockchain account, and the verification device of the blockchain account can be integrated in a computer device, and the verification method for a blockchain account of the embodiment of the present application can be performed by a computer device. Among them, the computer device can be a terminal or a server. The terminal can be a terminal device such as a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC, Personal Computer), a personal digital assistant (Personal Digital Assistant, PDA), etc. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms, but is not limited to this.
[0056] See also Figure 1 , Figure 1 A flow chart of a distributed identity and verifiable credential (VC) model provided for an embodiment of the present application. In the distributed identity and verifiable credential (VC) model provided in an embodiment of the present application, there are three participants: a holder, an issuer, and a verifier. Among them, the holder can register a distributed identity, query a distributed identity, and can also register a distributed identity and become an issuer. The holder user can apply for a verifiable statement and send the application to the issuer. The issuer can determine whether to issue a verifiable statement after verifying the holder's distributed identity. The holder user provides a verifiable statement to the verifier, and the verifier can verify whether the user, issuer, or signature information is legal. The verifier may also call the issuer to check the status of the verifiable statement.
[0057] Specifically, Verifiable Credential provides a specification to describe certain attributes of an entity and implement evidence-based trust. DID holders can use verifiable credentials to prove to other entities (individuals, organizations, specific things, etc.) that certain attributes of their own are credible. At the same time, combined with cryptographic technologies such as digital signatures and zero-knowledge proofs, the credentials can be made more secure and credible, and user privacy can be further protected from being violated.
[0058] Among them, the embodiment of the present application can be applied to the verifiable system of the verifiable statement (VC). In the verifiable statement system, there are three participants: the issuer (Issuer), an entity that owns user data and can issue a verifiable statement, such as a government, bank, university and other institutions and organizations; the holder (Holder), the holder is the user, the user requests, receives and holds the entity of the verifiable statement from the issuer, and presents the verifiable statement to the verifier. The issued verifiable statement can be self-saved for future reuse, such as saved in a wallet, and the user may also transfer one or more VCs to other people; the verifier (Verifier), receives the verifiable statement and verifies it. After the verification is passed, a certain type of service can be provided to the user who presents the verifiable statement; the identifier registration agency (Verifiable Data Registry), maintains a database of distributed identity identification (DID), such as a blockchain or a distributed ledger. In the verifiable statement system, the verifier can verify the user's verifiable statement, and can also verify the self-signed verifiable statement, that is, the verifiable statement (VP). After the verification is passed, the validity of the verifiable statement held by the user can be determined. Among them, issuers have different categories, and issuers of different categories have different authority levels.
[0059] For example, taking the three-level issuer architecture as an example, issuers can be divided into root issuers, first-level issuers, and ordinary issuers. The root issuer can directly add a first-level issuer and authorize the first-level issuer to issue a designated certificate. The root issuer can be a member of the alliance organization in the alliance chain. The first-level issuer can directly add an ordinary issuer and authorize the ordinary issuer to issue a designated certificate. The first-level issuer can be an authoritative institution, an authoritative association, an authoritative organization, an alliance, and other types of first-level institutions in a broad sense (such as the Education Bureau, public blockchain platform, industrial and commercial institutions, the China Banking Regulatory Commission, government organizations, general first-level institutions, etc.). After being authorized by the first-level issuer, the network entity can become an ordinary issuer. The ordinary issuer has the authority to issue designated certificates. The ordinary issuer can be a branch of various institutions / associations / organizations / alliances, such as companies (industrial and commercial certification agencies), various universities (issued by the Education Bureau), various ordinary issuers (ticket issuers), etc.
[0060] In the embodiments of the present application, distributed digital identities are not only people, but also organizations, and even objects in the future. These people, organizations, and objects do not simply rely on the original centralized authority, cannot be taken away or deleted, and are identities that are carried for life. The distributed identity identification (Decentralized Identifiers, DID) mentioned in the embodiments of the present application is a decentralized and verifiable digital identifier with the characteristics of being distributed, autonomous and controllable, and cross-chain reuse. Entities can independently complete the registration, resolution, update, or revocation of DIDs. DID is specifically resolved into DIDDocument, which includes the unique identification code of DID, a list of public keys and detailed information of the public keys (holders, encryption algorithms, key status, etc.), and other attribute descriptions of the DID holder.
[0061] The embodiments of the present application provide a blockchain account verification method, device, computer equipment and storage medium, which are described in detail below. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.
[0062] The embodiment of the present application provides a method for verifying a blockchain account. The embodiment of the present application will be described from the perspective of a verification device for a blockchain account, and the verification device for a blockchain account can be specifically integrated in a computer device.
[0063] Please also read Figure 2 and Figure 3 , Figure 2 A flowchart of a blockchain account verification method provided in an embodiment of the present application, the specific process may be as follows: Steps 101 to 105:
[0064] 101. Receive a transaction request initiated by a controller to be verified corresponding to a target user, wherein the transaction request carries a transaction body, and the transaction body includes transaction data, a target DID account, signature information of the controller to be verified, and private key information of the controller to be verified.
[0065] Among them, the transaction data can be the original transaction data, and the target DID account can be the user's DID (for example: did:future:0x8688f14154d2ab5E05229a7C3FB2393d02e68E06). The signature information can be calculated by the signature algorithm. Optionally, the signature algorithm provided in the embodiment of the present application can be an elliptic curve signature algorithm (Secp256k1 signature algorithm).
[0066] Specifically, before registering a DID account, an account system contract that supports the DID account controller contract can be deployed at the bottom of the blockchain. The core functions of the account system contract include: DID account creation, adding a DID controller, deleting a DID controller, querying all controllers of a DID account, querying the number of DID accounts, and other functions required by DID accounts, such as changing services, changing authorizations, etc. The reference code example of the DID account controller contract is as follows:
[0067]
[0068]
[0069]
[0070] Furthermore, the reference code example of the DID account contract is as follows:
[0071]
[0072]
[0073] In one embodiment, before the step of “receiving a transaction request initiated by a controller to be verified corresponding to the target user”, the method may include:
[0074] Receiving an account registration request sent by a first controller corresponding to the target user, the account registration request carrying attribute information of the first controller, the first controller attribute information including first private key information of the first controller, first public key information of the first controller, and a first controller address of the first controller;
[0075] Based on the first controller attribute information, generating a target contract address in an account system contract deployed on the blockchain network, wherein the account system contract is used to manage DID accounts;
[0076] Generate a target DID account based on the target contract address and preset identification information;
[0077] The target DID account is saved in the account system contract, and the target DID account is sent to the target user, so that the controller corresponding to the target user obtains the control authority of the target DID account.
[0078] For example, a user can generate an initial private key off-chain and use the private key to initiate an account creation transaction on the blockchain to create a DID contract account (the transaction to create an account is consistent with the existing Ethereum transaction format). The blockchain will create the contract account as the user's DID account. For example, the initial private key can be:
[0079] 4c0883a69102937d6231471b5dbb6204fe5129617082792ae468d01a3f362318;
[0080] The public key can be:
[0081] (4e3b81af9c2234cad09d679ce6035ed1392347ce64ce405f5dcd36228a25de6e47fd35c4215d1edf53e6f83de344615ce719bdb0fd878f6ed76f06dd277956de);
[0082] The controller address can be:
[0083] 0x2c7536e3605d9c16a7a3d7b1898e529396a65c23;
[0084] Users can use the initial private key to initiate a transaction, enter the default controller address, default controller public key, otherParams and other DID-related parameters, and call the DID account controller contract to create a DID account.
[0085] The reference code example for creating a DID account on the user side is as follows:
[0086]
[0087] The reference code example for creating a DID account on the blockchain network is as follows:
[0088]
[0089] In a specific embodiment, the step of “generating a target contract address in an account system contract deployed on the blockchain network based on the first controller attribute information” may include:
[0090] Create a DID account contract in the account system contract;
[0091] The first controller attribute information is written into the DID account contract, and a target contract address corresponding to the DID account contract is generated based on the first controller attribute information.
[0092] Specifically, the preset identification information may include a DID prefix and a DID method identifier. The step of "generating a target DID account based on the target contract address and the preset identification information" may include:
[0093] The DID prefix, the DID method identifier and the target contract address are concatenated in sequence to generate a target DID account.
[0094] Among them, the DID prefix is fixed, indicating that this string is a DID identification string; the DID method identifier represents the DID method, which is used to indicate how this DID identification is defined and operated.
[0095] For example, the DidAccount contract address could be:
[0096] 0x8688f14154d2ab5E05229a7C3FB2393d02e68E06
[0097] The final did account is:
[0098] did:future:0x8688f14154d2ab5E05229a7C3FB2393d02e68E06.
[0099] Optionally, after creating a DID account, a DID change event can be sent to the user, returning information such as the user's DID account, controller public key, creation time, etc.
[0100] In one embodiment, after the step of “saving the target DID account in the account system contract and sending the target DID account to the target user”, the method may include:
[0101] Receive an adding request from an initiating controller among multiple candidate controllers of the target user for a controller to be added, wherein the adding request carries a target DID account of the target user and attribute information of a second controller of the controller to be added, and the attribute information of the second controller includes second public key information of the controller to be added and an address of the second controller of the controller to be added;
[0102] Based on the target DID account and the second controller attribute information, the controller to be added is added as the target controller of the target DID account, wherein the target controller has control authority over the target DID account.
[0103] Specifically, the step of “adding the controller to be added as the target controller of the target DID account based on the target DID account and the second controller attribute information” may include:
[0104] The attribute information of the second controller is saved in the DID account contract corresponding to the target DID account, so as to add the controller to be added as the target controller of the target DID account.
[0105] Furthermore, before the step of “saving the second controller attribute information into the DID account contract corresponding to the target DID account”, the method may include:
[0106] Determine whether the initiating controller is the controller of the target DID account;
[0107] If yes, then save the attribute information of the second controller to the DID account contract corresponding to the target DID account;
[0108] If not, the controller to be added will not be added as the controller of the DID account.
[0109] The reference code example for the controller of a newly added DID account on the user side is as follows:
[0110] / / Add a controller to a did account
[0111] / / did target did; newController new controller address; newControllerPublicKey new controller public key
[0112] function addController(string did,address newController,stringnewControllerPublicKey)public{
[0113] DIDAccount(did).addController(did);
[0114] }
[0115] Among them, the reference code example of the controller of a newly added DID account in the blockchain network is as follows:
[0116]
[0117] In order to manage the controller corresponding to the DID account, after the step of “adding the controller to be added as the target controller of the target DID account based on the target DID account and the second controller attribute information”, the method may include:
[0118] Receive a deletion request from an initiating controller among multiple candidate controllers of the target user to a controller to be deleted, wherein the deletion request carries a target DID account corresponding to the initiating controller and a controller address of the controller to be deleted;
[0119] The controller address of the controller to be deleted is deleted from the DID account contract corresponding to the target DID account to release the control authority of the controller to be deleted over the DID account.
[0120] The reference code example for deleting the controller of a DID account on the user side is as follows:
[0121] / / A did account deletes the controller
[0122] / / did target did; controller controller address
[0123] function delController(string did,address controller)public{
[0124] DIDAccount(did).delController(did);
[0125] }
[0126] The following is a reference code example of how the blockchain deletes the controller of a DID account:
[0127]
[0128] To count the number of accounts in a blockchain network, methods may include:
[0129] Receive a DID account statistics request sent by the target user;
[0130] Based on the DID account statistics request, the number of all DID accounts is counted through the account system contract deployed on the blockchain network;
[0131] The number of accounts is returned to the target user.
[0132] The reference code example for querying all DID accounts on the blockchain is as follows:
[0133]
[0134] 102. Obtain controller public key information of multiple account controllers in the DID account contract corresponding to the target DID account, and obtain multiple controller public key information.
[0135] 103. Determine the public key information to be verified of the controller to be verified based on the signature information of the controller to be verified and the private key information of the controller to be verified.
[0136] 104. Search among the multiple controller public keys to see whether there is controller public key information matching the public key information to be verified, and determine a verification result.
[0137] 105. If the verification result is successful, the transaction is determined to be valid, and the transaction is performed in the blockchain network based on the transaction body.
[0138] In summary, the embodiment of the present application provides a blockchain account verification method, which receives a transaction request initiated by a controller to be verified corresponding to a target user; obtains the controller public key information of multiple account controllers in the DID account contract corresponding to the target DID account, and obtains multiple controller public key information; determines the public key information to be verified of the controller to be verified based on the signature information of the controller to be verified and the private key information of the controller to be verified; searches among the multiple controller public keys for controller public key information that matches the public key information to be verified, and determines the verification result; if the verification result is successful, the transaction is determined to be valid, and the transaction is conducted in the blockchain network based on the transaction body. The embodiment of the present application can reset the private key by using the DID contract as the underlying system contract, and the user uses the DID contract account as the underlying blockchain account, so as to solve the problem of private key loss and improve the reliability of the blockchain.
[0139] Based on the above introduction, the following example will further illustrate the blockchain account verification method of this application. Figure 3 , the present application provides a blockchain account verification method in another embodiment, the specific method is as follows:
[0140] (1) By deploying a DID account system contract at the bottom layer of the blockchain, the DID account system contract includes functions such as creating a DID account, resetting the DID account private key, querying the DID account, and counting the number of accounts.
[0141] (2) The user can generate an initial private key off-chain and use the private key to initiate a transaction to create a DID contract account on the blockchain. The blockchain will create a contract account, i.e. the user's DID account, based on the transaction. Specifically, write the default controller address, default controller public key, otherParams and other DID related parameters (services, etc.) to the DID account system contract, and call the DID account controller contract to create a DID account.
[0142] (3) Users can set one or more controllers for the DID account (each controller has a corresponding private key). Each controller can control the DID account, so users do not need to worry about losing their private keys and can solve the problem by resetting the controller.
[0143] (4) In addition, when a user initiates a blockchain transaction, he or she can add a DID account address to the end of the original transaction body, and then sign the transaction body using the private key of one of the controllers in the DID account to send the transaction to the blockchain. Before the blockchain receives the transaction and enters the queue, it first obtains the DID account from the end of the transaction body, and queries the controller's public key in the contract through the DID account address. At the same time, it recovers the public key of the signer of the transaction body, and the blockchain verifies the signature of the transaction body. The blockchain also verifies whether the public key of the controller of the transaction is one of the controllers of the DID account. If so, the transaction is authentic and valid, and can be entered into the queue for transaction.
[0144] (5) The blockchain can also count the specific number of registered users of the blockchain account through the DID account system contract. Specifically, the blockchain can query the number of did accounts to count the specific number of registered users of the blockchain account.
[0145] In order to facilitate the better implementation of the blockchain account verification method provided in the embodiment of the present application, the embodiment of the present application also provides a verification device based on the above blockchain account. The meaning of the nouns is the same as that in the above blockchain account verification method, and the specific implementation details can refer to the description in the method embodiment.
[0146] See also Figure 4 , Figure 4 A schematic diagram of a blockchain account verification device provided in an embodiment of the present application, the device comprising:
[0147] The receiving unit 201 is used to receive a transaction request initiated by the controller to be verified corresponding to the target user, wherein the transaction request carries a transaction body, and the transaction body includes transaction data, a target DID account, signature information of the controller to be verified, and private key information of the controller to be verified;
[0148] An acquisition unit 202 is used to acquire controller public key information of multiple account controllers in the DID account contract corresponding to the target DID account, and obtain multiple controller public key information;
[0149] A first determining unit 203 is used to determine the public key information to be verified of the controller to be verified based on the signature information of the controller to be verified and the private key information of the controller to be verified;
[0150] A second determination unit 204 is used to search among the multiple controller public keys whether there is controller public key information matching the public key information to be verified, and determine a verification result;
[0151] The third determination unit 205 is used to determine that the transaction is valid if the verification result is successful, and perform the transaction in the blockchain network based on the transaction body.
[0152] In some embodiments, the apparatus further comprises:
[0153] A first receiving subunit is configured to receive an account registration request sent by a first controller corresponding to the target user, wherein the account registration request carries attribute information of the first controller, and the attribute information of the first controller includes first private key information of the first controller, first public key information of the first controller, and a first controller address of the first controller;
[0154] A first generating unit, configured to generate a target contract address in an account system contract deployed on the blockchain network based on the first controller attribute information, wherein the account system contract is used to manage DID accounts;
[0155] A second generating unit, configured to generate a target DID account based on the target contract address and preset identification information;
[0156] The first processing unit is used to save the target DID account in the account system contract, and send the target DID account to the target user, so that the controller corresponding to the target user obtains the control authority of the target DID account.
[0157] In some embodiments, the apparatus further comprises:
[0158] A creation unit, used to create a DID account contract in the account system contract;
[0159] The third generating unit is used to write the first controller attribute information into the DID account contract, and generate a target contract address corresponding to the DID account contract based on the first controller attribute information.
[0160] In some embodiments, the apparatus further comprises:
[0161] The fourth generating unit is used to sequentially concatenate the DID prefix, the DID method identifier, and the target contract address to generate a target DID account.
[0162] In some embodiments, the apparatus further comprises:
[0163] A second receiving subunit is configured to receive an adding request from an initiating controller among multiple candidate controllers of the target user to a controller to be added, wherein the adding request carries a target DID account of the target user and attribute information of a second controller of the controller to be added, and the attribute information of the second controller includes second public key information of the controller to be added and an address of the second controller of the controller to be added;
[0164] An adding unit is used to add the controller to be added as a target controller of the target DID account based on the target DID account and the second controller attribute information, wherein the target controller has control authority over the target DID account.
[0165] In some embodiments, the apparatus further comprises:
[0166] The second processing unit is used to save the second controller attribute information into the DID account contract corresponding to the target DID account, so as to add the controller to be added as the target controller of the target DID account.
[0167] In some embodiments, the apparatus further comprises:
[0168] A determination unit, used to determine whether the initiating controller is the controller of the target DID account;
[0169] The third processing unit is used for:
[0170] If yes, save the attribute information of the second controller to the DID account contract corresponding to the target DID account;
[0171] If not, the controller to be added will not be added as the controller of the DID account.
[0172] In some embodiments, the apparatus further comprises:
[0173] A third receiving subunit is configured to receive a deletion request from an initiating controller among multiple candidate controllers of the target user to a controller to be deleted, wherein the deletion request carries a target DID account corresponding to the initiating controller and a controller address of the controller to be deleted;
[0174] The deleting unit is used to delete the controller address of the controller to be deleted from the DID account contract corresponding to the target DID account, so as to release the control authority of the controller to be deleted over the DID account.
[0175] In some embodiments, the apparatus further comprises:
[0176] A fourth receiving subunit, configured to receive a DID account statistics request sent by the target user;
[0177] A statistics unit, configured to count the number of all DID accounts through the account system contract deployed on the blockchain network based on the DID account statistics request;
[0178] A returning unit is used to return the number of accounts to the target user.
[0179] The embodiment of the present application provides a verification device for a blockchain account, which receives a transaction request initiated by a controller to be verified corresponding to a target user through a receiving unit 201, wherein the transaction request carries a transaction body, and the transaction body includes transaction data, a target DID account, signature information of the controller to be verified, and private key information of the controller to be verified; the acquisition unit 202 acquires the controller public key information of multiple account controllers in the DID account contract corresponding to the target DID account, and obtains multiple controller public key information; the first determination unit 203 determines the public key information to be verified of the controller to be verified based on the signature information of the controller to be verified and the private key information of the controller to be verified; the second determination unit 204 searches the multiple controller public keys for controller public key information matching the public key information to be verified, and determines the verification result; the third determination unit 205 determines that the transaction is valid if the verification result is successful, and conducts the transaction in the blockchain network based on the transaction body. The embodiment of the present application can reset the private key by using the DID contract as the underlying system contract, and the user uses the DID contract account as the underlying blockchain account, so as to solve the problem of private key loss and improve the reliability of the blockchain.
[0180] Accordingly, the embodiment of the present application also provides a computer device, which may be a terminal or a server, and the terminal may be a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC), a personal digital assistant (PDA), or other terminal devices. Figure 5 As shown, Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 300 includes a processor 301 having one or more processing cores, a memory 302 having one or more computer-readable storage media, and a computer program stored in the memory 302 and executable on the processor. The processor 301 is electrically connected to the memory 302. Those skilled in the art will appreciate that the computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or arrange components differently.
[0181] The processor 301 is the control center of the computer device 300. It uses various interfaces and lines to connect the various parts of the entire computer device 300, executes various functions of the computer device 300 and processes data by running or loading software programs and / or modules stored in the memory 302, and calling data stored in the memory 302, thereby monitoring the computer device 300 as a whole.
[0182] In the embodiment of the present application, the processor 301 in the computer device 300 will load instructions corresponding to the processes of one or more application programs into the memory 302 according to the following steps, and the processor 301 will run the application programs stored in the memory 302 to implement various functions:
[0183] Receive a transaction request initiated by the controller to be verified corresponding to the target user, wherein the transaction request carries a transaction body, which includes transaction data, target DID account, signature information of the controller to be verified, and private key information of the controller to be verified;
[0184] Obtain controller public key information of multiple account controllers in the DID account contract corresponding to the target DID account, and obtain multiple controller public key information;
[0185] Determine the public key information to be verified of the controller to be verified based on the signature information of the controller to be verified and the private key information of the controller to be verified;
[0186] Searching among the multiple controller public keys whether there is controller public key information matching the public key information to be verified, and determining a verification result;
[0187] If the verification result is successful, the transaction is determined to be valid, and the transaction is performed in the blockchain network based on the transaction body.
[0188] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0189] Optional, such as Figure 5 As shown, the computer device 300 further includes: a touch screen 303, a radio frequency circuit 304, an audio circuit 305, an input unit 306, and a power supply 307. The processor 301 is electrically connected to the touch screen 303, the radio frequency circuit 304, the audio circuit 305, the input unit 306, and the power supply 307, respectively. Those skilled in the art can understand that Figure 5 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0190] The touch display screen 303 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 303 may include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user and various graphical user interfaces of the computer device, and these graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-EmittingDiode) and the like. The touch panel can be used to collect the user's touch operation on or near it (such as the user uses any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 301, and can receive the command sent by the processor 301 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 301 to determine the type of touch event, and then the processor 301 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 303 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 303 can also be used as a part of the input unit 306 to realize the input function.
[0191] The radio frequency circuit 304 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other computer devices through wireless communication, and to send and receive signals between the network device or other computer devices.
[0192] The audio circuit 305 can be used to provide an audio interface between the user and the computer device through a speaker and a microphone. The audio circuit 305 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 305 and converted into audio data, and then the audio data is output to the processor 301 for processing, and then sent to another computer device through the radio frequency circuit 304, or the audio data is output to the memory 302 for further processing. The audio circuit 305 may also include an earphone jack to provide communication between an external headset and the computer device.
[0193] The input unit 306 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0194] The power supply 307 is used to supply power to various components of the computer device 300. Optionally, the power supply 307 can be logically connected to the processor 301 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 307 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0195] although Figure 5 Not shown, the computer device 300 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.
[0196] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0197] As can be seen from the above, the computer device provided in this embodiment can use the DID contract as the underlying system contract, and the user uses the DID contract account as the underlying blockchain account, which can reset the private key, solve the problem of private key loss, and improve the reliability of the blockchain.
[0198] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0199] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored, and the computer program can be loaded by a processor to execute the steps in any blockchain account verification method provided in the embodiment of the present application. For example, the computer program can execute the following steps:
[0200] Receive a transaction request initiated by the controller to be verified corresponding to the target user, wherein the transaction request carries a transaction body, which includes transaction data, target DID account, signature information of the controller to be verified, and private key information of the controller to be verified;
[0201] Obtain controller public key information of multiple account controllers in the DID account contract corresponding to the target DID account, and obtain multiple controller public key information;
[0202] Determine the public key information to be verified of the controller to be verified based on the signature information of the controller to be verified and the private key information of the controller to be verified;
[0203] Searching among the multiple controller public keys whether there is controller public key information matching the public key information to be verified, and determining a verification result;
[0204] If the verification result is successful, the transaction is determined to be valid, and the transaction is performed in the blockchain network based on the transaction body.
[0205] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0206] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0207] Since the computer program stored in the storage medium can execute the steps in any blockchain account verification method provided in the embodiments of the present application, the beneficial effects that can be achieved by any blockchain account verification method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0208] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0209] The above is a detailed introduction to a blockchain account verification method, device, computer equipment and storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the technical solutions and core ideas of the present application. Ordinary technicians in this field should understand that they can still modify the technical solutions recorded in the aforementioned embodiments, or replace some of the technical features therein with equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A blockchain account verification method, characterized in that: include: Receive a transaction request initiated by the controller to be verified corresponding to the target user, wherein the transaction request carries a transaction body, which includes transaction data, target DID account, signature information of the controller to be verified, and private key information of the controller to be verified; Obtain controller public key information of multiple account controllers in the DID account contract corresponding to the target DID account, and obtain multiple controller public key information; Determine the public key information to be verified of the controller to be verified based on the signature information of the controller to be verified and the private key information of the controller to be verified; Searching among the multiple controller public keys whether there is controller public key information matching the public key information to be verified, and determining a verification result; If the verification result is successful, the transaction is determined to be valid, and the transaction is performed in the blockchain network based on the transaction body; Before receiving the transaction request initiated by the controller to be verified corresponding to the target user, it also includes: Receiving an account registration request sent by a first controller corresponding to a target user, wherein the account registration request carries attribute information of the first controller; Based on the first controller attribute information, generating a target contract address in an account system contract deployed on the blockchain network, wherein the account system contract is used to manage DID accounts; Generate a target DID account based on the target contract address and preset identification information; save the target DID account in the account system contract, and send the target DID account to the target user.
2. The blockchain account verification method according to claim 1, characterized in that: The first controller attribute information includes first private key information of the first controller, first public key information of the first controller, and a first controller address of the first controller.
3. The blockchain account verification method according to claim 2, characterized in that: The generating a target contract address in the account system contract deployed on the blockchain network based on the first controller attribute information includes: Create a DID account contract in the account system contract; The first controller attribute information is written into the DID account contract, and a target contract address corresponding to the DID account contract is generated based on the first controller attribute information.
4. The blockchain account verification method according to claim 3, characterized in that: The preset identification information includes a DID prefix and a DID method identifier; The generating a target DID account based on the target contract address and preset identification information includes: The DID prefix, the DID method identifier and the target contract address are concatenated in sequence to generate a target DID account.
5. The blockchain account verification method according to claim 3, characterized in that: After the target DID account is saved in the account system contract and the target DID account is sent to the target user, the method further includes: Receive an adding request from an initiating controller among multiple candidate controllers of the target user for a controller to be added, wherein the adding request carries a target DID account of the target user and attribute information of a second controller of the controller to be added, and the attribute information of the second controller includes second public key information of the controller to be added and an address of the second controller of the controller to be added; Based on the target DID account and the second controller attribute information, the controller to be added is added as the target controller of the target DID account, wherein the target controller has control authority over the target DID account.
6. The blockchain account verification method according to claim 5, characterized in that: The adding the controller to be added as a target controller of the target DID account based on the target DID account and the second controller attribute information includes: The attribute information of the second controller is saved in the DID account contract corresponding to the target DID account, so as to add the controller to be added as the target controller of the target DID account.
7. The blockchain account verification method according to claim 6, characterized in that: Before saving the second controller attribute information into the DID account contract corresponding to the target DID account, the method further includes: Determine whether the initiating controller is the controller of the target DID account; If yes, then save the attribute information of the second controller to the DID account contract corresponding to the target DID account; If not, the controller to be added will not be added as the controller of the DID account.
8. The blockchain account verification method according to claim 5, characterized in that: After adding the controller to be added as the target controller of the target DID account based on the target DID account and the second controller attribute information, the method further includes: Receive a deletion request from an initiating controller among multiple candidate controllers of the target user to a controller to be deleted, wherein the deletion request carries a target DID account corresponding to the initiating controller and a controller address of the controller to be deleted; The controller address of the controller to be deleted is deleted from the DID account contract corresponding to the target DID account to release the control authority of the controller to be deleted over the DID account.
9. The blockchain account verification method according to claim 2, characterized in that: Also includes: Receive a DID account statistics request sent by the target user; Based on the DID account statistics request, the number of all DID accounts is counted through the account system contract deployed on the blockchain network; The number of accounts is returned to the target user.
10. A blockchain account verification device, characterized in that: The device comprises: A receiving unit, configured to receive a transaction request initiated by a controller to be verified corresponding to a target user, wherein the transaction request carries a transaction body, and the transaction body includes transaction data, a target DID account, signature information of the controller to be verified, and private key information of the controller to be verified; An acquisition unit, used to acquire controller public key information of multiple account controllers in the DID account contract corresponding to the target DID account, and obtain multiple controller public key information; A first determining unit, configured to determine the public key information to be verified of the controller to be verified based on the signature information of the controller to be verified and the private key information of the controller to be verified; A second determination unit is used to search among the multiple controller public keys whether there is controller public key information matching the public key information to be verified, and determine a verification result; A third determination unit is used to determine that the transaction is valid if the verification result is successful, and to perform the transaction in the blockchain network based on the transaction body; A first receiving subunit is used to receive an account registration request sent by a first controller corresponding to a target user, wherein the account registration request carries attribute information of the first controller; A first generating unit, configured to generate a target contract address in an account system contract deployed on the blockchain network based on the first controller attribute information, wherein the account system contract is used to manage DID accounts; The second generation unit is used to generate a target DID account based on the target contract address and preset identification information; the first processing unit is used to save the target DID account in the account system contract and send the target DID account to the target user.
11. A computer device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the blockchain account verification method as described in any one of claims 1 to 9 are implemented.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the blockchain account verification method as described in any one of claims 1 to 9 are implemented.
