Resource exchange method and device based on block chain, equipment, medium and product

By storing the mapping relationship between the redemption code value and resource identification in the blockchain system, the problem of relying on the blockchain platform in the resource redemption process is solved, the redemption efficiency and security are improved, and the redemption scenario is expanded.

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

Patent Information

Application Number
CN202311150603.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-06
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

In the existing technology, the resource redemption process strongly relies on the blockchain platform, resulting in the redemption codes that can only be maintained by the blockchain platform, which reduces the resource redemption efficiency and limits the resource redemption scenario.

Method used

By storing the first mapping relationship between the redemption code value and the resource identification in the blockchain system, nodes are allowed to directly receive the redemption code and perform resource redemption, avoiding the inefficiency of sending the redemption code to a third party.

Benefits of technology

It improves the security and efficiency of the resource redemption process, expands the use scenarios of resource redemption, enables nodes in the blockchain system to directly process the redemption code, and improves the overall resource management and redemption process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119579249A_ABST
    Figure CN119579249A_ABST
Patent Text Reader

Abstract

The invention discloses a resource exchange method and device based on a block chain, equipment, a medium and a product, and relates to the technical field of block chains. The method comprises the following steps: acquiring at least one on-chain resource, wherein the at least one on-chain resource respectively corresponds to a resource identifier; a configuration instruction is received, the configuration instruction comprises at least one redemption code value, and the redemption code represented by the redemption code value is used for redeeming the resources on the chain; storing a first mapping relationship based on the configuration instruction, wherein the first mapping relationship comprises a corresponding exchange relationship between at least one exchange code value and the resource identifier; and under the condition that the first exchange code sent by the resource exchange party is received, determining the first on-chain resource exchanged by the first exchange code based on the first mapping relationship. Through the mode, the security of the resource exchange process can be improved through the exchange code, and the problem of low efficiency caused by the fact that the exchange code needs to be sent to a third party to carry out resource exchange is also avoided. The method can be applied to various scenes such as cloud technology, artificial intelligence and intelligent transportation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of blockchain technology, and in particular to a resource exchange method, device, equipment, medium and product based on blockchain. Background Art

[0002] Blockchain is a chain composed of multiple blockchain nodes. Each blockchain node stores data or information. It has the characteristics of decentralization, unforgeability, openness and transparency. Therefore, it is widely used in various data protection fields.

[0003] In the related technology, based on the activities on the blockchain platform, the user can obtain the redemption code issued by the blockchain platform, and the redemption code is used to redeem resources on the blockchain system; when the user uses the redemption code to redeem resources, the redemption code needs to be sent to the blockchain platform, and the blockchain platform determines the resources that the user can redeem and the blockchain address corresponding to the user based on the redemption code, so as to transfer the resources to the blockchain address corresponding to the user.

[0004] The above resource exchange process is strongly dependent on the blockchain platform. Since the exchange code can only be maintained by the blockchain platform, the user must use the blockchain platform to realize resource exchange, which greatly reduces the efficiency of resource exchange. The inability to exchange directly on the blockchain also greatly limits the resource exchange scenario, resulting in inefficient resource transfer. Summary of the invention

[0005] The embodiment of the present application provides a resource exchange method, device, equipment, medium and product based on blockchain, which can improve the security of the resource exchange process through the exchange code, avoid the inefficiency of sending the exchange code to a third party before the resource exchange, and expand the use scenario of resource exchange by means of the first mapping relationship between the exchange code value and the resource identifier. The technical solution is as follows.

[0006] In one aspect, a resource exchange method based on blockchain is provided, the method being executed by a node in a blockchain system, the method comprising:

[0007] Acquire at least one on-chain resource, each of the at least one on-chain resource corresponds to a resource identifier, the resource identifier uniquely identifies the on-chain resource, and the on-chain resource is a resource deployed in the blockchain system;

[0008] Receive a configuration instruction, wherein the configuration instruction includes at least one redemption code value, wherein the redemption code value is used to represent information of a redemption code, and the redemption code is used to redeem the on-chain resource in the blockchain system;

[0009] storing a first mapping relationship based on the configuration instruction, wherein the first mapping relationship includes a corresponding redemption relationship between the at least one redemption code value and the resource identifier;

[0010] When a first redemption code sent by a resource redeemer is received, a first on-chain resource to be redeemed by the first redemption code is determined from the at least one on-chain resource based on the first mapping relationship, and the first on-chain resource is sent to the resource redeemer.

[0011] On the other hand, a resource exchange device based on blockchain is provided, the device comprising:

[0012] A resource acquisition module, used to acquire at least one on-chain resource, each of which corresponds to a resource identifier, and the resource identifier uniquely identifies the on-chain resource, and the on-chain resource is a resource deployed in the blockchain system;

[0013] An instruction receiving module, used to receive a configuration instruction, wherein the configuration instruction includes at least one redemption code value, wherein the redemption code value is used to represent information of a redemption code, and the redemption code is used to redeem the on-chain resources in the blockchain system;

[0014] a relationship storage module, configured to store a first mapping relationship based on the configuration instruction, wherein the first mapping relationship includes a corresponding redemption relationship between the at least one redemption code value and the resource identifier;

[0015] The resource exchange module is used to determine the first on-chain resource exchanged by the first redemption code from the at least one on-chain resource based on the first mapping relationship when receiving the first redemption code sent by the resource exchanger, and the first on-chain resource is used to send to the resource exchanger.

[0016] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement a resource exchange method based on blockchain as described in any of the above-mentioned embodiments of the present application.

[0017] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, a code set or an instruction set is stored in the storage medium, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the blockchain-based resource exchange method as described in any of the above-mentioned embodiments of the present application.

[0018] On the other hand, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes any of the resource exchange methods based on blockchain described in the above embodiments.

[0019] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:

[0020] After obtaining at least one on-chain resource and a configuration instruction including at least one redemption code value, since the redemption code represented by the redemption code value is used to redeem the on-chain resource in the blockchain system, a first mapping relationship including the redemption relationship between at least one redemption code value and a resource identifier can be stored, and then the resource redemption is performed through the first mapping relationship. The redemption code value representing the redemption code is configured through the node in the blockchain system to avoid the risk that may be caused by directly exposing the redemption code to the blockchain system. The corresponding relationship between the resource identifier and the on-chain resource, the redemption relationship between the on-chain resource and the redemption code, and the representation relationship between the redemption code and the redemption code value are integrated to store the first mapping relationship between the redemption code value and the resource identifier on the node in the blockchain system, thereby not only improving the security of resource redemption through the redemption code, but also enabling the node in the blockchain system to directly receive the first redemption code sent by the resource redeemer, so as to determine the first on-chain resource redeemed by the first redemption code through the first mapping relationship, avoiding the inefficiency of sending the redemption code to a third party to perform resource redemption, while ensuring security, improving the efficiency of resource redemption, and facilitating the expansion of the use scenario of resource redemption through the redemption code and the first mapping relationship. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 This is a structural diagram of a distributed system provided by an exemplary embodiment of the present application applied to a blockchain system;

[0023] Figure 2 is a schematic diagram of a block structure provided by an exemplary embodiment of the present application;

[0024] Figure 3 It is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;

[0025] Figure 4 is a flowchart of a resource exchange method based on blockchain provided by an exemplary embodiment of the present application;

[0026] Figure 5 is a flowchart of a resource exchange method based on blockchain provided by another exemplary embodiment of the present application;

[0027] Figure 6 is a flowchart of a resource exchange method based on blockchain provided by another exemplary embodiment of the present application;

[0028] Figure 7 is a flowchart of a resource exchange method based on blockchain provided by another exemplary embodiment of the present application;

[0029] Figure 8 It is a schematic diagram of a process of interactively executing redemption code value configuration between a resource publisher and a contract provided by an exemplary embodiment of the present application;

[0030] Fig. 9 It is a schematic diagram of a resource exchange process interactively executed between a resource exchange party and a contract provided by an exemplary embodiment of the present application;

[0031] Fig.10 It is a structural block diagram of a resource exchange device based on blockchain provided by an exemplary embodiment of the present application;

[0032] Fig.11 It is a structural block diagram of a server provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0033] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0034] First, a brief introduction is given to the terms involved in the embodiments of the present application.

[0035] Blockchain: Blockchain is a distributed ledger technology in the field of information technology. It is generally composed of consensus, transaction blocks and status data storage, cryptographic identity security, etc. Since the ledger is stored in a distributed manner and the blocks are agreed upon, it has the characteristics of being tamper-proof, traceable, and jointly maintained.

[0036] Smart contract: A smart contract is a program that runs on the blockchain. Unlike ordinary programs, smart contracts must ensure that the results of running in every node of the blockchain network are exactly the same, so that any node can verify whether the results of the smart contract execution in the block are correct.

[0037] In the related technology, based on the activities on the blockchain platform, the user can obtain the redemption code issued by the blockchain platform, and the redemption code is used to redeem resources on the blockchain; when the user uses the redemption code to redeem resources, the redemption code needs to be sent to the blockchain platform, and the blockchain platform determines the resources that the user can redeem and the blockchain address corresponding to the user based on the redemption code, so as to transfer the resources to the blockchain address corresponding to the user. The above resource redemption process is strongly dependent on the blockchain platform. Since the redemption code can only be maintained by the blockchain platform, the user must use the blockchain platform to realize resource redemption, which greatly reduces the efficiency of resource redemption. The process of not being able to redeem directly on the blockchain also greatly limits the resource redemption scenario, resulting in inefficient resource transfer.

[0038] In an embodiment of the present application, after obtaining at least one on-chain resource and a configuration instruction including at least one redemption code value, since the redemption code represented by the redemption code value is used to redeem on-chain resources in the blockchain system, it is possible to store a first mapping relationship including the corresponding redemption relationship between at least one redemption code value and a resource identifier, and then, when receiving the first redemption code sent by the resource redeemer, determine the first on-chain resource redeemed by the first redemption code from at least one on-chain resource based on the first mapping relationship. Through the above method, not only can the security of the resource redemption process be improved through the redemption code, but also the inefficiency of having to send the redemption code to a third party to redeem resources is avoided, and the use scenario of resource redemption is expanded with the help of the first mapping relationship between the redemption code value and the resource identifier.

[0039] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards in the relevant regions. For example, the on-chain resources, redemption codes, redemption code values, etc. involved in this application are all obtained with full authorization.

[0040] The system involved in the embodiments of the present application may be a distributed system formed by connecting a client and multiple nodes (any form of computing devices in an access network, such as a server and a user terminal) through network communication.

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

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

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

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

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

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

