IP Library Granted Patent US 11,138,597
Granted Patent B2
US 11,138,597 · App. 16/709,817 · Granted Oct 5, 2021

System and method for improving security of smart contract on blockchain

Inventor: Zhongxiao Yao (Hangzhou, CN)
Assignee: ADVANCED NEW TECHNOLOGIES CO., LTD.
G06Q20/38215G06Q20/401G06Q20/405H04L9/0637H04L9/3263G06Q2220/00H04L2209/38H04L2209/56
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 11,138,597
App. No.
16/709,817
Granted
Oct 5, 2021
Kind
B2
Abstract

A computer-implemented method for improving security of smart contract comprises: obtaining a first and a second transactions both invoking a smart contract, wherein the first transaction is associated with a protection condition; executing the second transaction and updating a current state of the smart contract; determining whether the updated current state of the smart contract satisfies the protection condition; in response to determining that the updated current state satisfies the protection condition, executing the first transaction, and recording the second and the first transactions into a data block for adding to a blockchain; and in response to determining that the updated current state does not satisfy the protection condition, recording the second transaction into another data block for adding to the blockchain, without executing the first transaction.

Claims (60)

1. A computer-implemented method, comprising:

obtaining, by a blockchain node of a blockchain computer network, (1) a first transaction comprising an address of a smart contract in a blockchain on the blockchain computer network, one or more first parameters, and a first value and (2) a second transaction comprising the address of the smart contract in the blockchain, one or more second parameters, wherein a result of execution of the smart contract depends on, according to Transaction-Ordering Dependence (TOD), an order of execution of the first and second transactions;

generating, by the blockchain node based on the first value, an execution condition of executing the smart contract based on the first transaction;

selecting, by the blockchain node, the second transaction before selecting the first transaction;

updating, by the blockchain node, a first world state of the blockchain to a first transitional state by updating the smart contract based on the second value;

updating, by the blockchain node, the first transitional state to a second world state by calling executable code of the smart contract according to the address in the blockchain and the one or more second parameters;

updating, by the blockchain node, the second world state to a second transitional state by updating the smart contract based on the first value;

determining, by the blockchain node, whether the second transitional state of the blockchain satisfies the execution condition;

determining, by the blockchain node, that the second transitional state does not satisfy the execution condition;

reverting, by the blockchain node, the blockchain from the second transitional state to the second world state;

recording, by the blockchain node, the execution of the second transaction corresponding to the second world state into a new data block without executing the first transaction; and

discarding, by the blockchain node, the first transaction.

2. The method of claim 1 , further comprising:

returning, by the blockchain node, an execution exception to a computing device.

3. The method of claim 1 , wherein:

the execution condition is associated with a price range, an amount range, or a time range of an item.

4. The method of claim 3 , wherein:

the first transaction is associated with a purchase order of the item at the price range; and

the second transaction is associated with a sales order of selling the item.

5. The method of claim 1 , wherein: obtaining the first transaction and the second transaction comprises obtaining the first transaction and the second transaction from a pool database.

6. A system comprising one or more processors and one or more non-transitory computer-readable memories coupled to the one or more processors and storing instructions executable by the one or more processors, wherein execution of the instructions causes the one or more processors to perform operations comprising:

obtaining (1) a first transaction comprising an address of a smart contract in a blockchain, one or more first parameters, and a first value and (2) a second transaction comprising the address of the smart contract in the blockchain, one or more second parameters, and a second value, wherein a result of execution of the smart contract depends on, according to Transaction-Ordering Dependence (TOD), an order of execution of the first and second transactions;

generating, based on the first value, an execution condition of executing the smart contract based on the first transaction;

selecting the second transaction before selecting the first transaction;

updating a first world state of the blockchain to a first transitional state by updating the smart contract based on the second value;

updating the first transitional state to a second world state by calling executable code of the smart contract according to the address in the blockchain and the one or more second parameters;

updating the second world state to a second transitional state by updating the smart contract based on the first value;

determining whether the second transitional state of the blockchain satisfies the execution condition;

determining that the second transitional state does not satisfy the execution condition;

reverting the blockchain from the second transitional state to the second world state;

recording the execution of the second transaction corresponding to the second world state into a new data block without executing the first transaction; and

discarding the first transaction.

7. The system of claim 6 , wherein the is one or more processors are further caused to perform:

returning an execution exception to a computing device.

8. The system of claim 6 , wherein:

the execution condition is associated with a price range, an amount range, or a time range of an item.

9. The system of claim 8 , wherein:

the first transaction is associated with a purchase order of the item at the price range; and

the second transaction is associated with a sales order of selling the item.

10. The system of claim 6 , wherein: obtaining the first transaction and the second transaction comprises obtaining the first transaction and the second transaction from a pool database.

11. A non-transitory computer-readable storage medium storing instructions executable by one or more processors, wherein execution of the instructions causes the one or more processors to perform operations comprising:

obtaining (1) a first transaction comprising an address of a smart contract in a blockchain, one or more first parameters, and a first value and (2) a second transaction comprising the address of the smart contract in the blockchain, one or more second parameters, and a second value, wherein a result of execution of the smart contract depends on, according to Transaction-Ordering Dependence (TOD), an order of execution of the first and second transactions;

generating, based on the first value, an execution condition of executing the smart contract based on the first transaction;

selecting the second transaction before selecting the first transaction;

updating a first world state of the blockchain to a first transitional state by updating the smart contract based on the second value;

updating the first transitional state to a second world state by calling executable code of the smart contract according to the address in the blockchain and the one or more second parameters;

updating the second world state to a second transitional state by updating the smart contract based on the first value;

determining whether the second transitional state of the blockchain satisfies the execution condition;

determining that the second transitional state does not satisfy the execution condition;

reverting the blockchain from the second transitional state to the second world state;

recording the execution of the second transaction corresponding to the second world state into a new data block without executing the first transaction; and

discarding the first transaction.

12. The storage medium of claim 11 , the processor is caused to further perform:

returning an execution exception to a computing device.

13. The storage medium of claim 11 , wherein:

the execution condition is associated with a price range, an amount range, or a time range of an item.

14. The storage medium of claim 13 , wherein:

the first transaction is associated with a purchase order of the item at the price range; and

the second transaction is associated with a sales order of selling the item.

15. The storage medium of claim 11 , wherein: obtaining the first transaction and the second transaction comprises obtaining the first transaction and the second transaction from a pool database.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 16, 2020
From: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
To: ADVANCED NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053796/0281 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 3, 2020
From: ALIBABA GROUP HOLDING LIMITED
To: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053702/0392 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 10, 2019
From: YAO, ZHONGXIAO
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 051237/0594 →