IP Library Granted Patent US 10,839,107
Granted Patent B2
US 10,839,107 · App. 16/777,110 · Granted Nov 17, 2020

Managing a smart contract on a blockchain

Inventors: Changzheng Wei (Hangzhou, CN); Ying Yan (Hangzhou, CN)
Assignee: ADVANCED NEW TECHNOLOGIES CO., LTD.
G06F21/64G06F21/602
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,839,107
App. No.
16/777,110
Granted
Nov 17, 2020
Kind
B2
Abstract

A computer-implemented method includes: in response to a first client device invoking a transaction with respect to a target smart contract, obtaining, by a blockchain node device in a blockchain, encrypted contract codes of the target smart contract; transmitting the encrypted contract codes of the target smart contract to a trusted execution environment; in response to determining that the target smart contract is not a managed smart contract, extracting a decryption key stored in the trusted execution environment, in which the decryption key corresponds to the encrypted contract codes of the target smart contract; decrypting the encrypted contract codes of the target smart contract; executing the decrypted contract codes of the target smart contract in the trusted execution environment; encrypting the execution result; and transmitting the encrypted execution result to the distributed ledgers of the blockchain for storage.

Claims (87)

1. A computer-implemented method comprising:

in response to a first client device invoking a transaction with respect to a target smart contract, obtaining, by a blockchain node device in a blockchain, encrypted contract codes of the target smart contract, wherein the encrypted contract codes are stored in distributed ledgers of the blockchain, and wherein a trusted execution environment is installed on the blockchain node device;

transmitting the encrypted contract codes of the target smart contract to the trusted execution environment;

obtaining a smart contract management rule;

determining, in the trusted execution environment, that the target smart contract is not a managed smart contract based on the smart contract management rule;

in response to determining that the target smart contract is not a managed smart contract, extracting a decryption key stored in the trusted execution environment, wherein the decryption key corresponds to the encrypted contract codes of the target smart contract;

decrypting the encrypted contract codes of the target smart contract using the extracted decryption key;

executing the decrypted contract codes of the target smart contract in the trusted execution environment to obtain an execution result;

encrypting the execution result; and

transmitting the encrypted execution result to the distributed ledgers of the blockchain for storage.

2. The computer-implemented method of claim 1 , wherein the trusted execution environment stores the extracted decryption key and a plurality of other decryption keys corresponding to other encrypted contract codes, respectively, of other smart contracts stored in the distributed ledgers of the blockchain; and

wherein the plurality of other decryption keys corresponding to the other encrypted contract codes of other smart contracts are set as extraction prohibited.

3. The computer-implemented method of claim 2 , wherein the plurality of other decryption keys correspond to encrypted contract codes, respectively, of managed smart contracts.

4. The computer-implemented method of claim 1 , further comprising:

receiving creation transaction data corresponding to a creation transaction initiated by a second client device with respect to the target smart contract, wherein the creation transaction data comprises the encrypted contract codes of the target smart contract;

in response to receiving the creation transaction data, creating the target smart contract by executing smart contract creation codes in the trusted execution environment;

creating a contract account on the blockchain, wherein the contract account corresponds to the target smart contract; and

transmitting the encrypted contract codes of the target smart contract to the distributed ledgers of the blockchain for storage.

5. The computer-implemented method of claim 4 , wherein the encrypted contract codes of the target smart contract are generated by the second client device using a first encryption method that comprises any one of the following: a symmetric encryption method, an asymmetric encryption method, or a symmetric encryption method combined with an asymmetric encryption method, and

wherein encrypting the execution result comprises applying to the execution result a second encryption method that comprises any one of the following: a symmetric encryption method or an asymmetric encryption method.

6. The computer-implemented method of claim 1 , wherein obtaining the smart contract management rule comprises:

monitoring, by the blockchain node device, data related to the target smart contract in an independent regulatory blockchain;

in response to a regulatory party generating a latest smart contract regulatory rule by invoking a second smart contract deployed on the independent regulatory blockchain, storing the latest smart contract regulatory rule into a local storage of the blockchain node device; and