[0047] 2.1) Wallet, used to provide the function of conducting electronic currency transactions, including initiating transactions (i.e., sending the transaction record of the current transaction to other nodes in the blockchain system. After successful verification by other nodes, as a response to acknowledging the validity of the transaction, the transaction record data is stored in a temporary block of the blockchain; of course, the wallet also supports querying the remaining electronic currency in the electronic currency address.

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

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

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

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

[0052] In an optional embodiment, the implementation environment involved in the embodiment of the present application is described, and the blockchain-based resource exchange method provided in the embodiment of the present application is implemented by executing a node in the blockchain system.

[0053] For illustration, please refer to Figure 3 The implementation environment involves a resource publisher 310, a node 320 in the blockchain system, and a resource exchanger 330.

[0054] In some embodiments, the resource publisher 310 is used to publish on-chain resources in the blockchain system so that the node 320 in the blockchain system obtains at least one on-chain resource. Among them, at least one on-chain resource corresponds to a resource identifier, and the resource identifier uniquely identifies the on-chain resource. The on-chain resource is a resource deployed in the blockchain system.

[0055] In some embodiments, the node 320 in the blockchain system also receives a configuration instruction. Illustratively, the configuration instruction is an instruction issued by the resource publisher 310, and the configuration instruction includes at least one redemption code value, and the configuration instruction is used to configure the redemption code value in the blockchain system, and the redemption code value is used to represent the information of the redemption code, and the redemption code is used to redeem the on-chain resources in the blockchain system.

[0056] In some embodiments, the node 320 in the blockchain system stores a first mapping relationship based on a configuration instruction, where the first mapping relationship includes a corresponding redemption relationship between at least one redemption code value and a resource identifier.

[0057] Schematically, the redemption code value corresponds to the redemption code, and the resource identifier corresponds to the on-chain resource. Based on the redemption relationship of the redemption code for redeeming on-chain resources and the above two corresponding relationships, the redemption relationship between the redemption code value and the resource identifier can be determined.

[0058] In some embodiments, the resource exchanger 330 is used to send a first redemption code to the node 320 in the blockchain system, and the first redemption code is a redemption code held by the resource exchanger 330. When receiving the first redemption code sent by the resource exchanger 330, the node 320 in the blockchain system can determine the first on-chain resource exchanged by the first redemption code from at least one on-chain resource based on the first mapping relationship.

[0059] Among them, the first on-chain resources are used to be sent to the resource exchange party.

[0060] Illustratively, when receiving the first redemption code sent by the resource redeemer 330, the node 320 in the blockchain system processes the first redemption code to obtain a first redemption code value corresponding to the first redemption code, and then searches in the first mapping relationship based on the first redemption code value to determine the first on-chain resource redeemed by the first redemption code from at least one on-chain resource.

[0061] In some embodiments, the node 320 in the blockchain system can be implemented as a server, and the resource publisher 310 and / or the resource exchanger 330 can be implemented as a terminal; or, the node 320 in the blockchain system can be implemented as a server, etc. The above implementation environment is only an illustrative example, and the embodiments of the present application are not limited to this.

[0062] It is worth noting that the above-mentioned terminals include but are not limited to mobile terminals such as mobile phones, tablet computers, portable laptops, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, and can also be implemented as desktop computers, etc.; the above-mentioned servers can be independent physical servers, or they can be server clusters or distributed systems composed of multiple physical servers, or they can be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.

[0063] Among them, cloud technology refers to a hosting technology that unifies hardware, application programs, networks and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool that can be used on demand and is flexible and convenient.

[0064] In combination with the above-mentioned noun introduction and application scenarios, the resource exchange method based on blockchain provided by this application is explained, and the method is applied to a node in a blockchain system as an example. Figure 4 As shown, the method includes the following steps 410 to 440.

[0065] Step 410, obtain at least one on-chain resource.

[0066] Among them, on-chain resources are resources deployed in the blockchain system. Schematically, the resources that have been put on the chain are called on-chain resources. The on-chain process is used to represent the process of putting resources (data) on the blockchain system so that each node in the blockchain system reaches a consensus on the process of putting the resources on the chain. Then the resources can be called on-chain resources.

[0067] Among them, at least one on-chain resource corresponds to a resource identifier; the resource identifier uniquely identifies the on-chain resource.

[0068] Indicatively, each on-chain resource is unique, and each on-chain resource corresponds to a resource identifier, through which the corresponding on-chain resource can be uniquely represented. For example: on-chain resource 1 corresponds to resource identifier A, on-chain resource 2 corresponds to resource identifier B, and so on.

[0069] In some embodiments, in the process of a resource publisher obtaining a resource, the resource will be stored in a node in the blockchain system. The resource after multiple nodes reach consensus is the on-chain resource, thereby enabling the blockchain system to obtain at least one on-chain resource.

[0070] In some embodiments, the types of on-chain resources involved in the blockchain-based resource exchange method can also be completed by executing a resource contract for recording on-chain resource generation, exchange, etc. to complete the blockchain-based resource exchange method.

[0071] Step 420, receiving a configuration instruction.

[0072] Schematically, the configuration instruction is used to instruct a node in the blockchain system to perform a configuration process, wherein the configuration instruction includes at least one redemption code value.

[0073] Among them, the redemption code value is used to represent the information of the redemption code; the redemption code is used to redeem on-chain resources in the blockchain system.

[0074] Indicatively, there is an exchange relationship between the redemption code and the on-chain resources, and the on-chain resources in the blockchain system can be exchanged through the redemption code. For example: redemption code a is used to exchange on-chain resource 1 in the blockchain system, and redemption code b is used to exchange on-chain resource 2 in the blockchain system, etc.

[0075] Optionally, the exchange relationship between the redemption code and the on-chain resource is pre-set; or, the exchange relationship between the redemption code and the on-chain resource is determined based on the protocol; or, the exchange relationship between the redemption code and the on-chain resource is determined based on generation parameters when generating the on-chain resource, etc.

[0076] In some embodiments, the exchange relationship between the redemption code and the on-chain resource is presented as a one-to-one relationship, that is, one redemption code is used to redeem one on-chain resource with which there is an exchange relationship.

[0077] Schematically, the redemption code a is used to redeem the on-chain resource 1 in the blockchain system, wherein there is a one-to-one relationship between the redemption code a and the on-chain resource 1. When the redemption code a is received, the on-chain resource 1 can be redeemed.

[0078] In some embodiments, the redemption relationship between the redemption code and the on-chain resources is presented as a one-to-many relationship, that is, one redemption code is used to redeem multiple on-chain resources with which there is a redemption relationship.

[0079] Schematically, the redemption code b is used to redeem on-chain resources 1, on-chain resources 2, and on-chain resources 3 in the blockchain system, wherein there is a one-to-many relationship between the redemption code b and the on-chain resources 1, on-chain resources 2, and on-chain resources 3. When the redemption code b is received, at least one of the on-chain resources 1, on-chain resources 2, and on-chain resources 3 can be redeemed.

[0080] In some embodiments, the exchange relationship between the redemption code and the on-chain resource is presented as a many-to-one relationship, that is, multiple redemption codes are used to exchange one on-chain resource with which the redemption code has an exchange relationship.

[0081] Indicatively, redemption code c and redemption code d are used to jointly redeem on-chain resource 1 in the blockchain system, wherein there is a one-to-many relationship between redemption code c and redemption code d and on-chain resource 1. When redemption code c or redemption code d is received, on-chain resource 1 cannot be redeemed alone; only when redemption code c and redemption code d are received, on-chain resource 1 in the blockchain system can be redeemed.

[0082] In some embodiments, the exchange relationship between the redemption code and the on-chain resources is presented as a many-to-many relationship, that is, multiple redemption codes are used to exchange multiple on-chain resources with which there is an exchange relationship.

[0083] Schematically, redemption code c and redemption code d are used to jointly redeem on-chain resource 1 and on-chain resource 2 in the blockchain system, wherein there is a many-to-many relationship between redemption code c and redemption code d and on-chain resource 1 and on-chain resource 2. When redemption code c or redemption code d is received, on-chain resource 1 and on-chain resource 2 cannot be redeemed separately; when redemption code c and redemption code d are received, at least one of on-chain resource 1 and on-chain resource 2 in the blockchain system can be redeemed.

[0084] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.

[0085] In some embodiments, based on the redemption relationship between the redemption code and the on-chain resource, and the representation relationship between the on-chain resource and the resource identifier, the correspondence relationship between the redemption code and the resource identifier can be determined.

[0086] Optionally, the redemption relationship between the redemption code and the on-chain resource is presented as a one-to-one relationship. Based on the redemption relationship implemented as a one-to-one relationship and the one-to-one representation relationship between the on-chain resource and the resource identifier, the one-to-one correspondence between the redemption code and the resource identifier can be determined.

[0087] Schematically, redemption code a is used to redeem on-chain resource 1 in the blockchain system, wherein there is a one-to-one redemption relationship between redemption code a and on-chain resource 1, and on-chain resource 1 corresponds to resource identifier A, then the one-to-one correspondence between redemption code a and resource identifier A can be determined.

[0088] In some embodiments, the redemption code value is a value corresponding to the redemption code obtained by processing the redemption code, and the redemption code value is used to uniquely represent the redemption code.

[0089] Indicatively, as content used to redeem on-chain resources, the redemption code has strong security requirements. It is necessary to avoid the leakage of the redemption code as much as possible during the resource redemption process of exchanging on-chain resources through the redemption code.

[0090] Optionally, in order to ensure that the nodes in the blockchain are aware of the exchange relationship between the redemption code and the on-chain resources without leaking the redemption code, the redemption code is processed so as not to leak the original content of the redemption code based on the information that the redemption code is represented by the redemption code value.

[0091] Schematically, the redemption code platform (also referred to as the blockchain platform) generates a redemption code for redeeming on-chain resources based on on-chain resources, processes the redemption code to obtain a redemption code value, and then includes the redemption code value in a configuration instruction to be sent to a node in the blockchain system to avoid leaking the original content of the redemption code.

[0092] Schematically, the redemption relationship between the redemption code and the on-chain resource is pre-set as a one-to-one correspondence. When the redemption code platform generates a redemption code for redeeming the on-chain resource based on the on-chain resource, the redemption code platform generates a redemption code for redeeming each on-chain resource based on multiple on-chain resources, thereby obtaining multiple redemption code values; in addition, the redemption code platform processes the multiple redemption codes separately to obtain redemption code values, thereby obtaining redemption code values ​​corresponding to the multiple redemption codes, that is, obtaining multiple redemption code values; in addition, the redemption code platform includes at least one of the multiple redemption code values ​​in a configuration instruction, and sends the configuration instruction to the nodes in the blockchain system, thereby achieving the purpose of avoiding leakage of the original content of the redemption code.

[0093] In some embodiments, for redemption code values ​​corresponding to a plurality of redemption codes, each redemption code value corresponds to a redemption code, and a configuration instruction is used to configure the redemption code value on a node in the blockchain system.

[0094] Optionally, a plurality of redemption code values ​​are included in the configuration instruction. When configuring the plurality of redemption code values, the plurality of redemption code values ​​are configured sequentially; or, at least connected redemption code values ​​among the plurality of redemption code values ​​are configured simultaneously.

[0095] Optionally, a redemption code value is included in the configuration instruction, the redemption code value in the currently received configuration instruction is configured, and after the configuration is completed, a configuration instruction including another redemption code value is received, thereby achieving the purpose of configuring multiple redemption code values.

[0096] Step 430: Store the first mapping relationship based on the configuration instruction.

[0097] In schematic form, since the redemption code value is the content obtained after processing the redemption code, there is a one-to-one correspondence between the redemption code and the redemption code value; in addition, the redemption code is used to redeem on-chain resources in the blockchain system, so there is an exchange relationship between the redemption code and the on-chain resources; in addition, each on-chain resource corresponds to a resource identifier that is used to uniquely represent the on-chain resource, so there is a representation relationship between the on-chain resource and the resource identifier.

[0098] Optionally, after receiving the configuration instruction, the redemption code value included in the configuration instruction is determined. When configuring the redemption code value, the resource identifier corresponding to the on-chain resource is determined based on the on-chain resource used to redeem the redemption code corresponding to the redemption code value, thereby knowing the correspondence between the redemption code value, the on-chain resource and the resource identifier.

[0099] The first mapping relationship includes a corresponding exchange relationship between at least one exchange code value and a resource identifier.

[0100] In an illustrative manner, at least one redemption code value in the configuration instruction is analyzed respectively to determine the on-chain resource for which the redemption code corresponding to each redemption code value is used to redeem, and to determine the resource identifier corresponding to the on-chain resource, thereby establishing a redemption relationship between the redemption code value and the resource identifier.

[0101] For example: the configuration instruction includes the redemption code value m corresponding to the redemption code a, the redemption code a is used to redeem the on-chain resource 1, and the on-chain resource corresponds to the resource identifier A. Based on this, an exchange relationship between the redemption code value m and the resource identifier A can be established, and the exchange relationship is used as an exchange relationship under the first mapping relationship.

[0102] Optionally, at least one redemption code value under the configuration instruction is analyzed respectively, so as to determine the resource identifier having the above redemption relationship with the at least one redemption code value respectively, and establish the redemption relationship corresponding to the at least one redemption code value respectively.

[0103] Illustratively, a first mapping relationship is obtained by integrating a corresponding exchange relationship between at least one exchange code value and a resource identifier.

[0104] Step 440: upon receiving the first redemption code sent by the resource redeemer, determine the first on-chain resource to be redeemed with the first redemption code from at least one on-chain resource based on the first mapping relationship.

[0105] Illustratively, the resource exchanger is used to represent an object that needs to exchange resources. Optionally, the resource exchanger is implemented as a personal object; or, the resource exchanger is implemented as an enterprise object, etc.

[0106] In some embodiments, the resource exchanger obtains the first redemption code by completing a predetermined task; or, the resource exchanger obtains the first redemption code based on a distribution process of a redemption code platform; or, the resource exchanger obtains the first redemption code through a donation process from other redemption code holders, etc.

[0107] In an exemplary embodiment, the first redemption code is at least one of the multiple redemption codes, and the resource redeemer holds the first redemption code. Optionally, when the resource redeemer needs to obtain on-chain resources from the blockchain system, the resource redemption process can be realized by consuming the first redemption code.

[0108] Optionally, the resource exchanger sends a first redemption code to a node in the blockchain system. Upon receiving the first redemption code, the node in the blockchain system searches for the stored first mapping relationship to determine the first on-chain resource exchanged for the first redemption code from at least one on-chain resource stored in the blockchain system.

[0109] Illustratively, the first mapping relationship stores an exchange relationship between an exchange code value and a resource identifier. After receiving the first exchange code, the first exchange code is processed to obtain a first exchange code value, and then a search is performed in the first mapping relationship based on the first exchange code value to determine a first resource identifier that has an exchange relationship with the first exchange code value.

[0110] Among them, the first resource identifier uniquely identifies the first on-chain resource.

[0111] In an illustrative manner, the resource identifier is used to uniquely represent the on-chain resource. Therefore, after determining the first resource identifier, the on-chain resource represented by the first resource identifier can be determined as the first on-chain resource. The first on-chain resource is used to represent the on-chain resource determined by the first redemption code, and is an on-chain resource that can be redeemed through the first redemption code.

[0112] Among them, the first on-chain resources are used to be sent to the resource exchange party.

[0113] In some embodiments, the resource exchanger has been registered in the blockchain system, so that the resource exchanger has a corresponding third address in the blockchain system. When the first-chain resource is sent, the first-chain resource in the blockchain system is transferred to the third address registered by the resource exchanger in the blockchain system, thereby achieving the purpose of sending the first-chain resource.

[0114] Optionally, after determining the first on-chain resource for which the first redemption code is to be redeemed, the first on-chain resource is transferred to a third address corresponding to the resource redeemer, thereby achieving the purpose of sending the first on-chain resource to the resource redeemer.

[0115] Optionally, after determining the first on-chain resource for which the first redemption code is to be redeemed, the resource redemption status of the first on-chain resource is determined. The resource redemption status is used to characterize the redemption status of the on-chain resource corresponding to the redemption code value in the blockchain system. Schematically, the resource redemption status includes that the on-chain resource has been redeemed (e.g., the resource redeemer has previously redeemed the first on-chain resource through the redemption code and cannot redeem it again; or, other resource redeemers have redeemed the first on-chain resource through the redemption code), the on-chain resource has not been redeemed, the on-chain resource has expired (e.g., the on-chain resource is invalid if it is not redeemed within a preset time period), etc.

[0116] In some embodiments, in response to the first on-chain resource not being redeemed within a historical time period, a third address registered in the blockchain system by a resource redeemer is determined; and the first on-chain resource is transferred to the third address.

[0117] In an illustrative manner, when the resource exchange status indicates that the resource on the first chain has not been exchanged, the resource on the first chain is transferred to a third address corresponding to the resource exchanger, thereby achieving the purpose of sending the resource on the first chain to the resource exchanger.

[0118] In some embodiments, in response to the first on-chain resource having been exchanged within a historical time period, a resource exchange failure message is sent to the resource exchanger.

[0119] Illustratively, when the resource exchange status indicates that the resource on the first chain has been exchanged, a resource exchange failure message is sent to the resource exchanger to prompt the resource exchanger that the resource on the first chain has been exchanged.

[0120] In some embodiments, a resource validity period corresponding to the resource on the first chain is determined.

[0121] The resource validity period is used to represent the period of time during which the resources on the first chain are effectively exchanged.

[0122] Optionally, some on-chain resources are time-limited resources, where the time limit is the effective time period of the resource, which is used to indicate the time period during which the on-chain resource can be effectively exchanged. When the time of resource exchange is within the effective time period of the resource, the on-chain resource can be exchanged; when the time of resource exchange is not within the effective time period of the resource, the on-chain resource cannot be exchanged, etc. Indicatively, the first on-chain resource is a time-limited resource.

[0123] In some embodiments, in response to the receiving time of the first redemption code not being within the resource valid time period, a resource redemption failure message is sent to the resource redeemer.

[0124] Optionally, the time of receiving the first redemption code is used as the time of resource redemption, and the receiving time is compared with the resource validity period. If the receiving time is not within the resource validity period, a resource redemption failure message is sent to the resource redeemer; if the receiving time is not within the resource validity period, the first on-chain resource is sent to the resource redeemer, etc.

[0125] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.

[0126] To summarize, the redemption code value representing the redemption code is configured through the nodes in the blockchain system to avoid the risks that may be caused by directly exposing the redemption code to the blockchain system. The correspondence between the resource identifier and the on-chain resource, the redemption relationship between the on-chain resource and the redemption code, and the representation relationship between the redemption code and the redemption code value are integrated to store the first mapping relationship between the redemption code value and the resource identifier on the node in the blockchain system, thereby not only improving the security of resource redemption through the redemption code, but also enabling the node in the blockchain system to directly receive the first redemption code sent by the resource redeemer, so as to determine the first on-chain resource redeemed by the first redemption code through the first mapping relationship, avoiding the inefficiency of sending the redemption code to a third party to redeem the resource, improving the resource redemption efficiency while ensuring security, and facilitating the expansion of the use scenarios of resource redemption through the redemption code and the first mapping relationship.

[0127] In an optional embodiment, when storing the first mapping relationship based on the configuration instruction, the address of the instruction issuer that issues the configuration instruction is compared with the address represented by the resource identifier included in the configuration instruction, and the first mapping relationship is stored based on the address comparison result. Figure 5 As shown above Figure 2 The illustrated embodiment may also be implemented as the following steps 510 to 560 .

[0128] Step 510, obtain at least one on-chain resource.

[0129] Among them, on-chain resources are resources deployed in the blockchain system; at least one on-chain resource corresponds to a resource identifier; and the resource identifier uniquely identifies the on-chain resource.

[0130] In some embodiments, on-chain resources are resources that are published by a resource publisher and uploaded to a node in a blockchain system.

[0131] Schematically, in the process of resource publishers obtaining resources, the resources will be stored in the nodes in the blockchain system. The resources after multiple nodes reach consensus are the on-chain resources, so that the blockchain system can obtain at least one on-chain resource.

[0132] In an optional embodiment, resource configuration parameters sent by a resource publisher are received.

[0133] Among them, the resource configuration parameters are used to generate at least one on-chain resource on the blockchain. Schematically, the resource publisher is used to characterize the object for making on-chain resources, and the resource configuration parameters are the parameter content required to synthesize on-chain resources. The resource publisher generates on-chain resources on the blockchain system by sending resource configuration parameters to the blockchain system.

[0134] Indicatively, the process of generating on-chain resources through resource configuration parameters is called the "casting" process. "Casting" can also be called the process of writing digital items (such as images, audio, video, text, etc.) into the blockchain system. Optionally, through Ethereum smart contracts (Ethereum Request for Comment, ERC20), ERC721, also known as non-fungible tokens (NFT), ERC1155 and other smart contracts as standard requirements to be followed in the resource casting process, by setting various resource configuration parameters such as name, address, file parameters, etc., the purpose of casting to obtain on-chain resources is achieved.

[0135] Schematically, non-interchangeable non-homogeneous resources are referred to as NFTs, and the implementation of on-chain resources as NFTs is used as an example to illustrate.

[0136] Optionally, the process of casting NFT can be realized through the open platform OpenSea. First, set up an encrypted wallet, which is regarded as the registration process of the user object on the blockchain system. It is used to save the NFT, encrypted resources, etc. of the user object when exchanging resources and casting resources in the blockchain system;

[0137] Secondly, you can also create a collection before minting NFT to determine the collection to which the minted NFT belongs. For example: create a collection by naming and describing it;

[0138] Finally, by setting various parameters such as name, address, file parameters, etc., the resources are uploaded to the blockchain system, so that the on-chain resources after consensus by each node in the blockchain system are obtained based on the resources, thus realizing the process of casting on-chain resources.

[0139] In an optional embodiment, corresponding resource identifiers are generated based on at least one on-chain resource.

[0140] Schematically, while a node in the blockchain system generates at least one on-chain resource based on resource configuration parameters, a corresponding resource identifier is generated for each on-chain resource, and the resource identifier is used to uniquely represent the on-chain resource.

[0141] For example: the on-chain resource obtained by casting is NFT, and multiple NFTs are generated based on different resource configuration parameters. A resource identifier is generated for each NFT, which is represented by tokenid, which can also be called the resource serial number.

[0142] In some embodiments, based on the resource issuer and at least one on-chain resource, a resource identifier corresponding to each of the at least one on-chain resource is generated.

[0143] In an illustrative manner, after generating at least one on-chain resource, the object that casts the on-chain resource is determined, that is, the resource publisher is determined, an association relationship is established between the resource publisher and at least one on-chain resource, and a resource identifier corresponding to at least one on-chain resource is generated. The resource identifier can not only represent the on-chain resource, but also represent the resource publisher that casts the on-chain resource.

[0144] Optionally, in the blockchain system, the resource publisher corresponds to a first address, the on-chain resources minted by the resource publisher are stored in the first address, and each on-chain resource corresponds to a resource identifier.

[0145] In an optional embodiment, the resource identifier is sent to the resource publisher.

[0146] The resource publisher generates a redemption code for redeeming on-chain resources according to the resource identifier, and obtains a redemption code value corresponding to the redemption code.

[0147] In an optional embodiment, the resource identifier is sent to a redemption code platform.

[0148] Schematically, after the nodes in the blockchain system generate corresponding resource identifiers based on the on-chain resources, they send the resource identifiers to the redemption code platform.

[0149] The redemption code platform is used to generate a redemption code for at least one on-chain resource and obtain a redemption code value corresponding to the at least one redemption code.

[0150] Illustratively, the redemption code platform is used to generate redemption codes, which can be redeemed for on-chain resources released by resource publishers.

[0151] Optionally, the redemption code platform and the resource publisher reach a resource agreement in advance so that the redemption code issued by the redemption code platform can be exchanged for on-chain resources issued by the resource publisher; or, the redemption code platform and the resource publisher jointly follow a specified agreement so that the redemption code issued by the redemption code platform can be exchanged for on-chain resources issued by the resource publisher; or, the resource publisher is an object that resides on the redemption code platform, and sends the resource identifier to the redemption code platform to achieve the purpose of sending the resource identifier to the resource publisher, etc.

[0152] In some embodiments, after obtaining the resource identifier, the redemption code platform uses the resource identifier to uniquely indicate the on-chain resource, so the redemption code platform can determine the resource status of the generated on-chain resource based on the resource identifier.

[0153] Indicatively, the redemption code platform and the resource publisher reach a resource agreement in advance, including that the on-chain resource 1 published by the resource publisher can be redeemed by the redemption code A, and the on-chain resource 2 published by the resource publisher can be redeemed by the redemption code B, etc. Based on this, after obtaining the resource identifier m representing the on-chain resource 1 and the resource identifier n representing the on-chain resource 2, the redemption code platform can determine that the blockchain system includes at least the on-chain resource 1 and the on-chain resource 2.

[0154] In some embodiments, the redemption code platform generates a redemption code for redeeming on-chain resources based on the resource identifier.

[0155] Schematically, after obtaining the resource identifier m representing the on-chain resource 1 and the resource identifier n representing the on-chain resource 2, the redemption code platform generates a redemption code A based on the resource identifier m for redeeming the on-chain resource 1 in the blockchain system; in addition, a redemption code B is generated based on the resource identifier n for redeeming the on-chain resource 2 in the blockchain system, and so on.

[0156] In some embodiments, after generating a redemption code for at least one on-chain resource, the redemption code platform converts the at least one redemption code into a code value to obtain a redemption code value corresponding to the at least one redemption code.

[0157] Illustratively, the code value conversion is used to represent the redemption code in the form of a numerical value.

[0158] Optionally, the redemption code is converted into a binary form to obtain a redemption code value corresponding to the redemption code, wherein different redemption codes correspond to different redemption code values.

[0159] Optionally, the redemption code is hashed and the obtained hash value corresponding to the redemption code is used as the redemption code value corresponding to the redemption code, wherein different redemption codes correspond to different redemption code values.

[0160] Step 520: Receive configuration instructions.

[0161] Schematically, the configuration instruction is an instruction sent by the redemption code platform, which includes a redemption code value generated based on the redemption code. The redemption code, as the content used to redeem on-chain resources, has high security requirements. In order to avoid directly exposing multiple redemption codes to the blockchain system to cause possible security risks, the redemption code platform converts the redemption code into a code value to obtain the redemption code value, and sends the redemption code value to the nodes in the blockchain system in the form of a configuration instruction.

[0162] The configuration instruction includes a first configuration instruction consisting of a second resource identifier and a second redemption code value, and the second resource identifier includes a first address registered by the resource publisher on the blockchain system.

[0163] Optionally, the blockchain system includes a resource contract corresponding to the on-chain resources, such as: the on-chain resources are NFTs, the resource contract corresponding to the on-chain resources is an NFT contract, and the NFT contract is implemented as a piece of code on the blockchain system.

[0164] Illustratively, the configuration instruction is used to configure the redemption code value on the resource contract in the blockchain system. Optionally, a configuration instruction includes multiple redemption code values, and the first configuration instruction can be implemented as a sub-instruction under the configuration instruction, which includes a redemption code value; or, a configuration instruction includes a redemption code value, and the first configuration instruction can be implemented as any one of the configuration instructions, etc.

[0165] Illustratively, the first address is used to represent the blockchain address of the resource publisher registered on the blockchain system.

[0166] In some embodiments, a settlement relationship is established between the resource publisher and the redemption code platform. The resource publisher is settled on the redemption code platform. The resource publisher can send configuration instructions through the redemption code platform to configure the redemption code value generated by the redemption code platform and having a redemption relationship with the on-chain resources published by the resource publisher on the resource contract in the blockchain system.

[0167] Step 530, determining a second address registered on the blockchain system by the instruction issuer that issues the first configuration instruction.

[0168] Optionally, the first configuration instruction is an instruction triggered by an instruction issuer, and the blockchain address of the instruction issuer registered on the blockchain system is the second address.

[0169] In an exemplary manner, after obtaining the first configuration instruction, the object that issued the first configuration instruction is determined, and the object is used as the instruction issuer. Optionally, the instruction issuer issues the first configuration instruction through a redemption code platform.

[0170] Illustratively, after receiving the first configuration instruction, the node in the blockchain system can determine the blockchain address of the instruction issuer registered on the blockchain system, and use the blockchain address as the second address.

[0171] Step 540: perform address comparison between the first address and the second address.

[0172] Illustratively, the first address is used to represent the blockchain address corresponding to the resource publisher; the second address is used to represent the blockchain address of the object configured by the first configuration instruction. For example, if the first configuration instruction is a configuration instruction issued by object G, then the second address is used to represent the address of object G registered in the blockchain system.

[0173] Optionally, the first address is compared with the second address to determine whether the first address and the second address are the same address.

[0174] Step 550: configure the second redemption code value based on the address comparison result to obtain a first mapping relationship.

[0175] Illustratively, the address comparison result includes the following two situations: (1) the address comparison result indicates that the first address and the second address are the same address; (2) the address comparison result indicates that the first address and the second address are different addresses.

[0176] Optionally, based on the difference in the address comparison result, the second redemption code value in the first configuration instruction is configured differently.

[0177] In an optional embodiment, in response to the address comparison result indicating that the first address is the same as the second address, the second redemption code value is configured based on the configuration of the second redemption code value on the blockchain system to obtain a first mapping relationship.

[0178] Illustratively, when the address comparison result indicates that the first address is the same as the second address, it is determined that the first configuration instruction is a configuration process performed by the resource publisher, and therefore the configuration process is allowed, so that the second redemption code value in the configuration instruction can be configured.

[0179] Optionally, first determine the configuration status of the second redemption code value on the blockchain system, where the configuration status is used to indicate whether the second redemption code value has been configured on the blockchain system (eg, a resource contract in the blockchain system).

[0180] In some embodiments, in response to the second redemption code value not being configured on the blockchain system, the second redemption code value is configured on the blockchain system to obtain a first mapping relationship.

[0181] In an illustrative manner, if the configuration status indicates that the second redemption code value is not configured on the blockchain system, that is, the second redemption code value does not yet exist on the blockchain system, then based on the premise that the first address and the second address are the same, the second redemption code value is configured on the blockchain system to obtain a first mapping relationship.

[0182] In some embodiments, in response to the second redemption code value having been configured on the blockchain system, a configuration rejection message is fed back.

[0183] Illustratively, if the configuration status indicates that the second redemption code value has been configured on the blockchain system, it means that the second redemption code value already exists on the blockchain system. In order to avoid the problem of repeated configuration of the second redemption code value, a configuration rejection message is generated. The configuration rejection message is used to represent the refusal to repeatedly configure the second redemption code value.

[0184] In some embodiments, the second redemption code value and the second resource identifier are jointly stored as a redemption relationship in the first mapping relationship; and the first mapping relationship is obtained based on at least one redemption relationship.

[0185] Illustratively, when the second redemption code value is configured in the blockchain system, the second redemption code value and the second resource identifier sent by the first configuration instruction are jointly stored to determine the redemption relationship between the second redemption code value and the second resource identifier, and the redemption relationship is used as one of the redemption relationships in the first mapping relationship.

[0186] Optionally, multiple configuration instructions or multiple sub-instructions under one configuration instruction are analyzed separately to obtain multiple exchange relationships between redemption code values ​​and resource identifiers, and the above-mentioned first mapping relationship is obtained by combining the multiple exchange relationships.

[0187] In an optional embodiment, in response to the address comparison result indicating that the first address is different from the second address, the redemption code value is not configured in the blockchain system.

[0188] Optionally, in response to the address comparison result indicating that the first address is different from the second address, a configuration rejection message is fed back to the instruction issuer, where the configuration rejection message is used to indicate that the second redemption code value is not configured on the blockchain.

[0189] Illustratively, when the address comparison result indicates that the first address is different from the second address, it is determined that the first configuration instruction is not a configuration process performed by the resource issuer, and therefore the configuration process is not allowed, so that the redemption code value is not configured in the blockchain system.

[0190] In some embodiments, a second configuration instruction is received.

[0191] Illustratively, when the first configuration instruction is implemented as any one of a plurality of configuration instructions, the second configuration instruction is implemented as other configuration instructions among the plurality of configuration instructions except the first configuration instruction; when the first configuration instruction is implemented as a sub-instruction under the configuration instruction, the second configuration instruction is implemented as other sub-instructions among the configuration instruction except the first configuration instruction, and so on.

[0192] Optionally, based on the redemption code value included in the configuration instruction, if the second redemption code value in the first configuration instruction is not allowed to be configured in the blockchain system, the redemption code values ​​included in other configuration instructions are further analyzed, that is, the second configuration instruction is obtained.

[0193] In an optional embodiment, it is determined that the redemption code value configured by the configuration instruction is used to redeem the on-chain resource; based on the corresponding relationship between the on-chain resource and the resource identifier, a first mapping relationship between the redemption code value and the resource identifier is established.

[0194] Illustratively, after receiving the redemption code value, when it is determined to configure the redemption code value, the on-chain resource used to redeem the redemption code value is determined, thereby determining the resource identifier corresponding to the on-chain resource, and then based on the correspondence between the on-chain resources and the resource identifiers, determining the resource identifiers corresponding to multiple redemption code values ​​respectively, thereby establishing a first mapping relationship between the redemption code value and the resource identifier.

[0195] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.

[0196] Step 560: upon receiving the first redemption code sent by the resource redeemer, determine the first on-chain resource to be redeemed with the first redemption code from at least one on-chain resource based on the first mapping relationship.

[0197] Illustratively, the resource exchanger is used to represent an object that needs to exchange resources. Optionally, the resource exchanger is implemented as a personal object; or, the resource exchanger is implemented as an enterprise object, etc.

[0198] In some embodiments, after the resource redeemer completes a predetermined task set by the redemption code platform, he obtains the first redemption code as a task completion reward.

[0199] In an illustrative manner, the redemption code platform sets multiple scheduled tasks. When the resource redeemer completes scheduled task 1 among the multiple scheduled tasks, he / she will obtain redemption code A as a task completion reward; when the resource redeemer completes scheduled task 2 among the multiple scheduled tasks, he / she will obtain redemption code B as a task completion reward, etc. The above-mentioned redemption code A and redemption code B can both be used as the first redemption code for the resource redeemer to use when redeeming resources.

[0200] In some embodiments, the resource redeemer obtains the first redemption code as a purchased item by purchasing a redemption code generated by a redemption code platform.

[0201] Indicatively, the resource exchanger purchases on-chain resource gift cards (such as NFT gift cards) on the redemption code platform by consuming items and virtual resources, and the redemption code platform issues a redemption code for redeeming on-chain resources to the resource exchanger. When the resource exchanger needs to redeem on-chain resources, it can directly request to redeem on-chain resources from the blockchain system, or indirectly request to redeem on-chain resources from the blockchain system through the redemption code platform.

[0202] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.

[0203] Optionally, the redemption code sent by the resource redeemer is referred to as a first redemption code, and the first redemption code is at least one redemption code among the redemption codes held by the resource redeemer.

[0204] In an optional embodiment, when the first redemption code sent by the resource redeemer is received, the first redemption code is converted into a code value to obtain a first redemption code value corresponding to the first redemption code.

[0205] Illustratively, the code value conversion is used to represent the redemption code in the form of a numerical value.

[0206] In some embodiments, when a first redemption code sent by a resource redeemer is received, the first redemption code is hash-converted to obtain a hash value corresponding to the first redemption code as the first redemption code value.

[0207] Illustratively, hash conversion is used to convert the first redemption code into a hash value (hash). The hash value can be understood as: processing a piece of data (such as a file, a string, etc.) through a hash algorithm to map a longer piece of data into shorter data. The data obtained after mapping is regarded as the hash value of the original data.

[0208] Alternatively, a hash algorithm can also be called a hash algorithm. Common hash algorithms include Message Digest (MD), Secure Hash Algorithm (SHA), etc. The MD algorithm family includes MD2, MD4, and MD5, which are updated versions of the MD algorithm. The message digests they generate are all 128 bits, usually represented by 32 characters in hexadecimal. The SHA algorithm family includes SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512. SHA-224, SHA-256, SHA-384, and SHA-512 are sometimes collectively referred to as SHA-2. SHA-1 can convert a maximum of 2 64 The data is converted into a 160-bit data digest. The digest length generated by SHA-2 is the number after their name. For example, the digest length generated by the SHA-256 algorithm is 256 bits, so its brute-force resistance is better than that of the MD algorithm.

[0209] In some embodiments, any of the above hash algorithms is used to perform hash conversion on the first redemption code to obtain a first redemption code value corresponding to the first redemption code. Optionally, the redemption code value is referred to as a redemption code hash, and the redemption code hash has a unique reference and can uniquely represent the redemption code; in addition, the redemption code hash is irreversible, that is, when analyzing the redemption code hash, the corresponding redemption code (also referred to as the original redemption code) cannot be calculated by reversing the redemption code value, thereby avoiding the problem of redemption code theft.

[0210] For example, taking a book as data that has not been hashed, a 64-bit string (hash value) can be obtained after hashing the content of the book, but the content of the book cannot be deduced based on the 64-bit string alone.

[0211] In an optional embodiment, based on the first redemption code value and the first mapping relationship, a first on-chain resource for redemption of the first redemption code is determined from at least one on-chain resource.

[0212] In some embodiments, the first mapping relationship is queried based on the first redemption code value to determine a first resource identifier having a redemption relationship with the first redemption code value.

[0213] Illustratively, after a first redemption code value corresponding to a first redemption code is obtained through hash conversion, a first mapping relationship is used to store the redemption relationship between the redemption code value and the resource identifier, and the first redemption code value is searched in the first mapping relationship, and a resource identifier that has a redemption relationship with the first redemption code value is determined as the first resource identifier.

[0214] In some embodiments, a first on-chain resource uniquely identified by a first resource identifier is determined from at least one on-chain resource.

[0215] Based on the resource identifier being used to uniquely characterize the on-chain resource, therefore based on the determination of the first resource identifier, the first on-chain resource represented by the first resource identifier can be determined from at least one on-chain resource, and the first on-chain resource corresponds to the first redemption code value, and is used to characterize the on-chain resource redeemed by the first redemption code.

[0216] Among them, the first on-chain resources are used to be sent to the resource exchange party.

[0217] In some embodiments, the resource exchanger has been registered in the blockchain system, so that the resource exchanger has a corresponding first blockchain address in the blockchain system. When the first chain resource is sent, the first chain resource is transferred to the first blockchain address registered by the resource exchanger in the blockchain system, thereby achieving the purpose of sending the first chain resource.

[0218] In some embodiments, after determining the first on-chain resource for which the first redemption code is to be redeemed, the resource redemption status of the first on-chain resource is determined. The resource redemption status is used to characterize the redemption status of the on-chain resource. Schematically, the resource redemption status includes that the on-chain resource has been redeemed (e.g., the resource redeemer has previously redeemed the first on-chain resource through the redemption code and cannot be redeemed repeatedly; or, other resource redeemers have already redeemed the first on-chain resource through the redemption code), the on-chain resource has not been redeemed, the on-chain resource has expired (e.g., the on-chain resource is invalid if it is not redeemed within a preset time period), etc.

[0219] In an illustrative manner, when the resource exchange status indicates that the resource on the first chain has not been exchanged, the resource on the first chain is transferred to the first blockchain address corresponding to the resource exchanger, so as to achieve the purpose of sending the resource on the first chain to the resource exchanger; or, when the resource exchange status indicates that the resource on the first chain has been exchanged, a resource exchange failure message is sent to the resource exchanger to prompt the resource exchanger that the resource on the first chain has been exchanged.

[0220] In an optional embodiment, the resource redemption process is performed through a redemption code value.

[0221] Optionally, the resource exchanger obtains a first redemption code, converts the first redemption code into a code value, obtains a first redemption code value corresponding to the first redemption code, and sends the first redemption code value to a node in the blockchain system, thereby avoiding exposing the redemption code to the blockchain system.

[0222] Optionally, the resource publisher sends the redemption code value corresponding to the redemption code to the resource redeemer. The resource redeemer holds at least one redemption code value. When the resource redeemer needs to redeem resources, the resource redeemer sends the first redemption code value to a node in the blockchain system, thereby avoiding exposing the redemption code to the wrong resource redeemer. The resource redeemer can perform the resource redemption process through the redemption code value, etc.

[0223] In an optional embodiment, the resource exchanger holds a first public key corresponding to a node in the blockchain system, and the node in the blockchain system holds a first private key for decrypting the first public key.

[0224] The first redemption code is encrypted by the first public key.

[0225] In some embodiments, upon receiving a first redemption code sent by a resource redeemer, the encrypted first redemption code is decrypted using a first private key to obtain the first redemption code; based on the first redemption code, a first mapping relationship is queried to determine a first on-chain resource redeemed by the first redemption code from at least one on-chain resource.

[0226] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.

[0227] To summarize, the redemption code value representing the redemption code is configured through the nodes in the blockchain system to avoid the risks that may be caused by directly exposing the redemption code to the blockchain system. The correspondence between the resource identifier and the on-chain resource, the redemption relationship between the on-chain resource and the redemption code, and the representation relationship between the redemption code and the redemption code value are integrated to store the first mapping relationship between the redemption code value and the resource identifier on the node in the blockchain system, thereby not only improving the security of resource redemption through the redemption code, but also enabling the node in the blockchain system to directly receive the first redemption code sent by the resource redeemer, so as to determine the first on-chain resource redeemed by the first redemption code through the first mapping relationship, avoiding the inefficiency of sending the redemption code to a third party to redeem the resource, improving the resource redemption efficiency while ensuring security, and facilitating the expansion of the use scenarios of resource redemption through the redemption code and the first mapping relationship.

[0228] In an embodiment of the present application, by comparing the address of the instruction issuer that issues the configuration instruction with the address represented by the resource identifier included in the configuration instruction, it is determined whether the instruction issuer that issues the configuration instruction is the resource publisher that casts the on-chain resources, so as to limit the objects of the redemption code value configuration process and improve the security of the redemption code value configuration process; in addition, when configuring the redemption code value, a first mapping relationship is established between the comprehensive redemption code value and the resource identifier, so as to manage the redemption relationship between the redemption code value and the resource identifier in a more coordinated manner through the first mapping relationship, thereby improving the configuration efficiency and resource management efficiency.

[0229] In an optional embodiment, the node in the blockchain system is further used to store a second mapping relationship, and the second mapping relationship is used to characterize the relationship between at least one redemption code value and the resource redemption state. Figure 6 As shown above Figure 4 The illustrated embodiment may further include steps 610 to 630 implemented as follows.

[0230] Step 610, in response to the redemption code value being configured in the blockchain system, adjusting the resource redemption state corresponding to the redemption code value to a first state.

[0231] Illustratively, in addition to storing the first mapping relationship based on the configuration instruction, the resource redemption state corresponding to the redemption code value is set to the first state.

[0232] Among them, the first state is used to represent that the on-chain resources exchanged by the redemption code value have not been exchanged within the historical time period.

[0233] In some embodiments, after a node in a blockchain system obtains at least one on-chain resource, the on-chain resource is a resource redeemed through a redemption code. Before the redemption code value is configured in the node in the blockchain system, the on-chain resource is in an unredeemable state, so the resource redemption state corresponding to the redemption code value can be set to the first state.

[0234] In some embodiments, after a node in a blockchain system obtains at least one on-chain resource, the on-chain resource can be exchanged not only through a redemption code but also through resource transfer and other methods. Therefore, when configuring the redemption code value in the blockchain system, it is determined whether the on-chain resource used to redeem the redemption code value has been redeemed within a historical time period. When the on-chain resource has not been redeemed within the historical time period, the resource redemption state corresponding to the redemption code value can be set to the first state.

[0235] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.

[0236] Step 620: Establish a second mapping relationship representing at least one redemption code value and at least one resource redemption state.

[0237] Schematically, in the process of configuring at least one redemption code value based on the configuration instruction, the resource identifier that has an exchange relationship with each redemption code value can be determined; each redemption code value is analyzed separately to determine the resource identifier corresponding to each redemption code value, so as to know the on-chain resources used for redemption of each redemption code value, and then according to the resource exchange situation of the on-chain resources used for redemption of each redemption code value in the historical time period, the resource exchange status corresponding to each redemption code value is determined to establish a second mapping relationship.

[0238] Optionally, the on-chain resource is a resource that is exchanged through a redemption code. When the on-chain resource has not been exchanged, at least one resource exchange state represented by the second mapping relationship is a first state, that is, the initial situation of the second mapping relationship is implemented as the resource exchange state corresponding to at least one redemption code value is a first state, to represent that the redemption process of at least one on-chain resource has not yet been performed through the redemption code.

[0239] Schematically, the first state can be represented by a numerical value. For example, the first state is represented by "0", which means that the on-chain resource corresponding to the redemption code value has not been redeemed. For example, the second mapping relationship includes redemption code value m-0; redemption code value n-0, etc., which means that the on-chain resource 1 used for redemption by redemption code A corresponding to redemption code value m has not been redeemed; the on-chain resource 2 used for redemption by redemption code B corresponding to redemption code value n has not been redeemed, etc.

[0240] Step 630: In response to the first on-chain resource corresponding to the first redemption code value being redeemed, adjusting the resource redemption state corresponding to the first redemption code value to a second state in the second mapping relationship.

[0241] Schematically, when the resource exchanger sends a first redemption code so that the first on-chain resource in at least one on-chain resource is exchanged with the first redemption code and then sent to the resource exchanger, the first on-chain resource is realized in a redeemed state; based on this redemption process, the first redemption code value corresponding to the first on-chain resource is determined through the first mapping relationship (the first resource identifier is determined based on the first on-chain resource, and the first redemption code value is determined through the first resource identifier), and then according to the second mapping relationship, the resource redemption state corresponding to the first redemption code value is adjusted to the second state.

[0242] The second state is used to indicate that the on-chain resource exchanged by the exchange code value has been exchanged within the historical time period. The first state is different from the second state.

[0243] That is, by adjusting the resource exchange state corresponding to the first exchange code value to the second state, it means that the first on-chain resource exchanged by the first exchange code corresponding to the first exchange code value has been exchanged within the historical time period.

[0244] Optionally, based on the adjustment of the second state, even if the first redemption code is received later (such as: the first redemption code held by other resource redeemers; or the first redemption code that has not been destroyed in time by the current resource redeemer, etc.), the first-chain resources required to be redeemed by the first redemption code will not be successfully redeemed due to the restrictions of the second state. This can not only effectively avoid the problem of repeated redemption of the first-chain resources, but also enable more coordinated management of the redemption of the first-chain resources through the second mapping relationship.

[0245] Schematically, the second state can be represented by a numerical value. For example: the first state is represented as "0" and the second state is represented as "1", which means that the on-chain resource corresponding to the redemption code value has been redeemed. For example: in the initial case, the second mapping relationship includes redemption code value m-0; redemption code value n-0, etc.; after receiving the first redemption code sent by the resource redeemer (such as: redemption code A corresponding to the redemption code value m), based on the fact that the first on-chain resource (such as: on-chain resource 1) used for redemption by the first redemption code has not been redeemed, the first on-chain resource can be sent to the resource redeemer, and based on the resource sending (resource redemption) process, the resource redemption state corresponding to the first redemption code value (redemption code value m) is adjusted from the first state "0" to the second state "1", then the second mapping relationship becomes redemption code value m-1; redemption code value n-0, etc.

[0246] Similarly, when receiving other redemption codes (also called first redemption codes) for resource redemption, the resource redemption status corresponding to other redemption code values ​​in the second mapping relationship can also be redeemed according to the resource redemption status of other on-chain resources. For example: after receiving the redemption code B corresponding to the redemption code value n sent by the resource redeemer again, based on the fact that the on-chain resource 2 used for redemption by the redemption code B has not been redeemed, the on-chain resource 2 can be sent to the resource redeemer. Based on the resource sending process, the resource redemption status corresponding to the redemption code value n is adjusted from the first state "0" to the second state "1", and the second mapping relationship becomes the redemption code value m-1; the redemption code value n-1, and so on.

[0247] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.

[0248] To summarize, the redemption code value representing the redemption code is configured through the nodes in the blockchain system to avoid the risks that may be caused by directly exposing the redemption code to the blockchain system. The correspondence between the resource identifier and the on-chain resource, the redemption relationship between the on-chain resource and the redemption code, and the representation relationship between the redemption code and the redemption code value are integrated to store the first mapping relationship between the redemption code value and the resource identifier on the node in the blockchain system, thereby not only improving the security of resource redemption through the redemption code, but also enabling the node in the blockchain system to directly receive the first redemption code sent by the resource redeemer, so as to determine the first on-chain resource redeemed by the first redemption code through the first mapping relationship, avoiding the inefficiency of sending the redemption code to a third party to redeem the resource, improving the resource redemption efficiency while ensuring security, and facilitating the expansion of the use scenarios of resource redemption through the redemption code and the first mapping relationship.

[0249] In an embodiment of the present application, a second mapping relationship is introduced to characterize the resource exchange status of the on-chain resources used to exchange the configured redemption code value. Through the correspondence between the redemption code value and the resource exchange status, it is convenient to know the resource exchange status more intuitively and clearly, so that through the establishment and update process of the second mapping relationship, the redemption code value and the exchanged on-chain resources are managed more simply and comprehensively, which is improved and conducive to improving the resource exchange efficiency.

[0250] In an optional embodiment, the user for resource exchange is called a resource exchanger, and the resource exchanger performs the resource exchange process by sending a first exchange code to a node in the blockchain system. Figure 4 The execution subject of the resource exchange method on the blockchain shown is the node in the blockchain system; Figure 7 As shown, the execution subject of the resource exchange method on the blockchain is taken as the resource exchanger as an example for explanation, and the explanation content is as follows: step 710 to step 730.

[0251] Step 710, obtain a first redemption code.

[0252] The first redemption code is used to redeem on-chain resources from the blockchain, and the on-chain resources are resources deployed in the blockchain system.

[0253] Among them, the blockchain stores at least one on-chain resource and a first mapping relationship, and at least one on-chain resource corresponds to a resource identifier, which uniquely identifies the on-chain resource; the first mapping relationship includes a correspondence between at least one redemption code value and the resource identifier, and the redemption code value is used to represent the information of the redemption code.

[0254] Illustratively, a node in the blockchain system receives a configuration instruction before obtaining a first redemption code; and stores a first mapping relationship based on the configuration instruction.

[0255] Among them, the configuration instruction includes at least one redemption code value, and the redemption code is used to redeem on-chain resources in the blockchain system.

[0256] In some embodiments, the resource exchanger obtains the first redemption code by completing a predetermined task; or, the resource exchanger obtains the first redemption code based on a distribution process of a redemption code platform; or, the resource exchanger obtains the first redemption code through a donation process from other redemption code holders, etc.

[0257] In an illustrative manner, the first redemption code is any at least one redemption code among a plurality of redemption codes held by the resource redeemer. When the resource redeemer needs to obtain on-chain resources from the blockchain system, the resource redemption process can be realized by consuming the first redemption code.

[0258] Step 720: Send the first redemption code to the blockchain system.

[0259] Among them, the blockchain system is used to convert the redemption code into a first redemption code value.

[0260] Optionally, the first redemption code is used to redeem the on-chain resources stored in the resource contract. The first redemption code is sent to the blockchain system, and the first redemption code is received through the resource redemption interface corresponding to the resource contract on the blockchain system. The resource redemption interface can convert the first redemption code into a first redemption code value.

[0261] Illustratively, the resource exchange interface performs hash conversion on the first redemption code to use the hash value of the converted first redemption code as the first redemption code value.

[0262] In an optional embodiment, the resource exchanger converts the first redemption code into a code value to obtain a first redemption code value, and sends the first redemption code value to the blockchain system.

[0263] Step 730: Receive a resource exchange message sent by the blockchain system.

[0264] Among them, the blockchain system is used to determine the first on-chain resource for redemption of the first redemption code from at least one on-chain resource through a first mapping relationship.

[0265] Schematically, the first mapping relationship is used to store the redemption relationship between the redemption code value and the resource identifier. Based on the first redemption code value obtained after converting the first redemption code into a code value, the resource identifier corresponding to the first redemption code value is determined from the first mapping relationship as the first resource identifier. Based on the resource identifier, the on-chain resource is uniquely identified. Therefore, the first on-chain resource can be determined based on the first resource identifier. The first on-chain resource is the on-chain resource that the first redemption code is used to redeem.

[0266] Among them, the resource exchange message is a message generated based on the resource exchange status of the resources on the first chain.

[0267] Optionally, after determining that the first redemption code is used to redeem the first on-chain resource, the node in the blockchain system determines the resource redemption status of the first on-chain resource.

[0268] Among them, the resource exchange status is used to characterize the exchange status of on-chain resources. In principle, the resource exchange status includes the on-chain resource has been exchanged (e.g., the resource exchanger has previously exchanged the first on-chain resource through the exchange code and cannot exchange it again; or, other resource exchangers have exchanged the first on-chain resource through the exchange code), the on-chain resource has not been exchanged, the on-chain resource has expired (e.g., the on-chain resource is invalid if it is not exchanged within a preset time period), etc.

[0269] In an optional embodiment, a resource exchange success message sent by the blockchain system is received.

[0270] Among them, the resource exchange success message is a message generated by the blockchain system when it determines that the resources on the first chain have not been exchanged within the historical time period; the resource exchange success message is used to indicate that the blockchain system transfers the resources on the first chain to the resource exchange party.

[0271] In an illustrative manner, when the resource exchange status indicates that the resource on the first chain has not been exchanged, the resource on the first chain is transferred to the first blockchain address corresponding to the resource exchanger, so as to achieve the purpose of sending the resource on the first chain to the resource exchanger. Optionally, based on the resource exchange process, the node in the blockchain system generates a resource exchange success message and sends the resource exchange success message to the resource exchanger.

[0272] In an optional embodiment, a resource exchange failure message sent by a blockchain system is received.

[0273] Among them, the resource exchange failure message is a message generated by the blockchain system when it determines that the resources on the first chain have been exchanged within a historical time period.

[0274] Illustratively, when the resource exchange status indicates that the resource on the first chain has been exchanged, the blockchain system cannot send the resource on the first chain to the resource exchanger, and therefore generates a resource exchange failure message, and sends the resource exchange failure message to the resource exchanger to remind the resource exchanger that the resource on the first chain cannot be successfully exchanged.

[0275] Optionally, the resource exchange failure message may also be a message generated based on that the resources on the first chain have not been exchanged within a preset time period.

[0276] Indicatively, the first on-chain resource is an on-chain resource with a time limit. When the first on-chain resource is not redeemed by any resource redeemer within a preset time period, the first on-chain resource becomes invalid. When the first on-chain resource is determined based on the first redemption code after the preset time period, since the first on-chain resource has expired, the blockchain system cannot send the first on-chain resource to the resource redeemer, and then generates a resource redemption failure message and sends it to the resource redeemer to remind the resource redeemer that the first on-chain resource cannot be successfully redeemed.

[0277] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.

[0278] In an optional embodiment, a second mapping relationship is also stored in the blockchain system, and the second mapping relationship is used to characterize the exchange situation between at least one redemption code value and the resource redemption status.

[0279] In an illustrative manner, if the resource exchange situation changes based on the redemption code, the redemption code value corresponding to the redemption code in the second mapping relationship is determined, and the resource redemption status corresponding to the redemption code value is adjusted; thereby, when the resource redemption situation is determined based on the redemption code, the resource redemption status corresponding to the redemption code value of the redemption code can be more intuitively determined through the second mapping relationship, thereby facilitating a more standardized management process for at least one on-chain resource.

[0280] In an optional embodiment, the content within the blockchain system is executed through a resource contract in the blockchain system.

[0281] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.

[0282] To summarize, the redemption code value representing the redemption code is configured through the nodes in the blockchain system to avoid the risks that may be caused by directly exposing the redemption code to the blockchain system. The correspondence between the resource identifier and the on-chain resource, the redemption relationship between the on-chain resource and the redemption code, and the representation relationship between the redemption code and the redemption code value are integrated to store the first mapping relationship between the redemption code value and the resource identifier on the node in the blockchain system, thereby not only improving the security of resource redemption through the redemption code, but also enabling the node in the blockchain system to directly receive the first redemption code sent by the resource redeemer, so as to determine the first on-chain resource redeemed by the first redemption code through the first mapping relationship, avoiding the inefficiency of sending the redemption code to a third party to redeem the resource, improving the resource redemption efficiency while ensuring security, and facilitating the expansion of the use scenarios of resource redemption through the redemption code and the first mapping relationship.

[0283] In an embodiment of the present application, the resource exchange process of the resource exchanger is explained. Under the condition that the nodes in the blockchain system are configured with a first mapping relationship, the resource exchanger can more directly search for the first-chain resource that has an exchange relationship with the first exchange code value of the first exchange code in the blockchain system by sending the first exchange code it holds, thereby improving the search efficiency of the first-chain resource; in addition, the resource exchange status of the resource on the first chain can be determined with the help of the second mapping relationship, so as to more intuitively know whether the resource on the first chain has been exchanged, avoiding the limitation that the resource exchanger can only exchange resources through the platform, and greatly improving the flexibility of the resource exchanger in exchanging resources.

[0284] In an optional embodiment, the related technology is briefly introduced. In the related technology, the following method is usually used to issue on-chain assets (such as NFT) to users:

[0285] (1) No threshold restriction method, that is, the object can be exchanged at will;

[0286] (2) First, the blockchain addresses of the users are collected through various resource exchange platforms, questionnaires, etc., and a whitelist is configured when deploying a resource contract (such as an NFT contract). The whitelist stores the blockchain addresses of the users collected above. Then, the whitelist is uploaded to the blockchain system, so that only the users on the whitelist can redeem resources on the chain.

[0287] (3) Collect the blockchain addresses of users offline through various resource exchange platforms, questionnaires, etc., and form a whitelist (blockchain addresses of the whitelist), but do not maintain the whitelist on the blockchain system. Instead, the resource publisher (or resource publisher) actively transfers the on-chain resources to the blockchain address of the user, preventing the user from actively exchanging;

[0288] (4) Instead of collecting the blockchain addresses of the users in advance to form a whitelist, the redemption code platform maintains the redemption codes off-chain. If the users need to use the redemption codes to redeem on-chain resources on the blockchain, they must go to the redemption code platform to realize the resource redemption process, and cannot directly redeem the resources on the blockchain system.

[0289] However, the above process has at least the following disadvantages:

[0290] 1. As in the above-mentioned related technologies (1) to (3), the exchange process of on-chain resources with thresholds (such as NFT) requires the blockchain address of the user to be sensed in advance for judgment. It is impossible to give on-chain resources as gifts to other users, and other users cannot receive them by themselves;

[0291] 2. As in the above-mentioned related technology (4), although the purpose of exchanging on-chain resources can be achieved with the help of redemption codes, the redemption codes can also be given as gifts to other users, or exchanged for goods with other users. However, due to the security issues required by the redemption codes for exchanging on-chain resources, the data of the redemption codes is not public, and the redemption code platform that generates the redemption codes needs to maintain the redemption codes offline. Therefore, during the resource redemption process, the user can only realize the resource redemption process through the redemption code platform, which is relatively inefficient. In addition, offline maintenance may also cause the redemption code to be unusable or reused after expiration, affecting the efficient use of the redemption code.

[0292] In an optional embodiment, the resource exchange method on the above-mentioned blockchain is called "a design for redeeming on-chain assets with redemption codes", wherein the redemption code value is obtained by converting the code value through the redemption code while maintaining the above-mentioned advantages of the redemption code, and then the irreversible redemption code value is configured in the blockchain system, thereby improving the security of the redemption code; in addition, based on the configuration process in the blockchain system, the user can directly send the redemption code to the blockchain system to redeem on-chain resources through the redemption code, thereby improving the efficiency of resource exchange.

[0293] Indicatively, Figure 8 As shown above Figure 4 The resource exchange method on the blockchain shown can also be implemented as a redemption code value configuration part and a resource exchange part. The redemption code value configuration part is used to configure the irreversible redemption code value in the blockchain system; the resource exchange part is used to represent that the resource exchanger obtains the on-chain resource from the blockchain system through the redemption code. The configuration part and the exchange part are described in the following content.

[0294] (I) Redemption code value configuration part

[0295] Indicatively, Figure 8 As shown, taking the implementation of on-chain resources as NFT resources as an example, an NFT contract 820 (a piece of code deployed on the blockchain system) is deployed on the blockchain system, and the configuration process involves the resource publisher 810 and the NFT contract 820 deployed on the blockchain system.

[0296] Compared with the original standard that only defines the interface names and parameter names of NFT casting and transfer, smart contract standards such as ERC721 and ERC1155 add the interface logic of redemption code, so as not to restrict the newly added interface methods and the logic implementation in the interface. Considering that there are many contract development languages, different blockchain systems have different corresponding development languages, such as: the contract development language on the Ethereum blockchain system is usually implemented as solidity, etc. Optionally, the Ethereum blockchain system is used as an example for the following description.

[0297] Optionally, the NFT contract 820 is a resource contract deployed on the blockchain system based on smart contract standards such as ERC721 and ERC1155. Compared with the original standard contract, the NFT contract 820 adds a first mapping relationship between the redemption code value (redemption code hash) and the resource identifier (tokenid), and a second mapping relationship between the redemption code value (redemption code hash) and the resource redemption status (redemption status).

[0298] Illustratively, the process of constructing the first mapping relationship and the second mapping relationship is implemented using the dictionary mapping data structure mapping of Solidity.

[0299] In some embodiments, the configuration process of configuring the redemption code value is implemented through the redemption code configuration interface setCode on the NFT contract 820, and the configuration redemption code interface setCode is used to receive (tokenid, codehash), where codehash is used to represent the redemption code value.

[0300] Optionally, the redemption code configuration interface setCode needs to perform strict checks and judgments, and tokenid is the resource identifier of the NFT that has been released by the resource publisher.

[0301] First, determine the blockchain address of the configurator who performs the redemption code value configuration process, and determine the blockchain address of the resource publisher of the NFT represented by the tokenid according to the tokenid in (tokenid, codehash); then compare whether the blockchain address of the configurator and the blockchain address of the resource publisher are the same address. This judgment process is used to limit: only the resource publisher can perform the configuration process of the redemption code value.

[0302] Indicatively, the resources on the chain are open and transparent, and each user can know the situation of NFT, but the redemption process of NFT depends on the redemption code, so the redemption code plain text cannot be directly configured on the NFT contract 820 in the blockchain system, otherwise the information will be leaked. Therefore, using the redemption code hash can ensure that the redemption code cannot be reversed, so that the original redemption code cannot be known based on the redemption code hash. There are many hash algorithms, such as the above-mentioned MD5 algorithm, SHA258 algorithm, etc.

[0303] Optionally, the redemption code configuration interface setCode determines that the resource issuer is performing the configuration process of the redemption code value based on the tokenid in (tokenid, codehash), and then checks the codehash therein to determine whether the codehash has been configured on the NFT contract 820.

[0304] Indicatively, if it is determined that codehash has been previously configured on the NFT contract 820, codehash is refused to be configured again. For example, codehash is a redemption code value m used to redeem on-chain resource 1. If the redemption code value m has been configured before, there is no need to reconfigure the redemption code value m to save the amount of configuration data.

[0305] Indicatively, if it is determined that codehash has not been configured on the NFT contract 820 before, the codehash is configured on the NFT contract 820. For example: codehash is the redemption code value n used to redeem on-chain resource 2. If the redemption code value n has not been configured before, the redemption code value n is configured on the NFT contract 820 for the subsequent redemption process.

[0306] In some embodiments, the redemption code configuration interface is based on the existence of a redemption relationship between the received resource identifier and the redemption code value, that is, the on-chain resource represented by the resource identifier is used to be redeemed through the redemption code corresponding to the redemption code value.

[0307] In an illustrative manner, when the redemption code value is configured in the NFT contract 820 in the blockchain system, the redemption code value and the resource identifier are jointly stored to establish a first mapping relationship including the redemption relationship between the redemption code value and the resource identifier. That is, the mapping record from codehash to tokenid is completed based on the configuration process.

[0308] In some embodiments, in addition to establishing the above-mentioned first mapping relationship on the NFT contract 820, a corresponding resource exchange status is set for each redemption code value to establish a second mapping relationship. Among them, the resource exchange status is used to characterize the exchange status of on-chain resources, that is, the exchange status of on-chain resources represented by the resource identifier that has an exchange relationship with the redemption code value. That is: based on the configuration process, another mapping record from codehash to resource exchange status is also completed.

[0309] In an illustrative manner, on-chain resources need to be redeemed through redemption codes. Before the redemption code value is configured in the NFT contract 820 and there is no resource redemption process, the resource redemption state corresponding to each redemption code value is the first state, that is, each redemption code value in the second mapping relationship corresponds to the first state.

[0310] Optionally, as the resource exchange process of exchanging the corresponding on-chain resources through the redemption code, in the second mapping relationship, the first state corresponding to the redemption code value of the redemption code is promptly adjusted to the second state to indicate that the on-chain resource corresponding to the redemption code value has been exchanged, thereby avoiding the problem of repeated redemption of the on-chain resource.

[0311] like Figure 8 As shown, before configuring the redemption code value, the resource publisher 810 needs to first call the mint method or create method of the standard NFT contract to pass parameters normally to carry out the NFT casting process, which is equivalent to processing the on-chain resources on the chain so that the blockchain system stores the casted on-chain resources (NFT). Schematically, the unique resource identifier tokenid of the on-chain resource can be obtained during the casting process of the NFT.

[0312] Optionally, the resource publisher 810 generates a redemption code for redeeming the NFT based on the minted NFT, and performs hash conversion on the redemption code through a hash algorithm such as the MD5 algorithm or the SHA258 algorithm to obtain a redemption code value (codehash); or, the resource publisher 810 is an object resident on the redemption code platform, and the resource publisher 810 generates a redemption code for redeeming the NFT based on the redemption code platform after the process of minting the NFT, and performs hash conversion on the redemption code through a hash algorithm such as the MD5 algorithm or the SHA258 algorithm to obtain a redemption code value (codehash).

[0313] like Figure 8 As shown, the resource publisher 810 calls the redemption code configuration interface setCode to implement the configuration process of configuring the redemption code value on the NFT contract 820.

[0314] In an optional embodiment, the resource exchanger is used to perform the resource exchange process through the exchange interface on the NFT contract 820 after the above-mentioned configuration process.

[0315] Optionally, in order to facilitate the resource exchanger to subsequently exchange resources by calling the exchange interface, transfer logic is added during the configuration process.

[0316] Schematically, the transfer logic is the logic deployed for the NFT contract 820, which is used to transfer the on-chain resources (NFT) generated by minting to the blockchain address corresponding to the NFT contract 820.

[0317] In some embodiments, the resource publisher 810 performs the following Figure 8 After the process of calling the redemption code configuration interface setCode to configure the redemption code hash is shown, the first mapping relationship and the second mapping relationship are stored on the NFT contract 820; thereafter, the NFT contract 820 executes the transfer logic to transfer the NFT cast and stored in the blockchain system to the blockchain address corresponding to the NFT contract 820.

[0318] Indicatively, the blockchain address corresponding to the NFT contract 820 is used to represent the address assigned to the NFT contract after it is deployed in the blockchain system. The NFT contract 820 has control over the on-chain resources stored in the blockchain address corresponding to the NFT contract 820. Only the logic triggered by the execution of the contract code can operate the on-chain resources stored in the blockchain address. This not only improves the control of the NFT contract 820 over the on-chain resources stored therein, but also facilitates the NFT contract 820 to execute the resource exchange process more quickly based on the exchange code sent by the resource exchanger.

[0319] Optionally, the blockchain address corresponding to the NFT contract 820 does not have a private key, and no object can perform any operations on the on-chain resources stored therein. Only objects with the plain text of the redemption code can call the redemption interface of the NFT contract 820 to trigger the resource redemption process through contract logic verification. In other words, once the contract code of the NFT contract 820 is deployed, the execution logic is fixed and no one can tamper with it, thereby further improving the security of resource redemption with the help of the properties of the NFT contract 820.

[0320] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.

[0321] (II) Resource Exchange

[0322] Indicatively, Fig. 9As shown, taking the implementation of on-chain resources as NFT resources as an example, the resource exchanger 910 (or redeemer) is used to exchange NFT resources through a redemption code (original redemption code); an NFT contract 920 is deployed on the blockchain system, and the resource exchange process involves the resource exchanger 910 and the NFT contract 920 deployed on the blockchain system.

[0323] In an optional embodiment, the resource exchanger 910 is used to perform the resource exchange process through the exchange interface on the NFT contract 920 after the above-mentioned exchange code value configuration process.

[0324] In an illustrative manner, the resource exchanger 910 calls the exchange interface and sends the exchange code to the NFT contract 920; the NFT contract 920 performs code value conversion on the exchange code to obtain the exchange code value corresponding to the exchange code. For example, the NFT contract 920 converts the code value of the exchange code using the hash algorithm used by the resource publisher when performing code value conversion, such as the above-mentioned MD5 algorithm, SHA259 algorithm, etc., and uses the obtained hash value as the exchange code value corresponding to the exchange code.

[0325] For example: in the implementation process of the redemption interface cash (code), the resource exchanger 910 only needs to pass the redemption code (the original parameter of the redemption code) to the NFT contract 920. The contract logic of the NFT contract 920 will calculate the redemption code value (codehash) corresponding to the redemption code on the chain. The codehash calculated for the same redemption code (code) must be the same, and the codehash cannot be reversed to a redemption code.

[0326] In an illustrative manner, the NFT contract 920 checks whether the redemption code value (codehash) after code value conversion is in the first mapping relationship based on the first mapping relationship stored in the redemption code value configuration process. If it is, the resource identifier (tokenid) corresponding to the redemption code value is determined; if not, it means that the redemption code value does not have an inclusion relationship with the redemption code value in the pre-stored first mapping relationship, so the redemption code value is no longer analyzed.

[0327] Indicatively, if the redemption code value (codehash) after the code value conversion is in the first mapping relationship, the NFT contract 920 also checks the resource redemption status (redemption status) corresponding to the redemption code value (codehash) at the current moment based on the second mapping relationship stored in the redemption code value configuration process, that is, determines whether the on-chain resource (NFT) corresponding to the redemption code value has been redeemed (redeemed). If it has not been redeemed (such as the first state mentioned above), the on-chain resource corresponding to the redemption code value is determined to send the on-chain resource to the resource redeemer 910; if it has been redeemed (such as the second state mentioned above), the on-chain resource is no longer processed.

[0328] In an illustrative manner, when the on-chain resources of the NFT contract 920 are sent to the resource exchanger 910, the triggering conditions for triggering the contract logic of the NFT contract 920 are implemented based on the above process, and the on-chain resources corresponding to the redemption code value are determined from the blockchain address corresponding to the NFT contract 920. By transferring the on-chain resources from the blockchain address corresponding to the NFT contract 920 to the blockchain address corresponding to the resource exchanger 910, the purpose of sending the on-chain resources to the resource exchanger 910 is achieved.

[0329] Illustratively, if the on-chain resource is sent to the resource exchanger 910, the resource exchange state of the exchange code value corresponding to the on-chain resource in the second mapping relationship is adjusted to redeemed, such as adjusting the first state to the second state.

[0330] For example: check the mapping relationship configured by codehash during setCode (including the first mapping relationship and the second mapping relationship), and determine whether there is a first mapping relationship from codehash to tokenid, so as to index the corresponding NFT; if the corresponding NFT is indexed, determine whether the resource exchange status is an unexchanged state; if it is an unexchanged state, the contract execution logic of the NFT contract 920 will transfer the NFT to the blockchain address of the resource exchanger 910.

[0331] Optionally, in the above process, there is no need to send the blockchain address of the resource exchanger 910 to the NFT contract 920. The NFT contract 920 can obtain the blockchain address of the resource exchanger 910 that calls the exchange interface through the native application programming interface (Application Programming Interface, API). That is: make full use of the API corresponding to the NFT contract 920 to more directly and accurately obtain the blockchain address of the resource exchanger 910 that calls the exchange interface, avoiding the cumbersome process of pre-collecting blockchain addresses, and also helping to improve the efficiency and accuracy of the resource exchange process.

[0332] In addition, after the on-chain resource transfer is successful, the resource exchange status is adjusted to redeemed, thereby preventing the resource exchanger 910 from redeeming repeatedly and intercepting inappropriate behavior in a timely manner.

[0333] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.

[0334] To summarize, the redemption code value representing the redemption code is configured through the nodes in the blockchain system to avoid the risks that may be caused by directly exposing the redemption code to the blockchain system. The correspondence between the resource identifier and the on-chain resource, the redemption relationship between the on-chain resource and the redemption code, and the representation relationship between the redemption code and the redemption code value are integrated to store the first mapping relationship between the redemption code value and the resource identifier on the node in the blockchain system, thereby not only improving the security of resource redemption through the redemption code, but also enabling the node in the blockchain system to directly receive the first redemption code sent by the resource redeemer, so as to determine the first on-chain resource redeemed by the first redemption code through the first mapping relationship, avoiding the inefficiency of sending the redemption code to a third party to redeem the resource, improving the resource redemption efficiency while ensuring security, and facilitating the expansion of the use scenarios of resource redemption through the redemption code and the first mapping relationship.

[0335] In the embodiment of the present application, there is no need to collect the blockchain address of the resource exchanger in advance. As long as the resource exchanger gets the redemption code, it can be redeemed through the redemption code platform, or the redemption interface on the blockchain contract can be directly called to redeem the resource; in addition, the management of the redemption code value on the blockchain system is transparent, and each user can publicly audit and view the number of redemption codes corresponding to the NFT resource publisher. The redemption code will not expire, and each redemption code is unique, so it can correspond one-to-one with each NFT released; in addition, the contract data of the on-chain contract code can be made public, and judgments can be made based on the redemption code value, and it is impossible to reverse the original redemption code to achieve the purpose of improper acquisition. Under the condition of simple and uncomplicated implementation, it is compatible with existing contract standards, and with the irreversible nature of the redemption code value, it is ensured that the redemption code value after each hash processing is the same, thereby strengthening security.

[0336] Fig.10 is a structural block diagram of a resource exchange device based on blockchain provided by an exemplary embodiment of the present application, such as Fig.10 As shown, the device includes the following parts:

[0337] The resource acquisition module 1010 is used to acquire at least one on-chain resource, each of which corresponds to a resource identifier, and the resource identifier uniquely identifies the on-chain resource, and the on-chain resource is a resource deployed in the blockchain system;

[0338] An instruction receiving module 1020 is used to receive a configuration instruction, wherein the configuration instruction includes at least one redemption code value, wherein the redemption code value is used to represent information of a redemption code, and the redemption code is used to redeem the on-chain resources in the blockchain system;

[0339] A relationship storage module 1030, configured to store a first mapping relationship based on the configuration instruction, wherein the first mapping relationship includes a corresponding redemption relationship between the at least one redemption code value and the resource identifier;

[0340] The resource exchange module 1040 is used to determine the first on-chain resource exchanged for the first redemption code from the at least one on-chain resource based on the first mapping relationship when receiving the first redemption code sent by the resource exchanger, and the first on-chain resource is used to send to the resource exchanger.

[0341] In an optional embodiment, the resource exchange module 1040 is further used to, upon receiving the first exchange code sent by the resource exchanger, convert the first exchange code into a code value to obtain a first exchange code value corresponding to the first exchange code; and determine the first on-chain resource exchanged by the first exchange code from the at least one on-chain resource based on the first exchange code value and the first mapping relationship.

[0342] In an optional embodiment, the resource exchange module 1040 is further configured to, upon receiving the first exchange code sent by the resource exchanger, perform hash conversion on the first exchange code to obtain a hash value corresponding to the first exchange code as the first exchange code value.

[0343] In an optional embodiment, the resource exchange module 1040 is further used to query the first mapping relationship based on the first exchange code value to determine a first resource identifier having the exchange relationship with the first exchange code value, wherein the first resource identifier uniquely identifies the first on-chain resource.

[0344] In an optional embodiment, the configuration instruction includes a first configuration instruction consisting of a second resource identifier and a second redemption code value, the first configuration instruction is an instruction triggered by an instruction issuer, and the second resource identifier includes a first address registered by a resource issuer on the blockchain system;

[0345] The relationship storage module 1030 is also used to determine the second address of the instruction issuer registered on the blockchain system; compare the first address with the second address; and configure the second redemption code value based on the address comparison result to obtain the first mapping relationship.

[0346] In an optional embodiment, the relationship storage module 1030 is also used to, in response to the address comparison result indicating that the first address is the same as the second address, configure the second redemption code value based on the configuration of the second redemption code value on the blockchain to obtain the first mapping relationship; in response to the address comparison result indicating that the first address is different from the second address, feedback a configuration rejection message to the instruction issuer, the configuration rejection message is used to indicate that the second redemption code value is not configured on the blockchain; and receive a second configuration instruction.

[0347] In an optional embodiment, the relationship storage module 1030 is also used to, in response to the second redemption code value not being configured on the blockchain, jointly store the second redemption code value and the second resource identifier to obtain the first mapping relationship; in response to the second redemption code value being configured on the blockchain, feedback the configuration rejection message to the instruction issuer.

[0348] In an optional embodiment, the resource acquisition module 1010 is also used to receive resource configuration parameters sent by a resource publisher, and the resource configuration parameters are used to generate the at least one on-chain resource on the blockchain; generate corresponding resource identifiers based on the at least one on-chain resource; send the resource identifier to the resource publisher, and the resource publisher is used to generate the redemption code for redeeming the on-chain resource according to the resource identifier, and obtain a redemption code value corresponding to the redemption code.

[0349] In an optional embodiment, the relationship storage module 1030 is also used to adjust the resource exchange state corresponding to the redemption code value to a first state in response to the redemption code value being configured in the blockchain system, wherein the first state is used to characterize that the on-chain resource redeemed by the redemption code value has not been redeemed within a historical time period; and establish a second mapping relationship between the at least one redemption code value and the at least one resource exchange state.

[0350] In an optional embodiment, the relationship storage module 1030 is also used to adjust the resource exchange state corresponding to the first redemption code value to a second state in the second mapping relationship in response to the first on-chain resource corresponding to the first redemption code value being exchanged; wherein the second state is used to characterize that the on-chain resource exchanged by the redemption code value has been exchanged within a historical time period.

[0351] In an optional embodiment, the resource exchange module 1040 is also used to determine a third address registered by the resource exchanger in the blockchain system in response to the first on-chain resource not being exchanged within a historical time period; transfer the first on-chain resource to the third address; or, in response to the first on-chain resource having been exchanged within a historical time period, send a resource exchange failure message to the resource exchanger; or, determine a resource validity time period corresponding to the first on-chain resource, the resource validity time period being used to characterize the time period in which the first on-chain resource is effectively exchanged; in response to the receiving time of the first redemption code not being within the resource validity time period, send the resource exchange failure message to the resource exchanger.

[0352] To summarize, the redemption code value representing the redemption code is configured through the nodes in the blockchain system to avoid the risks that may be caused by directly exposing the redemption code to the blockchain system. The correspondence between the resource identifier and the on-chain resource, the redemption relationship between the on-chain resource and the redemption code, and the representation relationship between the redemption code and the redemption code value are integrated to store the first mapping relationship between the redemption code value and the resource identifier on the node in the blockchain system, thereby not only improving the security of resource redemption through the redemption code, but also enabling the node in the blockchain system to directly receive the first redemption code sent by the resource redeemer, so as to determine the first on-chain resource redeemed by the first redemption code through the first mapping relationship, avoiding the inefficiency of sending the redemption code to a third party to redeem the resource, improving the resource redemption efficiency while ensuring security, and facilitating the expansion of the use scenarios of resource redemption through the redemption code and the first mapping relationship.

[0353] It should be noted that the resource exchange device based on blockchain provided in the above embodiment is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the resource exchange device based on blockchain provided in the above embodiment and the resource exchange method embodiment based on blockchain belong to the same concept. The specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0354] Fig.11The schematic diagram of the structure of a server provided by an exemplary embodiment of the present application is shown. The server 1100 includes a central processing unit (CPU) 1101, a system memory 1104 including a random access memory (RAM) 1102 and a read-only memory (ROM) 1103, and a system bus 1105 connecting the system memory 1104 and the central processing unit 1101. The server 1100 also includes a mass storage device 1106 for storing an operating system 1113, an application program 1114, and other program modules 1115.

