Resource transfer method and device based on block chain, equipment and medium

By using user private key signatures and smart contracts in the blockchain network, security and reliability issues during resource transfer are solved, and the secure transfer of virtual resources is achieved.

CN120258974APending Publication Date: 2025-07-04TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410011659.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-02
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

Existing resource transfer methods cannot guarantee the security and reliability of the resource transfer process, which can easily lead to malicious resource transfer.

Method used

By encrypting the hash value of the virtual resource using the user's private key to generate a digital signature and executing a smart contract in the blockchain network, ensuring that the integrity verification of the resource transfer request is passed before resource transfer is carried out.

Benefits of technology

It effectively avoids the virtual resources being maliciously tampered with during transmission, ensures the security and reliability of the resource transfer process, and prevents malicious transfer of resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120258974A_ABST
    Figure CN120258974A_ABST
Patent Text Reader

Abstract

The invention relates to a resource transfer method and device based on a block chain, equipment and a medium. The method comprises the following steps: determining at least one virtual resource to be transferred; performing hash processing based on the at least one virtual resource to be transferred through the first hash function to obtain a first resource hash value; encrypting the first resource hash value by using a user private key to obtain a resource digital signature; generating a resource transfer request, wherein the resource transfer request carries a resource digital signature and a user public key; sending a resource transfer request to a node in the block chain network, the resource transfer request being used for indicating the node to perform hash processing through a first hash function based on at least one virtual resource indicated by the resource transfer request to obtain a second resource hash value, decrypting the resource digital signature by using a user public key to obtain a first resource hash value, and sending the first resource hash value to the node; and when the second resource hash value is consistent with the first resource hash value, executing the smart contract in the node to perform resource transfer. By adopting the method, malicious resource transfer can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to blockchain and smart contract technologies, and more particularly to the field of resource processing, and in particular to a method, apparatus, device, and medium for resource transfer based on blockchain. Background Art

[0002] Blockchain technology is a distributed ledger technology in the field of information technology, generally composed of consensus, transaction blocks and state data storage, cryptographic identity security, etc. Since the ledger is distributedly stored and the blocks are consensus-based, it has features such as immutability, traceability, and common maintenance. A smart contract is an automatically executed contract based on blockchain technology, which is a computer protocol designed to spread, verify, or execute a contract in an information-based manner. Smart contracts allow for trusted transactions without a third party, and these transactions are monitorable and irreversible. In the resource processing scenario, in the traditional technology, the client usually directly sends a resource transfer request carrying virtual resources to the resource recipient. When the resource recipient receives the resource transfer request, it executes the smart contract set on the resource recipient to perform resource transfer.

[0003] However, the current resource transfer method cannot guarantee the security and reliability of resources during the resource transfer process and is prone to malicious resource transfer. Summary of the Invention

[0004] Based on this, it is necessary to provide a method, apparatus, device, and medium for resource transfer based on blockchain that can avoid malicious resource transfer in view of the above technical problems.

[0005] In a first aspect, the present application provides a method for resource transfer based on blockchain, the method comprising:

[0006] In response to a trigger event initiated by a user for resource transfer to a resource recipient, determining at least one virtual resource to be transferred, and different virtual resources have different resource identifiers;

[0007] Through a preset first hash function, performing hash processing based on the resource identifiers of the at least one virtual resource to be transferred to obtain a first resource hash value of the at least one virtual resource to be transferred;

[0008] Determining the user private key of the user and the user public key matching the user private key;

[0009] Encrypting the first resource hash value with the user private key to obtain a resource digital signature;

[0010] Generating a resource transfer request for the resource recipient, the resource transfer request carrying the resource digital signature and the user public key;

[0011] Send the resource transfer request to a node in the blockchain network. The resource transfer request is used to instruct the node to determine at least one virtual resource indicated by the resource transfer request, perform hashing processing on the resource identifiers of at least one virtual resource indicated by the resource transfer request through the preset first hash function to obtain the second resource hash value of at least one virtual resource indicated by the resource transfer request, decrypt the resource digital signature using the user public key to obtain the first resource hash value, and when the second resource hash value is consistent with the first resource hash value, execute the smart contract corresponding to the resource recipient in the node to perform resource transfer based on at least one virtual resource indicated by the resource transfer request.

[0012] In a second aspect, the present application provides a blockchain-based resource transfer method applied to a node of a blockchain network. A smart contract corresponding to a resource recipient is set in the node. The method includes:

[0013] Receive a resource transfer request initiated by a user based on a client for the resource recipient;

[0014] Determine the user public key of the user indicated by the resource transfer request, and determine the resource digital signature and at least one virtual resource indicated by the resource transfer request. The resource digital signature is encrypted by the client using the user private key matching the user public key to obtain the first resource hash value. The first resource hash value is obtained by the client performing hashing processing on the resource identifiers of at least one virtual resource to be transferred through a preset first hash function after determining at least one virtual resource to be transferred, and different virtual resources have different resource identifiers;

[0015] Use the user public key to decrypt the resource digital signature to obtain the first resource hash value;

[0016] Perform hashing processing on the resource identifiers of at least one virtual resource indicated by the resource transfer request through the preset first hash function to obtain a second resource hash value;

[0017] When the second resource hash value is consistent with the first resource hash value, execute the smart contract to perform resource transfer based on at least one virtual resource indicated by the resource transfer request.

[0018] In a third aspect, the present application provides a blockchain-based resource transfer device. The device includes:

[0019] A first determination module, configured to determine at least one virtual resource to be transferred in response to a trigger event initiated by a user for resource transfer to a resource recipient, where different virtual resources have different resource identifiers;

[0020] A first hashing module, configured to perform hashing processing on the resource identifiers of the at least one virtual resource to be transferred based on a preset first hashing function, to obtain a first resource hash value of the at least one virtual resource to be transferred;

[0021] The first determination module is further configured to determine the user private key of the user and the user public key that matches the user private key;

[0022] An encryption module, configured to encrypt the first resource hash value using the user private key to obtain a resource digital signature;

[0023] A generation module, configured to generate a resource transfer request for the resource recipient, where the resource transfer request carries the resource digital signature and the user public key;

[0024] A sending module, configured to send the resource transfer request to a node in a blockchain network, where the resource transfer request is used to instruct the node to determine the at least one virtual resource indicated by the resource transfer request, perform hashing processing on the resource identifiers of the at least one virtual resource indicated by the resource transfer request based on the preset first hashing function, to obtain a second resource hash value of the at least one virtual resource indicated by the resource transfer request, decrypt the resource digital signature using the user public key to obtain the first resource hash value, and when the second resource hash value is consistent with the first resource hash value, execute the smart contract corresponding to the resource recipient in the node to perform resource transfer based on the at least one virtual resource indicated by the resource transfer request.

[0025] In one embodiment, the first hashing module is further configured to respectively determine the resource face values of the at least one virtual resource to be transferred; splice the resource identifiers and resource face values of the at least one virtual resource to be transferred to obtain resource feature data of the at least one virtual resource to be transferred; and perform hashing processing on the resource feature data of the at least one virtual resource to be transferred based on a preset first hashing function to obtain a first resource hash value of the at least one virtual resource to be transferred.

[0026] In one embodiment, the first hash processing module is further configured to, for each of the at least one virtual resource to be transferred, splice the resource identifier and the resource face value of the targeted virtual resource to obtain the resource feature data of the targeted virtual resource; and splice the resource feature data of each of the at least one virtual resource to be transferred to obtain the resource feature data of the at least one virtual resource to be transferred.

[0027] In one embodiment, when applied to a client, the first determination module is further configured to, in response to a trigger event initiated by a user for transferring resources to a resource recipient, select a target resource container from at least one preset resource container, where the resource container is used to store virtual resources; when the target resource container is a hardware resource container, determine at least one virtual resource to be transferred from the virtual resources stored in the hardware resource container, and the hardware resource container is disposed in a resource management chip of the client.

[0028] In one embodiment, when applied to a client, the first determination module is further configured to, in response to a trigger event initiated by a user for transferring resources to a resource recipient, select a target resource container from at least one preset resource container, where the resource container is used to store virtual resources; when the target resource container is a software resource container, determine at least one virtual resource to be transferred from the virtual resources stored in the software resource container, and the software resource container is disposed in a resource management application pre-installed in the client.

[0029] In one embodiment, the first determination module is further configured to determine a first prime number and a second prime number, where a first key parameter is divisible by the second prime number, and the first key parameter is determined based on the difference between the first prime number and a preset first integer; determine a second integer, where the remainder obtained by dividing a second key parameter by the first prime number is equal to the remainder obtained by dividing the first integer by the first prime number, and the second key parameter is determined based on the second integer and the second prime number; select a positive integer less than the second prime number as the user private key; determine a third key parameter according to the second integer and the user private key; and perform a modulo operation on the third key parameter and the first prime number to obtain a user public key that matches the user private key.

[0030] In one embodiment, the encryption module is further configured to select a value as a random parameter from values greater than the first integer and less than the second prime number; determine a first signature parameter according to the random parameter, the second integer, the first prime number, and the second prime number; determine a second signature parameter according to the first signature parameter, the random parameter, the first resource hash value, the user private key, and the second prime number; and determine a resource digital signature according to the first signature parameter and the second signature parameter.

[0031] In one embodiment, the encryption module is further configured to determine a first signature intermediate state parameter according to the random parameter and the second integer; perform a modulo operation on the first signature intermediate state parameter and the first prime number to obtain a modulo parameter; and perform a modulo operation on the modulo parameter and the second prime number to obtain a first signature parameter.

[0032] In one embodiment, the encryption module is further configured to determine a second signature intermediate state parameter according to the product of the user private key and the first signature parameter; determine a third signature intermediate state parameter according to the sum of the second signature intermediate state parameter and the first resource hash value; determine a fourth signature intermediate state parameter according to the third signature intermediate state parameter and the random parameter; and perform a modulo operation on the fourth signature intermediate state parameter and the second prime number to obtain a second signature parameter.

[0033] Fourthly, the present application provides a resource transfer device based on a blockchain, which is applied to a node of a blockchain network. A smart contract corresponding to a resource recipient is set in the node. The device includes:

[0034] A receiving module, configured to receive a resource transfer request initiated by a user based on a client for the resource recipient;

[0035] A second determining module, configured to determine a user public key of the user indicated by the resource transfer request, and determine a resource digital signature and at least one virtual resource indicated by the resource transfer request. The resource digital signature is obtained by the client encrypting a first resource hash value using a user private key matching the user public key. The first resource hash value is obtained by the client, after determining at least one virtual resource to be transferred, performing a hash process on the resource identifiers of the at least one virtual resource to be transferred through a preset first hash function, and different virtual resources have different resource identifiers;

[0036] A decryption module, configured to decrypt the resource digital signature using the user public key to obtain the first resource hash value;

[0037] A second hashing processing module, configured to perform hashing processing on the resource identifier of each of at least one virtual resource indicated by the resource transfer request through the preset first hashing function, to obtain a second resource hash value;

