Data verification method and device, electronic equipment and storage medium

By obtaining the lost target private key and the public key to be verified, and using the public key and private keys of the associated objects, the problem of unable to manage the virtual resources after the loss of the user's private key will be solved. sex.

CN119377974APending Publication Date: 2025-01-28TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310923965.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-25
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

In the prior art, the user's private key is lost and virtual resources can no longer be managed and used, resulting in large losses.

Method used

By obtaining the target private key and the public key to be verified by the loss of the original private key, the public key and private keys of the associated object are verified. If the decryption information is consistent with the desensitization information, the target private key and the to be verified by the public key will take effect. Generate effective private key and effective public key.

Benefits of technology

With the loss of the user's private key, the help of the associated object to verify and take effect on the new private key and the new public key to avoid the loss of virtual resources and improve the holding stability of virtual resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119377974A_ABST
    Figure CN119377974A_ABST
Patent Text Reader

Abstract

Embodiments of the invention disclose a data verification method and apparatus, an electronic device and a storage medium. The method comprises the steps of obtaining a target private key of a target object and a corresponding to-be-verified public key; sending the to-be-verified public key to an association node of an association object of the target object, so that the association node desensitizes the to-be-verified public key through a preset desensitization algorithm, and encrypts desensitized first desensitization information through a private key of the association object to obtain encrypted information; receiving the encrypted information, and decrypting the encrypted information by using a public key corresponding to the private key to obtain decrypted information; desensitizing the to-be-verified public key by using a preset desensitization algorithm to obtain second desensitization information; and if the decryption information is consistent with the second desensitization information, determining that the target private key and the to-be-verified public key of the target object take effect. According to the embodiment of the invention, the associated object is utilized to help the target object to verify the target private key and the to-be-verified public key, so that the situation that a user cannot manage and use virtual resources once the private key is lost is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a data verification method, device, electronic device and storage medium. Background Art

[0002] With the development of blockchain technology, more and more users are using blockchain. Users often manage virtual resources stored on the chain through their own private keys. Therefore, the importance of users' private keys is relatively high.

[0003] In the prior art, the following two methods are usually used to help users keep their private keys: 1. Help users keep their private keys online on various terminal devices (such as personal computers, mobile terminals, etc.); 2. Help users keep their private keys offline in specific hardware devices.

[0004] However, whether it is stored online or offline, once the user loses the private key or the hardware device that stores the private key, the user can no longer manage and use the virtual resources, causing great losses. Summary of the invention

[0005] The embodiments of the present application provide a data verification method, device, electronic device and storage medium, which can improve the problem of loss caused by loss of user private keys in the prior art.

[0006] The present application provides a data verification method, the method comprising:

[0007] Obtain a target private key of a target object and a public key to be verified corresponding to the target private key, wherein the target private key is a private key generated after the original private key is lost;

[0008] Sending the public key to be verified to an associated node of an associated object of the target object, so that the associated node desensitizes the public key to be verified by using a preset desensitization algorithm, and encrypts the desensitized first desensitized information by using a private key of the associated object to obtain encrypted information;

[0009] Receiving the encrypted information returned by the associated node, and decrypting the encrypted information using the public key corresponding to the private key to obtain decrypted information;

[0010] Desensitizing the public key to be verified by using the preset desensitization algorithm to obtain second desensitized information;

[0011] If the decrypted information is consistent with the second desensitized information, it is determined that the target private key and the public key to be verified of the target object are effective, wherein the target private key after effectiveness is the effective private key, and the public key to be verified after effectiveness is the effective public key.

[0012] The present application provides a data verification device, the device comprising:

[0013] A public key acquisition unit, used to acquire a target private key of a target object and a public key to be verified corresponding to the target private key, wherein the target private key is a private key generated after the original private key is lost;

[0014] A public key sending unit, used for sending the public key to be verified to an associated node of an associated object of the target object, so that the associated node desensitizes the public key to be verified by a preset desensitization algorithm, and encrypts the desensitized first desensitized information by a private key of the associated object to obtain encrypted information;

[0015] An information decryption unit, used to receive the encrypted information returned by the associated node, and decrypt the encrypted information using the public key corresponding to the private key to obtain decrypted information;

[0016] An information desensitizing unit, used to desensitize the public key to be verified by using the preset desensitizing algorithm to obtain second desensitized information;

[0017] The effectiveness determination unit is used to determine that the target private key and the public key to be verified of the target object are effective when the decrypted information is consistent with the second desensitized information, wherein the target private key after effectiveness is the effective private key, and the public key to be verified after effectiveness is the effective public key.

[0018] In one embodiment, the device further comprises:

[0019] an object counting unit, configured to increase the associated object value by one each time the encrypted information is received, wherein the initial value of the associated object value is zero;

[0020] Correspondingly, the effectiveness determination unit is specifically used to determine that the target private key and the public key to be verified of the target object are effective when the decrypted information is consistent with the second desensitized information and the associated object value is not less than the associated object quantity threshold.

[0021] In one embodiment, the device further comprises:

[0022] The account storage unit is used to store a set number of associated object accounts and the public key corresponding to each of the associated object accounts into the associated object list.

[0023] In one implementation, the threshold value of the number of associated objects is not greater than the set number.

[0024] In one embodiment, the device further comprises:

[0025] an account adding unit, configured to store the associated object account and the public key of the associated object to be added to the associated object list when the associated object account of the associated object to be added is not recorded in the associated object list;

[0026] The total value increasing unit is used to increase the total value of the associated objects in the associated object list by one.

[0027] In one embodiment, the device further comprises:

[0028] an account deleting unit, configured to, when an associated object account of the associated object to be deleted is recorded in the associated object list, delete the associated object account of the associated object to be deleted and the public key of the associated object to be deleted from the associated object list;

[0029] a total value reduction unit, used to reduce the total value of the associated objects in the associated object list by one;

[0030] The threshold prompt unit is used to pop up a threshold modification prompt message when the total value of the associated objects after deducting one is less than the associated object quantity threshold, so as to remind the target object to modify the associated object quantity threshold.

[0031] In one embodiment, the device further comprises:

[0032] An address generating unit, configured to generate an address of the target object based on the valid private key and the valid public key;

[0033] A contract address acquisition unit, used to acquire a source contract address, where the source contract address is the address of the contract wallet to which the data verification method belongs;

[0034] A resource transfer unit is used to transfer virtual resources from the address of the target object to the source contract address.

[0035] In one embodiment, the device further comprises:

[0036] A parameter receiving unit, used to receive a target contract address, a target contract function value, a resource transfer amount, and a target object signature information, wherein the target object signature information is obtained by encrypting the third desensitized information with the effective private key, and the third desensitized information is obtained by desensitizing the target contract address, the target contract function value, and the resource transfer amount with a target desensitization algorithm;

[0037] An effective public key decryption unit, used to decrypt the target object signature using the effective public key to obtain target decryption information;

[0038] A target desensitization unit, configured to desensitize the target contract address, the target contract function value, and the resource transfer amount using the target desensitization algorithm to obtain fourth desensitized information;

[0039] A parameter verification unit is used to determine that the target contract address, the target contract function value and the resource transfer amount are accurate when the target decrypted information is consistent with the fourth desensitized information.

[0040] In one embodiment, the device further comprises:

[0041] A resource transfer unit is used to transfer the virtual resources of the resource transfer amount from the source contract address to the target contract address.

[0042] In one embodiment, the resource transfer unit is specifically used to transfer the virtual resources of the resource transfer amount from the source contract address to the target contract address when the amount of virtual resources corresponding to the contract address is not less than the resource transfer amount.