[0355] The mass storage device 1106 is connected to the central processing unit 1101 through a mass storage controller (not shown) connected to the system bus 1105. The mass storage device 1106 and its associated computer-readable media provide non-volatile storage for the server 1100. That is, the mass storage device 1106 may include a computer-readable medium (not shown) such as a hard disk or a compact disc read only memory (CD-ROM) drive.

[0356] Without loss of generality, computer readable media may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information such as computer readable instructions, data structures, program modules or other data. The above-mentioned system memory 1104 and mass storage device 1106 can be collectively referred to as memory.

[0357] According to various embodiments of the present application, the server 1100 can also be connected to a remote computer on the network through a network such as the Internet. That is, the server 1100 can be connected to the network 1112 through the network interface unit 1111 connected to the system bus 1105, or the network interface unit 1111 can be used to connect to other types of networks or remote computer systems (not shown).

[0358] The above-mentioned memory also includes one or more programs, and the one or more programs are stored in the memory and configured to be executed by the CPU.

[0359] An embodiment of the present application also provides a computer device, which includes a processor and a memory, wherein at least one instruction, at least one program, a code set or an instruction set is stored in the memory, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement the blockchain-based resource exchange method provided by the above-mentioned method embodiments.

[0360] An embodiment of the present application also provides a computer-readable storage medium, on which is stored at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the blockchain-based resource exchange method provided in the above-mentioned method embodiments.

