Blockchain-based transaction processing method and apparatus
A blockchain-based transaction processing method may comprise: in response to a designated account being logged in through an application client, generating, according to input to-be-operated account information and configured operation content, an operation instruction comprising the to-be-operated account information and the operation content; and sending the operation instruction to a node in a blockchain network, causing the node in the blockchain network to invoke a smart contract corresponding to the designated account upon receiving the operation instruction, and to execute an operation according to the operation content on another account corresponding to the to-be-operated account information.
1. A blockchain-based transaction processing method, comprising:
configuring different smart contracts for different designated accounts and creating a first mapping relationship between the different smart contracts and different designated accounts, wherein each smart contract is configured to execute an operation;
configuring different operation contents of a designated account for different smart contracts corresponding to the designated account, and creating a second mapping relationship between the different operation contents and the different smart contracts corresponding to the designated account;
in response to the designated account being logged in through an application client, generating an operation instruction according to input to-be-operated account information of another account in need of administrative supervision and configured a first operation content, the designated account having one or more administrative supervision capabilities over the another account corresponding to the to-be-operated account information through one or more of the different smart contracts corresponding to the designated account;
signing the operation instruction with a signature of the designated account, and encrypting the operation instruction; and
sending the signed and encrypted operation instruction to a node in a blockchain network, causing the node to:
decrypt the operation instruction and verify whether it is signed by the designated account:
after decrypting and verifying, select, based on the second mapping relationship, a first smart contract of the different smart contracts that corresponds to the first operation content; and
invoke the first smart contract to execute a first operation according to the first operation content on the another account corresponding to the to-be-operated account information.
2. The transaction processing method according to claim 1 , further comprising: when generating the operation instruction, using an algorithm to determine a summary of the operation instruction, and using a private key in a public-private key pair corresponding to the designated account to encrypt the summary to obtain an encrypted summary; and
wherein the sending the operation instruction to the node in the blockchain network comprises: sending the encrypted summary and the operation instruction to the node in the blockchain network.
3. The transaction processing method according to claim 2 , wherein, the designated account is a first designated account of the different designated accounts, wherein each of the different designated accounts has a different public-private key pair.
4. The transaction processing method according to claim 1 , wherein the designated account is a first designated account of the different designated accounts, the method further comprising:
configuring the different smart contracts corresponding to the first designated account according to attributes of the first designated account; and
configuring another smart contract corresponding to a second designated account of of the different designated accounts according to attributes of the second designated account.
5. A blockchain-based transaction processing apparatus, comprising a processor and a non-transitory computer-readable storage medium storing instructions that, when executed by the processor, cause the apparatus to perform a method, the method comprising:
configuring different smart contracts for different designated accounts and creating a first mapping relationship between the different smart contracts and different designated accounts, wherein each smart contract is configured to execute an operation;
configuring different operation contents of a designated account for different smart contracts corresponding to the designated account, and creating a second mapping relationship between the different operation contents and the different smart contracts corresponding to the designated account;
in response to the designated account being logged in through an application client, generating an operation instruction according to input to-be-operated account information of another account in need of administrative supervision and a first operation content, the designated account having one or more administrative supervision capabilities over the another account corresponding to the to-be-operated account information through one or more of the different smart contracts corresponding to the designated account;
signing the operation instruction with a signature of the designated account, and encrypting the operation instruction; and
sending the signed and encrypted operation instruction to a node in a blockchain network, causing the node to:
decrypt the operation instruction and verify whether it is signed by the designated account;
after decrypting and verifying, select, based on the second mapping relationship, a first smart contract of the different smart contracts that corresponds to the first operation content; and invoke the first smart contract to execute a first operation according to the first operation content on the another account corresponding to the to-be-operated account information.
6. The transaction processing apparatus according to claim 5 , wherein the method further comprises:
when generating the operation instruction, using an algorithm to determine a summary of the operation instruction, and using a private key in a public-private key pair corresponding to the designated account to encrypt the summary to obtain an encrypted summary; and
the sending the operation instruction to the node in the blockchain network comprises: sending the encrypted summary and the operation instruction to the node in the blockchain network.
7. The transaction processing method according to claim 1 , wherein the first operation that is executed comprises: freezing the other account, unfreezing the other account, suspending the other account, resuming the other account, closing the other account, opening the other account, or a mandatory transfer of a set quantity of resources from the other account.
8. The transaction processing method according to claim 1 , wherein the first smart contract is recorded in a block of the blockchain network in the form of a smart contract address, wherein when the node invokes the first smart contract, the node acquires contents of the first smart contract via the smart contract address of the first smart contract.
9. The transaction processing apparatus according to claim 6 , wherein the designated account is a first designated account of the different designated accounts, wherein each of the different designated accounts has a different public-private key pair.
10. The transaction processing apparatus according to claim 5 , wherein the designated account is a first designated account of the different designated accounts, wherein the method further comprises:
configuring the different smart contracts corresponding to the first designated account according to attributes of the first designated account; and
configuring another smart contract corresponding to a second designated account of the different designated accounts according to attributes of the second designated account.
11. The transaction processing apparatus according to claim 5 , wherein the first operation that is executed comprises: freezing the other account, unfreezing the other account, suspending the other account, resuming the other account, closing the other account, opening the other account, or a mandatory transfer of a set quantity of resources from the other account.
12. The transaction processing apparatus according to claim 5 , wherein the first smart contract is recorded in a block of the blockchain network in the form of a smart contract address, wherein when the node invokes the first smart contract, the node acquires contents of the first smart contract via the smart contract address of the first smart contract.
13. A non-transitory computer-readable storage medium storing instructions that, when executed by a processor, performs a method comprising:
configuring different smart contracts for different designated accounts and creating a first mapping relationship between the different smart contracts and different designated accounts, wherein each smart contract is configured to execute an operation;
configuring different operation contents of a designated account for different smart contracts corresponding to the designated account, and creating a second mapping relationship between the different operation contents and the different smart contracts corresponding to the designated account;
in response to the designated account being logged in through an application client, generating an operation instruction according to input to-be-operated account information of another account in need of administrative supervision and configured a first operation content, the designated account having one or more administrative supervision capabilities over the another account corresponding to the to-be-operated account information through one or more of the different smart contracts corresponding to the designated account;
signing the operation instruction with a signature of the designated account, and encrypting the operation instruction; and
sending the signed and encrypted operation instruction to a node in a blockchain network, causing the node to:
decrypt the operation instruction and verify whether it is signed by the designated account:
after decrypting and verifying, select, based on the second mapping relationship, a first smart contract of the different smart contracts that corresponds to the first operation content; and invoke the first smart contract to execute a first operation according to the first operation content on the another account corresponding to the to-be-operated account information.
14. The non-transitory computer-readable storage medium of claim 13 , wherein the method further comprises:
when generating the operation instruction, using an algorithm to determine a summary of the operation instruction, and using a private key in a public-private key pair corresponding to the designated account to encrypt the summary to obtain an encrypted summary; and
wherein sending the operation instruction to the node in the blockchain network comprises: sending the encrypted summary and the operation instruction to the node in the blockchain network.
15. The non-transitory computer-readable storage medium of claim 14 , wherein the designated account is a first designated account of the different designated accounts, wherein each of the different designated accounts has a different public-private key pair.
16. The non-transitory computer-readable storage medium of claim 13 , wherein the designated account is a first designated account of the different designated accounts, wherein the method further comprises:
configuring the different smart contracts corresponding to the first designated account according to attributes of the first designated account; and
configuring another smart contract corresponding to a second designated account of the different designated accounts according to attributes of the second designated account.
17. The non-transitory computer-readable storage medium of claim 13 , wherein the executed the first operation that is executed comprises: freezing the other account, unfreezing the other account, suspending the other account, resuming the other account, closing the other account, opening the other account, or a mandatory transfer of a set quantity of resources from the other account.