[0038] A transfer module, configured to execute the intelligent contract when the second resource hash value is consistent with the first resource hash value, so as to perform resource transfer based on at least one virtual resource indicated by the resource transfer request.

[0039] In one embodiment, the second determination module is further configured to determine a digital certificate indicated by the resource transfer request. The digital certificate is generated by a certificate registration end based on the user public key after obtaining the user public key of the user from the client, and the digital certificate includes the user public key; extract the user public key from the digital certificate; when the digital certificate passes the legality verification, notify the decryption module to execute the step of decrypting the resource digital signature using the user public key to obtain the first resource hash value.

[0040] In one embodiment, the digital certificate further includes a certificate digital signature and a registration public key of the certificate registration end. The certificate digital signature is encrypted by the certificate registration end using a registration private key matching the registration public key for a first certificate hash value, and the first certificate hash value is obtained by the certificate registration end performing hashing processing on the digital certificate through a preset second hashing function. The apparatus further includes:

[0041] A verification module, configured to extract the certificate digital signature and the registration public key from the digital certificate; decrypt the certificate digital signature using the registration public key to obtain the first certificate hash value; perform hashing processing on the digital certificate indicated by the resource transfer request through the preset second hashing function to obtain a second certificate hash value; and determine that the digital certificate passes the legality verification when the second certificate hash value is consistent with the first certificate hash value.

[0042] In one embodiment, the second hashing processing module is further configured to respectively determine the resource face value of each of at least one virtual resource indicated by the resource transfer request; splice the resource identifier and the resource face value of each of at least one virtual resource indicated by the resource transfer request to obtain resource feature data of at least one virtual resource indicated by the resource transfer request; and perform hashing processing on the resource feature data of at least one virtual resource indicated by the resource transfer request through the preset first hashing function to obtain the second resource hash value of at least one virtual resource indicated by the resource transfer request.

[0043] In one embodiment, the second hash processing module is further configured to, for each of at least one virtual resource indicated by the resource transfer request, splice the resource identifier and the resource face value of the targeted virtual resource to obtain the resource feature data of the targeted virtual resource; and splice the resource feature data of each of the at least one virtual resource indicated by the resource transfer request to obtain the resource feature data of the at least one virtual resource indicated by the resource transfer request.

[0044] In a fifth aspect, the present application provides a computer device, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the method embodiments of the present application are implemented.

[0045] In a sixth aspect, the present application provides a computer-readable storage medium, storing a computer program, and when the computer program is executed by a processor, the steps in the method embodiments of the present application are implemented.

[0046] In a seventh aspect, the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps in the method embodiments of the present application are implemented.

[0047] The above blockchain-based resource transfer method, device, equipment, and medium, in response to a trigger event initiated by a user for resource transfer to a resource recipient, determine at least one virtual resource to be transferred, where different portions of virtual resources have different resource identifiers; through a preset first hash function, perform hash processing based on the resource identifiers of at least one virtual resource to be transferred, and obtain a first resource hash value of at least one virtual resource to be transferred; determine the user's private key and the user's public key that matches the user's private key; encrypt the first resource hash value using the user's private key to obtain a resource digital signature; generate a resource transfer request for the resource recipient, where the resource transfer request carries the resource digital signature and the user's public key; send the resource transfer request to a node in the blockchain network, and the resource transfer request is used to instruct the node to determine at least one virtual resource indicated by the resource transfer request, through a preset first hash function, perform hash processing based on the resource identifiers of at least one virtual resource indicated by the resource transfer request, and obtain a second resource hash value of at least one virtual resource indicated by the resource transfer request, use the user's public key to decrypt the resource digital signature to obtain the first resource hash value, and when the second resource hash value is consistent with the first resource hash value, execute the smart contract corresponding to the resource recipient in the node to perform resource transfer based on at least one virtual resource indicated by the resource transfer request. Compared with traditional resource transfer methods, in this application, before sending a resource transfer request, the client initiating the resource transfer request signs at least one virtual resource to be transferred using the user's private key, and sends the resource digital signature and at least one virtual resource indicated by the resource transfer request to a node in the blockchain network, so that after the node in the blockchain network passes the integrity verification of at least one received virtual resource based on the resource digital signature, it then executes the smart contract set in the node to perform resource transfer based on at least one received virtual resource, avoiding malicious tampering of virtual resources during the transmission process, ensuring the security and reliability of virtual resources during the resource transfer process, and thus avoiding malicious transfer of resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 FIG. is an application environment diagram of a blockchain-based resource transfer method in an embodiment;

[0049] Figure 2 FIG. is a flowchart of a blockchain-based resource transfer method in an embodiment;

[0050] Figure 3 FIG. is a comparison diagram of physical resources and virtual resources in an embodiment;

[0051] Figure 4 FIG. is a schematic diagram of the interaction between a client and a blockchain network in an embodiment;

[0052] Figure 5Schematic diagram of the principle of block storage in a blockchain network in an embodiment;

[0053] Figure 6 Schematic diagram of the deployment of a smart contract in a node in an embodiment;

[0054] Figure 7 Schematic diagram of the implementation principle of a traditional resource transfer method;

[0055] Figure 8 Schematic diagram of the principle of malicious resource transfer caused by a traditional resource transfer method;

[0056] Figure 9 Schematic diagram of the process of a resource transfer method based on blockchain in another embodiment;

[0057] Figure 10 Schematic diagram of the process of a resource transfer method based on blockchain in yet another embodiment;

[0058] Figure 11 Structural block diagram of a resource transfer device based on blockchain in an embodiment;

[0059] Figure 12 Structural block diagram of a resource transfer device based on blockchain in another embodiment;

[0060] Figure 13 Structural block diagram of a resource transfer device based on blockchain in yet another embodiment;

[0061] Figure 14 Internal structure diagram of a computer device in an embodiment;

[0062] Figure 15 Internal structure diagram of a computer device in another embodiment. Detailed implementation manners

[0063] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0064] The resource transfer method based on blockchain provided by the present application can be applied to, for example Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can be set separately and can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or can be placed on the cloud or other servers. Among them, the terminal 102 can be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, vehicle-mounted terminals, intelligent voice interaction devices, aircraft, smart home appliances, and portable wearable devices. The smart home appliances can be smart speakers, smart TVs, smart air conditioners, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or can also be a cloud server that provides network security services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, cloud security, host security, CDN, as well as basic cloud computing services such as big data and artificial intelligence platforms. The terminal 102 and the server 104 can be directly or indirectly connected through wired or wireless communication methods, and this application does not make any restrictions here.

[0065] Specifically, the client of this application can be the terminal 102, and the nodes in the blockchain network can be the server 104. The terminal 102 can respond to a trigger event initiated by the user to transfer resources to the resource recipient, determine at least one virtual resource to be transferred, and different virtual resources have different resource identifiers. The terminal 102 can perform a hashing process on the resource identifiers of at least one virtual resource to be transferred based on a preset first hash function to obtain the first resource hash value of at least one virtual resource to be transferred. The terminal 102 can determine the user's private key and the user's public key that matches the user's private key, and encrypt the first resource hash value with the user's private key to obtain a resource digital signature. The terminal 102 can generate a resource transfer request for the resource recipient, and the resource transfer request carries the resource digital signature and the user's public key. The terminal 102 can send the resource transfer request to the server 104 in the blockchain network. The resource transfer request is used to instruct the server 104 to determine at least one virtual resource indicated by the resource transfer request, perform a hashing process on the resource identifiers of at least one virtual resource indicated by the resource transfer request based on a preset first hash function to obtain the second resource hash value of at least one virtual resource indicated by the resource transfer request, decrypt the resource digital signature with the user's public key to obtain the first resource hash value. When the second resource hash value is consistent with the first resource hash value, execute the smart contract corresponding to the resource recipient in the server 104 to transfer resources based on at least one virtual resource indicated by the resource transfer request.

[0066] In one embodiment, as Figure 2As shown, a blockchain-based resource transfer method is provided. In this embodiment, taking the application of this method to a client as an example, it includes the following steps:

[0067] Step 202, in response to a trigger event initiated by a user to transfer resources to a resource recipient, determine at least one virtual resource to be transferred, and different virtual resources have different resource identifiers.

[0068] Among them, virtual resources are virtual resources, different virtual resources have different resource identifiers, and the resource identifier is used to uniquely identify the virtual resource.

[0069] Specifically, the user can initiate a trigger event to transfer resources to a resource recipient based on the client, and the client can, in response to the trigger event initiated by the user to transfer resources to a resource recipient, determine at least one virtual resource to be transferred from the resource container for storing virtual resources.

[0070] To facilitate further understanding of the virtual resources in this application and better distinguish traditional physical resources from the virtual resources in this application, the following explanations are made. As Figure 3 shown, a resource issuing institution can issue physical resources and virtual resources. For physical resources, when a user has many physical resources but does not often use them, the user can go to the resource issuing institution to open a resource account and store the physical resources in the resource issuing institution. When the user needs to use them, the user can go to the resource issuing institution to retrieve the physical resources. In a resource payment scenario, the user can also bind the resource account opened in the resource issuing institution to a payment application. When it is necessary to pay for resources, the user can perform a scan code payment through the payment application to deduct the physical resources to be paid from the resource account. For virtual resources, after being issued by the resource issuing institution, they can be directly bound to the user's payment application. When it is necessary to pay for resources, the user can perform a scan code payment through the payment application to deduct the virtual resources to be paid.

[0071] Step 204, through a preset first hash function, perform hash processing based on the resource identifiers of at least one virtual resource to be transferred, and obtain the first resource hash value of at least one virtual resource to be transferred.

[0072] Among them, the first resource hash value is the resource hash value of at least one virtual resource to be transferred.

[0073] In one embodiment, the client can respectively determine the resource identifiers of at least one virtual resource to be transferred, and fuse the resource identifiers of the at least one virtual resource to be transferred to obtain the resource feature data of the at least one virtual resource to be transferred. Furthermore, the client can perform a hashing process on the resource feature data of the at least one virtual resource to be transferred through a preset first hash function to obtain the first resource hash value of the at least one virtual resource to be transferred.

[0074] In one embodiment, the client can splice the resource identifiers of at least one virtual resource to be transferred to obtain the resource feature data of the at least one virtual resource to be transferred. The client can perform a hashing process on the resource feature data of the at least one virtual resource to be transferred through a preset first hash function to obtain the first resource hash value of the at least one virtual resource to be transferred.

[0075] Step 206: Determine the user's private key and the user's public key that matches the user's private key.

[0076] Among them, the user's private key and the user's public key are keys generated by the user based on the client.

[0077] Specifically, the client can determine the user's private key and the user's public key that matches the user's private key. It can be understood that the user's private key and the user's public key are a pair of asymmetric keys. The user's private key can be used to encrypt data, and the user's public key can be used to decrypt the data encrypted with the matching user's private key.

[0078] Step 208: Encrypt the first resource hash value with the user's private key to obtain the resource digital signature.

[0079] Among them, the resource digital signature is a digital signature obtained by encrypting the first resource hash value of at least one virtual resource to be transferred with the user's private key.