[0361] The embodiments of the present application also provide a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes any of the resource exchange methods based on blockchain described in the above embodiments.

[0362] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A resource exchange method based on blockchain, characterized in that: The method is executed by a node in a blockchain system, and the method includes: Acquire at least one on-chain resource, each of the at least one on-chain resource corresponds to a resource identifier, the resource identifier uniquely identifies the on-chain resource, and the on-chain resource is a resource deployed in the blockchain system; Receive a configuration instruction, wherein the configuration instruction includes at least one redemption code value, wherein the redemption code value is used to represent information of a redemption code, and the redemption code is used to redeem the on-chain resource in the blockchain system; storing a first mapping relationship based on the configuration instruction, wherein the first mapping relationship includes a corresponding redemption relationship between the at least one redemption code value and the resource identifier; When a first redemption code sent by a resource redeemer is received, a first on-chain resource to be redeemed by the first redemption code is determined from the at least one on-chain resource based on the first mapping relationship, and the first on-chain resource is sent to the resource redeemer.

2. The method according to claim 1, characterized in that The step of, upon receiving the first redemption code sent by the resource redeemer, determining the first on-chain resource to be redeemed by the first redemption code from the at least one on-chain resource based on the first mapping relationship, comprises: When receiving the first redemption code sent by the resource redeemer, converting the first redemption code into a code value to obtain a first redemption code value corresponding to the first redemption code; Based on the first redemption code value and the first mapping relationship, the first on-chain resource to be redeemed by the first redemption code is determined from the at least one on-chain resource.

