Blockchain-based transaction processing method, apparatus, medium, and device
By using pre-set smart contracts and privacy smart contracts in the blockchain network to transfer virtual assets between virtual accounts of the transacting parties, and verifying the legitimacy through bank nodes, the security and reliability issues in blockchain transactions are solved, and safe and reliable digital asset transactions are realized.
Patent Information
- Application Number
- CN202210504442.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-10
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2042-05-10
AI Technical Summary
How to improve the security and reliability of digital asset transactions in blockchain networks, especially in multi-party transaction scenarios, to ensure the legality and privacy protection of the transaction process.
By using pre-set smart contracts in a blockchain network to transfer virtual assets between at least two virtual accounts, and by initiating a synchronous settlement request to a bank node to verify the legality of the virtual asset transfer results, sensitive data is protected using privacy smart contracts, and encryption and decryption operations are performed using trusted computing nodes.
It enables secure and reliable asset transactions on the blockchain, ensuring the legality and privacy of the transaction process and improving the security and reliability of transactions.
Smart Images

Figure CN117078262B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology, and specifically relates to a blockchain-based transaction processing method, a blockchain-based transaction processing device, a computer-readable medium, and an electronic device. Background Technology
[0002] With the rapid development of society, economy, and information technology, digital assets have gradually come into people's view. Digital assets refer to assets existing in the form of electronic data. With the development of blockchain technology, digital assets can be traded on the blockchain network without relying on third parties, thus creating conditions for the convenient circulation of digital assets on the network.
[0003] Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm. Blockchain technology can ensure the security and reliability of asset transactions on the network and reduce the cost of asset transactions.
[0004] As the value of digital assets or other financial assets on the blockchain increases, the security and reliability of digital asset transactions become a focal point. Therefore, improving the security and reliability of digital asset transactions is a pressing technical issue that needs to be addressed. Summary of the Invention
[0005] The purpose of this application is to provide a blockchain-based transaction processing method, apparatus, medium, and device, which at least to some extent solves the technical problem of how to improve the security and reliability of digital asset transactions in related technologies.
[0006] 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.
[0007] According to one aspect of the embodiments of this application, a blockchain-based transaction processing method is provided. The method includes: Acquire settlement request data, which is a request for transaction settlement initiated by the trading party's blockchain account, and the trading party's blockchain account is a blockchain account created by the trading party in the blockchain; Acquire at least two virtual accounts of trading parties corresponding to the settlement request data and a preset smart contract between the at least two virtual accounts of trading parties, wherein the virtual accounts of trading parties are bank virtual accounts created by the trading party blockchain accounts through bank nodes in the blockchain network; According to the preset smart contract, virtual assets are transferred between the virtual accounts of at least two trading parties; A synchronization settlement request is initiated to the bank node, which instructs the bank node to verify the legality of the virtual asset transfer results between the virtual accounts of the at least two transacting parties according to the preset smart contract.
[0008] According to one aspect of the embodiments of this application, a blockchain-based transaction processing apparatus is provided. The apparatus includes: The settlement request acquisition module is configured to acquire settlement request data, which is a request data initiated by the trading party's blockchain account to request transaction settlement. The trading party's blockchain account is a blockchain account created by the trading party in the blockchain. The smart contract acquisition module is configured to acquire at least two virtual accounts of trading parties corresponding to the settlement request data and a preset smart contract between the at least two virtual accounts of trading parties, wherein the virtual accounts of trading parties are bank virtual accounts created by the trading party blockchain accounts through bank nodes in the blockchain network; The virtual asset transfer module is configured to transfer virtual assets between at least two virtual accounts of the trading parties according to the preset smart contract; The settlement verification module is configured to initiate a synchronous settlement request to the bank node. The synchronous settlement request is used to instruct the bank node to verify the legality of the virtual asset transfer results between the virtual accounts of the at least two transacting parties according to the preset smart contract.
[0009] In some embodiments of this application, based on the above technical solutions, the transaction processing apparatus further includes: The clearing request acquisition unit is configured to acquire clearing request data encrypted with a first public key, wherein the clearing request data is request data initiated by the blockchain account of the transacting party for requesting transaction clearing; The smart contract creation unit is configured to decrypt the settlement request data using a first private key corresponding to the first public key, and create the preset smart contract based on the decrypted data.
[0010] In some embodiments of this application, based on the above technical solutions, the preset smart contract is a privacy smart contract, and the smart contract creation unit includes: The trusted computing node acquisition subunit is configured to acquire trusted computing nodes that have viewing permissions for the privacy smart contract. The transaction platform node includes the trusted computing node and ordinary computing nodes. The trusted computing node has a computing environment that is isolated from the data of the ordinary computing node. The smart contract creation subunit is configured to decrypt the clearing request data using a first private key corresponding to the first public key through the trusted computing node, and create the preset smart contract on the trusted computing node based on the decrypted data.
[0011] In some embodiments of this application, based on the above technical solutions, the virtual asset transfer module includes: The trusted execution node acquisition unit is configured to acquire a trusted execution node in the transaction platform node that has execution authority over the privacy smart contract through a preset smart contract created in the trusted computing node; The target public key acquisition unit is configured to acquire the target public key corresponding to the target private key of the trusted execution node; The contract encryption unit is configured to encrypt the preset smart contract using the target public key to obtain privacy contract encrypted data, and send the privacy contract encrypted data to the trusted execution node; The virtual asset transfer unit is configured to decrypt the encrypted data of the privacy contract using the target private key through the trusted execution node to obtain the privacy smart contract, and to transfer virtual assets between the virtual accounts of at least two transacting parties according to the privacy smart contract.
[0012] In some embodiments of this application, based on the above technical solutions, the transaction processing apparatus further includes: The account creation request data acquisition unit is configured to acquire account creation request data encrypted with a second public key. The account creation request data is request data initiated by the blockchain account of the transacting party. The account creation request data is used to request the bank node to create a bank virtual account corresponding to the request initiator. The target bank node acquisition unit is configured to decrypt the account creation request data using a second private key corresponding to the second public key, and to obtain the user registration information of the initiator of the account creation request data and the target bank node corresponding to the decrypted data. An account creation consensus initiating unit is configured to initiate a consensus with the blockchain regarding the initiator of the account creation request data creating a bank virtual account at the target bank node; An account creation request initiating unit is configured to initiate an account creation request to the target bank node when the consensus is successfully completed. The account creation request is used to instruct the target bank node to create a corresponding virtual bank account based on the user registration information.
[0013] In some embodiments of this application, based on the above technical solutions, the preset smart contract includes a normal state, an expired state, and a frozen state. The normal state indicates that the preset smart contract can be executed normally; the expired state indicates that the execution period of the preset smart contract has expired and execution has stopped; and the frozen state indicates that the preset smart contract is frozen and execution is suspended. The virtual asset transfer module includes: The conditional virtual asset transfer unit is configured to transfer virtual assets in at least two virtual accounts corresponding to the settlement request data when the initiator of the settlement request data is on the whitelist of the preset smart contract and the preset smart contract is in a normal state. The whitelist is used to record accounts with the authority to initiate and execute the preset smart contract.
[0014] In some embodiments of this application, based on the above technical solutions, the transaction processing apparatus further includes: The consensus initiating unit for the transfer result is configured to initiate a consensus on the virtual asset transfer result between the virtual accounts of the at least two transacting parties when it receives a successful verification indication of the legality verification of the synchronous settlement request from the bank node.
[0015] According to one aspect of the embodiments of this application, a computer-readable medium is provided, on which a computer program is stored, which, when executed by a processor, implements the blockchain-based transaction processing method as described above.
[0016] According to one aspect of the embodiments of this application, an electronic device is provided, the electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute a blockchain-based transaction processing method as described above by executing the executable instructions.
[0017] According to one aspect of the embodiments of this application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the blockchain-based transaction processing method as described above.
[0018] In the technical solution provided in this application embodiment, virtual assets are transferred between at least two virtual accounts of trading parties through a preset smart contract, and a synchronous settlement request is initiated to the bank node to instruct the bank node to verify the legality of the virtual asset transfer results between the at least two virtual accounts of trading parties according to the preset smart contract. Thus, on-chain asset trading on the blockchain can be realized through the transfer of virtual assets between the two trading parties' accounts and the verification of the legality of the virtual asset transfer results by the bank node, and it can have good transaction security and transaction reliability.
[0019] 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
[0020] The accompanying drawings, which are incorporated in and form part of this specification, schematically 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.
[0021] Figure 1 A schematic diagram illustrating the composition of a blockchain system in an embodiment of this application is shown. Figure 2 The schematic diagram illustrates the compositional structure of a blockchain maintained on a blockchain network.
[0022] Figure 3 The network architecture of a blockchain network applying the technical solution of this application is illustrated schematically.
[0023] Figure 4 A flowchart illustrating a blockchain-based transaction processing method according to an embodiment of this application is shown schematically.
[0024] Figure 5 A schematic diagram illustrating the structure of a blockchain account according to an embodiment of this application is shown.
[0025] Figure 6 A schematic diagram illustrating the creation process of a blockchain account according to one embodiment of this application is shown.
[0026] Figure 7 A schematic diagram illustrating the structure of a virtual account for a transacting party according to an embodiment of this application is shown.
[0027] Figure 8 A schematic diagram illustrating the creation process of a virtual account for a transacting party according to an embodiment of this application is shown.
[0028] Figure 9 A schematic diagram of the structure of a preset smart contract according to an embodiment of this application is shown.
[0029] Figure 10 The diagram illustrates a specific flow chart of a blockchain-based transaction processing method according to a particular embodiment of this application.
[0030] Figure 11 The illustration shows an application scenario diagram of a blockchain-based transaction processing method according to an embodiment of this application.
[0031] Figure 12 This illustration schematically shows a diagram of data flow between nodes on a blockchain according to an embodiment of this application.
[0032] Figure 13 The flowchart illustrating the steps prior to obtaining at least two virtual accounts of the trading parties corresponding to the settlement request data and the preset smart contract between the at least two virtual accounts of the trading parties is shown in a certain embodiment of this application.
[0033] Figure 14 The diagram illustrates the specific process of creating a preset smart contract according to a certain embodiment of this application.
[0034] Figure 15 The flowchart illustrates the steps of decrypting clearing request data using a first private key corresponding to a first public key and creating a preset smart contract based on the decrypted data in a certain embodiment of this application.
[0035] Figure 16 The illustration shows a schematic diagram of the specific process of creating a preset smart contract through a trusted computing node in a certain embodiment of this application.
[0036] Figure 17 The flowchart illustrating the steps of transferring virtual assets between at least two virtual accounts of trading parties according to a preset smart contract in a certain embodiment of this application is shown in the illustration.
[0037] Figure 18 This illustration schematically shows a specific process diagram of executing a preset smart contract through a trusted execution node in a certain embodiment of this application.
[0038] Figure 19 The diagram illustrates a trusted execution environment and a schematic diagram of the blockchain architecture in a certain embodiment of this application.
[0039] Figure 20 The flowchart illustrates steps that may be included in a certain embodiment of this application.
[0040] Figure 21A schematic block diagram of a blockchain-based transaction processing apparatus provided in an embodiment of this application is shown.
[0041] Figure 22 A schematic block diagram of a computer system architecture for implementing an electronic device according to embodiments of the present application is shown. Detailed Implementation
[0042] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art.
[0043] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.
[0044] 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.
[0045] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0046] In the specific implementation of this application, data related to user information and user accounts are involved. When the various embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0047] A blockchain is a shared, chained-block data structure built on transparent and trusted rules in a peer-to-peer network environment. It is designed to be tamper-proof, tamper-proof, and traceable. The chained-block data structure stores transactions occurring over a period of time in blocks, which are then linked chronologically using cryptographic algorithms. The ledger is distributed to all member nodes in the network, permanently recording the history of asset transactions between peer nodes in the chain of blocks linked by hash cryptographic algorithms. All confirmed and verified transactions are linked from the beginning of the chain to the latest block, hence the name blockchain. A blockchain can serve as a single source of truth, and members of a blockchain network can only view transactions relevant to them.
[0048] Figure 1 The schematic diagram illustrates the composition of a blockchain system according to an embodiment of this application. The blockchain system 100 may include at least one client 110 and a blockchain network 120. The blockchain network 120 includes at least one blockchain node 121. The client 110 may be various electronic devices such as smartphones, tablets, laptops, desktop computers, smart wearable devices, smart in-vehicle devices, smart payment terminals, and facial recognition terminals. By installing the corresponding client application, it can provide blockchain data services to users. The blockchain node 121 may be a terminal device or a server. For example, the blockchain node 121 may be an independent physical server, a server cluster consisting of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0049] In blockchain network 120, each blockchain node 121 receives input information during normal operation and maintains shared data within the blockchain network based on the received input information. To ensure information interoperability, information connections can exist between the various blockchain nodes 121, allowing them to transmit information to each other. For example, when any blockchain node 121 in blockchain network 120 receives input information and broadcasts it within the blockchain network 120, other node devices in blockchain network 120 can obtain the input information according to a consensus algorithm and store it as shared data.
[0050] Each blockchain node 121 in the blockchain network 120 has a corresponding node identifier. Each blockchain node 121 can also store the node identifiers of other blockchain nodes in the same blockchain network, so that the generated block can be broadcast to other nodes in the blockchain network 120 based on their node identifiers. Each blockchain node 121 can maintain a node identifier list as shown in Table 1, 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 shows a node identifier list using IP addresses as an example.
[0051] Table 1
[0052] Figure 2 This schematically illustrates the structural composition of a blockchain maintained on a blockchain network. For example... Figure 2 As shown, a blockchain consists of multiple sequentially linked blocks. Whenever new data needs to be written to the blockchain, this data is aggregated into a newly generated block. This newly generated block is then linked to the end of the blockchain. A consensus algorithm ensures that the blocks added on each node device 121 are identical. The block body of each block records the data of the current block, while its block header stores the hash value of the preceding block. If the transaction data in the preceding block changes, the hash value of the current block will also change accordingly. Therefore, data uploaded to the blockchain network is difficult to tamper with, improving the reliability of shared data.
[0053] Figure 3 The network architecture of a blockchain network applying the technical solution of this application is illustrated schematically. For example... Figure 3 As shown, in application scenarios that realize online transactions and online payments, the transaction entity node 310, the transaction platform node 320, and the resource allocation node 330 located in the blockchain network jointly maintain one or more blockchains 340.
[0054] Transaction entity node 310 is a blockchain node that provides transaction services to users. For example, it can be a merchant or individual seller who conducts online transactions with users.
[0055] Transaction platform node 320 is a blockchain node that provides transaction scenarios for online transactions. For example, it can be an e-commerce website, an online mall, or various business platforms that provide online transaction services.
[0056] Resource allocation node 330 is a blockchain node that provides asset management and allocation services for network transactions, such as a third-party payment institution.
[0057] When a user conducts a network transaction with the transaction entity node 310, they can pay transaction assets to the transaction entity node 310 through an account opened on the resource allocation node 330. The transaction platform node 320, as the provider of the transaction scenario, needs to deduct a certain amount of assets from the transaction assets as a platform service fee. To achieve reliable asset allocation between the transaction entity node 310 and the transaction platform node 320, a corresponding smart contract (such as a revenue-sharing contract) can be established based on the blockchain network for asset allocation. When a network transaction occurs, the resource allocation node 330 can allocate assets to various objects in the transaction scenario according to the smart contract.
[0058] To ensure the validity and credibility of the contract, the process data and result data of the contract can be stored on the blockchain 340. Decentralized contract signing and data storage can effectively avoid trust crises.
[0059] The blockchain-based transaction processing method provided in this application will be described in detail below with reference to specific implementation methods.
[0060] Figure 4 A flowchart illustrating a blockchain-based transaction processing method according to an embodiment of this application is shown schematically. In practical applications, Figure 4 The transaction processing method shown can be executed by transaction platform nodes in the blockchain network, or... Figure 4 The transaction processing method shown can be executed by nodes other than bank nodes in the blockchain network. This specification hereinafter uses the example of execution by a transaction platform node in the blockchain network, but the scope of the embodiments is not limited thereto. The blockchain network may include bank nodes, transaction platform nodes, and other consensus nodes or ledger nodes.
[0061] based on Figure 4 The transaction processing method shown enables the transfer of virtual assets between at least two virtual accounts of trading parties through a pre-set smart contract. It also initiates a synchronous settlement request to a bank node to instruct the bank node to verify the legality of the virtual asset transfer results between the at least two virtual accounts according to the pre-set smart contract. This allows for on-chain asset trading on the blockchain through the transfer of virtual assets between the two trading parties' accounts and the verification of the legality of the virtual asset transfer results by the bank node, and provides good transaction security and reliability.
[0062] Specifically, refer to Figure 4As shown, the transaction information processing method applied to blockchain includes at least the following steps S410 to S440, which are described in detail below.
[0063] In step S410, settlement request data is obtained. The settlement request data is a request data initiated by the trading party's blockchain account to request transaction settlement. The trading party's blockchain account is a blockchain account created by the trading party in the blockchain.
[0064] Specifically, settlement request data can be initiated by the buyer, seller, or platform in the transaction; this application does not impose any restrictions on this. Both the buyer and seller merchants have corresponding blockchain accounts created in the blockchain. Figure 5 A schematic diagram illustrating the structure of a blockchain account according to an embodiment of this application is shown. Figure 5 As shown, the information in a blockchain account may include username, authentication type, user ID, channel ID, account creation time, blockchain account address, metadata, etc.
[0065] Figure 6 A schematic diagram illustrating the creation process of a blockchain account according to one embodiment of this application is shown. Figure 6 As shown, the user data can be encrypted first using the public key of the trading platform node to obtain data 1. Then, the user registration information can be encrypted using the same public key to obtain data 2. After signing data 1 and data 2, they are sent to the trading platform node. The trading platform node verifies the signature to determine if the data originates from the merchant DApp. If the data does originate from the merchant DApp, data 1 is decrypted using the first private key of the trading platform node, and data 2 is decrypted using the second private key. If the data does not originate from the merchant DApp, the message is deemed invalid, and the request to create a blockchain account is rejected. In step S420, at least two virtual accounts corresponding to the settlement request data and a preset smart contract between these virtual accounts are obtained. The virtual accounts are bank virtual accounts created by the trading platform blockchain accounts through bank nodes in the blockchain network.
[0066] A merchant DApp (Decentralized Application) can be a decentralized distributed application.
[0067] Specifically, pre-defined smart contracts can include ordinary smart contracts and privacy smart contracts. Generally, data involved in blockchain transactions is public to all blockchain participants; for example, data in ordinary smart contracts is shared among all on-chain nodes. Privacy smart contracts, however, restrict access to the contract to users with the corresponding viewing and execution permissions. Thus, privacy smart contracts provide the blockchain with the ability to process sensitive data within contracts, protecting data privacy while ensuring the reliability of contract execution. Furthermore, the restrictions on execution and viewing permissions better guarantee the correct execution of contract logic and the complete presentation of contract data among authorized nodes.
[0068] Publicly available data related to clearing operations can be handled using standard contracts, such as contract version and status. Data using standard contracts can be directly parsed and queried via a blockchain explorer. However, data with higher privacy requirements in clearing operations, such as transaction amounts and target accounts, can be handled using privacy contracts. This type of data cannot be directly parsed and queried via a blockchain explorer. Standard contracts can be used for blockchain data storage, and all blockchain operation logs are recorded through standard contracts. Privacy contracts can be used to execute fund clearing and complete the transfer of funds between virtual accounts of trading parties.
[0069] A bank virtual account can be a type of account provided by a banking institution to an e-commerce platform or trading platform to provide functions such as fund management, payment reconciliation, and transaction settlement. This type of account can consist of a physical fund supervision general ledger account (type one account) opened with in-person verification at the e-commerce platform or trading platform counter, and a virtual account provided to the trading party that can be opened online through the e-commerce platform or trading platform without in-person verification at the counter.
[0070] The physical account of the general ledger for fund supervision corresponds to the virtual account of the general ledger for fund supervision, which in turn corresponds to multiple virtual accounts of the trading parties for clearing details. The general ledger virtual account is the sum of the detailed ledgers of the virtual accounts of the trading parties. The virtual accounts of the trading parties are used by each party in the transaction to record their own funds, while the general ledger account is used to supervise the accuracy of account values and for account management.
[0071] Figure 7 A schematic diagram illustrating the structure of a virtual account for a transacting party according to an embodiment of this application is shown. Figure 7 As shown, the information in the virtual account of the trading party may include username, account number, bank of account opening, account type, user ID, channel ID, account creation time, blockchain account address, metadata, etc.
[0072] Figure 8 A schematic diagram illustrating the creation process of a virtual account for a transacting party according to an embodiment of this application is shown. Figure 8As shown, the process begins by encrypting all user data using the trading platform node's public key, resulting in Data 1. Next, the trading platform node's public key is used to encrypt information about the user's virtual bank account, such as the account name and user ID, resulting in Data 3. Data 1 and Data 3 are then message-signed and sent to the trading platform node. The trading platform node verifies the signature to determine if the data originates from the merchant's DApp. If the data is determined not to originate from the merchant's DApp, the message is deemed invalid, and the request to create the bank's virtual account is rejected.
[0073] Once it's determined that the data originates from the merchant's DApp, the transaction platform node decrypts data 1 using its first private key, then encrypts data 1 using the bank node's public key, assembles data 1 and data 3, and signs the assembled data. Next, it initiates a blockchain transaction consensus. Upon successful consensus, it returns the blockchain transaction hash value and, based on the assembled data (data 1 and data 3 with the message signature), sends an account creation request to the bank node. The bank node verifies the signature to determine if the data originates from the transaction platform node. After confirming the data's origin through signature verification, the bank node decrypts data 3 using its private key and opens a virtual bank account based on the decrypted data. It then establishes the association between the blockchain account and the virtual bank account before returning the virtual bank account information to both the transaction platform node and the merchant's DApp.
[0074] Specifically, the transaction consensus in the embodiments of this application can be implemented by PBFT (Practical Byzantine Fault Tolerance) or other consensus algorithms.
[0075] Figure 9 A schematic diagram illustrating the structure of a preset smart contract according to an embodiment of this application is shown. Figure 9 As shown, the preset smart contract content structure can include a header, contract version, contract status, contract start time, contract technical time, and a whitelist of contract initiators; transaction-related information includes the virtual accounts of the starting and target parties, and the transaction amount; and data-related information includes public and private data. Specifically, the contract status can be initialization, update, end, or freeze. Public data can include: contract operation method, contract type, contract number, and contract creation time. Private data can be customized by the user. The contract type can include contracts created by the executor due to their own transactions, or contracts created by the executor due to asset transfers.
[0076] The whitelist includes accounts that have the same permissions as the contract creator. The whitelist is used to allow accounts to initiate contract execution when the contract creator does not have the necessary conditions to execute the contract.
[0077] Specifically, the initialization state is the initial state after the contract is created. The update state is the contract state after changes occur in the matters within the smart contract. For example, each transfer of the executor can be considered a contract update, making the contract an update state. The termination state is the contract's expiration state, i.e., the state where the contract ends. The contract freeze state is when the contract involves illegal or irregular matters; the blockchain network management platform can initiate a contract freeze operation to prevent malicious on-chain actions, making the contract unable to be invoked and executed.
[0078] In step S430, virtual assets are transferred between at least two virtual accounts of the transacting parties according to a preset smart contract.
[0079] For example, virtual assets can be virtual funds or other electronic virtual assets, and this application does not impose any restrictions on this. Funds in the virtual account of the transacting party can specifically be data information on fund transfers written by bank nodes, or they can be specific data assets.
[0080] In some embodiments, the at least two virtual accounts may include a buyer virtual account and a seller virtual account, and virtual assets are transferred between the buyer virtual account and the seller virtual account according to a preset smart contract. In some embodiments, the at least two virtual accounts may include multiple buyer virtual accounts and multiple seller virtual accounts, and virtual assets are transferred between the multiple buyer virtual accounts and the multiple seller virtual accounts according to a preset smart contract.
[0081] In specific business scenarios, the transfer of virtual assets is not limited to a simple transfer from A to B. The fund path for clearing and execution can involve multiple parties, such as a fund path of A->B->C->D->E->F. Because fund transfers can be complex, privacy smart contracts can ensure that the computational data of the fund path is not visible, while also guaranteeing the reliability of the fund transfer results from the bank's virtual account.
[0082] Figure 10 A schematic diagram illustrating a specific embodiment of a blockchain-based transaction processing method according to this application is shown. Figure 10As shown, the merchant DApp encrypts the settlement request data using the transaction platform node's public key, obtaining data 5. After signing data 5, it sends it to the transaction platform node. The transaction platform node then verifies the signature of data 5 to determine if it originates from the merchant DApp. If the data does not originate from the merchant DApp, the message is deemed invalid, and the settlement request data is rejected. If the data does originate from the merchant DApp, data 5 is decrypted using the transaction platform node's private key, and the validity of the preset smart contract is verified. If the validity verification fails, the message is deemed invalid, and the settlement request data is rejected. If the validity verification passes, data 5 is encrypted using the bank node's public key, assembled, and signed. After executing the preset smart contract, the transaction platform node sends a synchronization request to the bank node for the execution result of the preset smart contract. This request includes data 5 encrypted using the bank node's public key. Upon receiving the synchronization request, the bank node first verifies the signature of the request message to determine if the data originates from the transaction platform node, and then decrypts data 5 using the bank node's private key. If signature verification fails, a failure result is returned to the transaction platform node and the merchant DApp. If signature verification succeeds, the execution result of the preset smart contract is verified for legality. If the legality verification passes, the blockchain transaction consensus is successfully initiated, and the blockchain transaction hash value is returned to the transaction platform node and the merchant DApp.
[0083] In step S440, a synchronization settlement request is initiated to the bank node. The synchronization settlement request is used to instruct the bank node to verify the legality of the virtual asset transfer results between at least two virtual accounts of the transacting parties according to the preset smart contract.
[0084] Specifically, verifying the legality of virtual asset transfers between at least two virtual accounts can include one or more of the following: verifying whether the account initiating the request is a whitelisted account of the clearing smart contract; verifying whether the initial blockchain account address and the target account address are both bound to the corresponding bank virtual accounts; and verifying whether the amount of funds transferred is consistent with the amount set in the preset smart contract.
[0085] Figure 11 The illustration schematically depicts an application scenario of a blockchain-based transaction processing method according to an embodiment of this application. For example... Figure 11As shown, the buyer merchant, seller merchant, and transaction platform node all have physical accounts with the bank, namely the buyer's physical account, the fund supervision ledger physical account, and the seller's physical account. Corresponding to the buyer's physical account, the buyer merchant has a buyer virtual account with the bank node; corresponding to the seller's physical account, the seller merchant has a seller virtual account with the bank node; and corresponding to the fund supervision ledger physical account, the transaction platform receives orders and has a fund supervision ledger virtual account with the bank node. Therefore, through blockchain node data, clearing and settlement operations such as clearing and settlement between buyer virtual accounts, seller virtual accounts, and fund supervision ledger virtual accounts can be realized, thereby achieving on-chain asset clearing. In some implementations, clearing and settlement may include multiple buyer virtual accounts, multiple seller virtual accounts, and fund supervision ledger virtual accounts. An operation is a specific action attached to a transaction; a transaction contains one or more operational actions. Clearing can be a process of bookkeeping, executing transaction instructions, and deducting fees, which can be jointly participated in by clearing companies, UnionPay, NetsUnion, and the bank's payment system.
[0086] In practical applications, taking a blockchain e-commerce platform as an example, e-commerce platforms naturally need to support the fund settlement needs arising from business transactions between multiple merchants on the platform, as well as the fund settlement needs between merchants and the platform for providing system services or sales channel services. However, fund settlement requires enterprises to possess payment licenses to comply with legal and regulatory requirements, which e-commerce platforms generally lack. For operational needs, they rely on virtual account systems provided by banking institutions to complete the necessary fund clearing support. The blockchain-based transaction processing method proposed in this application enables on-chain clearing of funds between buyer and seller merchants on an e-commerce platform based on real transactions. First, when a buyer (seller) merchant joins the trading platform node, they can register a blockchain account on the trading platform node and a bank virtual account on the bank node. After a transaction occurs between the buyer and seller merchants, all data generated by the trading platform can be recorded on the blockchain. Then, the buyer merchant can deposit funds from their physical account into the buyer virtual account created by the buyer on the bank node. This buyer virtual account is used for fund clearing of business transactions with other merchants on the platform or for payment of platform management fees, among other payment scenarios. When a buyer places an order for goods or services offered by a seller through a trading platform, the platform records the transaction information. After the seller confirms the transaction, the buyer pays the seller for the goods or services. Funds are transferred from the buyer's virtual bank account to the seller's virtual bank account. A central fund management account records the transaction's cash flow and related transaction details. The seller can then withdraw funds from their virtual bank account to their physical bank account, and the trading platform records the withdrawal information.
[0087] Figure 12This diagram schematically illustrates the data flow between nodes on a blockchain according to an embodiment of this application. A blockchain network used to manage the blockchain may include multiple blockchain nodes. Blockchain nodes can be functionally categorized into consensus nodes and ledger nodes. Consensus nodes need to download and maintain the full blockchain ledger data and participate in consensus each time a transaction consensus is initiated to confirm whether the transaction can be executed. Ledger nodes can choose whether to record global blockchain ledger data and do not participate in actual transaction consensus. Nodes on the blockchain include trusted nodes and ordinary nodes. Trusted nodes have a computing environment isolated from the data of ordinary nodes. Trusted nodes include trusted computing nodes and trusted execution nodes. Therefore, related privacy data computation, encryption, decryption, execution of privacy contracts, and processing of sensitive business data computation can be performed through the trusted computing environment of trusted nodes. On-chain transaction instructions are instructions to initiate the execution of blockchain smart contracts, which include privacy smart contracts and ordinary smart contracts. Transaction instructions are business processes initiated by users in the business system, such as transfer transactions. Event detection is a module on the blockchain used to detect changes in business status. For example, when a preset smart contract is successfully executed, the success status will be synchronized to all blockchain nodes through the event detection module. The process engine is a toolkit that identifies transaction instructions as corresponding on-chain transaction instructions. After a transaction instruction initiates a call to the process engine, the process engine can determine the type of smart contract that invokes the on-chain transaction instruction.
[0088] Figure 13 This illustration schematically shows a flowchart of the steps preceding the acquisition of at least two virtual accounts of trading parties corresponding to settlement request data, and the preset smart contract between the at least two virtual accounts of trading parties, according to a certain embodiment of this application. Figure 13 As shown, based on the above embodiments, before obtaining the at least two virtual accounts of the trading parties corresponding to the settlement request data and the preset smart contract between the at least two virtual accounts of the trading parties in step S420, the following steps S1310 to S1320 may be further included.
[0089] S1310. Obtain the clearing request data encrypted with the first public key. The clearing request data is the request data initiated by the blockchain account of the transacting party to request the clearing of the transaction.
[0090] S1320. Use the first private key corresponding to the first public key to decrypt the clearing request data, and create a preset smart contract based on the decrypted data.
[0091] Figure 14 This diagram schematically illustrates the specific process of creating a preset smart contract according to a certain embodiment of this application. For example... Figure 14As shown, the merchant DApp encrypts and sorts data using the public key of the transaction platform node to obtain data 4, signs data 4, and sends it to the transaction platform node. The transaction platform node then verifies the signature of the received message and determines whether the data originates from the merchant DApp. If the message does not originate from the merchant DApp, the message is invalid, and the sorting request is rejected. If the message does originate from the merchant DApp, the message is valid, and the transaction platform node decrypts data 4 using its private key. Next, the transaction platform node encrypts data 4 using the public key of the bank node, assembles the data, and signs it. The transaction platform node creates a preset smart contract. If creation fails, a failure result is returned to the merchant DApp; if creation succeeds, a synchronization request to create the preset smart contract is initiated to the bank node, including data 4 encrypted with the bank node's public key. The bank node verifies the signature of the received message and determines whether the data originates from the transaction platform node. If the message does not originate from the transaction platform node, the message is invalid, and the synchronization request is rejected. If the message does originate from the transaction platform node, the message is valid, and data 4 is decrypted using the bank node's private key. Then, the bank node verifies the legitimacy of the pre-defined smart contract. If the legitimacy verification is successful, the blockchain transaction consensus is successfully initiated, and the blockchain transaction hash value is returned.
[0092] Specifically, the bank node verifies the legitimacy of the created pre-defined smart contract, which may include one or more of the following: verifying whether the account initiating the request is a legitimate account; verifying whether the initial blockchain account address and the target account address are both bound to the corresponding bank virtual account; and verifying whether the initial blockchain account address and the target account address have the consensus to create the pre-defined smart contract.
[0093] Figure 15 This schematically illustrates a flowchart of the steps in a certain embodiment of this application: decrypting clearing request data using a first private key corresponding to a first public key, and creating a preset smart contract based on the decrypted data. For example... Figure 15 As shown, based on the above embodiments, the preset smart contract is a privacy smart contract. Step S1320, which uses the first private key corresponding to the first public key to decrypt the clearing request data and creates the preset smart contract based on the decrypted data, may further include the following steps S1510 and S1520.
[0094] S1510. Obtain a trusted computing node with viewing permissions for the privacy smart contract. The transaction platform nodes include trusted computing nodes and ordinary computing nodes. The trusted computing nodes have a computing environment that is isolated from the data of the ordinary computing nodes. S1520. The clearing request data is decrypted by the trusted computing node using the first private key corresponding to the first public key, and a preset smart contract is created on the trusted computing node based on the decrypted data.
[0095] Figure 16 This illustration schematically depicts a specific process for creating a pre-defined smart contract through a trusted computing node, according to a certain embodiment of this application. For example... Figure 16 As shown, the merchant DApp encrypts and sorts data using the public key of the transaction platform node to obtain data 4, signs data 4, and sends it to the transaction platform node. The transaction platform node then verifies the signature of the received message and determines whether the data originates from the merchant DApp. If the message does not originate from the merchant DApp, it is deemed invalid, and the sorting request is rejected. If the message does originate from the merchant DApp, it is deemed valid, and the transaction platform node decrypts data 4 using its private key. The transaction platform node then encrypts data 4 using the public key of the trusted computing node, assembles and signs the data, and sends it to the trusted computing node. The trusted computing node decrypts data 4 using its private key and creates a pre-defined smart contract. If creation fails, a failure result is returned to the merchant DApp; if creation succeeds, the merchant DApp encrypts data 4 using the public key of the bank node, assembles and signs the data, and then initiates a synchronization request to the bank node to create the pre-defined smart contract. This request includes data 4 encrypted with the bank node's public key. The bank node verifies the signature of the received message and determines whether the data originates from the trusted computing node. When a message is determined not to originate from the corresponding trusted computing node, the message is deemed invalid, and the synchronization request is rejected. When a message is determined to originate from the corresponding trusted computing node, the message is deemed valid, and data 4 is decrypted using the bank node's private key. Then, the bank node verifies the validity of the created pre-defined smart contract. If the validity verification passes, the blockchain transaction consensus is successfully initiated, and the blockchain transaction hash value is returned. In a specific implementation, the trusted computing node can be one of the trusted computing nodes in the transaction platform. The transaction platform includes trusted computing nodes and ordinary computing nodes, and the trusted computing node has a computing environment isolated from the data of the ordinary computing nodes. Alternatively, the trusted computing node can be an independent trusted computing node separate from the transaction platform nodes. The blockchain nodes include trusted computing nodes and ordinary computing nodes, and the trusted computing node has a computing environment isolated from the data of the ordinary computing nodes.
[0096] Figure 17 This illustration schematically depicts a flowchart illustrating the steps of transferring virtual assets between at least two virtual accounts of trading parties according to a preset smart contract in a certain embodiment of this application. Figure 17As shown, based on the above embodiments, step S430, which involves transferring virtual assets between at least two virtual accounts of trading parties according to a preset smart contract, may further include the following steps S1710 to S1740.
[0097] S1710. Obtain a trusted execution node with execution authority over the privacy smart contract from the transaction platform node through a preset smart contract created in the trusted computing node; S1720. Obtain the target public key corresponding to the target private key of the trusted execution node; S1730. Encrypt the preset smart contract using the target public key to obtain the encrypted privacy contract data, and send the encrypted privacy contract data to the trusted execution node; S1740. Using a trusted execution node, the privacy smart contract is obtained by decrypting the encrypted data of the privacy contract with the target private key, and virtual assets are transferred between at least two virtual accounts of the transacting parties according to the privacy smart contract.
[0098] Figure 18This diagram illustrates the specific process of executing a preset smart contract via a trusted execution node according to a certain embodiment of this application. The merchant DAPP encrypts settlement request data using the public key of the transaction platform node, obtaining data 5. After signing data 5, it sends it to the transaction platform node. The transaction platform node then verifies the signature of data 5 to determine if it originates from the merchant DAPP. If the data does not originate from the merchant DAPP, the message is deemed invalid, and the settlement request data is rejected. If the data does originate from the merchant DAPP, data 5 is decrypted using the private key of the transaction platform node, and the validity of the preset smart contract is verified. If the validity verification fails, the message is deemed invalid, and the settlement request data is rejected. If the validity verification passes, data 5 is encrypted using the public key of the trusted execution node, assembled, signed, and sent to the trusted execution node. The trusted execution node decrypts data 5 using its private key and executes the preset smart contract. If the contract execution fails, a failure result is returned to the merchant DAPP. When the contract executes successfully, the trusted execution node encrypts data 5 using the bank node's public key, assembles the data, signs it, and then sends a synchronization request to the bank node for the execution result of the preset smart contract. This request includes data 5, encrypted with the bank node's public key and signed by the trusted execution node. Upon receiving the synchronization request, the bank node first verifies the signature of the request message to determine if the data originates from the trusted execution node, and then decrypts data 5 using the bank node's private key. If the signature verification fails, a failure result is returned to the trusted execution node, the transaction platform node, and the merchant DAPP. If the signature verification succeeds, the legality of the execution result of the preset smart contract is verified. If the legality verification passes, the blockchain transaction consensus is successfully initiated, and the blockchain transaction hash value is returned to the trusted execution node, the transaction platform node, and the merchant DAPP. In a specific implementation, the trusted execution node can be one of the trusted execution nodes in the transaction platform. The transaction platform node includes trusted execution nodes and ordinary execution nodes, and the trusted execution node has a computing environment that is isolated from the data of the ordinary execution nodes. A trusted execution node can be an independent entity from the transaction platform nodes. Blockchain nodes include trusted execution nodes and ordinary execution nodes. Trusted execution nodes have a computing environment that is isolated from the data of ordinary execution nodes. Therefore, trusted execution nodes ensure data privacy and the security of contract execution.
[0099] A Trusted Execution Environment (TEE) can be a secure, hardened zone for the CPU, ensuring the confidentiality and integrity of its software logic and data. This zone's hardware and software environment can be viewed as an isolated, un-sandboxed environment. Programs running within this environment cannot be read or written to by external systems, including the operating system, nor can their code execution logic be interfered with.
[0100] It is understandable that the operation instructions for fund transfer in virtual accounts may be stolen or tampered with by system administrators, resulting in system risks. However, using a trusted execution environment for contract creation and execution can prevent the abuse, theft, and data tampering of virtual accounts in actual applications, thus providing security for banking institutions that provide virtual bank account capabilities.
[0101] Figure 19 This illustration schematically depicts a trusted execution environment and a schematic diagram of the blockchain architecture in a certain embodiment of this application. For example... Figure 19 As shown, when the trusted computing environment encrypts and transmits data from the off-chain distributed storage database to the trusted computing environment for computation, it also shares and stores the index of this computational data across ordinary computing nodes on the blockchain. This ensures that the data computed in the trusted computing environment is consistent with the data shared on the blockchain within the business system. Therefore, by placing the plaintext source data in the trusted computing environment for computation and the shareable index data on the blockchain, the reliability of business data transmitted and computed between the blockchain and the trusted computing environment is significantly improved.
[0102] In practical applications, a business system can initiate a "transaction instruction," which, after being identified by the blockchain process engine, triggers on-chain instruction preparation. On-chain instruction preparation can include: confirming whether the smart contract used is a privacy-focused smart contract, a regular smart contract, or a hybrid smart contract. Hybrid smart contracts consist of a regular contract component and a privacy-focused contract component. On-chain instruction preparation can also include: uploading the contract to the blockchain or pre-installing it in a trusted execution environment.
[0103] A privacy contract, encrypted using the public key of a trusted execution node, is pre-installed on that node. When the business system executes the privacy computation contract, the trusted execution node decrypts and computes the contract data using its private key. After computation, the result is encrypted again using the public key of the user of the computation result—the executor of the liquidation contract—and then sent to a regular node for on-chain processing. The use of a trusted computing environment and privacy contracts reduces the risk of core data leakage in financial scenarios.
[0104] In certain embodiments of this application, a pre-defined smart contract is created to record the amount pending settlement for each transaction. The execution of this pre-defined smart contract ensures consistency between the components in the blockchain account and the funds in the bank's virtual account. Furthermore, by calculating the settlement path and executing the contract through a trusted computing environment, data privacy and computational security are guaranteed, achieving a closed-loop cash flow in commercial scenarios, improving cash flow efficiency, and reducing enterprise costs.
[0105] In some implementations, data about the virtual accounts of transacting parties stored in the bank node can be stored in a trusted computing node without being shared with other nodes on the blockchain. It is understood that putting data from virtual accounts on the blockchain could lead to privacy breaches, but the above embodiments can eliminate such risks, making them more suitable for business applications in high-risk-control scenarios such as banking and finance.
[0106] Based on the above embodiments, in some implementations, the preset smart contract includes a normal state, an expired state, and a frozen state. The normal state indicates that the preset smart contract can execute normally; the expired state indicates that the execution period of the preset smart contract has expired and execution has stopped; and the frozen state indicates that the preset smart contract is frozen and execution is suspended. Step S430, which involves transferring virtual assets between at least two virtual accounts of trading parties according to the preset smart contract, may further include the following steps: When the initiator of the settlement request data is on the whitelist of the preset smart contract and the preset smart contract is in a normal state, virtual assets are transferred in at least two virtual accounts of the trading parties corresponding to the settlement request data according to the preset smart contract. The whitelist is used to record accounts with the authority to initiate and execute the preset smart contract.
[0107] Based on the above embodiments, in some implementations, after initiating a synchronization settlement request to the bank node in step S440, the following steps may be further included: Once a successful verification indication is received from the bank node regarding the legitimacy of the synchronous settlement request, a consensus is initiated on the blockchain regarding the outcome of the virtual asset transfer between at least two virtual accounts of the transacting parties.
[0108] Figure 20 A flowchart illustrating steps that may be included in a certain embodiment of this application is shown schematically. For example... Figure 20 As shown, based on the above embodiments, the method of a certain embodiment of this application may further include the following steps S2010 to S2040.
[0109] S2010. Obtain account creation request data encrypted with the second public key. The account creation request data is request data initiated by the blockchain account of the transaction party. The account creation request data is used to request the bank node to create a bank virtual account corresponding to the request initiator.
[0110] S2020. Use the second private key corresponding to the second public key to decrypt the account creation request data, and obtain the user registration information of the initiator of the account creation request data and the target bank node corresponding to the decrypted data.
[0111] S2030. Initiate consensus on the blockchain regarding the creation of a bank virtual account by the initiator of the account creation request data at the target bank node.
[0112] S2040. When consensus is successfully achieved, an account creation request is sent to the target bank node. The account creation request is used to instruct the target bank node to create the corresponding virtual bank account based on the user registration information.
[0113] Blockchain technology has been widely applied in various business application scenarios. Through the characteristics of blockchain technology, the four flows of commerce, logistics, information and capital in business scenarios can be integrated. On-chain capital flow can be recorded and settled based on smart contracts. However, the on-chain nodes of commercial applications do not have "money", which makes the "money" after on-chain settlement inconsistent with the money in the off-chain bank account, which poses a security risk.
[0114] In certain specific embodiments of the blockchain-based transaction processing method of this application, users operating blockchain accounts through business systems to transfer funds are equivalent to operating bank virtual accounts. This ensures consistency between on-chain fund flows and off-chain bank account fund flows in commercial application scenarios. Sensitive data involved in the clearing process is calculated in a trusted execution environment, ensuring the data security and invisibility of the calculation process. Each fund recording and clearing operation can only be initiated by the user and is not restricted by a centralized management institution or administrator. The platform cannot initiate on-chain fund recording and clearing on behalf of users or without authorization. This ensures that each fund flow represents the user's true intention and guarantees the security and compliance of bank virtual account fund transfers, providing security guarantees for fund providers through technology.
[0115] It should be noted that although the steps of the method in this application are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0116] The following describes an apparatus embodiment of this application, which can be used to execute the blockchain-based transaction processing method in the above embodiments of this application. Figure 21 A schematic block diagram illustrating the structure of a blockchain-based transaction processing apparatus provided in an embodiment of this application is shown. Figure 21 As shown, the blockchain-based transaction processing device includes: The settlement request acquisition module 2110 is configured to acquire settlement request data, which is request data initiated by the trading party's blockchain account for requesting transaction settlement. The trading party's blockchain account is a blockchain account created by the trading party in the blockchain. The smart contract acquisition module 2120 is configured to acquire at least two virtual accounts of trading parties corresponding to the settlement request data and a preset smart contract between the at least two virtual accounts of trading parties, wherein the virtual accounts of trading parties are bank virtual accounts created by the trading party blockchain accounts through bank nodes in the blockchain network. The virtual asset transfer module 2130 is configured to transfer virtual assets between at least two virtual accounts of the trading parties according to the preset smart contract. The settlement verification module 2140 is configured to initiate a synchronous settlement request to the bank node. The synchronous settlement request is used to instruct the bank node to verify the legality of the virtual asset transfer results between the virtual accounts of the at least two transacting parties according to the preset smart contract.
[0117] In some embodiments of this application, based on the above embodiments, the transaction processing apparatus further includes: The clearing request acquisition unit is configured to acquire clearing request data encrypted with the first public key. The clearing request data is request data initiated by the blockchain account of the transacting party to request transaction clearing. The smart contract creation unit is configured to decrypt the settlement request data using the first private key corresponding to the first public key, and create a preset smart contract based on the decrypted data.
[0118] In some embodiments of this application, based on the above embodiments, the smart contract is preset to be a privacy smart contract, and the smart contract creation unit includes: The trusted computing node acquisition subunit is configured to acquire trusted computing nodes that have viewing permissions for privacy smart contracts. The transaction platform nodes include trusted computing nodes and ordinary computing nodes. The trusted computing nodes have a computing environment that is isolated from the data of the ordinary computing nodes. The smart contract creation sub-unit is configured to decrypt the clearing request data using the first private key corresponding to the first public key through a trusted computing node, and create a preset smart contract on the trusted computing node based on the decrypted data.
[0119] In some embodiments of this application, based on the above embodiments, the virtual asset transfer module includes: The trusted execution node acquisition unit is configured to acquire a trusted execution node with execution authority over the privacy smart contract from the transaction platform node through a preset smart contract created in the trusted computing node; The target public key acquisition unit is configured to acquire the target public key corresponding to the target private key of the trusted execution node; The contract encryption unit is configured to encrypt a preset smart contract using the target public key to obtain encrypted privacy contract data, and then send the encrypted privacy contract data to the trusted execution node; The virtual asset transfer unit is configured to use a trusted execution node to decrypt the encrypted data of the privacy contract using the target private key to obtain the privacy smart contract, and then transfer virtual assets between at least two virtual accounts of the transacting parties according to the privacy smart contract.
[0120] In some embodiments of this application, based on the above embodiments, the transaction processing apparatus further includes: The account creation request data acquisition unit is configured to acquire account creation request data encrypted with a second public key. The account creation request data is request data initiated by the blockchain account of the transaction party. The account creation request data is used to request the bank node to create a bank virtual account corresponding to the request initiator. The target bank node acquisition unit is configured to decrypt the account creation request data using the second private key corresponding to the second public key, and to obtain the user registration information of the initiator of the account creation request data and the target bank node corresponding to the decrypted data. The account creation consensus initiating unit is configured to initiate consensus on the blockchain regarding the initiator of the account creation request data, and to create a bank virtual account on the target bank node; The account creation request initiating unit is configured to send an account creation request to the target bank node when consensus is successfully completed. The account creation request is used to instruct the target bank node to create the corresponding virtual bank account based on the user registration information.
[0121] In some embodiments of this application, based on the above embodiments, the preset smart contract includes a normal state, an expired state, and a frozen state. The normal state indicates that the preset smart contract can be executed normally; the expired state indicates that the execution period of the preset smart contract has expired and execution has stopped; and the frozen state indicates that the preset smart contract is frozen and execution is suspended. The virtual asset transfer module includes: The conditional virtual asset transfer unit is configured to transfer virtual assets to at least two virtual accounts corresponding to the settlement request data when the initiator of the settlement request data is on the whitelist of the preset smart contract and the preset smart contract is in a normal state. The whitelist is used to record accounts with the authority to initiate and execute the preset smart contract.
[0122] In some embodiments of this application, based on the above embodiments, the transaction processing apparatus further includes: The consensus initiating unit for the transfer result is configured to initiate consensus on the blockchain regarding the transfer result of virtual assets between at least two virtual accounts of the transacting parties after receiving a successful verification indication of the legitimacy of the synchronous settlement request from the bank node.
[0123] The specific details of the blockchain-based transaction processing apparatus provided in the various embodiments of this application have been described in detail in the corresponding method embodiments, and will not be repeated here.
[0124] Figure 22 A schematic block diagram of a computer system architecture for implementing an electronic device according to embodiments of the present application is shown.
[0125] It should be noted that, Figure 22 The computer system 2200 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.
[0126] like Figure 22 As shown, the computer system 2200 includes a central processing unit (CPU) 2201, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 2202 or programs loaded from storage section 2208 into random access memory (RAM). The RAM 2203 also stores various programs and data required for system operation. The CPU 2201, ROM 2202, and RAM 2203 are interconnected via a bus 2204. An input / output interface 2205 (I / O interface) is also connected to the bus 2204.
[0127] The following components are connected to the input / output interface 2205: an input section 2206 including a keyboard, mouse, etc.; an output section 2207 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 2208 including a hard disk, etc.; and a communication section 2209 including a network interface card such as a local area network card, modem, etc. The communication section 2209 performs communication processing via a network such as the Internet. A drive 2210 is also connected to the input / output interface 2205 as needed. Removable media 2211, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on the drive 2210 as needed so that computer programs read from them can be installed into the storage section 2208 as needed.
[0128] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software 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 containing program code 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 2209, and / or installed from removable medium 2211. When the computer program is executed by central processing unit 2201, it performs various functions defined in the system of this application.
[0129] 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,—but not limited to—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 (EPROM), 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 storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code 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.
[0130] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing 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 computer instructions.
[0131] 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.
[0132] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the methods according to the embodiments of this application.
[0133] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention 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.
[0134] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A blockchain-based transaction processing method, characterized by, The method includes: Acquire settlement request data, which is a request for transaction settlement initiated by the trading party's blockchain account, and the trading party's blockchain account is a blockchain account created by the trading party in the blockchain; Acquire at least two virtual accounts of trading parties corresponding to the settlement request data and a preset smart contract between the at least two virtual accounts of trading parties, wherein the virtual accounts of trading parties are bank virtual accounts created by the trading party blockchain accounts through bank nodes in the blockchain network; According to the preset smart contract, virtual assets are transferred between the virtual accounts of at least two trading parties; A synchronization settlement request is initiated to the bank node to synchronize the execution result of the preset smart contract to the bank node. The synchronization settlement request is used to instruct the bank node to verify the legality of the virtual asset transfer result between the virtual accounts of the at least two transacting parties according to the preset smart contract.
2. The method of claim 1, wherein, Before acquiring at least two virtual accounts of trading parties corresponding to the settlement request data and the preset smart contract between the at least two virtual accounts of trading parties, the method further includes: Obtain clearing request data encrypted with the first public key, wherein the clearing request data is a request data initiated by the blockchain account of the transacting party to request transaction clearing; The clearing request data is decrypted using the first private key corresponding to the first public key, and the preset smart contract is created based on the decrypted data.
3. The method of claim 2, wherein, The preset smart contract is a privacy smart contract. It uses a first private key corresponding to the first public key to decrypt the settlement request data, and creates the preset smart contract based on the decrypted data, including: Obtain a trusted computing node with viewing permissions for the privacy smart contract. The transaction platform node includes the trusted computing node and ordinary computing nodes. The trusted computing node has a computing environment that is isolated from the data of the ordinary computing node. The trusted computing node uses a first private key corresponding to the first public key to decrypt the clearing request data, and creates the preset smart contract on the trusted computing node based on the decrypted data.
4. The method of claim 3, wherein, According to the preset smart contract, virtual assets are transferred between at least two virtual accounts of the transacting parties, including: By using a preset smart contract created in the trusted computing node, a trusted execution node with execution authority over the privacy smart contract can be obtained from the transaction platform node; Obtain the target public key corresponding to the target private key of the trusted execution node; The preset smart contract is encrypted using the target public key to obtain encrypted privacy contract data, and the encrypted privacy contract data is sent to the trusted execution node; The trusted execution node uses the target private key to decrypt the encrypted data of the privacy contract to obtain the privacy smart contract, and performs virtual asset transfers between the virtual accounts of at least two transacting parties according to the privacy smart contract.
5. The method of claim 1, wherein, The method further includes: Obtain account creation request data encrypted with a second public key. The account creation request data is request data initiated by the blockchain account of the transacting party. The account creation request data is used to request the bank node to create a bank virtual account corresponding to the request initiator. The account creation request data is decrypted using the second private key corresponding to the second public key, and the user registration information of the initiator of the account creation request data and the target bank node corresponding to the decrypted data are obtained. A consensus is reached with the blockchain regarding the initiator of the account creation request data creating a virtual bank account on the target bank node; When the consensus is successfully completed, an account creation request is initiated to the target bank node. The account creation request is used to instruct the target bank node to create a corresponding virtual bank account based on the user registration information.
6. The method of claim 1, wherein, The preset smart contract includes a normal state, an expired state, and a frozen state. The normal state indicates that the preset smart contract can be executed normally. The expired state indicates that the execution period of the preset smart contract has expired and execution has stopped. The frozen state indicates that the preset smart contract has been frozen and execution has been suspended. According to the preset smart contract, virtual assets are transferred between at least two virtual accounts of the transacting parties, including: When the initiator of the settlement request data is on the whitelist of the preset smart contract, and the preset smart contract is in a normal state, virtual assets are transferred in at least two virtual accounts of the trading parties corresponding to the settlement request data according to the preset smart contract. The whitelist is used to record accounts with the authority to initiate the execution of the preset smart contract.
7. The method of claim 1, wherein, After initiating a synchronization settlement request to the bank node, the method further includes: Upon receiving a successful verification indication of the legitimacy of the synchronous settlement request from the bank node, a consensus is initiated with the blockchain regarding the results of the virtual asset transfer between the virtual accounts of the at least two transacting parties. 8.A blockchain-based transaction processing apparatus, characterized by, The device includes: The settlement request acquisition module is configured to acquire settlement request data, which is a request data initiated by the trading party's blockchain account to request transaction settlement. The trading party's blockchain account is a blockchain account created by the trading party in the blockchain. The smart contract acquisition module is configured to acquire at least two virtual accounts of trading parties corresponding to the settlement request data and a preset smart contract between the at least two virtual accounts of trading parties, wherein the virtual accounts of trading parties are bank virtual accounts created by the trading party blockchain accounts through bank nodes in the blockchain network; The virtual asset transfer module is configured to transfer virtual assets between at least two virtual accounts of the trading parties according to the preset smart contract; The settlement verification module is configured to initiate a synchronous settlement request to the bank node, synchronizing the execution result of the preset smart contract to the bank node. The synchronous settlement request is used to instruct the bank node to verify the legality of the virtual asset transfer result between the virtual accounts of the at least two transacting parties according to the preset smart contract.
9. A computer-readable medium, characterized in that, It stores a computer program that, when executed by a processor, implements the transaction processing method according to any one of claims 1 to 7.
10. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the transaction processing method of any one of claims 1 to 7 by executing the executable instructions.
11. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the transaction processing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Data transaction method and device based on blockchain network
CN111047444A
Bank transfer method and system based on blockchain network
CN111861440A
