IP Library Granted Patent US 11,113,271
Granted Patent B2
US 11,113,271 · App. 16/721,265 · Granted Sep 7, 2021

Methods and devices for performing off-chain testing on smart contract

Inventors: Haizhen Zhuo (Zhejiang, CN); Honglin Qiu (Zhejiang, CN)
Assignee: Advanced New Technologies Co., Ltd.
G06F16/2379G06F9/54G06F16/2365G06Q20/389H04L9/0637H04L9/0643H04L2209/38
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,113,271
App. No.
16/721,265
Filed
Dec 19, 2019
Granted
Sep 7, 2021
Kind
B2
Art Unit
2164
USPC
707/703
Abstract

Disclosed herein are methods, devices, and apparatuses, including computer programs stored on computer-readable media, for performing an off-chain testing on a smart contract. One of the methods includes: generating execution environment information for the smart contract, the execution environment information including at least one of transaction context information, blockchain information, or state information; providing an interface between the generated execution environment information and the smart contract; executing the smart contract based on the generated execution environment information and the provided interface; and storing an execution result of the smart contract.

Claims (52)

1. A computer-implemented method for performing an off-chain testing on a smart contract, comprising:

generating execution environment information for the smart contract, the execution environment information including at least one of transaction context information, blockchain information, or state information;

providing an interface between the generated execution environment information and the smart contract;

executing the smart contract based on the generated execution environment information and the provided interface; and

storing an execution result of the smart contract, wherein the storing the execution result comprises storing data indicating a change in at least one of the blockchain information or the state information,

wherein the generating the execution environment information, the providing the interface, the executing the smart contract, and the storing the execution result of the smart contract are performed before the smart contract is deployed into a blockchain, thereby implementing the off-chain testing on the smart contract.

2. The method of claim 1 , where the generating the execution environment information comprises:

generating the transaction context information to include at least one of an address of the smart contract, a transaction identifier of a transaction, or party information of the transaction.

3. The method of claim 1 , where the generating the execution environment information comprises:

generating the blockchain information to include at least one of a block identifier for a current block, a timestamp of the current block, and a hash value of a previous block.

4. The method of claim 1 , where the generating the execution environment information comprises:

generating the state information to include at least one of parameter information of the smart contract or transaction information.

5. The method of claim 1 , wherein the providing the interface comprises:

providing an application program interface (API) between the generated execution environment information and the smart contract.

6. The method of claim 1 , wherein the transaction context information corresponds to a first transaction, the method further comprising:

generating updated transaction context information corresponding to a second transaction; and

updating the execution environment information with the data indicating a change in at least one of the blockchain information or the state information, and the updated transaction context information.

7. The method of claim 6 , further comprising:

executing the smart contract based on the updated execution environment information and the provided interface; and

storing another execution result of the smart contract.

8. The method of claim 1 , further comprising:

displaying the execution result of the smart contract for verification.

9. A device for performing an off-chain testing on a smart contract, comprising:

one or more processors; and

one or more computer-readable memories coupled to the one or more processors and having instructions stored thereon that are executable by the one or more processors, wherein the one or more processors are configured to:

generate execution environment information for the smart contract, the execution environment information including at least one of transaction context information, blockchain information, or state information;

provide an interface between the generated execution environment information and the smart contract;

execute the smart contract based on the generated execution environment information and the provided interface; and

store an execution result of the smart contract, wherein storing the execution result comprises storing data indicating a change in at least one of the blockchain information or the state information,

wherein generating the execution environment information, providing the interface, executing the smart contract, and storing the execution result of the smart contract are performed before the smart contract is deployed into a blockchain, thereby implementing the off-chain testing on the smart contract.

10. The device of claim 9 , wherein in generating the execution environment information, the one or more processors are further configured to:

generate the transaction context information to include at least one of an address of the smart contract, a transaction identifier of a transaction, or party information of the transaction.

11. The device of claim 9 , wherein in generating the execution environment information, the one or more processors are further configured to:

generate the blockchain information to include at least one of a block identifier for a current block, a timestamp of the current block, and a hash value of a previous block.

12. The device of claim 9 , wherein in generating the execution environment information, the one or more processors are further configured to:

generate the state information to include at least one of parameter information of the smart contract or transaction information.

13. The device of claim 9 , wherein in providing the interface, the one or more processors are further configured to:

provide an application program interface (API) between the generated execution environment information and the smart contract.

14. The device of claim 9 , wherein the transaction context information corresponds to a first transaction, and the one or more processors are further configured to:

generate updated transaction context information corresponding to a second transaction; and

update the execution environment information with the data indicating a change in at least one of the blockchain information or the state information, and the updated transaction context information.

15. The device of claim 14 , wherein the one or more processors are further configured to:

execute the smart contract based on the updated execution environment information and the provided interface; and

store another execution result of the smart contract.

16. The device of claim 9 , wherein the one or more processors are further configured to:

display the execution result of the smart contract for verification.

17. A non-transitory computer-readable medium having stored therein instructions that, when executed by a processor of a device, cause the device to perform a method for performing an off-chain testing on a smart contract, the method comprising:

generating execution environment information for the smart contract, the execution environment information including at least one of transaction context information, blockchain information, or state information;

providing an interface between the generated execution environment information and the smart contract;

executing the smart contract based on the generated execution environment information and the provided interface; and

storing an execution result of the smart contract, wherein the storing the execution result comprises storing data indicating a change in at least one of the blockchain information or the state information,

wherein the generating the execution environment information, the providing the interface, the executing the smart contract, and the storing the execution result of the smart contract are performed before the smart contract is deployed into a blockchain, thereby implementing the off-chain testing on the smart contract.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 13, 2020
From: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
To: ADVANCED NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053761/0338 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 5, 2020
From: ALIBABA GROUP HOLDING LIMITED
To: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053713/0665 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 19, 2019
From: ZHUO, HAIZHEN; QIU, HONGLIN
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 051336/0377 →
Continuity (2)
Continuation PCTCN2019076883 · Mar 4, 2019
Related Publication 20200285633A1 · Sep 10, 2020
Cited By (2)
US 12,256,017 US 12,278,821