3. The method according to claim 2, characterized in that The step of converting the first redemption code into a code value to obtain a first redemption code value corresponding to the first redemption code upon receiving the first redemption code sent by the resource redeemer comprises: When the first redemption code sent by the resource redeemer is received, the first redemption code is hashed to obtain a hash value corresponding to the first redemption code as the first redemption code value.

4. The method according to claim 2, characterized in that: The determining, based on the first redemption code value and the first mapping relationship, from the at least one on-chain resource, the first on-chain resource for redemption of the first redemption code comprises: The first mapping relationship is queried based on the first redemption code value to determine a first resource identifier having the redemption relationship with the first redemption code value, wherein the first resource identifier uniquely identifies the first on-chain resource.

5. The method according to any one of claims 1 to 4, characterized in that: The configuration instruction includes a first configuration instruction consisting of a second resource identifier and a second redemption code value, the first configuration instruction is an instruction triggered by an instruction issuer, and the second resource identifier includes a first address registered by a resource issuer on the blockchain system; The storing the first mapping relationship based on the configuration instruction includes: Determine a second address of the instruction issuer registered on the blockchain system; performing an address comparison between the first address and the second address; The second redemption code value is configured based on the address comparison result to obtain the first mapping relationship.

6. The method according to claim 5, characterized in that The configuring the second redemption code value based on the address comparison result to obtain the first mapping relationship includes: In response to the address comparison result indicating that the first address is the same as the second address, configuring the second redemption code value based on the configuration of the second redemption code value on the blockchain system to obtain the first mapping relationship; In response to the address comparison result indicating that the first address is different from the second address, a configuration rejection message is fed back to the instruction issuer, where the configuration rejection message is used to indicate that the second redemption code value is not configured on the blockchain system; and a second configuration instruction is received.