[0043] In the data verification method provided by the embodiment of the present application, the target private key of the target object whose original private key is lost and the corresponding public key to be verified can be obtained first; then, the public key to be verified is sent to the associated node, so that the associated object of the target object desensitizes the public key to be verified through a preset desensitization algorithm at the associated node, and further encrypts the first desensitized information obtained by desensitization through the private key of the associated object to obtain encrypted information. Subsequently, the encrypted information returned by the associated node is received, and the encrypted information is decrypted using the public key corresponding to the private key of the associated object, that is, the public key of the associated object, to obtain decrypted information. Then, the public key to be verified is desensitized using the same preset desensitization algorithm to obtain the second desensitized information. If the decrypted information is consistent with the second desensitized information, it indicates that the public key to be verified has passed the verification of the associated object, so it can be determined that the target private key and the public key to be verified of the target object are effective, thereby obtaining the effective private key and the effective public key.

[0044] In an embodiment of the present application, when the original private key of the target object is lost, the new private key (i.e., the target private key) and the new public key (i.e., the public key to be verified) of the target object can be obtained, and then the public key to be verified is sent to the associated object that has an associated relationship with the target object, so that the associated object can sign and encrypt the public key to be verified by the preset desensitization algorithm and its own private key in turn to obtain encrypted information. The encrypted information returned from the associated object is received, and the public key of the associated object is used to verify and decrypt to obtain the decrypted information; and the public key to be verified is desensitized using the above-mentioned preset desensitization algorithm to obtain the second desensitized information, and then the decrypted information is compared with the second desensitized information; if the two are consistent, it is determined that the new private key (i.e., the target private key) and the new public key (i.e., the public key to be verified) of the target object are effective. The embodiment of the present application can utilize the public key and private key held by the associated object to help the target object verify the new private key (i.e., the target private key) and the new public key (i.e., the public key to be verified), thereby avoiding the situation where the user can no longer manage and use virtual resources once the private key is lost. This improves the problem of loss caused by the loss of user private keys in the prior art and improves the stability of holding virtual resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] 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.

[0046] Figure 1a This is an optional structural diagram of the distributed system provided by this application applied to the blockchain system;

[0047] Figure 1b It is an optional schematic diagram of the block structure provided by this application;

[0048] Figure 1c It is a flowchart of a data verification method provided in an embodiment of the present application;

[0049] Figure 1d It is a schematic diagram of the application of the contract wallet in the embodiment of the present application;

[0050] Figure 2 is a flowchart of a data verification method provided by another embodiment of the present application;

[0051] Figure 3 It is a structural schematic diagram of a data verification device provided by an embodiment of the present application;

[0052] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not 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 this application.

[0054] Embodiments of the present application provide a data verification method, device, electronic device, and storage medium.

[0055] The system involved in the embodiments of the present application may be a distributed system formed by connecting multiple nodes (any form of computing devices in the access network, such as servers, user terminals) through network communication.

[0056] Take the distributed system as the blockchain system as an example, see Figure 1a , Figure 1a It is an optional structural diagram of the distributed system 10 provided in the embodiment of the present application applied to the blockchain system, which is formed by multiple nodes 20 (any form of computing devices in the access network, such as servers and user terminals), and a peer-to-peer network is formed between the nodes 20. The peer-to-peer protocol is an application layer protocol running on the Transmission Control Protocol (TCP). In a distributed system, any machine such as a server or a terminal can join and become a node 20, and the node 20 includes a hardware layer, an intermediate layer, an operating system layer, and an application layer.

[0057] See also Figure 1a The functions of each node in the blockchain system shown include:

[0058] 1) Routing: a basic function of a node, used to support communication between nodes.

[0059] In addition to the routing function, the node can also have the following functions:

[0060] 2) Applications are deployed in the blockchain to implement specific businesses based on actual business needs, record data related to the implementation of functions to form record data, carry digital signatures in the record data to indicate the source of the task data, and send the record data to other nodes in the blockchain system for other nodes to add the record data to a temporary block when they successfully verify the source and integrity of the record data.

[0061] For example, the services implemented by the application include:

[0062] 2.1) Wallet, used to provide the function of conducting transactions of virtual resources (taking electronic currency as an example), including initiating transactions (i.e., sending the transaction record of the current transaction to other nodes in the blockchain system. After the other nodes successfully verify the transaction, as a response to acknowledge the validity of the transaction, the transaction record data is stored in the temporary block of the blockchain; of course, the wallet also supports querying the remaining electronic currency in the electronic currency address;

[0063] 2.2) Shared ledger, which is used to provide functions such as storage, query and modification of account data. The record data of the operation on the account data is sent to other nodes in the blockchain system. After other nodes verify the validity, as a response to acknowledging the validity of the account data, the record data is stored in a temporary block, and a confirmation can also be sent to the node that initiated the operation.

[0064] 2.3) Smart contracts are computerized protocols that can execute the terms of a contract. They are implemented by deploying code on a shared ledger that is executed when certain conditions are met. The code is used to complete automated transactions based on actual business needs, such as querying the logistics status of the goods purchased by the buyer and transferring the buyer's electronic currency to the merchant's address after the buyer signs for the goods. Of course, smart contracts are not limited to executing contracts for transactions, but can also execute contracts for processing received information.

[0065] 2.4) Contract wallets, used to manage and execute smart contracts. Unlike traditional digital wallets, contract wallets are not only used to store and manage cryptocurrencies, but also have the function of processing smart contract interactions. Contract wallets are usually bound to smart contracts on the blockchain, and the functions and operations defined in the contract can be executed through the contract wallet. It allows users to interact with smart contracts in a more advanced way without directly operating the contract code.

[0066] The data verification method provided in the embodiment of the present application can be executed by a smart contract, specifically by a contract wallet; optionally, the data verification method provided in the embodiment of the present application can be run on any blockchain node among multiple nodes of the blockchain system.

[0067] The target object can use the following program code to deploy the contract wallet:

[0068] constructor(string publicKey,string[]friendsPubKey,uint256 threshold){

[0069] require(threshold<=friendsPubKey.length);

[0070] _publicKey = publicKey;

[0071] for(uint i=;i <friendsPubKey.length;i++){

[0072] _friends[friendsPubKey[i]]=true;

[0073] }

[0074] _threshold = threshold;

[0075] _friendsNum=friendsPubKey.length;

[0076] _updateNum = 0;

[0077] }

[0078] The above code can create: the public key publicKey of the target object; the public key friendsPubKey of the associated object selected by the target object; and the threshold value of the number of associated objects threshold.

[0079] require(threshold<=friendsPubKey.length); means: it is required to limit: the threshold value of the number of associated objects is not greater than the total number of associated objects selected by the target object.

[0080] _publicKey=publicKey; means: assign the public key publicKey of the target object to _publicKey.

[0081] for(uint i=;i <friendsPubKey.length;i++){

[0082] _friends[friendsPubKey[i]]=true;}

[0083] Indicates: The public key friendsPubKey of the associated object selected by the target object is used as the key and stored in the key-value map.

[0084] _threshold=threshold; means: assign the threshold value of the number of associated objects threshold to _threshold.

[0085] _friendsNum = friendsPubKey.length; means: assign the total amount of associated objects friendsPubKey.length to _friendsNum.

[0086] _updateNum=0; indicates that the value of the associated object is set to 0; that is, the above process is the case where the original private key and the original public key of the target object are not lost.

[0087] 3) Blockchain, including a series of blocks that are connected to each other in the order of their generation. Once a new block is added to the blockchain, it will not be removed. The block records the record data submitted by the nodes in the blockchain system.

[0088] See also Figure 1b , Figure 1b This is an optional schematic diagram of the block structure provided by the embodiment of the present application. Each block includes the hash value of the transaction record stored in this block (the hash value of this block) and the hash value of the previous block. Each block is connected by the hash value to form a blockchain. In addition, the block can also include information such as the timestamp when the block was generated. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains relevant information for verifying the validity of its information (anti-counterfeiting) and generating the next block.