reading, as the smart contract management rule, the latest smart contract regulatory rule from the local storage of the blockchain node device.

7. The computer-implemented method of claim 1 , wherein the smart contract management rule comprises a smart contract blacklist comprising contract addresses of managed smart contracts, and

wherein determining that the target smart contract is not a managed smart contract based on the smart contract management rule comprises:

obtaining a contract address of the target smart contract;

matching the contract address of the target smart contract against the contract addresses in the smart contract blacklist; and

in response to determining that the contract address of the target smart contract does not match any one of the contract addresses in the smart contract blacklist, determining that the target smart contract is not a managed smart contract.

8. A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform operations comprising:

in response to a first client device invoking a transaction with respect to a target smart contract, obtaining, by a blockchain node device in a blockchain, encrypted contract codes of the target smart contract, wherein the encrypted contract codes are stored in distributed ledgers of the blockchain, and wherein a trusted execution environment is installed on the blockchain node device;

transmitting the encrypted contract codes of the target smart contract to the trusted execution environment;

obtaining a smart contract management rule;

determining, in the trusted execution environment, that the target smart contract is not a managed smart contract based on the smart contract management rule;

in response to determining that the target smart contract is not a managed smart contract, extracting a decryption key stored in the trusted execution environment, wherein the decryption key corresponds to the encrypted contract codes of the target smart contract;

decrypting the encrypted contract codes of the target smart contract using the extracted decryption key;

executing the decrypted contract codes of the target smart contract in the trusted execution environment to obtain an execution result;

encrypting the execution result; and

transmitting the encrypted execution result to the distributed ledgers of the blockchain for storage.

9. The non-transitory, computer-readable medium of claim 8 , wherein the trusted execution environment stores the extracted decryption key and a plurality of other decryption keys corresponding to other encrypted contract codes, respectively, of other smart contracts stored in the distributed ledgers of the blockchain; and

wherein the plurality of other decryption keys corresponding to the other encrypted contract codes of other smart contracts are set as extraction prohibited.

10. The non-transitory, computer-readable medium of claim 9 , wherein the plurality of other decryption keys correspond to encrypted contract codes, respectively, of managed smart contracts.

11. The non-transitory, computer-readable medium of claim 8 , wherein the operations further comprise:

receiving creation transaction data corresponding to a creation transaction initiated by a second client device with respect to the target smart contract, wherein the creation transaction data comprises the encrypted contract codes of the target smart contract;

in response to receiving the creation transaction data, creating the target smart contract by executing smart contract creation codes in the trusted execution environment;

creating a contract account on the blockchain, wherein the contract account corresponds to the target smart contract; and

transmitting the encrypted contract codes of the target smart contract to the distributed ledgers of the blockchain for storage.

12. The non-transitory, computer-readable medium of claim 11 , wherein the encrypted contract codes of the target smart contract are generated by the second client device using a first encryption method that comprises any one of the following: a symmetric encryption method, an asymmetric encryption method, or a symmetric encryption method combined with an asymmetric encryption method, and

wherein encrypting the execution result comprises applying to the execution result a second encryption method that comprises any one of the following: a symmetric encryption method or an asymmetric encryption method.

13. The non-transitory, computer-readable medium of claim 8 , wherein obtaining the smart contract management rule comprises:

monitoring, by the blockchain node device, data related to the target smart contract in an independent regulatory blockchain;

in response to a regulatory party generating a latest smart contract regulatory rule by invoking a second smart contract deployed on the independent regulatory blockchain, storing the latest smart contract regulatory rule into a local storage of the blockchain node device; and

reading, as the smart contract management rule, the latest smart contract regulatory rule from the local storage of the blockchain node device.

14. The non-transitory, computer-readable medium of claim 8 , wherein the smart contract management rule comprises a smart contract blacklist comprising contract addresses of managed smart contracts, and

