IP Library Granted Patent US 11,915,023
Granted Patent B2
US 11,915,023 · App. 16/886,364 · Granted Feb 27, 2024

System and method for smart contract publishing

Inventors: Aaron Blankstein (Chicago, IL); Jude Nelson (New Brunswick, NJ)
Assignee: Hiro Systems PBC
G06F9/45558G06F16/1824G06Q20/3829H04L9/0643H04L9/50G06F16/9024G06F2009/45595H04L9/3239
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,915,023
App. No.
16/886,364
Granted
Feb 27, 2024
Kind
B2
Abstract

A Turing incomplete smart contracting source code for use in a blockchain network is disclosed that allows for static analysis of a smart contract at the time of publishing.

Claims (51)

1. A method of processing smart contracts with a computing device of a decentralized network, the method comprising:

receiving, by the computing device, a smart contract from the decentralized network, the smart contract comprising a set of functions and defining a data map, wherein the data map comprises a map name, a key, and a value, wherein the map name is associated with a user-defined function of the set of functions of the smart contract, the key is associated with the value and is defined by a first known data type, and the value is associated with a static maximum size related to the size of the user-defined function and is defined by a second known data type;

parsing, by the computing device comprising a hardware processor and memory, language of the smart contract to form a parse tree comprising tree nodes, wherein each tree node corresponds to a respective function in the set of functions and a parameter of the respective function;

accessing a first tree node of the tree nodes;

determining that the user-defined function is associated with the first tree node;

determining, by the computing device, a runtime and a size of the user-defined function based on the first known data type and the second known data type associated with the data map;

computing, by the computing device, an execution value of the smart contract based on the runtime and the size;

outputting, by the computing device, the execution value for use by a virtual machine in determining whether the smart contract can be executed;

in response to a call to the user-defined function of the smart contract, storing, by the virtual machine, a state associated with the smart contract in the data map; and

in response to a second call to the user-defined function of the smart contract,

fetching, by the virtual machine, the state from the data map,

executing, by the virtual machine, at least a portion of the smart contract, and

storing an updated state of execution of the smart contract in the data map based on the execution of the portion of the smart contract.

2. The method of claim 1 , wherein the smart contract associates the value with an output of the function, and the static maximum size of the value defines a maximum size of the function output.

3. The method of claim 1 , wherein the data map associates the value with a tuple type.

4. The method of claim 3 , wherein the static maximum size is a numeric value associated with the tuple type in a Lisp like language.

5. The method of claim 3 , wherein the static maximum size is numerically defined in the data map.

6. The method of claim 1 , further comprising:

accessing a second tree node of the tree nodes;

determining that a second function associated with the second tree node is a native function generally applicable to the smart contract; and in response to the second function being determined to be a native function, determining a second runtime and a second size of the second function based on a table lookup.

7. The method of claim 6 , wherein computing an execution value of the smart contract further comprises determining the execution value of the smart contract based on the runtime, the size, the second runtime, and the second size.

8. The method of claim 1 , wherein receiving a smart contract further comprises receiving the smart contract in a Lisp like language.

9. The method of claim 1 , wherein receiving a smart contract further comprises receiving the smart contract as source code in a high-level language.

10. The method of claim 9 , wherein the high-level language comprises a non-compiled high-level language.

11. The method of claim 1 , wherein the decentralized network comprises a blockchain network.

12. A computing device of a decentralized network comprising:

a network interface configured to couple the computing device to the decentralized network and receive smart contracts therefrom, each of the received smart contracts comprising a set of functions;

a hardware processor;

a non-transitory computer readable storage medium storing program instructions for execution by the hardware processor in order to cause the computing device to:

receive, by the computing device, a smart contract from the decentralized network, the smart contract comprising a set of functions and defining a data map, wherein the data map comprises a map name, a key, and a value, wherein the map name is associated with a user-defined function of the set of functions of the smart contract, the key is associated with the value and is defined by a first known data type, and the value is associated with a static maximum size related to the size of the user-defined function and is defined by a second known data type;

parse language of the smart contract to form a parse tree comprising tree nodes, wherein each tree node corresponds to a respective function in the set of functions and a parameter of the respective function;

access a first tree node of the tree nodes;

determine that the user-defined function is associated with the first tree node;

determine a runtime and a size of the user-defined function based on the first known data type and the second known data type associated with the data map;

compute an execution value of the smart contract based on the runtime and the size;

output the execution value for use by a virtual machine in determining whether the smart contract can be executed;

in response to a call to the user-defined function of the smart contract, storing, by the virtual machine, a state associated with the smart contract in the data map; and

in response to a second call to the user-defined function of the smart contract,

fetching, by the virtual machine, the state from the data map,

executing, by the virtual machine, at least a portion of the smart contract, and

storing an updated state of execution of the smart contract in the data map based on the execution of the portion of the smart contract.

13. The computing device of claim 12 , wherein the smart contract associates the value with an output of the function, and the static maximum size of the value defines a maximum size of the function output.

14. The computing device of claim 12 , wherein the data map associates the value with a tuple type.

15. The computing device of claim 14 , wherein the static maximum size is a numeric value associated with the tuple type in a Lisp like language.

16. The computing device of claim 14 , wherein the static maximum size is numerically defined in the data map.

17. The computing device of claim 12 , wherein the program instructions, when executed, further cause the computing device to:

access a second tree node of the tree nodes;

determine that a second function associated with the second tree node is a native function generally applicable to the smart contract; and in response to the determination that the second function is a native function, determine a second runtime and a second size of the second function based on a table lookup.

18. The computing device of claim 17 , wherein the program instructions, when executed, further cause the computing device to determine the execution value of the smart contract based on the runtime, the size, the second runtime, and the second size.

19. The computing device of claim 12 , wherein the program instructions, when executed, further cause the computing device to receive the smart contract in a Lisp like language.

20. The computing device of claim 12 , wherein the program instructions, when executed, further cause the computing device to receive the smart contract as source code in a high-level language.

Assignments (1)
CHANGE OF NAME Recorded Jun 24, 2021
From: BLOCKSTACK PBC
To: HIRO SYSTEMS PBC
Reel/Frame 056679/0402 →
Continuity (2)
Division 16422707 · May 24, 2019
Related Publication 20200372502A1 · Nov 26, 2020