[0089] It is understandable that in the embodiments of the present application, related data such as user information is involved. When the embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0090] It should be noted that the serial numbers of the following embodiments are not intended to limit the preferred order of the embodiments.

[0091] In this embodiment, a data verification method is provided, such as Figure 1c As shown, the data verification method is applied to the blockchain, and the data verification method can be executed by running a smart contract on any blockchain node among multiple nodes of the blockchain system. The specific process of the method may include the following steps 110 to 150:

[0092] 110. Obtain a target private key of a target object and a public key to be verified corresponding to the target private key.

[0093] The target object is the user who has lost the original private key. If the original private key is not lost, the target object can manage his wallet through the original private key. The target private key is the private key generated after the original private key is lost, and the public key to be verified is the public key that forms a public-private key pair with the target private key.

[0094] The target private key and the public key to be verified can be generated by any blockchain node running a smart contract, or can be obtained by the above blockchain node from other blockchain nodes. It should be understood that the specific method of obtaining the target private key and the public key to be verified should not be understood as a limitation of this application.

[0095] Let’s take the target private key and the public key to be verified generated by any blockchain node running a smart contract as an example to describe:

[0096] Any blockchain node runs a smart contract to generate a public-private key pair (PubKey New ,PriKey new ), where PubKey New is the public key to be verified, PriKey new The target object needs a PubKey New Replace the _publicKey public key stored in the contract wallet, so that the target private key PriKey new The signed signature can be verified in the contract wallet to re-implement the scheduling of virtual resources. New To replace the _publicKey public key stored in the contract wallet, you need to execute the following steps 120 to 150 to implement the public key PubKey to be verified New verification process.

[0097] 120. Send the public key to be verified to an associated node of an associated object of the target object, so that the associated node desensitizes the public key to be verified using a preset desensitization algorithm, and encrypts the desensitized first desensitized information using a private key of the associated object to obtain encrypted information.

[0098] The associated object is a user who has an associated relationship with the target object, and the associated relationship can be set by the target object. For example, the associated relationship can be a family relationship, that is, the target object can set his family as an associated object; for another example, the associated relationship can be a friend relationship, that is, the target object can set his friends as an associated object. It should be understood that the specific relationship type of the associated relationship should not be understood as a limitation of this application.

[0099] The associated node is any blockchain node among the multiple nodes of the blockchain system that has logged in the associated object account. The associated node may be the same as the blockchain node that executes the data verification method provided in the embodiment of the present application, or it may be different from the blockchain node that executes the data verification method provided in the embodiment of the present application. The associated object account is the digital account of the associated object, and the associated object can use the associated object account to identify and manage its own assets.

[0100] The preset desensitization algorithm is a pre-set algorithm for desensitizing sensitive information to obtain non-sensitive information. In some embodiments, the preset desensitization algorithm may be a hash algorithm. For example, the preset desensitization algorithm may specifically be a Keccak-256 algorithm. Keccak-256 is a member of the SHA-3 (Secure Hash Algorithm 3) cryptographic hash function family. The Keccak-256 algorithm receives an input of any length and converts it into a fixed-length hash value of 256 bits (32 bytes). The preset desensitization algorithm may also be other hash algorithms, such as the SHA-256 algorithm, the Blake2 algorithm, and the like. It should be understood that the specific algorithm type of the preset desensitization algorithm should not be understood as a limitation on the present application.

[0101] The private key of the associated object is the private key held by the associated object.

[0102] The public key to be verified can be sent to the associated node through the routing function by the blockchain node running the method provided by the embodiment of the present application, or it can be sent to the associated object by the target object through other information transmission methods, and processed by the associated object and the associated node. Other information transmission methods can be sent through instant messaging tools or through email. It should be understood that the specific sending method of the public key to be verified to the associated node should not be understood as a limitation of the present application.

[0103] Optionally, in one implementation, desensitizing the public key to be verified by a preset desensitization algorithm to obtain the first desensitized information can be implemented by the following formula:

[0104] hashdata=keccak256(PubKey New ) (1)

[0105] Among them, PubKey New is the public key to be verified; keccak256() is the preset desensitizing algorithm; hashdata is the first desensitized information.

[0106] Correspondingly, let the associated object be user x, and then encrypt the desensitized first desensitized information by using the private key of the associated object to obtain encrypted information, which can be achieved by the following formula:

[0107] signature=encrypt(hashdata,PriKey x ) (2)

[0108] Among them, PriKey x is the private key of the associated object (ie user x); encrypt(hashdata,PriKey x ) refers to using PriKey x The process of encrypting hashdata; signature is the encrypted information.

[0109] Optionally, in a specific implementation, before step 120, the embodiment of the present application may further include: storing a set number of associated object accounts and a public key corresponding to each of the associated object accounts into an associated object list.

[0110] The set quantity is a pre-set quantity value, which is a positive integer, and its specific numerical value should not be understood as a limitation on the present application.

[0111] The associated object account is the digital account of the associated object, and the associated object can use the associated object account to identify and manage its own assets.

[0112] The public key corresponding to each associated object account and the private key of the associated object described in step 120 form a public-private key pair of the associated object. That is, each associated object has its own corresponding public-private key pair, which includes the public key and private key of the associated object.

[0113] The associated object list is a list that stores associated object information. The associated object list can specifically store a set number of associated object accounts and the public key corresponding to each of the associated object accounts. For example, let the preset number be 3, and the preset number of associated object accounts are: user x's account, user y's account, and user z's account. Correspondingly, the public key corresponding to each associated object account is: PubKey x 、PubKey y 、PubKey z .

[0114] The associated object list can be a key-value pair mapping (Key-Value Map). The Key-Value Map associates data (i.e., the associated object account in this embodiment) with a unique key (i.e., the public key in this embodiment), so that the corresponding data can be easily found, modified or deleted according to the key.

[0115] Continuing with the above example, a set number of associated object accounts and the public key corresponding to each associated object account are stored in the associated object list, which can be specifically expressed as:

[0116] friendsPubKey=[Pubkey x ,Pubkey y ,Pubkey z ] (3)

[0117] Among them, friendsPubKey is a list of associated objects; PubKey x PubKey is the public key of user x; y is the public key of user y; PubKey z is the public key of user z.

[0118] In the above implementation, each public key has its own corresponding private key, which is held privately by the user: User x holds the same private key as PubKey x Corresponding PriKey x ; User y holds the PubKey y Corresponding PriKey y ; User z holds the PubKey z Corresponding PriKey z .

[0119] The threshold of the number of associated objects is not greater than the above-mentioned set number.

[0120] The threshold value for the number of associated objects is a positive integer threshold value for preset associated objects. The threshold value for the number of associated objects can be set for the target object, and is the minimum number of associated objects that help the target object verify the public key to be verified. That is, the associated objects that help the target object verify the public key to be verified need to reach the threshold value for the number of associated objects. The minimum value of the threshold value for the number of associated objects can be 1, that is, only one associated object is needed to help the target object verify the public key to be verified. The threshold value for the number of associated objects can also be other positive integer values ​​that are not greater than the set number. On the premise that it is not greater than the set number and is a positive integer, the specific value of the threshold value for the number of associated objects should not be understood as a limitation on the present application.

[0121] 130. Receive the encrypted information returned by the associated node, and decrypt the encrypted information using the public key corresponding to the private key to obtain decrypted information.

[0122] The public key corresponding to the private key is pre-stored in the associated object list, so the encrypted information can be decrypted using the public key in the associated object list.

[0123] Continuing with the example above, the private key PriKey of user x is used. x , encrypt the first desensitized information to obtain encrypted information.

[0124] Correspondingly, the public key corresponding to the private key is PubKeyx .

[0125] Decrypting the encrypted information using the public key corresponding to the private key to obtain the decrypted information can be achieved by the following formula:

[0126] bytes32_hashdata=VefirySignature(signature,friendPubKey) (4)

[0127] Among them, signature is the encrypted information; friendPubKey is the public key corresponding to the private key, which is PubKey in this example. x ; VefirySignature(signature, friendPubKey) means to use friendPubKey to decrypt signature. The specific decryption algorithm used for decryption is encapsulated in the function VefirySignature; bytes32_hashdata is the decryption information. The decryption algorithm encapsulated by the function VefirySignature corresponds to the encryption algorithm encapsulated by encrypt in formula (2). The encryption algorithm encapsulated by encrypt can be any asymmetric encryption algorithm (such as RSA, ECC, etc.) selected by the target object.

[0128] 140. Desensitize the public key to be verified by using the preset desensitization algorithm to obtain second desensitized information.

[0129] The preset desensitization algorithm used in step 140 is the same as the preset desensitization algorithm used by the associated node in step 120 .

[0130] Continuing with the above example, the public key to be verified is desensitized using the preset desensitization algorithm to obtain the second desensitized information, which can be achieved by the following formula:

[0131] hashdata'=keccak256[abi.encodePacked(PubKey New )] (5)

[0132] Among them, PubKey New is the public key to be verified; abi.encodePacked(PubKey New ) refers to the PubKey New Concatenate and generate a compact encoding result; keccak256() is the preset desensitization algorithm; hashdata' is the second desensitization information.

[0133] 150. If the decrypted information is consistent with the second desensitized information, it is determined that the target private key and the public key to be verified of the target object are effective, wherein the target private key after effectiveness is the effective private key, and the public key to be verified after effectiveness is the effective public key.

[0134] If the decrypted information is consistent with the second desensitized information, it means that the target private key and the public key to be verified of the target object have taken effect and passed the verification of the associated object; in the above example, it specifically means that the decrypted information is obtained by the private key PriKey of user x. x Checked out, and user x is one of the associated objects stored in the associated object list; that is, PubKey x User x's public key PubKey x The verification process of the public key to be verified is authorized by the target object. Therefore, it can be determined that the target private key and the public key to be verified of the target object are effective, and the effective target private key is recorded as the effective private key, and the effective public key to be verified is recorded as the effective public key.

[0135] In the above-mentioned implementation, the public key and private key held by the associated object can be used to help the target object verify the new private key (i.e., the target private key) and the new public key (i.e., the public key to be verified), thereby avoiding the situation where the user can no longer manage and use virtual resources once the private key is lost, thereby improving the problem of losses caused by the loss of user private keys in the prior art.

[0136] Optionally, in a specific implementation, after step 130, the method provided in the embodiment of the present application may further include:

[0137] Each time the encrypted information is received, the associated object value is incremented by one, wherein the initial value of the associated object value is zero.

[0138] Correspondingly, step 150 may specifically include: if the decrypted information is consistent with the second desensitized information and the associated object value is not less than the associated object quantity threshold, determining that the target private key and the public key to be verified of the target object are effective.

[0139] The associated object value is a statistical value of the associated objects for generating the encrypted information. The initial value of the associated object value can be set to zero, and the associated object value is increased by one each time the encrypted information is received, thereby realizing the number statistics of the associated objects for generating the encrypted information.

[0140] When the decrypted information is consistent with the second desensitized information and the associated object value is greater than or equal to the associated object quantity threshold, it can be determined that the target private key and the public key to be verified of the target object are effective.

[0141] The above process can be specifically implemented through the following program code:

[0142] if(_tmpPublicKey==""){

[0143] _tmpPublicKey = newPubKey;

[0144] }else{

[0145] require(_tmpPublicKey==newPubKey);

[0146] }

[0147] _updateNum++;

[0148] if (_updateNum>=_threshold) {

[0149] _updateNum=0:

[0150] _publicKey = newPubKey;

[0151] _tmpPublicKey=""

[0152] }

[0153] Among them, if (_tmpPublicKey = = "") {

[0154] _tmpPublicKey = newPubKey;

[0155] }else{

[0156] require(_tmpPublicKey==newPubKey);

[0157] }

[0158] Indicates: If _tmpPublicKey is empty, the public key to be verified (i.e. PubKey New ) is assigned to _tmpPublicKey; if _tmpPublicKey is not empty, it is necessary to restrict: _tmpPublicKey and the public key to be verified (that is, PubKey New ) are equal.

[0159] if (_updateNum>=_threshold) {

[0160] _updateNum=0:

[0161] _publicKey = newPubKey;

[0162] _tmpPublicKey=""

[0163] }

[0164] Indicates: If the associated object value _updateNum is greater than or equal to the associated object number threshold _threshold, the public key newPubKey to be verified is assigned to _publicKey, and the associated object value _updateNum is reset to zero, and _tmpPublicKey is cleared, so as to wait for the next verification process of the public key to be verified if the effective private key of the target object is lost again.

[0165] The target object may send the public key to be verified to all the associated objects in the associated object list, or may send the public key to be verified to the associated objects within a threshold number of associated objects in the associated object list.

[0166] Let’s assume that the threshold of the number of associated objects is 2. We can continue with the example above: the blockchain node where the target object is located can send the public key to be verified to the associated node of the account running user x, the associated node of the account running user y, and the associated node of the account running user z. For details, see Figure 1d The blockchain node where the target object is located can also send the public key to be verified to any two of the three associated nodes mentioned above.

[0167] In the above implementation, for each of the multiple associated objects, steps 110 to 150 can be executed to compare the corresponding decrypted information with the second desensitized information. When each decrypted information is consistent with the second desensitized information and the associated object value is greater than or equal to the associated object quantity threshold, the target private key of the target object and the public key to be verified are determined to be effective. This implementation requires that the number of associated objects that help verify the public key to be verified needs to meet certain requirements, further increasing the reliability of the verification process of the public key to be verified.

[0168] When the private key of the target object is lost or stolen, the public key in the contract wallet can be replaced with the help of the associated object, so that the target object can regain the scheduling rights of the virtual resource assets in the contract and avoid the loss of the target object's virtual resources. In the subsequent process, the new effective private key signature can be used to initiate transactions and transfer virtual resources with other target contracts (such as Contract A, Contract B, and Contract C).

[0169] Optionally, in a specific implementation manner, the embodiment of the present application may further include the following steps A1 to A2:

[0170] A1. When the associated object account of the associated object to be added is not recorded in the associated object list, the associated object account of the associated object to be added and the public key of the associated object to be added are stored in the associated object list.

[0171] The associated object to be added is an associated object that the target object expects to add to the associated object list. Before storing the associated object account and the corresponding public key of the associated object to be added into the associated object list, it can be determined whether the associated object account of the associated object to be added has been recorded in the associated object list. If the associated object account of the associated object to be added is not recorded in the associated object list, the associated object account of the associated object to be added and the public key of the associated object to be added are stored.

[0172] A2. Increment the total value of the associated objects in the associated object list by one.

[0173] The total value of associated objects is the total quantity value of associated objects recorded in the associated object list.

[0174] After the related information of the associated object to be newly added is added, the total value of the associated objects in the associated object list is increased by one, so that the total value of the associated objects can be kept updated in real time.

[0175] Optionally, in a specific implementation manner, the embodiment of the present application may further include the following steps B1 to B3:

[0176] B1. When the associated object account of the associated object to be deleted is recorded in the associated object list, the associated object account of the associated object to be deleted and the public key of the associated object to be deleted are deleted from the associated object list.

[0177] The to-be-deleted associated object is an associated object that the target object expects to delete from the associated object list. Before deleting the associated object account and the corresponding public key of the to-be-deleted associated object from the associated object list, it can be determined whether the associated object account of the to-be-deleted associated object has been recorded in the associated object list. If the associated object account of the to-be-deleted associated object has been recorded in the associated object list, the associated object account of the to-be-deleted associated object and the public key of the to-be-deleted associated object are deleted.