wherein determining that the target smart contract is not a managed smart contract based on the smart contract management rule comprises:

obtaining a contract address of the target smart contract;

matching the contract address of the target smart contract against the contract addresses in the smart contract blacklist; and

in response to determining that the contract address of the target smart contract does not match any one of the contract addresses in the smart contract blacklist, determining that the target smart contract is not a managed smart contract.

15. A computer-implemented system, comprising:

one or more computers; and

one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, perform one or more operations comprising:

in response to a first client device invoking a transaction with respect to a target smart contract, obtaining, by a blockchain node device in a blockchain, encrypted contract codes of the target smart contract, wherein the encrypted contract codes are stored in distributed ledgers of the blockchain, and wherein a trusted execution environment is installed on the blockchain node device;

transmitting the encrypted contract codes of the target smart contract to the trusted execution environment;

obtaining a smart contract management rule;

determining, in the trusted execution environment, that the target smart contract is not a managed smart contract based on the smart contract management rule;

in response to determining that the target smart contract is not a managed smart contract, extracting a decryption key stored in the trusted execution environment, wherein the decryption key corresponds to the encrypted contract codes of the target smart contract;

decrypting the encrypted contract codes of the target smart contract using the extracted decryption key;

executing the decrypted contract codes of the target smart contract in the trusted execution environment to obtain an execution result;

encrypting the execution result; and

transmitting the encrypted execution result to the distributed ledgers of the blockchain for storage.

16. The computer-implemented system of claim 15 , wherein the trusted execution environment stores the extracted decryption key and a plurality of other decryption keys corresponding to other encrypted contract codes, respectively, of other smart contracts stored in the distributed ledgers of the blockchain; and

wherein the plurality of other decryption keys corresponding to the other encrypted contract codes of other smart contracts are set as extraction prohibited.

17. The computer-implemented system of claim 16 , wherein the plurality of other decryption keys correspond to encrypted contract codes, respectively, of managed smart contracts.

18. The computer-implemented system of claim 15 , wherein the operations further comprise:

receiving creation transaction data corresponding to a creation transaction initiated by a second client device with respect to the target smart contract, wherein the creation transaction data comprises the encrypted contract codes of the target smart contract;

in response to receiving the creation transaction data, creating the target smart contract by executing smart contract creation codes in the trusted execution environment;

creating a contract account on the blockchain, wherein the contract account corresponds to the target smart contract; and

transmitting the encrypted contract codes of the target smart contract to the distributed ledgers of the blockchain for storage.

19. The computer-implemented system of claim 15 , wherein obtaining the smart contract management rule comprises:

monitoring, by the blockchain node device, data related to the target smart contract in an independent regulatory blockchain;

in response to a regulatory party generating a latest smart contract regulatory rule by invoking a second smart contract deployed on the independent regulatory blockchain, storing the latest smart contract regulatory rule into a local storage of the blockchain node device; and

reading, as the smart contract management rule, the latest smart contract regulatory rule from the local storage of the blockchain node device.

20. The computer-implemented system of claim 15 , wherein the smart contract management rule comprises a smart contract blacklist comprising contract addresses of managed smart contracts, and

wherein determining that the target smart contract is not a managed smart contract based on the smart contract management rule comprises:

obtaining a contract address of the target smart contract;

matching the contract address of the target smart contract against the contract addresses in the smart contract blacklist; and

in response to determining that the contract address of the target smart contract does not match any one of the contract addresses in the smart contract blacklist, determining that the target smart contract is not a managed smart contract.

Assignments (4)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 18, 2025
From: ADVANCED NEW TECHNOLOGIES CO., LTD.
To: ANTCHAIN TECHNOLOGY PTE. LTD.
Reel/Frame 070253/0064 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 10, 2020
From: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
To: ADVANCED NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053754/0625 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 31, 2020
From: WEI, CHANGZHENG; YAN, YING
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 053649/0748 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 31, 2020
From: ALIBABA GROUP HOLDING LIMITED
To: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053743/0464 →