[0080] In one embodiment, the client can perform an exclusive OR operation on the user's private key and the first resource hash value to obtain an operation result. Furthermore, the client can perform a hashing process on the operation result through the first hash function to obtain the resource digital signature.

[0081] Step 210: Generate a resource transfer request for the resource recipient, and the resource transfer request carries the resource digital signature and the user's public key.

[0082] Among them, the resource transfer request is a computer instruction for requesting virtual resource transfer.

[0083] Specifically, the client can generate a resource transfer request for the resource recipient based on the resource digital signature, the user's public key, and at least one virtual resource to be transferred. Among them, the resource transfer request carries the resource digital signature, the user's public key, and at least one virtual resource to be transferred.

[0084] Step 212: Send a resource transfer request to the nodes in the blockchain network. The resource transfer request is used to instruct the nodes to determine at least one virtual resource indicated by the resource transfer request, perform hashing processing on the resource identifiers of at least one virtual resource indicated by the resource transfer request through a preset first hash function to obtain the second resource hash value of at least one virtual resource indicated by the resource transfer request, decrypt the resource digital signature using the user's public key to obtain the first resource hash value, and when the second resource hash value is consistent with the first resource hash value, execute the smart contract corresponding to the resource recipient in the node to transfer resources based on at least one virtual resource indicated by the resource transfer request.

[0085] Wherein, the second resource hash value is the hash value of at least one virtual resource indicated by the resource transfer request.

[0086] Specifically, the client can send a resource transfer request to the nodes in the blockchain network. The nodes in the blockchain network can receive the resource transfer request initiated by the user for the resource recipient based on the client, and determine the user's public key indicated by the resource transfer request, as well as determine the resource digital signature and at least one virtual resource indicated by the resource transfer request. The nodes in the blockchain network can decrypt the resource digital signature using the user's public key to obtain the first resource hash value, and perform hashing processing on the resource identifiers of at least one virtual resource indicated by the resource transfer request through a preset first hash function to obtain the second resource hash value. When the second resource hash value is consistent with the first resource hash value, the nodes in the blockchain network can execute the smart contract corresponding to the resource recipient in the node to transfer resources based on at least one virtual resource indicated by the resource transfer request.

[0087] It should be noted that at least one virtual resource to be transferred determined by the client, that is, at least one virtual resource carried in the resource transfer request, is the virtual resource that the client needs to transfer outwards. At least one virtual resource indicated by the resource transfer request is the virtual resource actually obtained by the nodes in the blockchain network. It can be understood that if the virtual resource is not tampered with during the transmission process, at least one virtual resource indicated by the resource transfer request is the same as at least one virtual resource to be transferred determined by the client. If the virtual resource is maliciously tampered with during the transmission process, at least one virtual resource indicated by the resource transfer request is different from at least one virtual resource to be transferred determined by the client.

[0088] In one embodiment, as Figure 4As shown, the blockchain network includes Node 1, Node 2, Node 3, …, Node n, where n is an integer. Smart contracts are set in Node 1, Node 2, Node 3, …, Node n. For example, the blockchain-based resource transfer method of this application can be applied to Node 1 in the blockchain network. It can be understood that Node 1 in the blockchain network can receive a resource transfer request sent by a client and perform subsequent resource processing.

[0089] In one embodiment, the node in the blockchain network can execute the smart contract corresponding to the resource recipient based on at least one virtual resource indicated by the resource transfer request to perform resource transfer, generate a resource transfer result, and store the resource transfer result in the blockchain network.

[0090] In one embodiment, as Figure 5 shown, it is a schematic diagram of the block structure provided in this embodiment. Each block includes the data stored in this block, that is, the resource transfer result, the hash value of the resource transfer result stored in this block, that is, the block hash of this block, and the hash value of the previous block, that is, the previous block hash. For example, for Block 2, Block 2 includes the data stored in this block, that is, the resource transfer result, the hash value of the resource transfer result stored in this block, that is, the hash value of Block 2, and the hash value of the previous block, that is, the hash value of Block 1. For Block 3, Block 3 includes the data stored in this block, that is, the resource transfer result, the hash value of the resource transfer result stored in this block, that is, the hash value of Block 3, and the hash value of the previous block, that is, the hash value of Block 2. It can be understood that each block is connected through the hash value to form a blockchain network. In addition, the block may also include information such as the timestamp when the block is generated.

[0091] In one embodiment, as Figure 6 shown, a smart contract is set in the node of the blockchain network. It can be understood that the smart contract is an automatically executed computer protocol based on blockchain technology. Specifically, when the second resource hash value is consistent with the first resource hash value, the node in the blockchain network can execute the smart contract corresponding to the resource recipient based on at least one virtual resource indicated by the resource transfer request to perform resource transfer, generate a resource transfer result, and store the resource transfer result in the blockchain network.

[0092] In the above blockchain-based resource transfer method, in response to a trigger event initiated by a user to transfer resources to a resource recipient, at least one virtual resource to be transferred is determined, and different virtual resources have different resource identifiers; through a preset first hash function, hash processing is performed based on the resource identifiers of at least one virtual resource to be transferred, and a first resource hash value of at least one virtual resource to be transferred is obtained; the user's private key and the user's public key matching the user's private key are determined; the first resource hash value is encrypted using the user's private key to obtain a resource digital signature; a resource transfer request for the resource recipient is generated, and the resource transfer request carries the resource digital signature and the user's public key; the resource transfer request is sent to a node in the blockchain network. The resource transfer request is used to instruct the node to determine at least one virtual resource indicated by the resource transfer request, perform hash processing based on the resource identifiers of at least one virtual resource indicated by the resource transfer request through a preset first hash function, obtain a second resource hash value of at least one virtual resource indicated by the resource transfer request, decrypt the resource digital signature using the user's public key to obtain the first resource hash value, and when the second resource hash value is consistent with the first resource hash value, execute the smart contract corresponding to the resource recipient in the node to transfer resources based on at least one virtual resource indicated by the resource transfer request. Compared with the traditional resource transfer method, in this application, before sending the resource transfer request, the client initiating the resource transfer request signs at least one virtual resource to be transferred using the user's private key, and sends the resource digital signature and at least one virtual resource indicated by the resource transfer request to the node of the blockchain network, so that after the node of the blockchain network passes the integrity verification of at least one received virtual resource based on the resource digital signature, the smart contract set in the node is executed to transfer resources based on at least one received virtual resource, avoiding malicious tampering of virtual resources during the transmission process, ensuring the security and reliability of virtual resources during the resource transfer process, and thus avoiding malicious transfer of resources.

[0093] As Figure 7 shown, in the traditional resource transfer method, the client directly sends a resource transfer request carrying virtual resources to a node in the blockchain network. When the node in the blockchain network receives the resource transfer request, it executes the smart contract set in the node to transfer resources based on the received virtual resources. However, in the current resource transfer method, as Figure 8 shown, once an attacker intercepts the virtual resources sent by the client and tampers with the intercepted virtual resources, and then sends the tampered virtual resources to the node in the blockchain network, when the node in the blockchain network receives the resource transfer request, it directly executes the smart contract set in the node to transfer resources based on the received tampered virtual resources, which cannot ensure the security and reliability of resources during the resource transfer process and cannot avoid malicious transfer of resources.

[0094] However, in this application, the client uses the user's private key to sign at least one virtual resource to be transferred, and sends the resource digital signature and at least one virtual resource indicated by the resource transfer request to the nodes of the blockchain network. After the nodes of the blockchain network pass the integrity verification of the received at least one virtual resource based on the resource digital signature, it indicates that the virtual resource sent by the client has not been tampered with. At this time, the smart contract set on the node is executed to transfer the resources based on the received at least one virtual resource. If the nodes of the blockchain network fail to pass the integrity verification of the received at least one virtual resource, it indicates that the virtual resource sent by the client has been maliciously tampered with. The nodes will not execute the smart contract nor transfer the resources, ensuring the security and reliability of the virtual resources during the resource transfer process, thereby avoiding the malicious transfer of resources.

[0095] In one embodiment, through a preset first hash function, hash processing is performed based on the resource identifiers of at least one virtual resource to be transferred, and a first resource hash value of at least one virtual resource to be transferred is obtained, including: respectively determining the resource face values of at least one virtual resource to be transferred; splicing the resource identifiers and resource face values of at least one virtual resource to be transferred to obtain resource feature data of at least one virtual resource to be transferred; through the preset first hash function, performing hash processing on the resource feature data of at least one virtual resource to be transferred to obtain the first resource hash value of at least one virtual resource to be transferred.

[0096] Among them, the resource face value is the face value of the virtual resource. For easy understanding, an example is given here. The virtual face value can include at least one of one yuan, five yuan, ten yuan, twenty yuan, fifty yuan, one hundred yuan, etc.

[0097] In one embodiment, the client can respectively determine the resource face values of at least one virtual resource to be transferred. The client can splice the resource identifiers of at least one virtual resource to be transferred to obtain identifier feature data of at least one virtual resource to be transferred. The client can splice the resource face values of at least one virtual resource to be transferred to obtain face value feature data of at least one virtual resource to be transferred. Furthermore, the client can splice the identifier feature data and face value feature data of at least one virtual resource to be transferred to obtain resource feature data of at least one virtual resource to be transferred, and through the preset first hash function, perform hash processing on the resource feature data of at least one virtual resource to be transferred to obtain the first resource hash value of at least one virtual resource to be transferred. In this way, the accuracy of the resource feature data of at least one virtual resource to be transferred can be improved, thereby further ensuring the security and reliability of the virtual resources during the resource transfer process and further avoiding the malicious transfer of resources.

[0098] In the above embodiments, by concatenating the resource identifiers and resource face values of at least one virtual resource to be transferred, resource feature data of at least one virtual resource to be transferred is obtained, and by using a first hash function, the resource feature data of at least one virtual resource to be transferred is hashed to obtain a first resource hash value, which can improve the accuracy of the first resource hash value, thereby further ensuring the security and reliability of virtual resources during the resource transfer process, and further avoiding malicious transfer of resources.

[0099] In one embodiment, concatenating the resource identifier and resource face value of each of at least one virtual resource to be transferred to obtain resource feature data of at least one virtual resource to be transferred includes: for each of at least one virtual resource to be transferred, concatenating the resource identifier and resource face value of the virtual resource targeted to obtain resource feature data of the virtual resource targeted; and concatenating the resource feature data of each of at least one virtual resource to be transferred to obtain resource feature data of at least one virtual resource to be transferred.

[0100] Specifically, for each of at least one virtual resource to be transferred, the client can concatenate the resource identifier and resource face value of the virtual resource targeted to obtain resource feature data of the virtual resource targeted. After each of at least one virtual resource to be transferred obtains corresponding resource feature data, the client can concatenate the resource feature data of each of at least one virtual resource to be transferred to obtain resource feature data of at least one virtual resource to be transferred.