[0178] B2. Subtract one from the total value of the associated objects in the associated object list.

[0179] After deleting the related information of the associated object to be deleted, the total value of the associated objects in the associated object list is reduced by one, so that the total value of the associated objects can be kept updated in real time.

[0180] B3. If the total value of the associated objects after decrementing by one is less than the associated object quantity threshold, a threshold modification prompt message is popped up to remind the target object to modify the associated object quantity threshold.

[0181] After the total value of the associated objects is reduced by one, the total value of the associated objects after reduction by one needs to be compared with the threshold value of the number of associated objects. If the total value of the associated objects after reduction by one is still greater than or equal to the threshold value of the number of associated objects, then there is no problem with the current threshold value of the number of associated objects.

[0182] If the total value of the associated objects after decrement is less than the associated object quantity threshold, it means that even if all the associated objects in the associated object list implement the verification process of the public key to be verified, it still cannot meet the requirement of reaching the associated object quantity threshold, which will cause the target private key and the public key to be verified to be ineffective. To avoid the above situation, a threshold modification prompt message can be popped up to remind the target object to reduce the value of the associated object quantity threshold.

[0183] Optionally, in a specific implementation manner, the embodiment of the present application may further include the following steps C1 to C3:

[0184] C1. Generate the address of the target object based on the effective private key and the effective public key.

[0185] After determining the effective private key and effective public key, the account address of the target object can be derived.

[0186] The specific process of deriving the target object’s account address can be as follows:

[0187] According to the public key, a hash operation is performed through a specific hash function (such as SHA-256, RIPEMD-160, etc.) to generate an account address. The hash function can convert the public key into a shorter and unique address. The generated address usually needs to be processed in a specific format to meet the requirements of different blockchain platforms. Formatting usually includes adding prefixes or suffixes and performing verification.

[0188] The generated account address can be used to receive and send virtual resources (such as electronic currency, game equipment, etc.). Other users can send virtual resources to this address, and the holder of the private key can control and manage the virtual resource assets in this address.

[0189] C2. Obtain the source contract address, which is the address of the contract wallet to which the data verification method belongs.

[0190] C3. Transfer the virtual resources from the address of the target object to the address of the source contract.

[0191] In the above implementation, the virtual resources can be transferred from the address of the target object to the source contract address corresponding to the contract wallet. Even if the private key of the contract wallet is lost, it can still be retrieved by authenticating the new public and private key pair through the associated objects stored in the associated object list, thereby improving the security of the virtual assets of the target object.

[0192] Optionally, in a specific implementation manner, the embodiment of the present application may further include the following steps D1 to D5:

[0193] D1. Receive the target contract address, target contract function value, resource transfer amount, and target object signature information.

[0194] The target contract address is the address of the target contract that the user expects to call across contracts for virtual resources. For details, please refer to Figure 1d , Figure 1d The contracts A, B, and C shown can all be the target contracts mentioned above. The address refers to the unique identifier corresponding to the smart contract deployed on the blockchain platform. It is a string of letters and numbers with a fixed length. Let target represent the target contract address.

[0195] The target contract function value is: a value generated based on the function of calling the target contract and the function parameter value. Among them, the function of calling the target contract can be set by the target object itself, for example, it can be swapethtousdc, buynft, mintnft, etc., and Func can be used to represent the function of calling the target contract. Function parameter values ​​can include: the value of the transfer amount of virtual resources, the exchange target type of virtual resources, etc., and Params can be used to represent the function parameter value. After ABI encoding of the function Func and the function parameter value Params, the target contract function value can be obtained, and calldata can be used to represent the target contract function value.

[0196] The resource transfer amount is the quantity of virtual resources that you want to transfer to the target contract address. You can use value to represent the resource transfer amount.

[0197] The target object signature information is obtained by encrypting the third desensitized information with the effective private key; the third desensitized information is obtained by desensitizing the target contract address, target contract function value, and resource transfer amount with the target desensitization algorithm.

[0198] The target desensitization algorithm is a pre-set algorithm for desensitizing sensitive information to obtain non-sensitive information. In some embodiments, the target desensitization algorithm may be a hash algorithm. The target desensitization algorithm may be the same as the preset desensitization algorithm described above, or may be different from the preset desensitization algorithm described above. It should be understood that the specific algorithm type of the target desensitization algorithm should not be understood as a limitation on the present application.

[0199] The target desensitization algorithm may specifically be the Keccak-256 algorithm. Continuing with the above example, the third desensitization information is obtained by desensitizing the target contract address, target contract function value, and resource transfer amount using the target desensitization algorithm, which may be specifically implemented by the following formula:

[0200] hashdata tar =keccak256(target,calldata,value) (6)

[0201] Among them, hashdata tar is the third desensitized information; target represents the target contract address; calldata represents the target contract function value; value represents the resource transfer amount; keccak256() is the target desensitization algorithm.

[0202] Correspondingly, the target object signature information is obtained by encrypting the third desensitized information with the effective private key, which can be specifically implemented by the following formula:

[0203] signature tar =encrypt tar (hashdata tar ,PriKey U ) (7)

[0204] Among them, PriKey U To validate the private key; encrypt(hashdata tar ,PriKey U ) refers to using PriKey U For hashdata tar The encryption process; signature tar Signature information for the target object.

[0205] D2. Decrypt the target object signature using the effective public key to obtain target decryption information.

[0206] Continuing with the example above, PriKey U To validate the private key, let the valid public key be PubKey U Then the target object signature is decrypted using the effective public key to obtain the target decryption information, which can be achieved by the following formula:

[0207] bytes32_hashdata tar =VefirySignature tar (signature tar ,PubKeyU ) (8)

[0208] Among them, signature tar Sign information for the target object; PriKey U VefirySignature is the valid private key tar (signature tar ,PubKey U ) refers to the use of PubKey U Signature tar Decryption is performed. The specific decryption algorithm used for decryption is encapsulated in the function VefirySignature tar Bytes32_hashdata tar Decrypts information for the target. Function VefirySignature tar The encapsulated decryption algorithm is the same as the encrypt algorithm in formula (7) tar The encapsulated encryption algorithms are corresponding.

[0209] D3. Desensitize the target contract address, target contract function value and resource transfer amount using the target desensitization algorithm to obtain fourth desensitized information.

[0210] The target desensitization algorithm used in step D3 is the same as the target desensitization algorithm used to calculate the third desensitization information.

[0211] Continuing with the above example, the target desensitization algorithm is used to desensitize the target contract address, target contract function value and resource transfer amount to obtain the fourth desensitized information, which can be achieved by the following formula:

[0212] hashdata' tar =keccak256[abi.encodePacked(target,calldata,value)] (9)

[0213] Among them, abi.encodePacked(target,calldata,value) means to concatenate the target contract address target, the target contract function value calldata, and the resource transfer amount value in sequence to generate a compact encoding result; keccak256() is the target desensitization algorithm; hashdata' tar This is the fourth desensitized information.

[0214] D4. If the target decrypted information is consistent with the fourth desensitized information, it is determined that the target contract address, target contract function value and resource transfer amount are accurate.

[0215] If the target decrypted information is consistent with the fourth desensitized information, it means that the target contract address, target contract function value and resource transfer amount have accurately passed the verification of the target object, which means that the transaction is signed by the target object using the effective private key, that is, the target object has the right to transfer the virtual resources in the contract wallet. Therefore, it can be determined that the target contract address, target contract function value and resource transfer amount are accurate and compliant.

[0216] D5. Transfer the virtual resources of the resource transfer amount from the source contract address to the target contract address.

[0217] After confirming that the target contract address, target contract function value, and resource transfer amount are accurate and compliant, virtual resources with the same value as the resource transfer amount can be transferred from the source contract address to the target contract address.