7. The method according to claim 6, characterized in that The configuring the second redemption code value based on the configuration of the second redemption code value on the blockchain system to obtain the first mapping relationship includes: In response to the second redemption code value not being configured on the blockchain system, jointly storing the second redemption code value and the second resource identifier to obtain the first mapping relationship; or, In response to the second redemption code value having been configured on the blockchain system, feeding back the configuration rejection message to the instruction issuer.

8. The method according to any one of claims 1 to 4, characterized in that: The acquiring of at least one on-chain resource includes: Receiving resource configuration parameters sent by a resource publisher, wherein the resource configuration parameters are used to generate the at least one on-chain resource on the blockchain system; Generate the corresponding resource identifier based on the at least one on-chain resource; The resource identifier is sent to the resource publisher, and the resource publisher is used to generate the redemption code for redeeming the on-chain resource according to the resource identifier, and obtain the redemption code value corresponding to the redemption code.

9. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: In response to the redemption code value being configured in the blockchain system, adjusting the resource redemption state corresponding to the redemption code value to a first state, the resource redemption state being used to characterize the redemption status of the on-chain resource corresponding to the redemption code value in the blockchain system, the first state being used to characterize that the on-chain resource redeemed by the redemption code value has not been redeemed within a historical time period; A second mapping relationship representing the at least one redemption code value and at least one resource redemption state is established.