[0101] In the above embodiments, for each of at least one virtual resource to be transferred, by concatenating the resource identifier and resource face value of the virtual resource targeted to obtain resource feature data of the virtual resource targeted, and concatenating the resource feature data of each of at least one virtual resource to be transferred to obtain resource feature data of at least one virtual resource to be transferred, the accuracy of the resource feature data of at least one virtual resource to be transferred can be improved, thereby further ensuring the security and reliability of virtual resources during the resource transfer process, and further avoiding malicious transfer of resources.

[0102] In one embodiment, in response to a trigger event of a user initiating a resource transfer to a resource recipient, determining at least one virtual resource to be transferred includes: in response to a trigger event of a user initiating a resource transfer to a resource recipient, selecting a target resource container from at least one preset resource container, where the resource container is used to store virtual resources; when the target resource container is a hardware resource container, determining at least one virtual resource to be transferred from the virtual resources stored in the hardware resource container, and the hardware resource container is disposed in a resource management chip of the client.

[0103] Specifically, a resource management chip is provided in the client. A hardware resource container for storing virtual resources is provided in the resource management chip, and the hardware resource container is implemented based on the hardware logic of the resource management chip. It can be understood that at least one type of resource container is preset in the client, such as a hardware resource container and a software resource container. The client can select a target resource container from the preset at least one type of resource container in response to a trigger event initiated by the user for resource transfer to a resource recipient. When the target resource container is a hardware resource container, at least one virtual resource to be transferred is determined from the virtual resources stored in the hardware resource container.

[0104] In the above embodiment, by responding to a trigger event initiated by the user for resource transfer to a resource recipient, a target resource container is selected from the preset at least one type of resource container. When the target resource container is a hardware resource container, at least one virtual resource to be transferred is determined from the virtual resources stored in the hardware resource container. Since the hardware resource container supports the offline function, even when the client is in an offline state, resource transfer can be achieved, thus ensuring the stability of resource transfer. At the same time, by storing the virtual resources in the hardware resource container of the resource management chip, since the hardware resource container is implemented based on the hardware logic of the resource management chip and is not easily attacked maliciously, the security of storing virtual resources can be improved.

[0105] In one embodiment, determining at least one virtual resource to be transferred in response to a trigger event initiated by the user for resource transfer to a resource recipient includes: selecting a target resource container from the preset at least one type of resource container in response to a trigger event initiated by the user for resource transfer to a resource recipient, where the resource container is used to store virtual resources; when the target resource container is a software resource container, at least one virtual resource to be transferred is determined from the virtual resources stored in the software resource container, and the software resource container is provided in a resource management application pre-installed in the client.

[0106] Specifically, a resource management application is pre-installed in the client, and a software resource container for storing virtual resources is provided in the resource management application. It can be understood that at least one type of resource container is preset in the client, such as a hardware resource container and a software resource container. The client can select a target resource container from the preset at least one type of resource container in response to a trigger event initiated by the user for resource transfer to a resource recipient. When the target resource container is a software resource container, the client can determine at least one virtual resource to be transferred from the virtual resources stored in the software resource container.

[0107] In the above embodiments, in response to a trigger event initiated by a user for resource transfer to a resource recipient, a target resource container is selected from at least one preset resource container. When the target resource container is a software resource container, at least one virtual resource to be transferred is determined from the virtual resources stored in the software resource container. Since the software resource container supports online functions, the client can implement resource transfer in an online state, which can improve the convenience of resource transfer and thus improve the resource transfer efficiency.

[0108] In one embodiment, determining a user's private key and a user public key that matches the user private key includes: determining a first prime number and a second prime number, where a first key parameter is divisible by the second prime number, and the first key parameter is determined based on the difference between the first prime number and a preset first integer; determining a second integer, where the remainder obtained by dividing a second key parameter by the first prime number is equal to the remainder obtained by dividing the first integer by the first prime number, and the second key parameter is determined based on the second integer and the second prime number; selecting a positive integer less than the second prime number as the user private key; determining a third key parameter according to the second integer and the user private key; and performing a modulo operation on the third key parameter and the first prime number to obtain a user public key that matches the user private key.

[0109] Specifically, the client can determine a first prime number and a second prime number, where the determined first prime number and second prime number should meet the following conditions: the first key parameter is divisible by the second prime number, and the first key parameter is determined based on the difference between the first prime number and a preset first integer. The client can determine a second integer, where the determined second integer should meet the following conditions: the remainder obtained by dividing the second key parameter by the first prime number is equal to the remainder obtained by dividing the first integer by the first prime number, and the second key parameter is determined based on the second integer and the second prime number. Furthermore, the client can randomly select a positive integer less than the second prime number as the user private key. The client can determine a third key parameter according to the second integer and the user private key, perform a modulo operation on the third key parameter with the first prime number, and use the obtained modulus as the user public key that matches the user private key.

[0110] In one embodiment, the client can select a first prime number p and a second prime number q such that p - 1 is divisible by q. It can be understood that the first integer is 1. The client can select an integer g that satisfies , which means that the second key parameter the remainder obtained by dividing by the first prime number p is equal to the remainder obtained by dividing the first integer 1 by the first prime number p, and mod is the modulo operation. The client can randomly select a positive integer x less than the second prime number q as the user private key. The client can determine the user public key through the formula , where is the third key parameter, and y is the user's public key.

[0111] In the above embodiments, by determining the first prime number, the second prime number, and the second integer, and selecting a positive integer from the positive integers less than the second prime number as the user's private key. Then, according to the second integer and the user's private key, the third key parameter is determined, and the third key parameter is subjected to a modulo operation with the first prime number to obtain the user's public key that matches the user's private key, which improves the security of the user's private key and the user's public key. Thus, the security and reliability of the virtual resources during the resource transfer process can be further guaranteed, and the malicious transfer of resources can be further avoided.

[0112] In one embodiment, encrypting the first resource hash value with the user's private key to obtain a resource digital signature includes: selecting a value as a random parameter from the values greater than the first integer and less than the second prime number; determining a first signature parameter according to the random parameter, the second integer, the first prime number, and the second prime number; determining a second signature parameter according to the first signature parameter, the random parameter, the first resource hash value, the user's private key, and the second prime number; and determining the resource digital signature according to the first signature parameter and the second signature parameter.

[0113] Specifically, the client can randomly select a value from the values greater than the first integer and less than the second prime number as the random parameter. The client can calculate the first signature parameter according to the random parameter, the second integer, the first prime number, and the second prime number, and calculate the second signature parameter according to the first signature parameter, the random parameter, the first resource hash value, the user's private key, and the second prime number. Then, the client can determine the resource digital signature according to the first signature parameter and the second signature parameter.

[0114] In one embodiment, the client can perform at least one of the operations of addition, subtraction, multiplication, and division on the random parameter, the second integer, the first prime number, and the second prime number to obtain the first signature parameter.

[0115] In one embodiment, the client can perform at least one of the operations of addition, subtraction, multiplication, and division on the first signature parameter, the random parameter, the first resource hash value, the user's private key, and the second prime number to obtain the second signature parameter.

[0116] In the above embodiments, by randomly selecting a value from the values greater than the first integer and less than the second prime number as the random parameter, determining the first signature parameter according to the random parameter, the second integer, the first prime number, and the second prime number, and determining the second signature parameter according to the first signature parameter, the random parameter, the first resource hash value, the user's private key, and the second prime number. Then, determining the resource digital signature according to the first signature parameter and the second signature parameter can improve the security of the resource digital signature. Thus, the security and reliability of the virtual resources during the resource transfer process can be further guaranteed, and the malicious transfer of resources can be further avoided.

[0117] In one embodiment, determining a first signature parameter according to a random parameter, a second integer, a first prime number, and a second prime number includes: determining a first signature intermediate state parameter according to the random parameter and the second integer; performing a modulo operation on the first signature intermediate state parameter and the first prime number to obtain a modulo parameter; performing a modulo operation on the modulo parameter and the second prime number to obtain the first signature parameter.

[0118] Specifically, the client can calculate the first signature intermediate state parameter according to the random parameter and the second integer, perform a modulo operation on the first signature intermediate state parameter with the first prime number, and use the obtained modulo as the modulo parameter. Further, the client can perform a modulo operation on the modulo parameter with the second prime number, and use the obtained modulo as the first signature parameter.

[0119] In the above embodiment, by determining the first signature intermediate state parameter according to the random parameter and the second integer, performing a modulo operation on the first signature intermediate state parameter and the first prime number to obtain a modulo parameter, and then performing a modulo operation on the modulo parameter and the second prime number to obtain the first signature parameter, the accuracy of the first signature parameter can be improved, thereby further ensuring the security and reliability of virtual resources during the resource transfer process and further avoiding malicious transfer of resources.

[0120] In one embodiment, determining a second signature parameter according to the first signature parameter, the random parameter, the first resource hash value, the user private key, and the second prime number includes: determining a second signature intermediate state parameter according to the product of the user private key and the first signature parameter; determining a third signature intermediate state parameter according to the sum of the second signature intermediate state parameter and the first resource hash value; determining a fourth signature intermediate state parameter according to the third signature intermediate state parameter and the random parameter; performing a modulo operation on the fourth signature intermediate state parameter and the second prime number to obtain the second signature parameter.

[0121] Specifically, the client can calculate the product of the user private key and the first signature parameter, and calculate the second signature intermediate state parameter according to the product of the user private key and the first signature parameter. The client can calculate the sum of the second signature intermediate state parameter and the first resource hash value, and calculate the third signature intermediate state parameter according to the sum of the second signature intermediate state parameter and the first resource hash value. The client can calculate the fourth signature intermediate state parameter according to the third signature intermediate state parameter and the random parameter. Further, the client can perform a modulo operation on the fourth signature intermediate state parameter with the second prime number, and use the obtained modulo as the second signature parameter.

[0122] In one embodiment, the client can randomly select a value as the random parameter k from values greater than the first integer 1 and less than the second prime number q, and calculate the first signature parameter through the formula , where is the first signature intermediate state parameter. is the modulus parameter, r is the first signature parameter. And through the formula , calculate the second signature parameter. Among them, is the second signature intermediate state parameter, H(m) is the first resource hash value, is the third signature intermediate state parameter, is the fourth signature intermediate state parameter, s is the second signature parameter. Furthermore, the client can determine the resource digital signature (r, s) according to the first signature parameter and the second signature parameter.

[0123] In the above embodiment, by multiplying the user private key by the first signature parameter, the second signature intermediate state parameter is determined. According to the sum of the second signature intermediate state parameter and the first resource hash value, the third signature intermediate state parameter is determined. And according to the third signature intermediate state parameter and the random parameter, the fourth signature intermediate state parameter is determined. Furthermore, by performing a modulo operation on the fourth signature intermediate state parameter and the second prime number, the second signature parameter is obtained, which can improve the accuracy of the second signature parameter, thereby further ensuring the security and reliability of the virtual resources during the resource transfer process, and further avoiding the malicious transfer of resources.

[0124] In one embodiment, as Figure 9 shown, a resource transfer method based on a blockchain is provided, which is applied to a node of a blockchain network. A smart contract corresponding to the resource recipient is set in the node. It can be understood that the node can be a terminal or a server, and includes the following steps:

[0125] Step 902, receive a resource transfer request from the user based on the client for the resource recipient.

[0126] Specifically, the user can initiate a trigger event for resource transfer to the resource recipient based on the client. The client can respond to the trigger event initiated by the user for resource transfer to the resource recipient, and determine at least one virtual resource to be transferred from the resource container for storing virtual resources. The client can perform a hash process on the resource identifiers of at least one virtual resource to be transferred through a preset first hash function, and obtain the first resource hash value of at least one virtual resource to be transferred. The client can determine the user private key of the user and the user public key matching the user private key, and encrypt the first resource hash value with the user private key to obtain the resource digital signature. The client can generate a resource transfer request for the resource recipient based on the resource digital signature, the user public key, and at least one virtual resource to be transferred. Among them, the resource transfer request carries the resource digital signature, the user public key, and at least one virtual resource to be transferred. The client can send the resource transfer request to the node in the blockchain network. The node in the blockchain network can receive the resource transfer request from the user based on the client for the resource recipient.

[0127] Step 904: Determine the user public key of the user indicated by the resource transfer request, and determine the resource digital signature and at least one virtual resource indicated by the resource transfer request. The resource digital signature is obtained by the client encrypting the first resource hash value using the user private key that matches the user public key. The first resource hash value is obtained by the client, after determining at least one virtual resource to be transferred, through a preset first hash function, based on the resource identifiers of at least one virtual resource to be transferred. Different virtual resources have different resource identifiers.

[0128] Step 906: Use the user public key to decrypt the resource digital signature to obtain the first resource hash value.

[0129] Step 908: Through a preset first hash function, perform a hash process based on the resource identifiers of at least one virtual resource indicated by the resource transfer request to obtain a second resource hash value.

[0130] Step 910: When the second resource hash value is consistent with the first resource hash value, execute the smart contract to perform resource transfer based on at least one virtual resource indicated by the resource transfer request.

[0131] In the above embodiments, a resource transfer request initiated by a user based on a client for a resource recipient is received; the user public key of the user indicated by the resource transfer request is determined, and the resource digital signature and at least one virtual resource indicated by the resource transfer request are determined. The resource digital signature is obtained by the client encrypting a first resource hash value using a user private key that matches the user public key. The first resource hash value is obtained by the client, after determining at least one virtual resource to be transferred, through a preset first hash function, based on the resource identifiers of the at least one virtual resource to be transferred. Different virtual resources have different resource identifiers; the resource digital signature is decrypted using the user public key to obtain the first resource hash value; a second resource hash value is obtained by performing a hash process on the resource identifiers of the at least one virtual resource indicated by the resource transfer request through a preset first hash function; when the second resource hash value is consistent with the first resource hash value, the smart contract set in the nodes of the blockchain network is executed to perform resource transfer based on the at least one virtual resource indicated by the resource transfer request. Compared with the traditional resource transfer method, in this application, before sending the resource transfer request, the client initiating the resource transfer request signs at least one virtual resource to be transferred using the user private key, and sends the resource digital signature and the at least one virtual resource indicated by the resource transfer request to the nodes of the blockchain network, so that after the nodes of the blockchain network pass the integrity verification of the received at least one virtual resource based on the resource digital signature, the smart contract set in the nodes is executed to perform resource transfer based on the received at least one virtual resource, avoiding malicious tampering of the virtual resources during the transmission process, ensuring the security and reliability of the virtual resources during the resource transfer process, and thus avoiding malicious transfer of resources.

[0132] In one embodiment, determining the user public key of the user indicated by the resource transfer request includes: determining the digital certificate indicated by the resource transfer request. The digital certificate is generated by the certificate registration end based on the user public key after obtaining the user public key of the user from the client. The digital certificate contains the user public key; the user public key is extracted from the digital certificate; the method further includes: when the digital certificate passes the legality verification, the step of decrypting the resource digital signature using the user public key to obtain the first resource hash value is executed.

[0133] Specifically, the client can send a certificate registration request to the certificate registration end, and the user's public key is carried in the certificate registration request. The certificate registration end can receive the certificate registration request and generate a digital certificate containing the user's public key based on the user's public key carried in the certificate registration request. The certificate registration end can send the digital certificate to the client, and the client can receive the digital certificate and send the digital certificate to the nodes in the blockchain network based on the resource transfer request. It can be understood that the digital certificate can be carried in the resource transfer request. The nodes in the blockchain network can extract the user's public key from the digital certificate. The nodes in the blockchain network can perform a legality check on the digital certificate. When the digital certificate passes the legality check, the nodes in the blockchain network can use the user's public key to decrypt the resource digital signature to obtain the first resource hash value, and through a preset first hash function, perform a hash process on the resource identifier of each of at least one virtual resource indicated by the resource transfer request to obtain the second resource hash value. When the second resource hash value is consistent with the first resource hash value, the nodes in the blockchain network can execute the smart contract to transfer resources based on at least one virtual resource indicated by the resource transfer request.

[0134] In the above embodiment, by determining the digital certificate indicated by the resource transfer request and extracting the user's public key from the digital certificate. When the digital certificate passes the legality check and then performs the step of using the user's public key to decrypt the resource digital signature to obtain the first resource hash value, the security and reliability of the virtual resources in the resource transfer process can be further guaranteed, thus avoiding malicious transfer of resources.

[0135] In one embodiment, the digital certificate further includes a certificate digital signature and the registration public key of the certificate registration end. The certificate digital signature is obtained by the certificate registration end encrypting the first certificate hash value using the registration private key that matches the registration public key. The first certificate hash value is obtained by the certificate registration end performing a hash process on the digital certificate through a preset second hash function. The method further includes: extracting the certificate digital signature and the registration public key from the digital certificate; using the registration public key to decrypt the certificate digital signature to obtain the first certificate hash value; performing a hash process on the digital certificate indicated by the resource transfer request through the preset second hash function to obtain the second certificate hash value; when the second certificate hash value is consistent with the first certificate hash value, it is determined that the digital certificate passes the legality check.

[0136] Among them, the certificate digital signature is a digital signature obtained by encrypting the first certificate hash value of the digital certificate using the registration private key.

[0137] Specifically, the client can send a certificate registration request to the certificate registration end, and the user's public key is carried in the certificate registration request. After receiving the certificate registration request, the certificate registration end can hash the digital certificate through a preset second hash function to obtain a first certificate hash value, and use the registration private key of the certificate registration end to encrypt the first certificate hash value to obtain a certificate digital signature. The certificate registration end can generate a digital certificate containing the user's public key, the certificate digital signature, and the registration public key based on the user's public key, the certificate digital signature, and the registration public key. The certificate registration end can send the digital certificate to the client, and the client can receive the digital certificate and send the digital certificate to the nodes in the blockchain network based on the resource transfer request. It can be understood that the digital certificate can be carried in the resource transfer request. The nodes in the blockchain network can extract the user's public key, the certificate digital signature, and the registration public key from the digital certificate, and use the registration public key to decrypt the certificate digital signature to obtain the first certificate hash value. The nodes in the blockchain network can hash the digital certificate indicated by the resource transfer request through a preset second hash function to obtain a second certificate hash value. When the second certificate hash value is consistent with the first certificate hash value, the nodes in the blockchain network can determine that the digital certificate passes the legality verification. When the digital certificate passes the legality verification, the nodes in the blockchain network can use the user's public key to decrypt the resource digital signature to obtain a first resource hash value, and hash the resource identifier of each of at least one virtual resource indicated by the resource transfer request through a preset first hash function to obtain a second resource hash value. When the second resource hash value is consistent with the first resource hash value, the nodes in the blockchain network can execute the smart contract to transfer resources based on at least one virtual resource indicated by the resource transfer request.

[0138] In the above embodiment, by extracting the certificate digital signature and the registration public key from the digital certificate, using the registration public key to decrypt the certificate digital signature to obtain the first certificate hash value, and hashing the digital certificate indicated by the resource transfer request through a preset second hash function to obtain the second certificate hash value. When the second certificate hash value is consistent with the first certificate hash value, it is determined that the digital certificate passes the legality verification, which can improve the accuracy of the legality verification of the digital certificate, thereby further ensuring the security and reliability of the virtual resources in the resource transfer process, and avoiding the malicious transfer of resources.

[0139] In one embodiment, by means of a preset first hash function, hash processing is performed on the resource identifiers of at least one virtual resource indicated by the resource transfer request to obtain a second resource hash value, including: respectively determining the resource face values of at least one virtual resource indicated by the resource transfer request; splicing the resource identifiers and resource face values of at least one virtual resource indicated by the resource transfer request to obtain the resource characteristic data of at least one virtual resource indicated by the resource transfer request; and by means of the preset first hash function, performing hash processing on the resource characteristic data of at least one virtual resource indicated by the resource transfer request to obtain the second resource hash value of at least one virtual resource indicated by the resource transfer request.

[0140] In one embodiment, the client can respectively determine the resource face values of at least one virtual resource indicated by the resource transfer request. The client can splice the resource identifiers of at least one virtual resource indicated by the resource transfer request to obtain the identifier characteristic data of at least one virtual resource indicated by the resource transfer request. The client can splice the resource face values of at least one virtual resource indicated by the resource transfer request to obtain the face value characteristic data of at least one virtual resource indicated by the resource transfer request. Furthermore, the client can splice the identifier characteristic data and the face value characteristic data of at least one virtual resource indicated by the resource transfer request to obtain the resource characteristic data of at least one virtual resource indicated by the resource transfer request, and by means of the preset first hash function, perform hash processing on the resource characteristic data of at least one virtual resource indicated by the resource transfer request to obtain the first resource hash value of at least one virtual resource indicated by the resource transfer request. In this way, the accuracy of the resource characteristic data of at least one virtual resource indicated by the resource transfer request can be improved, thereby further ensuring the security and reliability of the virtual resources during the resource transfer process, and further avoiding the malicious transfer of resources.

[0141] In the above embodiment, by splicing the resource identifiers and resource face values of at least one virtual resource indicated by the resource transfer request to obtain the resource characteristic data of at least one virtual resource indicated by the resource transfer request, and by means of the preset first hash function, performing hash processing on the resource characteristic data of at least one virtual resource indicated by the resource transfer request to obtain the second resource hash value of at least one virtual resource indicated by the resource transfer request, the accuracy of the second resource hash value can be improved, thereby further ensuring the security and reliability of the virtual resources during the resource transfer process, and thus avoiding the malicious transfer of resources.

[0142] In one embodiment, the resource identification and resource face value of each of at least one virtual resource indicated by the resource transfer request are concatenated to obtain the resource characteristic data of at least one virtual resource indicated by the resource transfer request, including: for each of at least one virtual resource indicated by the resource transfer request, the resource identification and resource face value of the targeted virtual resource are concatenated to obtain the resource characteristic data of the targeted virtual resource; the resource characteristic data of each of at least one virtual resource indicated by the resource transfer request are concatenated to obtain the resource characteristic data of at least one virtual resource indicated by the resource transfer request.