[0218] Optionally, in a specific implementation, step D5 may specifically include the following steps: if the amount of virtual resources corresponding to the contract address is not less than the resource transfer amount, the virtual resources of the resource transfer amount are transferred from the source contract address to the target contract address.

[0219] The amount of virtual resources corresponding to the contract address is not less than the amount of resource transfer, that is, it is necessary to confirm that there is enough virtual resources in the contract address for transfer.

[0220] After implementing the above confirmation process, the cross-contract call of virtual resources can be implemented through the following code segment:

[0221] target.call(calldata,value)

[0222] In the above implementation, the contract wallet can be used to store the virtual resources of the target object, and the effective public key can be stored in the contract wallet, so that the scheduling of the virtual resources in the contract wallet requires the execution of the signature verification process of steps D1 to D5 above to be realized, that is, the target object holding the effective private key can be realized. The above implementation can realize the signature verification algorithm by running the contract wallet, increase the richness and flexibility of virtual resource scheduling, so that users can choose a more secure and reliable signature verification algorithm to protect the security of assets.

[0223] In the data verification method provided by the embodiment of the present application, the target private key of the target object whose original private key is lost and the corresponding public key to be verified can be obtained first; then, the public key to be verified is sent to the associated node, so that the associated object of the target object desensitizes the public key to be verified through a preset desensitization algorithm at the associated node, and further encrypts the first desensitized information obtained by desensitization through the private key of the associated object to obtain encrypted information. Subsequently, the encrypted information returned by the associated node is received, and the encrypted information is decrypted using the public key corresponding to the private key of the associated object, that is, the public key of the associated object, to obtain decrypted information. Then, the public key to be verified is desensitized using the same preset desensitization algorithm to obtain the second desensitized information. If the decrypted information is consistent with the second desensitized information, it indicates that the public key to be verified has passed the verification of the associated object, so it can be determined that the target private key and the public key to be verified of the target object are effective, thereby obtaining the effective private key and the effective public key. In the embodiment of the present application, in the case where the original private key of the target object is lost, the new private key (i.e., the target private key) and the new public key (i.e., the public key to be verified) of the target object can be obtained, and then the public key to be verified is sent to the associated object with which the target object has an association relationship, so that the associated object can sign and encrypt the public key to be verified by the preset desensitization algorithm and its own private key in turn to obtain encrypted information. The encrypted information returned from the associated object is received, and the public key of the associated object is used to verify and decrypt to obtain the decrypted information; and the public key to be verified is desensitized using the above-mentioned preset desensitization algorithm to obtain the second desensitized information, and then the decrypted information is compared with the second desensitized information; if the two are consistent, the new private key (i.e., the target private key) and the new public key (i.e., the public key to be verified) of the target object are determined to be effective. The embodiment of the present application can use the public key and private key held by the associated object to help the target object to verify the new private key (i.e., the target private key) and the new public key (i.e., the public key to be verified), so as to avoid the situation that once the private key is lost, the user can no longer manage and use the virtual resources, and improve the problem of loss caused by the loss of the user's private key in the prior art.

[0224] The embodiments of the present application can improve the holding stability of virtual resources.

[0225] In this embodiment, the method of the embodiment of the present application is described in detail by taking the virtual resource being electronic currency as an example.

[0226] like Figure 2 As shown, the specific process of a data verification method is as follows:

[0227] 201. Obtain a target private key of a target object and a public key to be verified corresponding to the target private key, wherein the target private key is a private key generated after the original private key is lost.

[0228] 202. Store a set number of associated object accounts and a public key corresponding to each associated object account into an associated object list.

[0229] 203. Send the public key to be verified to an associated node of an associated object of the target object, so that the associated node desensitizes the public key to be verified by a preset desensitization algorithm, and encrypts the desensitized first desensitized information by a private key of the associated object to obtain encrypted information.

[0230] 204. Receive the encrypted information returned by the associated node, and decrypt the encrypted information using the public key corresponding to the private key to obtain decrypted information.

[0231] 205. Whenever the encrypted information is received, the associated object value is incremented by one, wherein the initial value of the associated object value is zero.

[0232] 206. Desensitize the public key to be verified by using the preset desensitization algorithm to obtain second desensitized information.

[0233] 207. If the decrypted information is consistent with the second desensitized information and the associated object value is not less than the associated object quantity threshold, it is determined that the target private key and the public key to be verified of the target object are effective, wherein the target private key after effectiveness is the effective private key, and the public key to be verified after effectiveness is the effective public key.

[0234] Optionally, in a specific implementation, the method provided by the embodiment of the present application may further include: when the associated object account of the associated object to be added is not recorded in the associated object list, storing the associated object account of the associated object to be added and the public key of the associated object to be added to the associated object list; adding one to the total value of the associated objects in the associated object list.

[0235] Optionally, in another specific implementation, the method provided by the embodiment of the present application may further include: when the associated object account of the associated object to be deleted is recorded in the associated object list, deleting the associated object account of the associated object to be deleted and the public key of the associated object to be deleted from the associated object list; reducing the total value of the associated objects in the associated object list by one; if the total value of the associated objects after reduction by one is less than the associated object quantity threshold, popping up a threshold modification prompt message to remind the target object to modify the associated object quantity threshold.

[0236] 208. Generate the address of the target object based on the effective private key and the effective public key.

[0237] 209. Obtain a source contract address, where the source contract address is the address of the contract wallet to which the data verification method belongs.

[0238] 210. Transfer electronic currency from the user's address to the source contract address.

[0239] 211. Receive the target contract address, target contract function value, resource transfer amount and target object signature information, wherein the target object signature information is obtained by encrypting the third desensitized information by the effective private key, and the third desensitized information is obtained by desensitizing the target contract address, target contract function value and resource transfer amount by the target desensitization algorithm.

[0240] 212. Decrypt the target object signature using the effective public key to obtain target decryption information.

[0241] 213. Desensitize the target contract address, target contract function value, and resource transfer amount using the target desensitization algorithm to obtain fourth desensitized information.

[0242] 214. If the target decrypted information is consistent with the fourth desensitized information, it is determined that the target contract address, target contract function value and resource transfer amount are accurate.

[0243] 215. If the amount of electronic currency corresponding to the contract address is not less than the resource transfer amount, the electronic currency of the resource transfer amount is transferred from the source contract address to the target contract address.

[0244] The specific execution process of step 201 to step 215 has been described in detail above and will not be repeated here.

[0245] In the data verification method provided by the embodiment of the present application, the target private key of the target object whose original private key is lost and the corresponding public key to be verified can be obtained first; then, the public key to be verified is sent to the associated node, so that the associated object of the target object desensitizes the public key to be verified through a preset desensitization algorithm at the associated node, and further encrypts the first desensitized information obtained by desensitization through the private key of the associated object to obtain encrypted information. Subsequently, the encrypted information returned by the associated node is received, and the encrypted information is decrypted using the public key corresponding to the private key of the associated object, that is, the public key of the associated object, to obtain decrypted information. Then, the public key to be verified is desensitized using the same preset desensitization algorithm to obtain the second desensitized information. If the decrypted information is consistent with the second desensitized information, it indicates that the public key to be verified has passed the verification of the associated object, so it can be determined that the target private key and the public key to be verified of the target object are effective, thereby obtaining the effective private key and the effective public key. In the embodiment of the present application, in the case where the original private key of the target object is lost, the new private key (i.e., the target private key) and the new public key (i.e., the public key to be verified) of the target object can be obtained, and then the public key to be verified is sent to the associated object with which the target object has an association relationship, so that the associated object can sign and encrypt the public key to be verified by the preset desensitization algorithm and its own private key in turn to obtain encrypted information. The encrypted information returned from the associated object is received, and the public key of the associated object is used to verify and decrypt to obtain the decrypted information; and the public key to be verified is desensitized using the above-mentioned preset desensitization algorithm to obtain the second desensitized information, and then the decrypted information is compared with the second desensitized information; if the two are consistent, the new private key (i.e., the target private key) and the new public key (i.e., the public key to be verified) of the target object are determined to be effective. The embodiment of the present application can use the public key and private key held by the associated object to help the target object to verify the new private key (i.e., the target private key) and the new public key (i.e., the public key to be verified), so as to avoid the situation that once the private key is lost, the user can no longer manage and use the virtual resources, and improve the problem of loss caused by the loss of the user's private key in the prior art.

