CN-122022994-A - Transaction system and method based on intelligent contract wallet
Abstract
The invention discloses a transaction system and method based on an intelligent contract wallet, and relates to the technical field of digital currency. The specific implementation mode of the transaction system comprises a contract calling system, a contract executing system, a contract counting core system and a contract executing system, wherein the contract calling system is configured to acquire a contract calling request and trigger the contract executing system according to the contract calling request, the contract calling request indicates a target intelligent contract wallet to be transacted, the contract executing system is configured to execute an intelligent contract corresponding to the target intelligent contract wallet and buffer contract data, a transaction instruction is generated according to the contract data and sent to the coin counting core system, the contract data is cleared in response to the transaction result of the coin counting core system as transaction failure, the contract data is submitted in response to the transaction result as transaction success, and the coin counting core system is configured to call the target intelligent contract wallet to transact according to the transaction instruction and return the transaction result to the contract executing system. The embodiment realizes the data consistency of the intelligent contract transaction system.
Inventors
- ZHU WEI
- LIU JIEQUN
- CHEN QINGJIE
- FENG KAIKAI
- FU ZHENGTAO
Assignees
- 中国人民银行数字货币研究所
Dates
- Publication Date
- 20260512
- Application Date
- 20241112
Claims (16)
- 1. A transaction system based on an intelligent contract wallet is characterized by comprising a contract calling system, a coin counting core system and a contract executing system, wherein, The contract calling system is configured to acquire a contract calling request and trigger the contract executing system according to the contract calling request, wherein the contract calling request indicates a target intelligent contract wallet to be transacted; The contract execution system is configured to execute an intelligent contract corresponding to the target intelligent contract wallet, cache contract data, generate a transaction instruction according to the contract data, send the transaction instruction to the coin counting core system, clear the contract data in response to the transaction result of the coin counting core system being a transaction failure, and submit the contract data in response to the transaction result being a transaction success; the coin counting core system is configured to call the target intelligent contract wallet to conduct transaction according to the transaction instruction, and returns a transaction result to the contract executing system.
- 2. The transaction system according to claim 1, wherein the target smart contract wallet is a payment wallet, The contract calling system is further configured to acquire a collection result of a target collection wallet, and call the contract executing system according to the collection result; The contract execution system is configured to execute the intelligent contract according to the collection result and set a corresponding transfer state according to the collection result.
- 3. The transaction system according to claim 2, wherein, The contract invoking system is configured to transmit the collection result as an entry of the smart contract to the contract execution system, so that the contract execution system executes the smart contract according to the collection result.
- 4. The transaction system according to claim 2, wherein, The contract execution system is configured to execute the intelligent contract according to the result of the collection failure to obtain and buffer callback contract data under the condition that the collection of the target collection wallet fails, send a collection instruction to the coin counting core system, and submit the callback contract data according to the collection result returned by the coin counting core system; The coin counting core system is configured to call the target intelligent contract wallet to collect according to the collection instruction and return the collection result to the contract execution system.
- 5. The transaction system according to claim 2, wherein, And in the case that the target money receiving wallet is an intelligent contract wallet, the target intelligent contract wallet and the target money receiving wallet respectively correspond to different contract executing systems.
- 6. A transaction system according to any of claims 2 to 5 wherein, The contract execution system is configured to lock the intelligent contract instance corresponding to the target intelligent contract purse before receiving the transaction result sent by the coin counting core system.
- 7. The transaction system according to claim 1, wherein the target smart contract wallet is a cash wallet; The contract calling system is configured to trigger a contract executing system corresponding to the target intelligent contract wallet after determining that the target payment wallet corresponding to the target intelligent contract wallet is successful in payment, so that the contract executing system executes the intelligent contract, wherein the target payment wallet is a common wallet or an intelligent contract wallet.
- 8. A smart contract wallet-based transaction method, comprising: The contract calling system acquires a contract calling request and triggers a contract executing system according to the contract calling request, wherein the contract calling request indicates a target intelligent contract wallet to be transacted; the contract execution system executes the intelligent contract corresponding to the target intelligent contract wallet and caches contract data; The contract execution system generates a transaction instruction according to the contract data and sends the transaction instruction to a coin counting core system; The coin counting core system calls the target intelligent contract wallet to conduct transaction according to the transaction instruction, and returns a transaction result to the contract executing system; in response to a transaction success, the contract execution system commits the contract data; in response to a transaction failure, the contract execution system clears the contract data.
- 9. The method of transaction according to claim 8, wherein in the case where the target smart contract wallet is a payment wallet, further comprising: The contract calling system acquires the collection result of a target collection wallet and calls the contract executing system according to the collection result, wherein the target collection wallet is a common wallet or an intelligent contract wallet; The contract execution system executes the intelligent contract according to the collection result and sets a corresponding transfer state according to the collection result.
- 10. The transaction method according to claim 9, wherein the invoking the contract execution system according to the payment result includes: The contract calling system transmits the collection result to a contract executing system as the participation of the intelligent contract, so that the contract executing system executes the intelligent contract according to the collection result.
- 11. The transaction method according to claim 9, wherein the contract execution system executes the smart contract according to the collection result, comprising: the contract execution system executes the intelligent contract to obtain and buffer callback contract data according to the result of the collection failure under the condition that the collection of the target collection wallet fails, and sends a collection instruction to the coin counting core system; The coin counting core system calls the target intelligent contract wallet to collect money according to the collection instruction, and returns a collection result to the contract execution system; and the contract execution system submits the callback contract data according to the collection result.
- 12. The method of claim 9, wherein the transaction process is performed, In the case that the target money receiving wallet is an intelligent contract wallet, the target intelligent contract wallet and the target money receiving wallet respectively correspond to different contract executing systems.
- 13. The transaction method according to any one of claims 8 to 12, wherein the contract execution system further includes, before receiving a transaction result transmitted from the coin counting core system: The contract execution system locks the intelligent contract instance corresponding to the target intelligent contract wallet.
- 14. The method of claim 8, wherein, In the case where the target smart contract wallet is a money receiving wallet, before triggering the contract execution system according to the contract invocation request, further comprising: the contract calling system determines that the target payment wallet corresponding to the target intelligent contract wallet is successful in payment, wherein the target payment wallet is a common wallet or an intelligent contract wallet.
- 15. A server for conducting transactions based on a smart contract wallet, comprising: one or more processors; storage means for storing one or more programs, The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the transaction method of any of claims 8-14.
- 16. A computer readable medium on which a computer program is stored, characterized in that the program, when executed by a processor, implements the transaction method according to any of claims 8-14.
Description
Transaction system and method based on intelligent contract wallet Technical Field The invention relates to the technical field of digital currency, in particular to a transaction system and method based on an intelligent contract wallet. Background For transactions in a smart contract wallet, there is typically both a change in contract data state and a change in the amount in the smart contract wallet when executing the smart contract. However, the present transaction related to the smart contract wallet is generally implemented through multi-system interaction, that is, the execution of the smart contract and the payment receipt and payment of the smart contract wallet are implemented through different systems, which may cause failure of the smart contract wallet to receive and pay after the contract data is submitted, and the smart contract cannot be reversely operated, so that the system for executing the smart contract is inconsistent with the data of the payment receipt and payment system of the smart contract wallet. Disclosure of Invention In view of this, an embodiment of the present invention provides a transaction system and method based on an intelligent contract wallet, in which a contract calling system triggers a contract execution system according to a contract calling request, and the contract execution system executes an intelligent contract corresponding to a target intelligent contract wallet and caches contract data without directly submitting the contract data. The contract execution system submits the contract data after the coin counting core system calls the target intelligent contract wallet to succeed in transaction, and clears the contract data if the target intelligent contract wallet fails in transaction. Therefore, the contract execution system does not submit corresponding contract data after executing the intelligent contract, and submits the contract data after determining that the transaction of the coin counting core system is successful, so that the problem of inconsistent data caused by failure of the target intelligent contract wallet after submitting the contract data is avoided, and the data consistency of the intelligent contract transaction system is realized. To achieve the above object, according to one aspect of an embodiment of the present invention, there is provided a smart contract wallet-based transaction system. The transaction system based on the intelligent contract wallet comprises a contract calling system, a coin counting core system and a contract executing system, wherein, The contract calling system is configured to acquire a contract calling request and trigger the contract executing system according to the contract calling request, wherein the contract calling request indicates a target intelligent contract wallet to be transacted; the contract execution system is configured to execute an intelligent contract corresponding to the target intelligent contract wallet, buffer contract data, generate a transaction instruction according to the contract data, send the transaction instruction to the coin counting core system, clear the contract data in response to the transaction result of the coin counting core system being a transaction failure, and submit the contract data in response to the transaction result being a transaction success; the coin counting core system is used for calling the target intelligent contract wallet to conduct transaction according to the transaction instruction and returning the transaction result to the contract execution system. Optionally, the target smart contract wallet is a payment wallet; the contract calling system is also configured to acquire the collection result of the target collection wallet and call the contract executing system according to the collection result; And the contract execution system is configured to execute the intelligent contract according to the collection result and set a corresponding transfer state according to the collection result. Optionally, the contract invoking system is configured to transmit the collection result as an entry of the smart contract to the contract execution system, such that the contract execution system executes the smart contract according to the collection result. Alternatively, in the event that the target wallet fails to collect, The contract execution system is configured to execute an intelligent contract according to the result of collection failure to obtain and buffer callback contract data, and send a collection instruction to the coin counting core system; the coin counting core system is configured to call the target intelligent contract wallet to collect according to the collection instruction and return the collection result to the contract execution system. Alternatively, in the case where the target wallet is a smart contract wallet, The target intelligent contract wallet and the target money receiving wallet respectively correspond to different co