10. The method according to claim 9, characterized in that The method further comprises: In response to the first on-chain resource corresponding to the first redemption code value being redeemed, adjusting the resource redemption state corresponding to the first redemption code value to a second state in the second mapping relationship; The second state is used to represent that the on-chain resource exchanged by the redemption code value has been exchanged within a historical time period.

11. The method according to any one of claims 1 to 4, characterized in that: After determining the first on-chain resource to be exchanged with the first redemption code from the at least one on-chain resource based on the first mapping relationship, the method further includes: In response to the first on-chain resource not being exchanged within a historical time period, determining a third address at which the resource exchanger is registered in the blockchain system; transferring the first on-chain resource to the third address; or, In response to the first on-chain resource having been exchanged within a historical time period, sending a resource exchange failure message to the resource exchanger; or, Determine a resource validity period corresponding to the first on-chain resource, where the resource validity period is used to characterize a period during which the first on-chain resource is effectively redeemed; in response to a time point at which the first redemption code is received not being within the resource validity period, send the resource redemption failure message to the resource redeemer.

12. A resource exchange device based on blockchain, characterized in that: The device comprises: A resource acquisition module, used to acquire at least one on-chain resource, each of which corresponds to a resource identifier, and the resource identifier uniquely identifies the on-chain resource, and the on-chain resource is a resource deployed in the blockchain system; An instruction receiving module, used to receive a configuration instruction, wherein the configuration instruction includes at least one redemption code value, wherein the redemption code value is used to represent information of a redemption code, and the redemption code is used to redeem the on-chain resources in the blockchain system; a relationship storage module, configured to store a first mapping relationship based on the configuration instruction, wherein the first mapping relationship includes a corresponding redemption relationship between the at least one redemption code value and the resource identifier; The resource exchange module is used to determine the first on-chain resource exchanged by the first redemption code from the at least one on-chain resource based on the first mapping relationship when receiving the first redemption code sent by the resource exchanger, and the first on-chain resource is used to send to the resource exchanger.

13. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the blockchain-based resource exchange method as described in any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that: The storage medium stores at least one program, and the at least one program is loaded and executed by the processor to implement the blockchain-based resource exchange method as described in any one of claims 1 to 11.

15. A computer program product, characterized in that It includes a computer program or an instruction, which, when executed by a processor, implements the resource exchange method based on blockchain as described in any one of claims 1 to 11.