Resource transaction processing method based on block chain and related equipment
By associating resources with distributed identity identifiers on the blockchain, the cumbersome process of blockchain resource transactions is solved, enabling efficient, reliable, and simple cross-chain transfer of resources.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2024-10-15
- Publication Date
- 2026-04-17
AI Technical Summary
Resource transactions in blockchain are cumbersome and complex, especially cross-chain transactions which require additional verification of the initiator's identity, leading to inefficiency.
Resources stored on the blockchain are associated with distributed identity identifiers, which consist of the chain identifier of the blockchain where the resource resides and the account identifier of the resource owner. Resource transactions are processed by identifying and comparing the target chain identifier.
It simplifies the initiation and transfer processes of resource transactions, improves the processing efficiency of resource transactions, shortens the resource transfer time, and enhances the credibility, reliability, and accuracy of transactions.
Smart Images

Figure CN121883153A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of computer and blockchain technology, and more specifically, to blockchain-based resource transaction processing methods, apparatus, devices, computer-readable media, and program products. Background Technology
[0002] Currently, resources in blockchains are typically registered in the account address of the resource owner. This means that when initiating a resource transaction, the initiator must specify the recipient's account address. Furthermore, in cross-chain transactions, additional verification of the initiator's identity may be required, making the resource transaction process extremely cumbersome and complex. Therefore, improving the efficiency of blockchain resource transaction processing is a pressing issue that needs to be addressed. Summary of the Invention
[0003] The embodiments of this application provide a blockchain-based resource transaction processing method, apparatus, electronic device, computer-readable medium, and computer program product, which can improve the efficiency of blockchain resource transaction processing.
[0004] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part from practice of this application.
[0005] According to one aspect of the embodiments of this application, this application provides a blockchain-based resource transaction processing method, wherein resources stored on the blockchain are associated with distributed identity identifiers, and the distributed identity identifiers consist of the chain identifier of the blockchain where the resource resides and the account identifier of the resource owner. The method includes:
[0006] The resource receiver initiates a resource transaction, which contains the resource receiver's first distributed identity identifier.
[0007] Identify the target chain identifier contained in the first distributed identity identifier;
[0008] The target chain identifier is compared with the chain identifier corresponding to the resource sender, and the resource transaction is processed according to the comparison result.
[0009] According to one aspect of the embodiments of this application, this application provides a blockchain-based resource transaction processing device, wherein resources stored on the blockchain are associated with distributed identity identifiers, and the distributed identity identifiers consist of the chain identifier of the blockchain where the resource resides and the account identifier of the resource owner; the device includes a receiving unit, an identification unit, and a processing unit, wherein:
[0010] The receiving unit is used to receive a resource transaction initiated by the resource sender, wherein the resource transaction contains a first distributed identity identifier of the resource receiver.
[0011] The identification unit is used to identify the target chain identifier contained in the first distributed identity identifier;
[0012] The processing unit is used to compare the target chain identifier with the chain identifier corresponding to the resource sender, and process the resource transaction based on the comparison result.
[0013] In one embodiment of this application, based on the foregoing scheme, when the processing unit processes the resource transaction according to the comparison result, it may be specifically configured to: if the comparison result indicates that the target chain identifier is different from the chain identifier corresponding to the resource sender, then generate a cross-chain event based on the number of transaction resources contained in the resource transaction and the first distributed identity identifier; in response to the cross-chain event, send a cross-chain transaction matching the cross-chain event to the target blockchain through a cross-chain gateway, so that the target blockchain executes the cross-chain transaction to realize the cross-chain transfer of the target resources of the transaction resource quantity.
[0014] In one embodiment of this application, based on the foregoing scheme, when the processing unit processes the resource transaction according to the comparison result, it may be specifically configured to: if the comparison result indicates that the target chain identifier is the same as the chain identifier corresponding to the resource sender, then obtain the number of transaction resources contained in the resource transaction; and transfer the target resources of the transaction resource quantity from the resource sender to the resource receiver.
[0015] In one embodiment of this application, based on the foregoing scheme, the processing unit may further be configured to: receive a cross-chain transaction sent by a cross-chain gateway; obtain the quantity of cross-chain resources and the second distributed identity identifier corresponding to the resource recipient of the cross-chain transaction from the cross-chain transaction; and execute the cross-chain transaction to increase the resources associated with the second distributed identity identifier based on the cross-chain transaction.
[0016] In one embodiment of this application, based on the aforementioned scheme, when the processing unit executes the cross-chain transaction to increase the resources associated with the second distributed identity identifier based on the cross-chain transaction, it can be specifically configured to: call the resource mapping contract to obtain new resources matching the number of cross-chain resources; and associate the new resources with the second distributed identity identifier.
[0017] In one embodiment of this application, the number of cross-chain gateways includes multiple gateways. Based on the aforementioned scheme, when the processing unit receives a cross-chain transaction sent by a cross-chain gateway, it can be specifically configured to: receive transaction signatures for the same cross-chain transaction sent by each cross-chain gateway; call the public key of each cross-chain gateway to verify the corresponding transaction signature and obtain the verification result; if the number of verification results indicating that the verification has passed reaches a preset number, then the cross-chain transaction is received.
[0018] In one embodiment of this application, based on the foregoing scheme, the processing unit may further be configured to: obtain the transaction block header of the transaction initiating blockchain corresponding to the cross-chain transaction; perform on-chain verification of the cross-chain transaction based on the transaction block header to obtain a transaction verification result; if the transaction verification result indicates that the transaction initiating blockchain has already performed on-chain processing on the original resource transaction corresponding to the cross-chain transaction, then the step of receiving the cross-chain transaction sent by the cross-chain gateway is triggered, wherein the cross-chain transaction is generated based on the original resource transaction.
[0019] In one embodiment of this application, based on the foregoing scheme, the processing unit may further be configured to: if a hash value matching the hash lock value carried by the cross-chain transaction is detected within the hash lock time period carried by the cross-chain transaction, then execute the step of obtaining the quantity of cross-chain resources from the cross-chain transaction and the second distributed identity identifier corresponding to the resource recipient of the cross-chain transaction.
[0020] In one embodiment of this application, based on the foregoing scheme, the identification unit may further be configured to obtain the chain identifier corresponding to the resource sender. The process of obtaining the chain identifier corresponding to the resource sender includes: obtaining the public key of the resource sender; calling the identifier management contract to obtain the third distributed identity identifier of the resource sender based on the obtained public key; wherein, the identifier management contract is used to associate and store the distributed identity identifier and the identifier document containing the public key; and identifying the chain identifier contained in the third distributed identity identifier.
[0021] In one embodiment of this application, based on the foregoing scheme, the receiving unit may further be configured to: obtain the first distributed identity identifier of the resource recipient triggered by the resource sender, and the quantity of transaction resources to be transferred to the resource recipient; and generate the resource transaction based on the first distributed identity identifier and the quantity of transaction resources.
[0022] According to one aspect of the embodiments of this application, an electronic device is provided, including one or more processors; and a storage device for storing one or more computer programs, which, when executed by the one or more processors, cause the electronic device to implement the blockchain-based resource transaction processing method as described above.
[0023] According to one aspect of the embodiments of this application, an embodiment of this application provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor of an electronic device, causes the electronic device to perform the blockchain-based resource transaction processing method as described above.
[0024] According to one aspect of the embodiments of this application, this application provides a computer program product, including a computer program stored in a computer-readable medium, wherein a processor of an electronic device reads from the computer-readable medium and executes the computer program, causing the electronic device to perform the blockchain-based resource transaction processing method as described above.
[0025] In the technical solution provided in the embodiments of this application, by associating resources with distributed identity identifiers, unified management of resources and identities at the blockchain level is achieved. This makes it more convenient for each object to manage resources on different blockchains, which is conducive to improving asset management efficiency.
[0026] Meanwhile, resource transfer is based on the distributed identity identifiers of both parties during the resource transaction process. This eliminates the need for subsequent identity verification steps, simplifying the resource transfer process and improving transaction processing efficiency. Furthermore, distributed identity identifiers are simpler and easier to remember than account addresses; this minimizes the risk of incorrect account information input and simplifies the operations required to initiate resource transactions. Therefore, this embodiment simplifies the resource transaction initiation and transfer processes, improving overall transaction speed and reducing transfer time, thus effectively enhancing the resource transaction processing efficiency of the blockchain.
[0027] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0028] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:
[0029] Figure 1 This is a schematic diagram of the system architecture of a blockchain system provided in an embodiment of this application;
[0030] Figure 2 This is a schematic diagram of a blockchain provided in an embodiment of this application;
[0031] Figure 3 This is a schematic flowchart of a blockchain-based resource transaction processing method provided in an embodiment of this application;
[0032] Figure 4 This is a schematic diagram of the system architecture of another blockchain system provided in the embodiments of this application;
[0033] Figure 5 This is a flowchart illustrating another blockchain-based resource transaction processing method provided in this application embodiment;
[0034] Figure 6 This is a schematic diagram of a cross-chain transaction process provided in an embodiment of this application;
[0035] Figure 7 This is a schematic diagram illustrating a resource transfer scenario provided in an embodiment of this application;
[0036] Figure 8 This is a structural block diagram of a blockchain-based resource transaction processing device provided in an embodiment of this application;
[0037] Figure 9 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown. Detailed Implementation
[0038] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0039] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0040] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0041] The flowcharts shown in the accompanying diagrams are merely illustrative and do not necessarily include all content and operations, nor do they necessarily have to be executed in the described order. For example, some operations may be broken down, while others may be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0042] It should also be noted that "multiple" as mentioned in this application refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0043] Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and cryptographic algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying platform, a platform product service layer, and an application service layer. A blockchain consists of a series of blocks linked together in chronological order of their creation. Once a new block is added to the blockchain, it cannot be removed. Each block records the data packaged and submitted by the blockchain nodes within the system.
[0044] In blockchain, the consensus mechanism refers to the mechanism by which blockchain nodes reach a consensus on blocks (also known as block information or block data), ensuring that the latest block is accurately added to the blockchain. Blocks that successfully reach consensus are added to the blockchain, thus updating the world state of the blockchain. The latest data state in the blockchain after the latest block is on the chain is called the "world state."
[0045] Currently, resources in the blockchain are usually registered in the account address of the resource owner. Therefore, when initiating a resource transaction, the initiator must specify the account address of the resource recipient. At the same time, in cases such as cross-chain transactions, additional verification of the identity of the object may be required, making the resource transaction process very cumbersome and complicated.
[0046] Based on this, embodiments of this application provide a blockchain-based resource transaction processing scheme. This scheme associates resources stored on the blockchain with distributed identity identifiers, which consist of the chain identifier of the blockchain where the resource resides and the account identifier of the resource owner. Thus, the resource sender can initiate a resource transaction for the resource receiver using the resource receiver's first distributed identity identifier, thereby transferring the resource from the resource sender to the resource receiver.
[0047] The resources can include various types of data resources. For example, they can include data resources of the bill asset type (such as electronic bills, transaction vouchers, etc.), data resources of the account asset type (such as data resources that can serve as general equivalents, etc.), and data resources of the information sharing type (such as core bill information, shared account information, shared book information, shared location data information, etc.), without limitation.
[0048] A distributed identifier (DID) associated with a resource is a unique, persistent, and verifiable digital identifier. It is a decentralized digital identity recognition method used to uniquely identify entities (such as individuals, organizations, and devices). DID is a self-verifiable identity management method that enables entities to own and control their digital identities without a centralized registry.
[0049] Furthermore, since the distributed identity identifier in this scheme is also composed of the chain identifier of the blockchain where the resource is located and the account identifier of the resource owner, the distributed identity identifier in this scheme can also identify the blockchain where the resource owner is located, and the distributed identity identifier can also uniquely identify the resource owner on the corresponding blockchain.
[0050] It is clear that this solution achieves unified management of resources and identities by associating resources with distributed identity identifiers. This allows resource owners to manage all their resources on the blockchain using their distributed identity identifiers. Furthermore, resource owners initiate resource transactions using their distributed identity identifiers, ensuring the transactions are trustworthy and reliable, eliminating the need for subsequent identity verification and simplifying the resource transfer process. In addition, distributed identity identifiers are simpler and easier to remember than account addresses, thus simplifying the transaction initiation process for resource senders and improving transaction accuracy. Therefore, this solution simplifies the resource transaction initiation and transfer processes, facilitating faster resource transfers and effectively improving the efficiency of blockchain resource transaction processing.
[0051] Based on the above-mentioned blockchain-based resource transaction processing scheme, this application provides a blockchain system, which can be found in [reference needed]. Figure 1 , Figure 1 A schematic diagram of the system architecture of a blockchain system is shown. This blockchain system may include multiple blockchain networks. Figure 1 Blockchain network 110 and blockchain network 120 are used as examples.
[0052] Figure 1 The blockchain network 110 shown can specifically be a system for data sharing between nodes. This blockchain network 110 can include multiple blockchain nodes (also known as consensus nodes), such as... Figure 1 Blockchain nodes 111 to 114 are shown; among them, Figure 1 The ellipsis in the code indicates that the blockchain network 110 also includes other blockchain nodes. Blockchain nodes are the basic components of the entire blockchain system, responsible for processing transactions, storing blockchain data, and participating in consensus.
[0053] Each blockchain node in blockchain network 110 stores the same blockchain (also known as a block ledger), that is... Figure 1 The blockchain ledger (115) is the core data structure of a blockchain system, used to store and manage all confirmed blocks. Organized in a chain-like structure, each block contains a set of transactions, a block header (including metadata such as the hash value and timestamp of the previous block), and other information. The ledger provides a public, immutable history of transactions for the blockchain system, ensuring transparency and consistency.
[0054] Furthermore, each blockchain node, in its normal operation, can receive input information and maintain shared data within the blockchain network 110 based on this received input information. To ensure information exchange within the blockchain network 110, such as... Figure 1 As shown, each blockchain node in the blockchain network 110 can have a wired or wireless communication connection, and information can be transmitted between the blockchain nodes through the aforementioned communication connection.
[0055] For example, when any blockchain node in blockchain network 110 responds to a transaction request and executes the requested transaction, it can package the executed transaction as input information into a block. Upon receiving this block, other blockchain nodes in blockchain network 110 process it according to the consensus algorithm. After consensus is reached, the block is stored as data in the shared data, ensuring that the data stored on all blockchain nodes in blockchain network 110 is consistent.
[0056] Each blockchain node in blockchain network 110 has a corresponding node identifier. Furthermore, each blockchain node in blockchain network 110 can store the node identifiers of other blockchain nodes in blockchain network 110, so that the generated block can be broadcast to other blockchain nodes in blockchain network 110 based on their node identifiers. Each blockchain node can maintain a node identifier list as shown in the table below, storing the node name and node identifier in this list. The node identifier can be an IP (Internet Protocol) address or any other information that can be used to identify the node; Table 1 only uses IP addresses as an example.
[0057] Table 1
[0058] Node Name Node identifier Blockchain node 111 117.114.151.174 Blockchain node 112 117.116.189.145 … … Blockchain node xxx xxx.xxx.xxx.xxx
[0059] Each node in blockchain network 110 stores the same blockchain. A blockchain consists of multiple blocks; see [link to blockchain documentation]. Figure 2 A blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores input information feature values, version number, timestamp, and difficulty value, while the block body stores the input information. The next block after the genesis block takes the genesis block as its parent block. The next block also includes a block header and a block body. The block header stores the input information feature values of the current block, the block header feature values of the parent block, version number, timestamp, and difficulty value, and so on. This ensures that the block data stored in each block is related to the block data stored in the parent block, guaranteeing the security of the input information in the blocks.
[0060] also, Figure 1 The blockchain network 120 shown also includes multiple blockchain nodes, such as Figure 1 Blockchain nodes 121 to 124 are shown; among them, Figure 1 The ellipsis in the text indicates that the blockchain network 120 also includes other blockchain nodes. Each blockchain node in the blockchain network 120 also stores the same blockchain (also known as a block ledger), that is... Figure 1 Block ledger 125. For further description of blockchain network 120, please refer to blockchain network 110, which will not be repeated here.
[0061] In one embodiment, a blockchain node 111 in the blockchain network 110 can receive a resource transaction initiated by a resource sender, the resource transaction containing a first distributed identity identifier of the resource recipient; then, the blockchain node 111 can identify the target chain identifier contained in the first distributed identity identifier; finally, the blockchain node 111 compares the target chain identifier with the chain identifier corresponding to the resource sender, and processes the resource transaction according to the comparison result.
[0062] Optionally, during the process of processing resource transactions based on the comparison results, the resource transactions can be placed in the transaction pool of blockchain network 110 for on-chain processing.
[0063] Furthermore, the specific process of processing resource transactions on the blockchain can include: selecting resource transactions from the transaction pool, packaging them into blocks, and sending the blocks to various blockchain nodes in the blockchain network 110, so that each blockchain node can verify the block and obtain verification results. If the number of verification results indicating that the verification has passed reaches a preset threshold, the block is considered to have reached consensus, and each blockchain node can add the block to its own maintained blockchain, thereby realizing the on-chain processing of resource transactions. The preset threshold can be set manually or by any blockchain node in the aforementioned blockchain network, and is not limited here.
[0064] Specifically, a block refers to a block that has not yet reached consensus. A block can only be added to the blockchain after consensus is successfully reached. A block contains multiple transactions, which are arranged in a certain order. The order of each transaction in the block can be the order in which they were written into the block, or it can be based on the importance of each transaction; this is not limited here. The importance of a transaction can be determined based on the amount of resources consumed in executing the transaction, whether the transaction is a cross-chain transaction, etc., which will not be elaborated on here.
[0065] It should be noted that the embodiments of this application can be applied to various scenarios, including but not limited to smart finance, cloud technology, AI (Artificial Intelligence), intelligent transportation, smart healthcare, and so on, and are not limited thereto.
[0066] Furthermore, in specific embodiments of this application, if data or information such as blocks and transactions involve objects, when the embodiments of this application are applied to specific products or technologies, permission or consent from the objects is required, and the collection, use, and processing of related data or information must comply with the relevant laws, regulations, and standards of the relevant countries and regions.
[0067] The following details the various implementation details of the technical solutions in the embodiments of this application:
[0068] like Figure 3 As shown, Figure 3 This is a schematic flowchart illustrating a blockchain-based resource transaction processing method according to an embodiment of this application. This method can be applied to... Figure 1 The illustrated blockchain system allows the method to be executed by devices within the blockchain system. In this embodiment, the method is described as being executed by nodes in the blockchain network. Resources stored on the blockchain are associated with distributed identity identifiers, which consist of the chain identifier of the blockchain containing the resource and the account identifier of the resource's owner.
[0069] Among them, the resource transaction processing methods based on blockchain can include S301 to S303, which are described in detail below:
[0070] S301. Receive a resource transaction initiated by the resource sender, wherein the resource transaction contains the resource receiver's first distributed identity identifier.
[0071] In the embodiments of this application, the resource sender refers to the object that needs to transfer resources, while the resource receiver refers to the object that needs to receive resources.
[0072] Resources can be data or digital assets with value or rights. Resources can include various types, such as negotiable instrument assets, account assets, and information sharing types, etc., and are not limited here.
[0073] In practical implementation, the resources stored on the blockchain can be digital assets representing certain values or rights. Resources can represent various forms of value such as general equivalents, equity, points, and goods, and have characteristics such as divisibility, tradability, and programmability. The issuance and use of resources usually follow certain protocols and standards, such as ERC-20 (an application programming interface standard proposed in 2015) and ERC-721 (Ethereum Request for Comments 721, an application programming interface standard proposed in 2018).
[0074] Furthermore, a Distributed Identity Identifier (DID) consists of three main parts. The first part is the DIDScheme, similar to the Hypertext Transfer Protocol, Hypertext Transfer Security Protocol, and Text Transfer Protocol in a Uniform Resource Identifier (URL). The second part is the Distributed Identity Identifier Method (DID Method Name); the DID Method Name is a key component of the distributed identity identifier system, defining how to create, read, update, and delete DIDs and DID documents within a specific distributed ledger or network. The third part is a unique identifier, unique throughout the entire DID Method namespace.
[0075] For example, a distributed identity identifier can be "did:example:0x1234567890". Here, "did" represents the DID Scheme, "example" represents the DID method name, and 0x1234567890 represents a specific identifier.
[0076] As mentioned above, the distributed identity identifier consists of the chain identifier of the blockchain where the resource resides and the account identifier of the resource owner.
[0077] Therefore, a specific identifier can be obtained by concatenating the chain identifier of the blockchain where the resource resides and the account identifier of the resource owner. Among them, the chain identifier and the account identifier are unique in the global space of the blockchain system.
[0078] For example, the chain identifier of the first blockchain can be set as chainA, and the account identifier of object M can be set as 0x1234567890; then, the distributed identity identifier of object M for the first blockchain can be "did:example:chainA 0x1234567890". Correspondingly, the chain identifier of the second blockchain can be set as chainB, then the distributed identity identifier of object M for the second blockchain can be "did:example:chainB0x1234567890".
[0079] In one embodiment, the chain identifier can be used as the DID method name, and the account identifier of the resource owner can be used as a specific identifier. For example, the distributed identity identifier of object M for the first blockchain can be "did:chainA:0x1234567890", and the distributed identity identifier of object M for the second blockchain can be "did:chainB:0x1234567890".
[0080] Alternatively, distributed identity identifiers can be generated based on chain identifiers and account identifiers in other ways, which are not limited here.
[0081] It's worth noting that the resources stored on the aforementioned blockchain are associated with distributed identity identifiers (DISTRIBUTS). Specifically, each resource stored on the blockchain by an object is mapped to that object's DISTRIBUTS. For example, when object M stores 10 Tokens (a form of resource representation) into the first blockchain, a mapping is established between object M's DISTRIBUTS and these 10 Tokens. A string like "did:chainA:0x1234567890:+10Token" means that the resource associated with object M's DISTRIBUTS has increased by 10 Tokens.
[0082] It is easy to see that the embodiments of this application effectively utilize account abstraction to bind distributed identity identifiers to resources, thereby enabling resource owners to conveniently and quickly manage their resources using only the distributed identity identifier. It should be noted that account abstraction is a method of abstracting digital assets and related operations from the underlying blockchain technology, allowing objects to manage and use their digital assets more simply and intuitively without needing to concern themselves with the differences in the underlying technology.
[0083] In one possible implementation, resource transactions typically involve the transfer of resources. Therefore, the destination to which the resources are to be transferred needs to be clearly defined in the resource transaction, thus requiring the resource transaction to contain the first distributed identity identifier of the resource recipient. Simultaneously, resource transactions are usually initiated by the resource sender, therefore the resource sender needs to specify the resource recipient and the quantity of resources to be traded.
[0084] Therefore, the process of generating a resource transaction may specifically include: obtaining the first distributed identity identifier of the resource recipient triggered by the resource sender, and the quantity of transaction resources to be transferred to the resource recipient; and generating a resource transaction based on the first distributed identity identifier and the quantity of transaction resources.
[0085] For example, object N can be assigned a distributed identity identifier of "did:chainA:0x0987654321" on the first blockchain and "did:chainB:0x0987654321" on the second blockchain. Then, if object M wants to transfer 100 tokens (ATokens) from the first blockchain to object N, object M only needs to input object N's distributed identity identifier for the first blockchain and the amount of transaction resources, such as "To:did:chainA:0x0987654321Amount:100ATokens", where "To" represents the distributed identity identifier of the resource recipient and "Amount" represents the amount of transaction resources.
[0086] Correspondingly, if object M wants to transfer 100 ATokens to object N on the second blockchain, object M only needs to input object N's distributed identity identifier for the second blockchain and the amount of transaction resources, such as "To:did:chainB:0x0987654321Amount:100ATokens".
[0087] Optionally, considering that transactions of some resources may exhibit regularity and similarity, the resource sender can also initiate a resource transaction by selecting historical transactions that match their current resource transfer intention. Specifically, the blockchain network can obtain the historical transactions selected by the resource sender, and generate a resource transaction based on the distributed identity identifier of the resource recipient in the historical transaction and the quantity of resources traded.
[0088] It is easy to see that this embodiment, by registering resources under a distributed identity identifier, allows an object to complete asset transfer by inputting the distributed identity identifier of the resource recipient. Furthermore, compared to existing account addresses, the distributed identity identifier has shorter and more regular field lengths, making it easier for objects to remember and facilitating storage. Therefore, this embodiment greatly simplifies the transaction initiation process, improves transaction initiation efficiency, and consequently enhances overall resource processing efficiency.
[0089] Optionally, the current resource transfer intention of the resource sender can be obtained through other means to generate a resource transaction, which is not limited here.
[0090] S302. Identify the target chain identifier contained in the first distributed identity identifier.
[0091] In this embodiment of the application, referring to the composition of the distributed identity identifier mentioned in step S301, it can be seen that the chain identifier of the blockchain is usually placed in a specified position in the distributed identity identifier. Therefore, the chain identifier contained in the distributed identity identifier can be obtained by identifying the character in the specified position in the distributed identity identifier.
[0092] For example, when the chain identifier is used as the DID method name, the character in the first distributed identifier located in the DID method name position can be identified to obtain the target chain identifier.
[0093] Optionally, if the characters in the chain identifier and the account identifier are interleaved in a certain order when generating the distributed identity identifier, then when identifying the chain identifier, the characters belonging to the chain identifier can be identified based on the order in which they were generated, and the chain identifier can be recombined based on the identified characters.
[0094] Optionally, the identification chain method can vary depending on how the distributed identity identifier is generated, and is not limited here.
[0095] S303. Compare the target chain identifier with the chain identifier corresponding to the resource sender, and process the resource transaction based on the comparison result.
[0096] In this embodiment, the chain identifier corresponding to the resource sender can be obtained by identifying the resource sender's distributed identity identifier. Specifically, the resource sender can input its own distributed identity identifier during the resource transaction initiation process.
[0097] In one embodiment, considering that distributed identity identifiers are associated with resources, in order to avoid leakage of distributed identity identifiers and improve resource security, an identifier management contract can be deployed in the blockchain. The identifier management contract can associate and store distributed identity identifiers and identifier documents containing public keys.
[0098] The identifier management contract can be simply referred to as the DID management contract; the identifier document (DID document) is a data structure containing metadata and service information related to the DID, used to describe the DID subject. The DID document typically contains information such as the DID subject's public key, authentication method, and service terminal to support secure decentralized authentication and communication.
[0099] The identifier management contract can specifically be a smart contract. In short, a smart contract is a set of promises defined in digital form, which is a program that runs on the blockchain; the participants in a smart contract can execute these promises on the blockchain according to the protocol.
[0100] Therefore, the process of obtaining the chain identifier corresponding to the resource sender can include: obtaining the public key of the resource sender; then, based on the obtained public key, calling the identifier management contract to obtain the third distributed identity identifier of the resource sender; and finally, identifying the chain identifier contained in the third distributed identity identifier.
[0101] In this case, the resource sender can carry a public key in the resource transaction, so the public key can be obtained directly from the resource transaction; alternatively, the terminal device used by the resource sender when initiating the resource transaction may store the resource sender's public key, or the smart contract deployed on the blockchain may store the resource sender's public key, which can also be obtained through the corresponding functional interface.
[0102] In addition, the identifier documents in the identifier management contract can be traversed. If the public key stored in the currently traversed identifier document matches the obtained public key, the distributed identity identifier corresponding to the currently traversed identifier document will be determined as the third distributed identity identifier.
[0103] The comparison result of the two chain identifiers is specifically used to indicate whether the target chain identifier is the same as the chain identifier corresponding to the resource sender. If the comparison result indicates that the target chain identifier is the same as the chain identifier corresponding to the resource sender, it means that the resource transaction is a transaction for internal resource transfer within the blockchain, and the relevant steps for intra-chain resource transfer can be triggered. If the comparison result indicates that the target chain identifier is different from the chain identifier corresponding to the resource sender, it means that the resource transaction requires cross-chain resource transfer, and the relevant steps for cross-chain resource transfer can be triggered.
[0104] In one embodiment, the transfer of resources within the blockchain is relatively simple. Therefore, if the comparison result indicates that the target chain identifier is the same as the chain identifier corresponding to the resource sender, the quantity of transaction resources contained in the resource transaction can be obtained. Then, the target resource quantity of the transaction resource is directly transferred from the resource sender to the resource receiver.
[0105] Specifically, the resource transfer process within the blockchain can include: deducting or deleting the target resource associated with the resource sender's distributed identity identifier (i.e., the third distributed identity identifier); and adding a mapping relationship between the resource receiver's distributed identity identifier (i.e., the first distributed identity identifier) and the target resource.
[0106] In practical implementation, based on the aforementioned logic regarding resource transfer within the blockchain, a smart contract for this internal resource transfer can be deployed to achieve automatic resource transfer within the blockchain. In a practical application, taking the Transfer function in the smart contract as an example, the pseudocode after adding the logic for resource transfer within the blockchain is as follows:
[0107]
[0108]
[0109] In this embodiment, by associating resources with distributed identity identifiers composed of blockchain identifiers, unified management of resources and identities at the blockchain level is achieved. In this way, the resource owner can manage all its resources on different blockchains through different distributed identity identifiers. Compared with the existing technology that requires managing one or more account addresses for each blockchain, this embodiment makes resource management on different chains more convenient and helps to improve resource management efficiency.
[0110] Meanwhile, resource transfer is achieved based on the distributed identity identifiers of both parties during the resource transaction process. This ensures the trustworthiness and reliability of the entire resource transaction, eliminating the need for subsequent identity verification steps and simplifying the resource transfer process, thus improving resource transaction processing efficiency. Furthermore, distributed identity identifiers are simpler and easier to remember than account addresses. This avoids errors in inputting recipient account information during transaction initiation, improving accuracy, and simplifies the operations required from the resource sender. Therefore, this embodiment simplifies the resource transaction initiation and transfer processes, increasing transfer speed and time, thereby effectively improving the resource transaction processing efficiency of the blockchain.
[0111] Furthermore, because assets are registered under distributed identity identifiers (DIIs) rather than under account addresses as in traditional schemes, the DIIs are required for both transferring and receiving resources, which helps cultivate a habit of using DIIs. The widespread use of DIIs will further enrich the DII ecosystem, enabling the rapid popularization and development of identity authentication, certification, and verification.
[0112] In one possible implementation, to address the situation mentioned in step S303 where resource transactions require cross-chain resource transfers, a cross-chain gateway can be deployed in the blockchain to decouple the manual operations required in the cross-chain transaction process to the cross-chain gateway as much as possible, thereby improving the automation level of cross-chain transactions and thus improving resource processing efficiency.
[0113] Based on this, Figure 1 The blockchain system shown in this application provides another blockchain system, which can be found in [reference needed]. Figure 4 , Figure 4 A schematic diagram of the system architecture of another blockchain system is shown. For example... Figure 4As shown, a cross-chain gateway 130 is deployed in the blockchain system, and the cross-chain gateway 130 establishes communication connections with each blockchain network. Specifically, the cross-chain gateway 130 can achieve data interoperability of resources and information between different blockchains through specific technologies and protocols.
[0114] like Figure 4 As shown, cross-chain gateway 130 and blockchain network 110, as well as cross-chain gateway 130 and blockchain network 120, have established communication connections. It should be noted that further details regarding the blockchain system can be found in [link to relevant documentation]. Figure 1 Examples are provided, but will not be elaborated upon here.
[0115] In one embodiment of this application, such as Figure 5 The diagram illustrates another blockchain-based resource transaction processing method, which can be applied to... Figure 4 The illustrated blockchain system allows the method to be executed by devices within the blockchain system. In this embodiment, the method is described using an example of it being executed by a blockchain node in a blockchain network.
[0116] In this method, resources stored on the blockchain are associated with distributed identity identifiers, which consist of the chain identifier of the blockchain containing the resource and the account identifier of the resource owner. This blockchain-based resource transaction processing method... Figure 3 The method shown has been extended. Details of S501 to S505 are as follows:
[0117] S501, Receive a resource transaction initiated by the resource sender, wherein the resource transaction contains the resource receiver's first distributed identity identifier.
[0118] In this embodiment, the specific implementation of step S501 can be found in the specific implementation of step S301 in the above embodiments, and will not be repeated here.
[0119] S502, Identify the target chain identifier contained in the first distributed identity identifier.
[0120] In this embodiment, the specific implementation of step S502 can be found in the specific implementation of step S302 in the above embodiments, and will not be repeated here.
[0121] S503. Compare the target chain identifier with the chain identifier corresponding to the resource sender.
[0122] In this embodiment, the specific implementation of step S503 can be found in the specific implementation of step S303 in the above embodiments, and will not be repeated here.
[0123] S504. If the comparison result indicates that the target chain identifier is different from the chain identifier corresponding to the resource sender, then a cross-chain event is generated based on the number of transaction resources contained in the resource transaction and the first distributed identity identifier.
[0124] In this application embodiment, before, after, or during the generation of a cross-chain event, a target resource of the transaction resource quantity can be selected and locked from the resources associated with the third distributed identity identifier of the resource sender.
[0125] In one embodiment, a cross-chain event may include the amount of transaction resources and a first distributed identity identifier. Optionally, the cross-chain event may also include a third distributed identity identifier of the resource sender to facilitate subsequent identification of the two parties to the transaction.
[0126] In practical applications, based on the aforementioned logic of cross-chain resource transfer, smart contracts for cross-chain resource transfer can be deployed to achieve automatic resource transfer across chains. Taking the Transfer function in the smart contract as an example, the pseudocode after adding cross-chain logic is as follows:
[0127]
[0128] It is easy to see that, through the aforementioned smart contract, blockchain nodes can automatically determine the type of resource transfer, namely, whether it is an intra-chain resource transfer or a cross-chain resource transfer. At the same time, blockchain nodes can also perform different operations for different types of resource transfer to achieve intra-chain or cross-chain resource transfer. This makes the entire resource transfer process simpler, which is conducive to improving resource transfer efficiency and also to improving the resource trading experience of the target.
[0129] S505. In response to a cross-chain event, a cross-chain transaction matching the cross-chain event is sent to the target blockchain through a cross-chain gateway, enabling the target blockchain to execute the cross-chain transaction to achieve cross-chain transfer of the target resource quantity.
[0130] In this embodiment, the target blockchain refers to the blockchain indicated by the target chain identifier. Specifically, the cross-chain gateway can detect various blockchain networks in the blockchain system in real time. If a cross-chain event is detected in any blockchain network, a cross-chain transaction can be generated based on the detected cross-chain event. Therefore, the cross-chain transaction is matched with the cross-chain event.
[0131] Since step S504 mentions that the cross-chain event includes the number of transaction resources and the first distributed identity identifier, the cross-chain transaction generated based on the cross-chain event will also include the number of transaction resources and the first distributed identity identifier.
[0132] In practice, the cross-chain gateway can parse the transaction information contained in the cross-chain event, such as the number of transaction resources and the first distributed identity identifier; then, the cross-chain gateway can encapsulate the transaction information into a data format that the target blockchain can recognize, thereby obtaining the cross-chain transaction.
[0133] In one possible implementation, each blockchain network may receive cross-chain transactions sent from other blockchain networks through a cross-chain gateway.
[0134] Therefore, blockchain nodes may also receive cross-chain transactions sent by cross-chain gateways; then, blockchain nodes can obtain the quantity of cross-chain resources and the second distributed identity identifier corresponding to the resource recipient of the cross-chain transaction from the cross-chain transaction; finally, blockchain nodes can execute cross-chain transactions to increase the resources associated with the second distributed identity identifier based on the cross-chain transaction.
[0135] Specifically, the additional processing may include associating resources that match the number of cross-chain resources with a second distributed identity identifier.
[0136] In one embodiment, considering that different blockchains may have different resource value standards and data formats, resources stored in one blockchain network cannot be directly transferred to another. Therefore, resource mapping contracts can be pre-deployed on the two blockchains that may conduct cross-chain transactions.
[0137] In this cross-chain transaction, the blockchain belonging to the resource sender is called the source chain, and the blockchain belonging to the resource receiver is called the target chain. The resource mapping contract can set the mapping standard between resources in the source chain and resources in the target chain, such as specifying that a certain number of tokens in the source chain are equivalent to a certain number of tokens in the target chain. It's understandable that a resource mapping contract is also a smart contract.
[0138] Therefore, during the execution of cross-chain transactions, the resource mapping contract can be directly invoked to obtain new resources matching the quantity of cross-chain resources. These new resources are then associated with a second distributed identity identifier, thereby increasing the resources associated with the second distributed identity identifier. Specifically, the resource mapping contract can be configured to automatically map source chain resources to target chain resources at a 1:1 ratio.
[0139] Following the examples in the foregoing embodiments, please refer to the appendix. Figure 6 This illustrates a schematic diagram of a cross-chain transaction process. Figure 6 As shown in step 601, object M (i.e., the resource sender) inputs transaction parameters to initiate a resource transaction based on the transaction parameters.
[0140] In practical applications, the specific process of object M initiating a transaction can be found in the appendix. Figure 7 , Figure 7 A schematic diagram illustrating a resource transfer scenario is shown. For example... Figure 7 As shown, object M can log in to its wallet 701 on the first blockchain via a terminal device and enter the transaction parameters "To" (i.e., the distributed identity identifier of the resource recipient) and "Amount" (i.e., the quantity of transaction resources). Specifically, the "did:chainB:0x0987654321" entered by object M for the transaction parameter "To" is the distributed identity identifier of object N on the second blockchain; the "100AToken" entered for the transaction parameter "Amount" represents 100 ATokens from the first blockchain. Then, as... Figure 7 As shown, based on the input transaction parameters, object M initiated a resource transaction on the first blockchain.
[0141] Then, the first blockchain can respond to the resource transaction and transfer the corresponding resources to the second blockchain. For example... Figure 6 As shown in steps 602 to 605, after receiving a resource transaction, the first blockchain identifies whether the resource recipient in the resource transaction belongs to the first blockchain. If not, the first blockchain generates a corresponding cross-chain event based on the resource transaction and locks the target resource quantity (which can be 100 ATokens). In practical applications, the first blockchain can call a pre-deployed resource mapping contract to execute steps 602 to 605.
[0142] Subsequently, as shown in steps 606 to 608, after detecting a cross-chain event in the first blockchain, the cross-chain gateway can generate a cross-chain transaction based on the event and check the security of the cross-chain transaction. Finally, the cross-chain gateway sends the security-tested cross-chain transaction to the target chain of the cross-chain transaction, namely the second blockchain. The cross-chain gateway can verify the security of the cross-chain transaction by detecting the distributed identity identifier of the resource sender corresponding to the cross-chain transaction; it can also verify the security of the cross-chain transaction by detecting the corresponding block on the first blockchain. Optionally, the cross-chain gateway can also detect the security of the cross-chain transaction through other methods, which are not limited here.
[0143] Finally, as shown in steps 609 to 611, the second blockchain can respond to cross-chain transactions by issuing new resources matching the amount of resources traded, and distributing the new resources to the wallet of object N; thus, as Figure 7 As shown, after object N logs into its wallet 702 on the second blockchain via a terminal device, it can see that its resources have increased by 100 WrappedA Tokens.
[0144] Specifically, Wrapped A Token refers to the Wrapped Token for the first blockchain. A Wrapped Token is a mapping token from a source chain to a target chain, defined by a resource mapping contract. When resources are transferred from the source chain to the target chain, the token on the source chain is locked, and an equal amount of Wrapped Tokens are generated on the target chain. This design ensures the consistency of value during cross-chain token transfers.
[0145] Therefore, in this example, 100 ATokens are locked in the first blockchain, and an equal number of Wrapped ATokens are issued in the second blockchain. Common mapping tokens include WBTC (a type of encapsulated digital resource) and WETH (a digital resource used as an alternative to a general equivalent). In practical applications, the second blockchain can invoke a pre-deployed resource mapping contract to execute steps 609 to 610.
[0146] In summary, this example demonstrates how cross-chain gateways detect cross-chain events and invoke relevant smart contracts such as resource mapping contracts to enable automatic resource transfer across different blockchains. This allows for automated execution of both intra-chain and cross-chain resource transfers without human intervention. This automated approach significantly improves the processing speed of resource transactions, thereby avoiding potential security vulnerabilities such as double-spending attacks during cross-chain transfers and effectively reducing security risks in resource transactions.
[0147] In one possible implementation, considering that if the cross-chain gateway has excessive privileges, and is subsequently attacked and controlled by a third party, the third party could directly issue fraudulent transactions through the cross-chain gateway to transfer resources, causing serious consequences. Therefore, to improve the security of resource transfer processes and thus ensure the security of resources on the blockchain, the blockchain network can introduce security detection strategies to check the security of cross-chain transactions.
[0148] In one embodiment, the security detection strategy can be multi-gateway signing, meaning there can be multiple cross-chain gateways. When a sufficient number of cross-chain gateways sign the same cross-chain transaction, it indicates that the transaction is trustworthy and can be executed. The specific process includes: receiving transaction signatures for the same cross-chain transaction from various cross-chain gateways; then, using the public keys of each cross-chain gateway to verify the corresponding transaction signature and obtain the verification result; finally, if the number of verified results indicating successful verification reaches a preset number, the cross-chain transaction is accepted. The preset number can be manually set or set by any blockchain node in the aforementioned blockchain network, and is not limited here.
[0149] In another embodiment, a security detection strategy can be derived based on Simplified Payment Verification (SPV).
[0150] Based on this, the transaction block headers in each blockchain will be synchronized to other blockchains in the blockchain system. The detection process can specifically include: obtaining the transaction block header of the blockchain that initiated the cross-chain transaction; then, verifying the cross-chain transaction on the blockchain based on the transaction block header to obtain the transaction verification result; finally, if the transaction verification result indicates that the blockchain that initiated the transaction has processed the original resource transaction corresponding to the cross-chain transaction on the blockchain, the step of receiving the cross-chain transaction sent by the cross-chain gateway is triggered.
[0151] The blockchain initiating a cross-chain transaction is the source chain mentioned above. Cross-chain transactions are generated based on original resource transactions, which are resource transactions initiated in the source chain. The cross-chain transaction is derived from the cross-chain event generated corresponding to the original resource transaction.
[0152] Optionally, verification parameters from the blockchain initiating the transaction can also be obtained. These parameters represent the verification path for the aforementioned cross-chain transaction. Then, based on the transaction block header, the cross-chain transaction can be verified on-chain using the verification path represented by the verification parameters to obtain the transaction verification result.
[0153] In another embodiment, a security detection strategy can be derived based on a hash time-locked contract. In this case, the cross-chain transaction carries a hash lock time and a hash lock value, and the source chain of the cross-chain transaction provides the target chain with a hash value matching the hash lock value before the end of the hash lock time.
[0154] Therefore, the detection process may specifically include: if a hash value matching the hash lock value carried by the cross-chain transaction is detected within the hash lock time carried by the cross-chain transaction, then the step of obtaining the quantity of cross-chain resources from the cross-chain transaction and the second distributed identity identifier corresponding to the resource recipient of the cross-chain transaction is executed.
[0155] In this embodiment, by registering resources under a distributed identity identifier, unified management of resources and identities at the blockchain level is achieved. Simultaneously, by identifying the target chain identifier of the resource recipient and comparing it with the chain identifier corresponding to the resource sender, the resource transfer type can be automatically determined. This allows for the automatic execution of corresponding operations based on different resource transfer types. This method of automatically executing corresponding operations based on different resource transfer types reduces human intervention in the resource transaction process, simplifies the entire resource transfer process, and thus improves resource processing efficiency and the user experience of resource transactions.
[0156] Furthermore, this application embodiment enables automatic resource transfer across different blockchains via a cross-chain gateway. This automated processing significantly improves the processing speed of cross-chain resources, thereby avoiding security risks such as double-spending attacks during cross-chain transfers and effectively reducing security risks during resource transactions. Additionally, the uniqueness of distributed identity identifiers effectively reduces the risk of errors during cross-chain transfers; moreover, the reliability of distributed identity identifiers allows for the omission of authentication steps during cross-chain transactions generated based on these identifiers, improving the processing efficiency of cross-chain transactions and thus enhancing overall resource processing efficiency.
[0157] This application describes an apparatus embodiment that can be used to execute the blockchain-based resource transaction processing system method described in the above embodiments of this application. For details not disclosed in the apparatus embodiments of this application, please refer to the above embodiments of the blockchain-based resource transaction processing system method.
[0158] This application provides a blockchain-based resource transaction processing device. Resources stored on the blockchain are associated with distributed identity identifiers, which consist of the chain identifier of the blockchain containing the resource and the account identifier of the resource's owner. For example... Figure 8 As shown, the device includes a receiving unit 801, an identification unit 802, and a processing unit 803, wherein:
[0159] The receiving unit 801 is used to receive a resource transaction initiated by the resource sender, wherein the resource transaction contains the first distributed identity identifier of the resource receiver.
[0160] The identification unit 802 is used to receive a resource transaction initiated by the resource sender, wherein the resource transaction contains the first distributed identity identifier of the resource receiver.
[0161] The processing unit 803 is used to compare the target chain identifier with the chain identifier corresponding to the resource sender, and process the resource transaction based on the comparison result.
[0162] In one embodiment of this application, based on the aforementioned scheme, when processing resource transactions according to the comparison results, the processing unit 803 may be specifically configured to: if the comparison results indicate that the target chain identifier is different from the chain identifier corresponding to the resource sender, then generate a cross-chain event based on the number of transaction resources contained in the resource transaction and the first distributed identity identifier; in response to the cross-chain event, send a cross-chain transaction matching the cross-chain event to the target blockchain through the cross-chain gateway, so that the target blockchain executes the cross-chain transaction to realize the cross-chain transfer of the target resources of the transaction resource quantity.
[0163] In one embodiment of this application, based on the aforementioned scheme, when the processing unit 803 processes the resource transaction according to the comparison result, it may be specifically configured to: if the comparison result indicates that the target chain identifier is the same as the chain identifier corresponding to the resource sender, then obtain the number of transaction resources contained in the resource transaction; and transfer the target resource of the transaction resource quantity from the resource sender to the resource receiver.
[0164] In one embodiment of this application, based on the foregoing scheme, the processing unit 803 may further be configured to: receive a cross-chain transaction sent by a cross-chain gateway; obtain the quantity of cross-chain resources from the cross-chain transaction and the second distributed identity identifier corresponding to the resource recipient of the cross-chain transaction; and execute the cross-chain transaction to increase the resources associated with the second distributed identity identifier based on the cross-chain transaction.
[0165] In one embodiment of this application, based on the aforementioned scheme, when the processing unit 803 executes a cross-chain transaction to increase the resources associated with the second distributed identity identifier based on the cross-chain transaction, it can be specifically configured to: call the resource mapping contract to obtain new resources matching the number of cross-chain resources; and associate the new resources with the second distributed identity identifier.
[0166] In one embodiment of this application, the number of cross-chain gateways includes multiple ones. Based on the aforementioned scheme, when the processing unit 803 receives cross-chain transactions sent by the cross-chain gateways, it can be specifically configured to: receive transaction signatures for the same cross-chain transaction sent by each cross-chain gateway; call the public key of each cross-chain gateway to verify the corresponding transaction signature and obtain the verification result; if the number of verification results indicating that the verification has passed reaches a preset number, then the cross-chain transaction is received.
[0167] In one embodiment of this application, based on the aforementioned scheme, the processing unit 803 may further be configured to: obtain the transaction block header of the transaction initiating blockchain corresponding to the cross-chain transaction; perform on-chain verification of the cross-chain transaction based on the transaction block header to obtain the transaction verification result; if the transaction verification result indicates that the transaction initiating blockchain has already performed on-chain processing of the original resource transaction corresponding to the cross-chain transaction, then the step of receiving the cross-chain transaction sent by the cross-chain gateway is triggered, wherein the cross-chain transaction is generated based on the original resource transaction.
[0168] In one embodiment of this application, based on the foregoing scheme, the processing unit 803 may be further configured to: if a hash value matching the hash lock value carried by the cross-chain transaction is detected during the hash lock time carried by the cross-chain transaction, then perform the step of obtaining the cross-chain resource quantity from the cross-chain transaction and the second distributed identity identifier corresponding to the resource recipient of the cross-chain transaction.
[0169] In one embodiment of this application, based on the foregoing scheme, the identification unit 802 may further be configured to obtain the chain identifier corresponding to the resource sender. The process of obtaining the chain identifier corresponding to the resource sender includes: obtaining the public key of the resource sender; calling the identifier management contract to obtain the third distributed identity identifier of the resource sender based on the obtained public key; wherein, the identifier management contract is used to associate and store the distributed identity identifier and the identifier document containing the public key; and identifying the chain identifier contained in the third distributed identity identifier.
[0170] In one embodiment of this application, based on the foregoing scheme, the receiving unit 801 may further be configured to: obtain the first distributed identity identifier of the resource receiver triggered by the resource sender, and the number of transaction resources to be transferred to the resource receiver; and generate a resource transaction based on the first distributed identity identifier and the number of transaction resources.
[0171] According to one embodiment of this application, Figure 3 and Figure 5 The steps involved in the method shown can be derived from... Figure 8 The blockchain-based resource transaction processing device shown is executed by each unit.
[0172] According to another embodiment of this application, Figure 8 The units in the blockchain-based resource transaction processing device shown are divided based on logical functions. These units can be individually or entirely merged into one or more other units, or some of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. In other embodiments of this application, the blockchain-based resource transaction processing device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and multiple units can collaborate to achieve them.
[0173] According to another embodiment of this application, a general-purpose computing device, such as a computer device, including processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM), can be used to run an application capable of performing tasks such as... Figure 3 or Figure 5 The computer program (including program code) involved in each step of the method shown is used to construct, for example... Figure 8 The diagram illustrates a blockchain-based resource transaction processing apparatus and a blockchain-based resource transaction processing method for implementing embodiments of this application. The computer program may be recorded on, for example, a computer storage medium, loaded onto the aforementioned computer device via the computer storage medium, and run therein.
[0174] It should be noted that the apparatus provided in the above embodiments and the method provided in the above embodiments belong to the same concept, and the specific way in which each module and unit performs operations has been described in detail in the method embodiments, and will not be repeated here.
[0175] The apparatus provided in the above embodiments can be located within a terminal device or a server. The apparatus provided in this application achieves unified management of resources and identities by associating resources with distributed identity identifiers. This makes resource management on different blockchains more convenient and improves asset management efficiency. Furthermore, resource transfer is based on the distributed identity identifiers of both parties during resource transactions, eliminating the need for subsequent identity verification and simplifying the resource transfer process. In addition, distributed identity identifiers are simpler and easier to remember than account addresses; this avoids the sender entering incorrect account information and simplifies the operations required for initiating a transaction. Therefore, this application simplifies the resource transaction initiation and transfer processes, improving transfer speed and time, and effectively enhancing the resource processing efficiency of the blockchain.
[0176] Embodiments of this application also provide an electronic device, including one or more processors and a storage device, wherein the storage device is used to store one or more computer programs, which, when executed by one or more processors, enable the electronic device to implement the blockchain-based resource transaction processing method described above.
[0177] Figure 9 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown.
[0178] It should be noted that, Figure 9 The computer system 900 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0179] like Figure 9As shown, the computer system 900 includes a Central Processing Unit (CPU) 901, which can perform various appropriate actions and processes, such as executing the methods described in the above embodiments, based on a program stored in Read-Only Memory (ROM) 902 or a program loaded from storage portion 908 into Random Access Memory (RAM) 903. The RAM 903 also stores various programs and data required for system operation. The CPU 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0180] In some embodiments, the following components are connected to the I / O interface 905: an input section 906 including a keyboard, mouse, etc.; an output section 907 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 910 as needed so that computer programs read from it can be installed into the storage section 908 as needed.
[0181] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 909, and / or installed from removable medium 911. When the computer program is executed by processor (CPU) 901, it performs various functions defined in the system of this application.
[0182] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory, flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The signal medium for the data acquisition method described above in the various embodiments can also be any computer-readable medium other than a computer-readable storage medium. This computer-readable medium can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0183] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and a computer program.
[0184] The units or modules described in the embodiments of this application can be implemented in software or hardware, and can also be located in a processor. The names of these units or modules do not necessarily limit the specific unit or module itself.
[0185] Another aspect of this application provides a computer-readable medium storing a computer program that, when executed by a processor, implements the aforementioned blockchain-based resource transaction processing method. This computer-readable medium may be included in the electronic device described in the above embodiments, or it may exist independently and not incorporated into the electronic device.
[0186] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. The processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the aforementioned actions. Figure 3 and Figure 5 The method embodiment shown. The computer-readable storage medium may be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0187] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0188] Other embodiments of this application will readily conceive of by considering the specification and practicing the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0189] The above content is merely a preferred exemplary embodiment of this application and is not intended to limit the implementation of this application. Those skilled in the art can easily make corresponding modifications or alterations based on the main concept and spirit of this application. Therefore, the scope of protection of this application should be determined by the scope of protection claimed in the claims.
Claims
1. A resource transaction processing method based on blockchain, characterized in that, Resources stored on the blockchain are associated with distributed identity identifiers, which consist of the chain identifier of the blockchain where the resource resides and the account identifier of the resource owner. The method includes: The resource receiver initiates a resource transaction, which contains the resource receiver's first distributed identity identifier. Identify the target chain identifier contained in the first distributed identity identifier; The target chain identifier is compared with the chain identifier corresponding to the resource sender, and the resource transaction is processed according to the comparison result.
2. The method according to claim 1, characterized in that, The process of processing the resource transaction based on the comparison results includes: If the comparison result indicates that the target chain identifier is different from the chain identifier corresponding to the resource sender, then a cross-chain event is generated based on the number of transaction resources contained in the resource transaction and the first distributed identity identifier. In response to the cross-chain event, a cross-chain transaction matching the cross-chain event is sent to the target blockchain through a cross-chain gateway, causing the target blockchain to execute the cross-chain transaction to achieve cross-chain transfer of the target resource quantity of the transaction.
3. The method according to claim 1, characterized in that, The process of processing the resource transaction based on the comparison results includes: If the comparison result indicates that the target chain identifier is the same as the chain identifier corresponding to the resource sender, then the number of transaction resources contained in the resource transaction is obtained; The target amount of the transaction resources is transferred from the resource sender to the resource receiver.
4. The method according to claim 1, characterized in that, The method further includes: Receive cross-chain transactions sent by the cross-chain gateway; Obtain the quantity of cross-chain resources from the cross-chain transaction, and the second distributed identity identifier corresponding to the resource recipient of the cross-chain transaction; Execute the cross-chain transaction to increase the resources associated with the second distributed identity identifier based on the cross-chain transaction.
5. The method according to claim 4, characterized in that, The execution of the cross-chain transaction to increase the resources associated with the second distributed identity identifier based on the cross-chain transaction includes: Invoke the resource mapping contract to obtain new resources that match the number of cross-chain resources; Associate the newly added resource with the second distributed identity identifier.
6. The method according to claim 4, characterized in that, The number of cross-chain gateways includes multiple gateways, and receiving cross-chain transactions sent by the cross-chain gateways includes: Receive transaction signatures for the same cross-chain transaction from various cross-chain gateways; The public keys of each cross-chain gateway are invoked to verify the corresponding transaction signature and obtain the verification result. If the number of verification results that pass the characterization verification reaches a preset number, then the cross-chain transaction is accepted.
7. The method according to claim 4, characterized in that, The method further includes: Obtain the transaction block header of the blockchain that initiated the cross-chain transaction; Based on the transaction block header, the cross-chain transaction is verified on-chain to obtain the transaction verification result; If the transaction verification result indicates that the blockchain initiating the transaction has already processed the original resource transaction corresponding to the cross-chain transaction on the chain, then the step of receiving the cross-chain transaction sent by the cross-chain gateway is triggered, and the cross-chain transaction is generated based on the original resource transaction.
8. The method according to claim 4, characterized in that, The method further includes: If a hash value matching the hash lock value carried by the cross-chain transaction is detected within the hash lock time period carried by the cross-chain transaction, then the step of obtaining the quantity of cross-chain resources from the cross-chain transaction and the second distributed identity identifier corresponding to the resource recipient of the cross-chain transaction is executed.
9. The method according to any one of claims 1 to 8, characterized in that, The process of obtaining the chain identifier corresponding to the resource sender includes: Obtain the public key of the resource sender; Based on the obtained public key, the identifier management contract is invoked to obtain the third distributed identity identifier of the resource sender; wherein, the identifier management contract is used to associate and store the distributed identity identifier and the identifier document containing the public key; Identify the chain identifier contained in the third distributed identity identifier.
10. The method according to any one of claims 1 to 8, characterized in that, The method further includes: Obtain the first distributed identity identifier of the resource recipient triggered by the resource sender, and the quantity of transaction resources to be transferred to the resource recipient; The resource transaction is generated based on the first distributed identity identifier and the quantity of the transaction resources.
11. A resource transaction processing device based on blockchain, characterized in that, Resources stored on the blockchain are associated with distributed identity identifiers, which consist of the chain identifier of the blockchain where the resource resides and the account identifier of the resource owner. The device includes a receiving unit, an identification unit, and a processing unit, wherein: The receiving unit is used to receive a resource transaction initiated by the resource sender, wherein the resource transaction contains a first distributed identity identifier of the resource receiver. The identification unit is used to identify the target chain identifier contained in the first distributed identity identifier; The processing unit is used to compare the target chain identifier with the chain identifier corresponding to the resource sender, and process the resource transaction based on the comparison result.
12. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the blockchain-based resource transaction processing method as described in any one of claims 1 to 10.
13. An electronic device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the blockchain-based resource transaction processing method as described in any one of claims 1 to 10.
14. A computer program product, characterized in that, The computer program product includes a computer program adapted to be loaded by a processor and executed as described in any one of claims 1 to 10.