IP Library Granted Patent US 10,733,152
Granted Patent B2
US 10,733,152 · App. 16/725,290 · Granted Aug 4, 2020

System and method for implementing native contract on blockchain

Inventor: He Sun (Hangzhou, CN)
Assignee: Alibaba Group Holding Limited
G06F16/1837G06Q20/405H04L9/0637
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,733,152
App. No.
16/725,290
Granted
Aug 4, 2020
Kind
B2
Abstract

A computer-implemented method for implementing native contract on blockchain comprises: obtaining combined bytecode associated with a blockchain contract, wherein the combined bytecode comprises an indicator representing a type of the blockchain contract; determining the type of the blockchain contract based at least on the indicator; and executing the blockchain contract based on the determined type of the blockchain contract.

Claims (63)

1. A computer-implemented method for implementing blockchain contracts on blockchain, comprising:

obtaining machine code of a blockchain contract, wherein source code of the blockchain contract has been compiled by a compiler into a first bytecode portion, and the obtained machine code is different from the source code, wherein:

the obtained machine code comprises (1) the first bytecode portion and (2) a second bytecode portion including an indicator representing a type of the blockchain contract,

the type of the blockchain contract comprises native contract type or solidity contract type,

the native contract type indicates that the source code of the blockchain contract is written in a high-level programming language other than solidity, and

the solidity contract type indicates that the source code of blockchain contract is written in solidity;

determining the type of the blockchain contract based at least on the indicator; and

executing the blockchain contract based on the determined type of the blockchain contract.

2. The method of claim 1 , wherein:

the first bytecode portion comprises a dynamic library file compiled from the source code of the blockchain contract.

3. The method of claim 2 , wherein determining the type of the blockchain contract based at least on the indicator comprises:

determining, at a blockchain virtual machine, if the type of the blockchain contract is the native contract type or the solidity contract type.

4. The method of claim 3 , wherein executing the blockchain contract based on the determined type of the blockchain contract comprises:

in response to determining that the blockchain contract is the native contract type, triggering the blockchain virtual machine to execute the blockchain contract.

5. The method of claim 4 , wherein triggering the blockchain virtual machine comprises:

determining the blockchain virtual machine corresponding to the native contract type based at least on the indicator; and

triggering the determined blockchain virtual machine to execute the dynamic library file.

6. The method of claim 3 , wherein executing the blockchain contract based on the determined type of the blockchain contract comprises:

in response to determining that the blockchain contract is the native contract type, creating a child process to execute the blockchain contract.

7. The method of claim 6 , wherein creating the child process comprises:

creating an executable file; and

launching the executable file to execute the dynamic library file.

8. The method of claim 6 , wherein:

the child process and the blockchain virtual machine communicate via socket or shared memory.

9. The method of claim 3 , wherein executing the blockchain contract based on the determined type of the blockchain contract comprises:

in response to determining that the blockchain contract is the native contract type, launching a docker container to execute the blockchain contract.

10. The method of claim 9 , wherein launching the docker container comprises:

creating a docker container; and

launching the docker container to execute the dynamic library file.

11. The method of claim 9 , wherein:

the docker container and the blockchain virtual machine communicate via socket.

12. A non-transitory computer-readable storage medium for implementing blockchain contracts on blockchain, configured with instructions executable by one or more processors to cause the one or more processors to perform operations comprising:

obtaining machine code of a blockchain contract, wherein source code of the blockchain contract has been compiled by a compiler into a first bytecode portion, and the obtained machine code is different from the source code, wherein:

the obtained machine code comprises (1) the first bytecode portion and (2) a second bytecode portion including an indicator representing a type of the blockchain contract,

the type of the blockchain contract comprises native contract type or solidity contract type,

the native contract type indicates that the source code of the blockchain contract is written in a high-level programming language other than solidity, and

the solidity contract type indicates that the source code of blockchain contract is written in solidity;

determining the type of the blockchain contract based at least on the indicator; and

executing the blockchain contract based on the determined type of the blockchain contract.

13. The storage medium of claim 12 , wherein:

the first bytecode portion comprises a dynamic library file compiled from the source code of the blockchain contract.

14. The storage medium of claim 13 , wherein determining the type of the blockchain contract based at least on the indicator comprises:

determining, at a blockchain virtual machine, if the type of the blockchain contract is the native contract type or the solidity contract type.

15. The storage medium of claim 14 , wherein executing the blockchain contract based on the determined type of the blockchain contract comprises:

in response to determining that the blockchain contract is the native contract type, triggering the blockchain virtual machine to execute the blockchain contract.

16. The storage medium of claim 15 , wherein triggering the blockchain virtual machine comprises:

determining the blockchain virtual machine corresponding to the native contract type based at least on the indicator; and

triggering the determined blockchain virtual machine to execute the dynamic library file.

17. The storage medium of claim 14 , wherein executing the blockchain contract based on the determined type of the blockchain contract comprises:

in response to determining that the blockchain contract is the native contract type, creating a child process to execute the blockchain contract.

18. The storage medium of claim 17 , wherein creating the child process comprises:

creating an executable file; and

launching the executable file to execute the dynamic library file.

19. The storage medium of claim 14 , wherein executing the blockchain contract based on the determined type of the blockchain contract comprises:

in response to determining that the blockchain contract is the native contract type, launching a docker container to execute the blockchain contract.

20. A system for implementing blockchain contracts on blockchain, comprising one or more processors and one or more non-transitory computer-readable memories coupled to the one or more processors and configured with instructions executable by the one or more processors to cause the system to perform operations comprising:

obtaining machine code of a blockchain contract, wherein source code of the blockchain contract has been compiled by a compiler into a first bytecode portion, and the obtained machine code is different from the source code, wherein:

the obtained machine code comprises (1) the first bytecode portion and (2) a second bytecode portion including an indicator representing a type of the blockchain contract,

the type of the blockchain contract comprises native contract type or solidity contract type,

the native contract type indicates that the source code of the blockchain contract is written in a high-level programming language other than solidity, and

the solidity contract type indicates that the source code of blockchain contract is written in solidity;

determining the type of the blockchain contract based at least on the indicator; and

executing the blockchain contract based on the determined type of the blockchain contract.

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 23, 2019
From: SUN, HE
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 051357/0221 →