[0143] Specifically, for each of at least one virtual resource indicated by the resource transfer request, the client can concatenate the resource identification and resource face value of the targeted virtual resource to obtain the resource characteristic data of the targeted virtual resource. After each of at least one virtual resource indicated by the resource transfer request obtains the corresponding resource characteristic data, the client can concatenate the resource characteristic data of each of at least one virtual resource indicated by the resource transfer request to obtain the resource characteristic data of at least one virtual resource indicated by the resource transfer request.

[0144] In the above embodiment, for each of at least one virtual resource indicated by the resource transfer request, the resource identification and resource face value of the targeted virtual resource are concatenated to obtain the resource characteristic data of the targeted virtual resource, and the resource characteristic data of each of at least one virtual resource indicated by the resource transfer request are concatenated to obtain the resource characteristic data of at least one virtual resource indicated by the resource transfer request, which can improve the accuracy of the resource characteristic data of at least one virtual resource indicated by the resource transfer request, thereby further ensuring the security and reliability of the virtual resource during the resource transfer process, and thus avoiding the malicious transfer of resources.

[0145] As Figure 10 shown, in one embodiment, a blockchain-based resource transfer method is provided, and the method specifically includes the following steps:

[0146] Step 1002, the client can respond to a trigger event initiated by the user for resource transfer to the resource recipient, and determine at least one virtual resource to be transferred, where different virtual resources have different resource identifications.

[0147] Step 1004, the client can respectively determine the resource face value of each of at least one virtual resource to be transferred.

[0148] Step 1006, for each of at least one virtual resource to be transferred, the resource identification and resource face value of the targeted virtual resource are concatenated to obtain the resource characteristic data of the targeted virtual resource.

[0149] Step 1008: Concatenate the resource characteristic data of at least one virtual resource to be transferred to obtain the resource characteristic data of at least one virtual resource to be transferred.

[0150] Step 1010: The client can perform a hashing process on the resource characteristic data of at least one virtual resource to be transferred through a preset first hash function to obtain the first resource hash value of at least one virtual resource to be transferred.

[0151] Step 1012: The client can determine the user's private key and the user's public key that matches the user's private key, and use the user's private key to encrypt the first resource hash value to obtain a resource digital signature.

[0152] Step 1014: The client can generate a resource transfer request for the resource recipient and send the resource transfer request to a node in the blockchain network. The resource transfer request carries the resource digital signature and the user's public key.

[0153] Step 1016: The node can receive the resource transfer request for the resource recipient initiated by the user based on the client, determine the digital certificate indicated by the resource transfer request, and extract the user's public key from the digital certificate.

[0154] Among them, the digital certificate is generated by the certificate registration end based on the user's public key after obtaining the user's public key from the client. The digital certificate includes the user's public key, the certificate digital signature, and the registration public key of the certificate registration end. The certificate digital signature is obtained by the certificate registration end using the registration private key that matches the registration public key to encrypt the first certificate hash value. The first certificate hash value is obtained by the certificate registration end through a preset second hash function to perform a hashing process on the digital certificate.

[0155] Step 1018: The node can determine the resource digital signature and at least one virtual resource indicated by the resource transfer request, extract the certificate digital signature and the registration public key from the digital certificate, and the node can use the registration public key to decrypt the certificate digital signature to obtain the first certificate hash value.

[0156] Step 1020: The node can perform a hashing process on the digital certificate indicated by the resource transfer request through a preset second hash function to obtain a second certificate hash value.

[0157] Step 1022: When the second certificate hash value is consistent with the first certificate hash value, the node can determine that the digital certificate passes the legality verification.

[0158] Step 1024: When the digital certificate passes the legality verification, the node can use the user's public key to decrypt the resource digital signature to obtain the first resource hash value.

[0159] Step 1026, the node can respectively determine the resource face value of each of at least one virtual resource indicated by the resource transfer request.

[0160] Step 1028, for each of at least one virtual resource indicated by the resource transfer request, the node can splice the resource identifier and the resource face value of the targeted virtual resource to obtain the resource feature data of the targeted virtual resource.

[0161] Step 1030, the node can splice the resource feature data of each of at least one virtual resource indicated by the resource transfer request to obtain the resource feature data of at least one virtual resource indicated by the resource transfer request.

[0162] Step 1032, the node can perform a hashing process on the resource feature data of at least one virtual resource indicated by the resource transfer request through a preset first hash function to obtain the second resource hash value of at least one virtual resource indicated by the resource transfer request.

[0163] Step 1034, when the second resource hash value is consistent with the first resource hash value, the node can execute the smart contract corresponding to the resource recipient set in the node to perform resource transfer based on at least one virtual resource indicated by the resource transfer request.

[0164] This application also provides an application scenario, which applies the above blockchain-based resource transfer method. Specifically, the blockchain-based resource transfer method can be applied to the scenario of virtual resource payment. It can be understood that the client is the resource payment side, and the nodes in the blockchain network are the resource receiving sides. The resource transfer request is a resource payment request. Specifically, the resource payment side can, in response to a trigger event initiated by the user for resource payment to the resource recipient, determine at least one virtual resource to be paid, and different virtual resources have different resource identifiers. The resource payment side can respectively determine the resource face value of each of at least one virtual resource to be paid. For each of at least one virtual resource to be paid, the resource identifier and the resource face value of the targeted virtual resource are spliced to obtain the resource feature data of the targeted virtual resource. The resource feature data of each of at least one virtual resource to be paid is spliced to obtain the resource feature data of at least one virtual resource to be paid. The resource payment side can perform a hashing process on the resource feature data of at least one virtual resource to be paid through a preset first hash function to obtain the first resource hash value of at least one virtual resource to be paid. The resource payment side can determine the user's private key and the user's public key matching the user's private key, and encrypt the first resource hash value with the user's private key to obtain a resource digital signature. The resource payment side can generate a resource payment request for the resource recipient and send the resource payment request to the resource receiving side in the blockchain network, and the resource payment request carries the resource digital signature and the user's public key.

[0165] The resource receiver can receive a resource payment request initiated by a user based on the resource payer for the resource recipient, determine the digital certificate indicated by the resource payment request, and extract the user's public key from the digital certificate. Among them, the digital certificate is generated by the certificate registration end based on the user's public key after obtaining the user's public key from the resource payer. The digital certificate includes the user's public key, the certificate digital signature, and the registration public key of the certificate registration end. The certificate digital signature is obtained by the certificate registration end encrypting the first certificate hash value using the registration private key that matches the registration public key. The first certificate hash value is obtained by the certificate registration end hashing the digital certificate through a preset second hash function. The resource receiver can determine the resource digital signature and at least one virtual resource indicated by the resource payment request, extract the certificate digital signature and the registration public key from the digital certificate, and the resource receiver can use the registration public key to decrypt the certificate digital signature to obtain the first certificate hash value. The resource receiver can hash the digital certificate indicated by the resource payment request through a preset second hash function to obtain a second certificate hash value. When the second certificate hash value is consistent with the first certificate hash value, the resource receiver can determine that the digital certificate passes the legality verification.

[0166] When the digital certificate passes the legality verification, the resource receiver can use the user's public key to decrypt the resource digital signature to obtain the first resource hash value. The resource receiver can respectively determine the resource face values of at least one virtual resource indicated by the resource payment request. For each virtual resource among the at least one virtual resource indicated by the resource payment request, the resource receiver can splice the resource identifier and the resource face value of the targeted virtual resource to obtain the resource feature data of the targeted virtual resource. The resource receiver can splice the resource feature data of at least one virtual resource indicated by the resource payment request to obtain the resource feature data of at least one virtual resource indicated by the resource payment request. The resource receiver can hash the resource feature data of at least one virtual resource indicated by the resource payment request through a preset first hash function to obtain the second resource hash value of at least one virtual resource indicated by the resource payment request. When the second resource hash value is consistent with the first resource hash value, the resource receiver can execute the smart contract corresponding to the resource recipient set in the resource receiver to perform resource payment based on at least one virtual resource indicated by the resource payment request.

[0167] It can be understood that before the resource payment end that initiates a resource payment request sends the resource payment request, it signs at least one virtual resource to be paid using the user's private key, and sends the resource digital signature and at least one virtual resource indicated by the resource payment request to the resource receiving end of the blockchain network. After the resource receiving end of the blockchain network passes the integrity verification of the received at least one virtual resource based on the resource digital signature, it then executes the smart contract set at the resource receiving end to perform resource payment based on the received at least one virtual resource, avoiding malicious tampering of the virtual resource during the transmission process, ensuring the security and reliability of the virtual resource during the resource payment process, and thus avoiding malicious payment of resources.

[0168] The present application also provides another application scenario, which applies the above blockchain-based resource transfer method. Specifically, the blockchain-based resource transfer method can be applied to the scenario of virtual resource donation. The client is the resource donation end, and the node of the blockchain network is the resource receiving end. The resource transfer request is a resource donation request. It can be understood that before the resource donation end that initiates a resource donation request sends the resource donation request, it signs at least one virtual resource to be donated using the user's private key, and sends the resource digital signature and at least one virtual resource indicated by the resource donation request to the resource receiving end of the blockchain network. After the resource receiving end of the blockchain network passes the integrity verification of the received at least one virtual resource based on the resource digital signature, it then executes the smart contract set at the resource receiving end to perform resource donation based on the received at least one virtual resource, avoiding malicious tampering of the virtual resource during the transmission process, ensuring the security and reliability of the virtual resource during the resource donation process, and thus avoiding malicious donation of resources.

[0169] It should be understood that although the steps in the flowcharts of the above embodiments are shown in sequence, these steps are not necessarily executed in sequence. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above embodiments may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.

[0170] In one embodiment, as Figure 11 shown, a blockchain-based resource transfer device 1100 is provided. The device specifically includes:

[0171] The first determination module 1102 is configured to determine at least one virtual resource to be transferred in response to a trigger event initiated by a user for resource transfer to a resource recipient, where different virtual resources have different resource identifiers;

[0172] The first hash processing module 1104 is configured to perform hash processing on the resource identifiers of at least one virtual resource to be transferred based on a preset first hash function to obtain a first resource hash value of the at least one virtual resource to be transferred;

[0173] The first determination module 1102 is further configured to determine the user's private key and the user's public key that matches the user's private key;

[0174] The encryption module 1106 is configured to encrypt the first resource hash value using the user's private key to obtain a resource digital signature;

[0175] The generation module 1108 is configured to generate a resource transfer request for the resource recipient, where the resource transfer request carries the resource digital signature and the user's public key;

[0176] The sending module 1110 is configured to send a resource transfer request to a node in the blockchain network. The resource transfer request is used to instruct the node to determine at least one virtual resource indicated by the resource transfer request, perform hash processing on the resource identifiers of at least one virtual resource indicated by the resource transfer request based on a preset first hash function to obtain a second resource hash value of at least one virtual resource indicated by the resource transfer request, decrypt the resource digital signature using the user's public key to obtain the first resource hash value, and when the second resource hash value is consistent with the first resource hash value, execute the smart contract corresponding to the resource recipient in the node to perform resource transfer based on at least one virtual resource indicated by the resource transfer request.