[0246] The embodiments of the present application can improve the holding stability of virtual resources.

[0247] In order to better implement the above method, the embodiment of the present application also provides a data verification device, which can be integrated in any blockchain node of the multiple nodes included in the blockchain system, and the blockchain node can be a terminal, server and other devices. Among them, the terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop, or a personal computer (PC) and other devices; the server can be a single server or a server cluster composed of multiple servers. For example, in this embodiment, the data verification device will be specifically integrated in any blockchain node as an example to describe the device of the embodiment of the present application in detail.

[0248] For example, Figure 3 As shown, the data verification device is applied to any blockchain node, and the device includes:

[0249] The public key acquisition unit 301 is used to acquire a target private key of a target object and a public key to be verified corresponding to the target private key, wherein the target private key is a private key generated after the original private key is lost;

[0250] The public key sending unit 302 is used to send the public key to be verified to the associated node of the associated object of the target object, so that the associated node desensitizes the public key to be verified by using a preset desensitization algorithm, and encrypts the desensitized first desensitized information by using the private key of the associated object to obtain encrypted information;

[0251] The information decryption unit 303 is used to receive the encrypted information returned by the associated node, and decrypt the encrypted information using the public key corresponding to the private key to obtain decrypted information;

[0252] The information desensitizing unit 304 is used to desensitize the public key to be verified by using the preset desensitizing algorithm to obtain second desensitized information;

[0253] The effectiveness determination unit 305 is used to determine that the target private key and the public key to be verified of the target object are effective when the decrypted information is consistent with the second desensitized information, wherein the target private key after effectiveness is the effective private key, and the public key to be verified after effectiveness is the effective public key.

[0254] In one embodiment, the device further comprises:

[0255] an object counting unit, configured to increase the associated object value by one each time the encrypted information is received, wherein the initial value of the associated object value is zero;

[0256] Correspondingly, the effectiveness determination unit 305 is specifically used to determine that the target private key and the public key to be verified of the target object are effective when the decrypted information is consistent with the second desensitized information and the associated object value is not less than the associated object quantity threshold.

[0257] In one embodiment, the device further comprises:

[0258] The account storage unit is used to store a set number of associated object accounts and the public key corresponding to each of the associated object accounts into the associated object list.

[0259] In one implementation, the threshold value of the number of associated objects is not greater than the set number.

[0260] In one embodiment, the device further comprises:

[0261] an account adding unit, configured to store the associated object account and the public key of the associated object to be added to the associated object list when the associated object account of the associated object to be added is not recorded in the associated object list;

[0262] The total value increasing unit is used to increase the total value of the associated objects in the associated object list by one.

[0263] In one embodiment, the device further comprises:

[0264] an account deleting unit, configured to, when an associated object account of the associated object to be deleted is recorded in the associated object list, delete the associated object account of the associated object to be deleted and the public key of the associated object to be deleted from the associated object list;

[0265] a total value reduction unit, used to reduce the total value of the associated objects in the associated object list by one;

[0266] The threshold prompt unit is used to pop up a threshold modification prompt message when the total value of the associated objects after deducting one is less than the associated object quantity threshold, so as to remind the target object to modify the associated object quantity threshold.

[0267] In one embodiment, the device further comprises:

[0268] An address generating unit, configured to generate an address of the target object based on the valid private key and the valid public key;

[0269] A contract address acquisition unit, used to acquire a source contract address, where the source contract address is the address of the contract wallet to which the data verification method belongs;

[0270] A resource transfer unit is used to transfer virtual resources from the address of the target object to the source contract address.

[0271] In one embodiment, the device further comprises:

[0272] A parameter receiving unit, used to receive a target contract address, a target contract function value, a resource transfer amount, and a target object signature information, wherein the target object signature information is obtained by encrypting the third desensitized information with the effective private key, and the third desensitized information is obtained by desensitizing the target contract address, the target contract function value, and the resource transfer amount with a target desensitization algorithm;

[0273] An effective public key decryption unit, used to decrypt the target object signature using the effective public key to obtain target decryption information;

[0274] A target desensitization unit, configured to desensitize the target contract address, the target contract function value, and the resource transfer amount using the target desensitization algorithm to obtain fourth desensitized information;

[0275] A parameter verification unit is used to determine that the target contract address, the target contract function value and the resource transfer amount are accurate when the target decrypted information is consistent with the fourth desensitized information.

[0276] In one embodiment, the device further comprises:

[0277] A resource transfer unit is used to transfer the virtual resources of the resource transfer amount from the source contract address to the target contract address.

[0278] In one embodiment, the resource transfer unit is specifically used to transfer the virtual resources of the resource transfer amount from the source contract address to the target contract address when the amount of virtual resources corresponding to the contract address is not less than the resource transfer amount.

[0279] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.

[0280] In the data verification device provided by the embodiment of the present application, the target private key of the target object whose original private key is lost and the corresponding public key to be verified can be obtained first; then, the public key to be verified is sent to the associated node, so that the associated object of the target object desensitizes the public key to be verified through a preset desensitization algorithm at the associated node, and further encrypts the first desensitized information obtained by desensitization through the private key of the associated object to obtain encrypted information. Subsequently, the encrypted information returned by the associated node is received, and the encrypted information is decrypted using the public key corresponding to the private key of the associated object, that is, the public key of the associated object, to obtain decrypted information. Then, the public key to be verified is desensitized using the same preset desensitization algorithm to obtain the second desensitized information. If the decrypted information is consistent with the second desensitized information, it indicates that the public key to be verified has passed the verification of the associated object, so it can be determined that the target private key and the public key to be verified of the target object are effective, thereby obtaining the effective private key and the effective public key. In the embodiment of the present application, in the case where the original private key of the target object is lost, the new private key (i.e., the target private key) and the new public key (i.e., the public key to be verified) of the target object can be obtained, and then the public key to be verified is sent to the associated object with which the target object has an association relationship, so that the associated object can sign and encrypt the public key to be verified by the preset desensitization algorithm and its own private key in turn to obtain encrypted information. The encrypted information returned from the associated object is received, and the public key of the associated object is used to verify and decrypt to obtain the decrypted information; and the public key to be verified is desensitized using the above-mentioned preset desensitization algorithm to obtain the second desensitized information, and then the decrypted information is compared with the second desensitized information; if the two are consistent, the new private key (i.e., the target private key) and the new public key (i.e., the public key to be verified) of the target object are determined to be effective. The embodiment of the present application can use the public key and private key held by the associated object to help the target object to verify the new private key (i.e., the target private key) and the new public key (i.e., the public key to be verified), so as to avoid the situation that once the private key is lost, the user can no longer manage and use the virtual resources, and improve the problem of loss caused by the loss of the user's private key in the prior art.

[0281] The embodiments of the present application can improve the holding stability of virtual resources.

[0282] The embodiment of the present application also provides an electronic device, which can be a terminal, a server, etc. The terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop, a personal computer, etc. The server can be a single server or a server cluster composed of multiple servers, etc.

[0283] In some embodiments, the data verification device may also be integrated into multiple electronic devices. For example, the data verification device may be integrated into multiple servers, and the data verification method of the present application may be implemented by multiple servers.

[0284] In this embodiment, the electronic device of this embodiment is an electronic device as an example for detailed description, for example, Figure 4 As shown, it shows a schematic diagram of the structure of the electronic device involved in the embodiment of the present application, specifically:

[0285] The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, an input module 404, and a communication module 405. Those skilled in the art will appreciate that Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0286] The processor 401 is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 402, and calling data stored in the memory 402. In some embodiments, the processor 401 may include one or more processing cores; in some embodiments, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.

[0287] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data verification by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.

[0288] The electronic device also includes a power supply 403 for supplying power to various components. In some embodiments, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 403 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0289] The electronic device may further include an input module 404, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0290] The electronic device may further include a communication module 405. In some embodiments, the communication module 405 may include a wireless module. The electronic device may perform short-range wireless transmission through the wireless module of the communication module 405, thereby providing the user with wireless broadband Internet access. For example, the communication module 405 may be used to help the user send and receive emails, browse web pages, and access streaming media.

[0291] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 401 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402, thereby realizing various functions, as follows:

[0292] Obtain a target private key of a target object and a public key to be verified corresponding to the target private key, wherein the target private key is a private key generated after the original private key is lost; send the public key to be verified to an associated node of an associated object of the target object, so that the associated node desensitizes the public key to be verified by using a preset desensitizing algorithm, and encrypts the desensitized first desensitized information by using the private key of the associated object to obtain encrypted information; receive the encrypted information returned by the associated node, and decrypt the encrypted information by using the public key corresponding to the private key to obtain decrypted information; desensitize the public key to be verified by using the preset desensitizing algorithm to obtain second desensitized information; if the decrypted information is consistent with the second desensitized information, determine that the target private key and the public key to be verified of the target object are effective, wherein the target private key after effectiveness is the effective private key, and the public key to be verified after effectiveness is the effective public key.

[0293] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0294] 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.

[0295] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any one of the data verification methods provided in the embodiments of the present application. For example, the instructions can execute the following steps:

[0296] Obtain a target private key of a target object and a public key to be verified corresponding to the target private key, wherein the target private key is a private key generated after the original private key is lost; send the public key to be verified to an associated node of an associated object of the target object, so that the associated node desensitizes the public key to be verified by using a preset desensitizing algorithm, and encrypts the desensitized first desensitized information by using the private key of the associated object to obtain encrypted information; receive the encrypted information returned by the associated node, and decrypt the encrypted information by using the public key corresponding to the private key to obtain decrypted information; desensitize the public key to be verified by using the preset desensitizing algorithm to obtain second desensitized information; if the decrypted information is consistent with the second desensitized information, determine that the target private key and the public key to be verified of the target object are effective, wherein the target private key after effectiveness is the effective private key, and the public key to be verified after effectiveness is the effective public key.

[0297] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0298] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the various optional implementations provided in the above embodiments.

[0299] Since the instructions stored in the storage medium can execute the steps in any data verification method provided in the embodiments of the present application, the beneficial effects that can be achieved by any data 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.

[0300] The above is a detailed introduction to a data verification method, device, electronic device and computer-readable 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 method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A data verification method, characterized in that: The method comprises: Obtain a target private key of a target object and a public key to be verified corresponding to the target private key, wherein the target private key is a private key generated after the original private key is lost; Sending the public key to be verified to an associated node of an associated object of the target object, so that the associated node desensitizes the public key to be verified by using a preset desensitization algorithm, and encrypts the desensitized first desensitized information by using a private key of the associated object to obtain encrypted information; receiving the encrypted information returned by the associated node, and decrypting the encrypted information using the public key corresponding to the private key to obtain decrypted information; Desensitizing the public key to be verified by using the preset desensitization algorithm to obtain second desensitized information; If the decrypted information is consistent with the second desensitized information, it is determined that the target private key and the public key to be verified of the target object are effective, wherein the target private key after effectiveness is the effective private key, and the public key to be verified after effectiveness is the effective public key.

2. The method according to claim 1, characterized in that After receiving the encrypted information returned by the associated node, the method further includes: Whenever the encrypted information is received, the value of the associated object is incremented by one, wherein the initial value of the associated object value is zero; If the decrypted information is consistent with the second desensitized information, determining that the target private key and the public key to be verified of the target object are effective includes: If the decrypted information is consistent with the second desensitized information and the associated object value is not less than the associated object quantity threshold, it is determined that the target private key and the public key to be verified of the target object are effective.

3. The method according to claim 2, characterized in that Before sending the public key to be verified to the associated node of the associated object of the target object, the method further includes: A set number of associated object accounts and a public key corresponding to each of the associated object accounts are stored in an associated object list.

4. The method according to claim 3, characterized in that The associated object quantity threshold is not greater than the set quantity.

5. The method according to claim 1, characterized in that The method further comprises: When the associated object account of the associated object to be added is not recorded in the associated object list, storing the associated object account of the associated object to be added and the public key of the associated object to be added in the associated object list; The total value of the associated objects in the associated object list is increased by one.

6. The method according to claim 1, characterized in that The method further comprises: When the associated object account of the associated object to be deleted is recorded in the associated object list, deleting the associated object account of the associated object to be deleted and the public key of the associated object to be deleted from the associated object list; Subtract one from the total value of the associated objects in the associated object list; If the total value of the associated objects after decrementing by one is less than the associated object quantity threshold, a threshold modification prompt message is popped up to remind the target object to modify the associated object quantity threshold.

7. The method according to claim 1, characterized in that The method further comprises: Generate the address of the target object based on the effective private key and the effective public key; Obtain the source contract address, which is the address of the contract wallet to which the data verification method belongs; Transfer the virtual resource from the target object's address to the source contract address.

8. The method according to claim 7, characterized in that The method further comprises: Receive the target contract address, target contract function value, resource transfer amount and target object signature information, wherein the target object signature information is obtained by encrypting the third desensitized information with the effective private key, and the third desensitized information is obtained by desensitizing the target contract address, target contract function value and resource transfer amount with the target desensitization algorithm; Decrypting the target object signature using the effective public key to obtain target decryption information; Desensitizing the target contract address, the target contract function value, and the resource transfer amount using the target desensitization algorithm to obtain fourth desensitized information; If the target decrypted information is consistent with the fourth desensitized information, it is determined that the target contract address, target contract function value and resource transfer amount are accurate.

9. The method according to claim 8, characterized in that The method further comprises: Transfer the virtual resources of the resource transfer amount from the source contract address to the target contract address.

10. The method according to claim 9, characterized in that The transferring of the virtual resource of the resource transfer amount from the source contract address to the target contract address includes: If the amount of virtual resources corresponding to the contract address is not less than the amount of resource transfer, the virtual resources of the amount of resource transfer are transferred from the source contract address to the target contract address.

11. A data verification device, characterized in that: The device comprises: A public key acquisition unit, used to acquire a target private key of a target object and a public key to be verified corresponding to the target private key, wherein the target private key is a private key generated after the original private key is lost; A public key sending unit, used for sending the public key to be verified to an associated node of an associated object of the target object, so that the associated node desensitizes the public key to be verified by a preset desensitization algorithm, and encrypts the desensitized first desensitized information by a private key of the associated object to obtain encrypted information; An information decryption unit, used to receive the encrypted information returned by the associated node, and decrypt the encrypted information using the public key corresponding to the private key to obtain decrypted information; An information desensitizing unit, used to desensitize the public key to be verified by using the preset desensitizing algorithm to obtain second desensitized information; The effectiveness determination unit is used to determine that the target private key and the public key to be verified of the target object are effective when the decrypted information is consistent with the second desensitized information, wherein the target private key after effectiveness is the effective private key, and the public key to be verified after effectiveness is the effective public key.

12. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps in the data verification method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the data verification method according to any one of claims 1 to 10.

14. A computer program product, characterized in that The method comprises a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the steps in the data verification method according to any one of claims 1 to 10 are implemented.