[0177] In one embodiment, the first hash processing module 1104 is further configured to respectively determine the resource face values of at least one virtual resource to be transferred; splice the resource identifiers and resource face values of at least one virtual resource to be transferred to obtain resource feature data of at least one virtual resource to be transferred; perform hash processing on the resource feature data of at least one virtual resource to be transferred based on a preset first hash function to obtain a first resource hash value of at least one virtual resource to be transferred.

[0178] In one embodiment, the first hash processing module 1104 is further configured to, for each virtual resource among at least one virtual resource to be transferred, splice the resource identifier and resource face value of the targeted virtual resource to obtain resource feature data of the targeted virtual resource; splice the resource feature data of at least one virtual resource to be transferred to obtain resource feature data of at least one virtual resource to be transferred.

[0179] In one embodiment, when applied to a client, the first determination module 1102 is further configured to, in response to a trigger event initiated by a user for resource transfer to a resource recipient, select a target resource container from at least one preset resource container, where the resource container is used to store virtual resources; when the target resource container is a hardware resource container, determine at least one virtual resource to be transferred from the virtual resources stored in the hardware resource container, and the hardware resource container is disposed in a resource management chip of the client.

[0180] In one embodiment, when applied to a client, the first determination module 1102 is further configured to, in response to a trigger event initiated by a user for resource transfer to a resource recipient, select a target resource container from at least one preset resource container, where the resource container is used to store virtual resources; when the target resource container is a software resource container, determine at least one virtual resource to be transferred from the virtual resources stored in the software resource container, and the software resource container is disposed in a resource management application pre-installed in the client.

[0181] In one embodiment, the first determination module 1102 is further configured to determine a first prime number and a second prime number, where a first key parameter is divisible by the second prime number, and the first key parameter is determined based on the difference between the first prime number and a preset first integer; determine a second integer, where the remainder obtained by dividing a second key parameter by the first prime number is equal to the remainder obtained by dividing the first integer by the first prime number, and the second key parameter is determined based on the second integer and the second prime number; select a positive integer less than the second prime number as a user private key; determine a third key parameter according to the second integer and the user private key; perform a modulo operation on the third key parameter and the first prime number to obtain a user public key that matches the user private key.

[0182] In one embodiment, the encryption module 1106 is further configured to select a numerical value as a random parameter from the numerical values greater than the first integer and less than the second prime number; determine a first signature parameter according to the random parameter, the second integer, the first prime number, and the second prime number; determine a second signature parameter according to the first signature parameter, the random parameter, the first resource hash value, the user private key, and the second prime number; determine a resource digital signature according to the first signature parameter and the second signature parameter.

[0183] In one embodiment, the encryption module 1106 is further configured to determine a first signature intermediate parameter according to the random parameter and the second integer; perform a modulo operation on the first signature intermediate parameter and the first prime number to obtain a modulo parameter; perform a modulo operation on the modulo parameter and the second prime number to obtain the first signature parameter.

[0184] In one embodiment, the encryption module 1106 is further configured to determine a second signature intermediate state parameter according to the product of the user private key and the first signature parameter; determine a third signature intermediate state parameter according to the sum of the second signature intermediate state parameter and the first resource hash value; determine a fourth signature intermediate state parameter according to the third signature intermediate state parameter and the random parameter; and perform a modulo operation on the fourth signature intermediate state parameter and the second prime number to obtain the second signature parameter.

[0185] The above blockchain-based resource transfer device, in response to a trigger event initiated by a user for resource transfer to a resource recipient, determines at least one virtual resource to be transferred, and different virtual resources have different resource identifiers; performs a hash process on the resource identifiers of the at least one virtual resource to be transferred based on a preset first hash function to obtain a first resource hash value of the at least one virtual resource to be transferred; determines the user private key of the user and the user public key matching the user private key; encrypts the first resource hash value using the user private key to obtain a resource digital signature; generates a resource transfer request for the resource recipient, where the resource transfer request carries the resource digital signature and the user public key; sends the resource transfer request to a node in the blockchain network, and the resource transfer request is used to instruct the node to determine the at least one virtual resource indicated by the resource transfer request, perform a hash process on the resource identifiers of the at least one virtual resource indicated by the resource transfer request based on the preset first hash function to obtain a second resource hash value of the at least one virtual resource indicated by the resource transfer request, decrypt the resource digital signature using the user public key to obtain the first resource hash value, and when the second resource hash value is consistent with the first resource hash value, execute the smart contract corresponding to the resource recipient in the node to perform resource transfer based on the at least one virtual resource indicated by the resource transfer request. Compared with the traditional resource transfer method, in this application, before sending the resource transfer request, the client initiating the resource transfer request signs the at least one virtual resource to be transferred using the user private key, and sends the resource digital signature and the at least one virtual resource indicated by the resource transfer request to the node of the blockchain network, so that after the node of the blockchain network passes the integrity verification of the received at least one virtual resource based on the resource digital signature, it then executes the smart contract set in the node to perform resource transfer based on the received at least one virtual resource, avoiding malicious tampering of the virtual resource during the transmission process, ensuring the security and reliability of the virtual resource during the resource transfer process, and thus avoiding malicious transfer of resources.

[0186] In one embodiment, as Figure 12 shown, a blockchain-based resource transfer device 1200 is provided, which is applied to a node of a blockchain network, and a smart contract corresponding to a resource recipient is set in the node. The device specifically includes:

[0187] A receiving module 1202, configured to receive a resource transfer request initiated by a user based on a client for a resource recipient;

[0188] A second determination module 1204, configured to determine a user public key of the user indicated by the resource transfer request, and determine a resource digital signature and at least one virtual resource indicated by the resource transfer request. The resource digital signature is obtained by the client encrypting a first resource hash value using a user private key that matches the user public key. The first resource hash value is obtained by the client, after determining at least one virtual resource to be transferred, performing a hashing process on the resource identifiers of the at least one virtual resource to be transferred through a preset first hashing function. Different virtual resources have different resource identifiers;

[0189] A decryption module 1206, configured to decrypt the resource digital signature using the user public key to obtain the first resource hash value;

[0190] A second hashing process module 1208, configured to perform a hashing process on the resource identifiers of the at least one virtual resource indicated by the resource transfer request through a preset first hashing function to obtain a second resource hash value;

[0191] A transfer module 1210, configured to, when the second resource hash value is consistent with the first resource hash value, execute a smart contract to perform resource transfer based on the at least one virtual resource indicated by the resource transfer request.

[0192] In one embodiment, the second determination module 1204 is further configured to determine a digital certificate indicated by the resource transfer request. The digital certificate is generated by a certificate registration end based on the user public key after obtaining the user public key of the user from the client. The digital certificate contains the user public key; extract the user public key from the digital certificate; when the digital certificate passes a legality verification, notify the decryption module 1206 to execute the step of decrypting the resource digital signature using the user public key to obtain the first resource hash value.

[0193] In one embodiment, the digital certificate further contains a certificate digital signature and a registration public key of the certificate registration end. The certificate digital signature is obtained by the certificate registration end encrypting a first certificate hash value using a registration private key that matches the registration public key. The first certificate hash value is obtained by the certificate registration end performing a hashing process on the digital certificate through a preset second hashing function. As Figure 13 shown, the resource transfer device 1200 based on a blockchain further includes:

[0194] The verification module 1212 is configured to extract the certificate digital signature and the registered public key from the digital certificate; use the registered public key to decrypt the certificate digital signature to obtain the first certificate hash value; perform a hash process on the digital certificate indicated by the resource transfer request through a preset second hash function to obtain a second certificate hash value; when the second certificate hash value is consistent with the first certificate hash value, it is determined that the digital certificate passes the legality verification.

[0195] In one embodiment, the second hash processing module 1208 is further configured to respectively determine the resource face values of at least one virtual resource indicated by the resource transfer request; splice the resource identifiers and resource face values of at least one virtual resource indicated by the resource transfer request to obtain the resource feature data of at least one virtual resource indicated by the resource transfer request; perform a hash process on the resource feature data of at least one virtual resource indicated by the resource transfer request through a preset first hash function to obtain a second resource hash value of at least one virtual resource indicated by the resource transfer request.

[0196] In one embodiment, the second hash processing module 1208 is further configured to, for each virtual resource among at least one virtual resource indicated by the resource transfer request, splice the resource identifier and the resource face value of the targeted virtual resource to obtain the resource feature data of the targeted virtual resource; splice the resource feature data of at least one virtual resource indicated by the resource transfer request to obtain the resource feature data of at least one virtual resource indicated by the resource transfer request.

[0197] The above blockchain-based resource transfer device receives a resource transfer request initiated by a user for a resource recipient based on a client; determines the user public key of the user indicated by the resource transfer request, and determines the resource digital signature and at least one virtual resource indicated by the resource transfer request. The resource digital signature is obtained by the client encrypting the first resource hash value using the user private key that matches the user public key. The first resource hash value is obtained by the client, after determining at least one virtual resource to be transferred, through a preset first hash function, performing a hash process based on the resource identifiers of at least one virtual resource to be transferred, and different virtual resources have different resource identifiers; uses the user public key to decrypt the resource digital signature to obtain the first resource hash value; through the preset first hash function, performs a hash process based on the resource identifiers of at least one virtual resource indicated by the resource transfer request to obtain a second resource hash value; when the second resource hash value is consistent with the first resource hash value, executes the smart contract set in the nodes of the blockchain network to perform resource transfer based on at least one virtual resource indicated by the resource transfer request. Compared with the traditional resource transfer method, in this application, before sending the resource transfer request, the client that initiates the resource transfer request signs at least one virtual resource to be transferred using the user private key, and sends the resource digital signature and at least one virtual resource indicated by the resource transfer request to the nodes of the blockchain network, so that after the nodes of the blockchain network pass the integrity verification of at least one virtual resource received based on the resource digital signature, they then execute the smart contract set in the nodes to perform resource transfer based on at least one virtual resource received, avoiding malicious tampering of virtual resources during the transmission process, ensuring the security and reliability of virtual resources during the resource transfer process, and thus avoiding malicious transfer of resources.

[0198] Each module in the above blockchain-based resource transfer device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so as to facilitate the processor to call and execute the operations corresponding to the above respective modules.

[0199] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 14As shown in the figure. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it implements a resource transfer method based on blockchain.

[0200] In one embodiment, a computer device is provided. The computer device can be a terminal, and its internal structure diagram can be as Figure 15 shown in the figure. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner. The wireless manner can be achieved through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a resource transfer method based on blockchain. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the computer device housing, or an external keyboard, touchpad, or mouse, etc.

[0201] Those skilled in the art can understand that Figure 14 and 15The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0202] In one embodiment, a computer device is also provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.

[0203] In one embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0204] In one embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0205] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions.

[0206] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above method embodiments. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0207] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0208] The above-described embodiments merely represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.

Claims

1. A resource transfer method based on blockchain, characterized in that, The method includes: In response to a trigger event initiated by a user for resource transfer to a resource recipient, determining at least one virtual resource to be transferred, where different virtual resources have different resource identifiers; Through a preset first hash function, performing hash processing based on the resource identifiers of the at least one virtual resource to be transferred, to obtain a first resource hash value of the at least one virtual resource to be transferred; Determining the user private key of the user and the user public key that matches the user private key; Using the user private key to encrypt the first resource hash value to obtain a resource digital signature; Generating a resource transfer request for the resource recipient, where the resource transfer request carries the resource digital signature and the user public key; Sending the resource transfer request to a node in the blockchain network, where the resource transfer request is used to instruct the node to determine the at least one virtual resource indicated by the resource transfer request, through the preset first hash function, performing hash processing based on the resource identifiers of the at least one virtual resource indicated by the resource transfer request, to obtain a second resource hash value of the at least one virtual resource indicated by the resource transfer request, using the user public key to decrypt the resource digital signature to obtain the first resource hash value, and when the second resource hash value is consistent with the first resource hash value, executing the smart contract corresponding to the resource recipient in the node to perform resource transfer based on the at least one virtual resource indicated by the resource transfer request.

2. The method according to claim 1, wherein The step of, through a preset first hash function, performing hash processing based on the resource identifiers of the at least one virtual resource to be transferred, to obtain a first resource hash value of the at least one virtual resource to be transferred, includes: Respectively determining the resource face values of the at least one virtual resource to be transferred; Concatenating the resource identifiers and resource face values of the at least one virtual resource to be transferred to obtain resource feature data of the at least one virtual resource to be transferred; Through the preset first hash function, performing hash processing on the resource feature data of the at least one virtual resource to be transferred to obtain a first resource hash value of the at least one virtual resource to be transferred.

3. The method according to claim 2, characterized in that, The step of concatenating the resource identifiers and resource face values of the at least one virtual resource to be transferred to obtain resource feature data of the at least one virtual resource to be transferred includes: For each virtual resource in the at least one virtual resource to be transferred, concatenating the resource identifier and resource face value of the virtual resource targeted to obtain resource feature data of the virtual resource targeted; Concatenating the resource feature data of the at least one virtual resource to be transferred to obtain resource feature data of the at least one virtual resource to be transferred.

4. The method according to claim 1, wherein When applied to a client, the step of, in response to a trigger event initiated by a user for resource transfer to a resource recipient, determining at least one virtual resource to be transferred, includes: In response to a trigger event initiated by a user for resource transfer to a resource recipient, selecting a target resource container from at least one preset resource container, where the resource container is used to store virtual resources; When the target resource container is a hardware resource container, determine at least one virtual resource to be transferred from the virtual resources stored in the hardware resource container, where the hardware resource container is set in a resource management chip of the client.

5. The method according to claim 1, wherein Applied to the client, the determining of at least one virtual resource to be transferred in response to a trigger event of resource transfer initiated by the user to a resource recipient includes: In response to a trigger event of resource transfer initiated by the user to a resource recipient, select a target resource container from at least one preset resource container, where the resource container is used to store virtual resources; When the target resource container is a software resource container, determine at least one virtual resource to be transferred from the virtual resources stored in the software resource container, where the software resource container is set in a resource management application pre-installed in the client.

6. The method according to any one of claims 1 to 5, characterized in that The determining of the user's private key and the user public key matching the user's private key includes: Determine a first prime number and a second prime number, where a first key parameter is divisible by the second prime number, and the first key parameter is determined based on the difference between the first prime number and a preset first integer; Determine a second integer, where the remainder obtained by dividing a second key parameter by the first prime number is equal to the remainder obtained by dividing the first integer by the first prime number, and the second key parameter is determined based on the second integer and the second prime number; Select a positive integer less than the second prime number as the user's private key; Determine a third key parameter according to the second integer and the user's private key; Perform a modulo operation on the third key parameter and the first prime number to obtain a user public key matching the user's private key.

7. The method according to claim 6, characterized in that The using of the user's private key to encrypt the first resource hash value to obtain a resource digital signature includes: Select a value as a random parameter from values greater than the first integer and less than the second prime number; Determine a first signature parameter according to the random parameter, the second integer, the first prime number, and the second prime number; Determine a second signature parameter according to the first signature parameter, the random parameter, the first resource hash value, the user's private key, and the second prime number; Determine a resource digital signature according to the first signature parameter and the second signature parameter.

8. The method according to claim 7, wherein The determining of the first signature parameter according to the random parameter, the second integer, the first prime number, and the second prime number includes: Determine a first signature intermediate state parameter according to the random parameter and the second integer; Perform a modulo operation on the first signature intermediate state parameter and the first prime number to obtain a modulo parameter; Perform a modulo operation on the modulo parameter and the second prime number to obtain a first signature parameter.

9. The method according to claim 7, characterized in that The determining of the second signature parameter according to the first signature parameter, the random parameter, the first resource hash value, the user's private key, and the second prime number includes: Determine a second signature intermediate state parameter according to the product of the user's private key and the first signature parameter; Determine a third signature intermediate state parameter according to the sum of the second signature intermediate state parameter and the first resource hash value; Determine a fourth signature intermediate state parameter according to the third signature intermediate state parameter and the random parameter; Perform a modulo operation on the fourth signature intermediate state parameter and the second prime number to obtain a second signature parameter.

10. A resource transfer method based on blockchain, characterized in that, Applied to a node of a blockchain network, where a smart contract corresponding to a resource recipient is set in the node, the method includes: Receive a resource transfer request initiated by a user based on a client for the resource recipient; Determine the user public key of the user indicated by the resource transfer request, and determine the resource digital signature and at least one virtual resource indicated by the resource transfer request. The resource digital signature is encrypted by the client using a user private key that matches the user public key from a first resource hash value. The first resource hash value is obtained by the client after determining at least one virtual resource to be transferred, through a preset first hash function, based on the resource identifiers of the at least one virtual resource to be transferred. Different virtual resources have different resource identifiers; Use the user public key to decrypt the resource digital signature to obtain the first resource hash value; Through the preset first hash function, perform a hash process based on the resource identifiers of the at least one virtual resource indicated by the resource transfer request to obtain a second resource hash value; When the second resource hash value is consistent with the first resource hash value, execute the smart contract to perform a resource transfer based on the at least one virtual resource indicated by the resource transfer request.

11. The method according to claim 10, wherein The determining the user public key of the user indicated by the resource transfer request includes: Determine the digital certificate indicated by the resource transfer request. The digital certificate is generated by a certificate registration end based on the user public key after obtaining the user public key of the user from the client. The digital certificate contains the user public key; Extract the user public key from the digital certificate; The method further includes: When the digital certificate passes the legality verification, execute the step of using the user public key to decrypt the resource digital signature to obtain the first resource hash value.

12. The method according to claim 11, characterized in that, The digital certificate further contains a certificate digital signature and the registration public key of the certificate registration end. The certificate digital signature is encrypted by the certificate registration end using a registration private key that matches the registration public key from a first certificate hash value. The first certificate hash value is obtained by the certificate registration end through a preset second hash function by performing a hash process on the digital certificate. The method further includes: Extract the certificate digital signature and the registration public key from the digital certificate; Use the registration public key to decrypt the certificate digital signature to obtain the first certificate hash value; Through the preset second hash function, perform a hash process on the digital certificate indicated by the resource transfer request to obtain a second certificate hash value; When the second certificate hash value is consistent with the first certificate hash value, determine that the digital certificate passes the legality verification.

13. The method according to any one of claims 10 to 12, characterized in that, Performing hashing on the resource identifier of each of at least one virtual resource indicated by the resource transfer request through the preset first hash function to obtain a second resource hash value includes: Determining the resource face value of each of at least one virtual resource indicated by the resource transfer request respectively; Concatenating the resource identifier and the resource face value of each of at least one virtual resource indicated by the resource transfer request to obtain the resource feature data of at least one virtual resource indicated by the resource transfer request; Performing hashing on the resource feature data of at least one virtual resource indicated by the resource transfer request through the preset first hash function to obtain the second resource hash value of at least one virtual resource indicated by the resource transfer request.

14. The method according to claim 13, wherein The concatenating the resource identifier and the resource face value of each of at least one virtual resource indicated by the resource transfer request to obtain the resource feature data of at least one virtual resource indicated by the resource transfer request includes: For each of at least one virtual resource indicated by the resource transfer request, concatenating the resource identifier and the resource face value of the virtual resource targeted to obtain the resource feature data of the virtual resource targeted; Concatenating the resource feature data of each of at least one virtual resource indicated by the resource transfer request to obtain the resource feature data of at least one virtual resource indicated by the resource transfer request.

15. A blockchain-based resource transfer device, characterized in that, The apparatus includes: A first determination module, configured to determine at least one virtual resource to be transferred in response to a trigger event of the user initiating a resource transfer to a resource recipient, where different virtual resources have different resource identifiers; A first hashing processing module, configured to perform hashing on the resource identifier of each of at least one virtual resource to be transferred through a preset first hash function to obtain a first resource hash value of at least one virtual resource to be transferred; The first determination module is further configured to determine the user private key of the user and the user public key matching the user private key; An encryption module, configured to encrypt the first resource hash value using the user private key to obtain a resource digital signature; A generation module, configured to generate a resource transfer request for the resource recipient, where the resource transfer request carries the resource digital signature and the user public key; A sending module, configured to send the resource transfer request to a node in the blockchain network, where the resource transfer request is used to instruct the node to determine at least one virtual resource indicated by the resource transfer request, perform hashing on the resource identifier of each of at least one virtual resource indicated by the resource transfer request through the preset first hash function to obtain a second resource hash value of at least one virtual resource indicated by the resource transfer request, decrypt the resource digital signature using the user public key to obtain the first resource hash value, and when the second resource hash value is consistent with the first resource hash value, execute the smart contract corresponding to the resource recipient in the node to perform resource transfer based on at least one virtual resource indicated by the resource transfer request.

16. A blockchain-based resource transfer device, characterized in that, A node applied to a blockchain network, in which a smart contract corresponding to a resource recipient is set, and the device includes: A receiving module, configured to receive a resource transfer request initiated by a user based on a client for the resource recipient; A second determination module, configured to determine the user public key of the user indicated by the resource transfer request, and determine the resource digital signature and at least one virtual resource indicated by the resource transfer request. The resource digital signature is obtained by the client encrypting a first resource hash value using a user private key that matches the user public key. The first resource hash value is obtained by the client, after determining at least one virtual resource to be transferred, through a preset first hash function, performing a hash process based on the resource identifiers of the at least one virtual resource to be transferred, and different virtual resources have different resource identifiers; A decryption module, configured to use the user public key to decrypt the resource digital signature to obtain the first resource hash value; A second hash processing module, configured to perform a hash process through the preset first hash function based on the resource identifiers of the at least one virtual resource indicated by the resource transfer request to obtain a second resource hash value; A transfer module, configured to, when the second resource hash value is consistent with the first resource hash value, execute the smart contract to perform resource transfer based on the at least one virtual resource indicated by the resource transfer request.

17. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 14 are implemented.

18. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 14 are implemented.

19. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 14 are implemented.