IP Library Granted Patent US 10,699,006
Granted Patent B1
US 10,699,006 · App. 16/671,010 · Granted Jun 30, 2020

Processing and storing blockchain data under a trusted execution environment

Inventors: Changzheng Wei (Hangzhou, CN); Ying Yan (Hangzhou, CN); Boran Zhao (Hangzhou, CN); Xuyang Song (Hangzhou, CN); Huabing Du (Hangzhou, CN)
Assignee: Alibaba Group Holding Limited
G06F21/53H04L9/3239G06F9/45533G06F2221/034H04L2209/127H04L2209/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 10,699,006
App. No.
16/671,010
Granted
Jun 30, 2020
Kind
B1
Abstract

Disclosed herein are methods, systems, and apparatus, including computer programs encoded on computer storage media, for processing blockchain data under a trusted execution environment (TEE). One of the methods includes receiving, by a blockchain node, a request to execute one or more software instructions in a TEE executing on the blockchain node; determining, by a virtual machine in the TEE, data associated with one or more blockchain accounts to execute the one or more software instructions based on the request; traversing, by the virtual machine, an internal cache hash table stored in the TEE to determine whether the data are included in the internal cache hash table; and in response to determining that the data is included in the internal cache hash table, executing, by the virtual machine, the one or more software instructions by retrieving the data from the internal cache hash table.

Claims (50)

1. A computer-implemented method for processing blockchain data under a trusted execution environment (TEE), the method comprising:

receiving, by a blockchain node, a request to execute one or more software instructions in a TEE executing on the blockchain node;

determining, by a virtual machine in the TEE, data associated with one or more blockchain accounts to execute the one or more software instructions based on the request, wherein the data associated with the one or more blockchain accounts are one or more key-value pairs (KVPs), and an internal cache hash table stores a plurality of KVPs associated with frequently accessed storage contents of a plurality of accounts of a blockchain;

traversing, by the virtual machine, the internal cache hash table stored in the TEE to determine whether the data are included in the internal cache hash table;

traversing, by the blockchain node, an external cache hash table through direct memory access to determine a first portion of KVPs that are included in the external cache hash table and a second portion of KVPs that are not included in the internal cache hash table;

in response to determining that the data is included in the internal cache hash table, executing, by the virtual machine, the one or more software instructions by retrieving the data from the internal cache hash table and by retrieving the second portion of KVPs from the external cache hash table, if the second portion of KVPs are included in the external cache hash table;

updating, by the virtual machine, the internal cache hash table in response to executing the one or more software instructions;

updating, by the blockchain node, the external cache hash table in response to executing the one or more software instructions; and

synchronizing, by the blockchain node, the external cache hash table with a global state of a blockchain stored in a database separate from the TEE and the internal cache hash table with the external cache hash table that comprises data associated with the one or more blockchain accounts, wherein the external cache hash table is stored in a cache memory separate from the TEE.

2. The computer-implemented method of claim 1 , wherein the external cache hash table stores a plurality of KVPs associated with states and storage content of frequently accessed accounts of the blockchain.

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

executing, by the virtual machine, the one or more software instructions by retrieving the second portion of KVPs from the global state, if the second portion of—KVPs are not included in the internal cache hash table or the external cache hash table; and

updating, by the blockchain node, the global state in response to executing the one or more software instructions.

4. The computer-implemented method of claim 1 , wherein the global state is stored in the database outside of an enclave as a Merkle Patricia tree (MPT).

5. The computer-implemented method of claim 1 , wherein the global state includes a mapping between addresses and states of a plurality of blockchain accounts of the blockchain, and the plurality of blockchain accounts include one or more of externally owned accounts or contract accounts, and wherein each of the contracts accounts includes a storage root.

6. The computer-implemented method of claim 5 , wherein the storage root comprises a hash of a root node of an MPT, and wherein the MPT encodes hash of storage contents of the corresponding contract account.

7. A non-transitory, computer-readable storage medium storing one or more instructions executable by a computer system to perform operations for processing blockchain data under a trusted execution environment (TEE), the operations comprising:

receiving, by a blockchain node, a request to execute one or more software instructions in a TEE executing on the blockchain node;

determining, by a virtual machine in the TEE, data associated with one or more blockchain accounts to execute the one or more software instructions based on the request, wherein the data associated with the one or more blockchain accounts are one or more key-value pairs (KVPs), and an internal cache hash table stores a plurality of KVPs associated with frequently accessed storage contents of a plurality of accounts of a blockchain;

traversing, by the virtual machine, the internal cache hash table stored in the TEE to determine whether the data are included in the internal cache hash table;

traversing, by the blockchain node, an external cache hash table through direct memory access to determine a first portion of KVPs that are included in the external cache hash table and a second portion of KVPs that are not included in the internal cache hash table;

in response to determining that the data is included in the internal cache hash table, executing, by the virtual machine, the one or more software instructions by retrieving the data from the internal cache hash table and by retrieving the second portion of KVPs from the external cache hash table, if the second portion of KVPs are included in the external cache hash table;

updating, by the virtual machine, the internal cache hash table in response to executing the one or more software instructions;

updating, by the blockchain node, the external cache hash table in response to executing the one or more software instructions; and

synchronizing, by the blockchain node, the external cache hash table with a global state of a blockchain stored in a database separate from the TEE and the internal cache hash table with the external cache hash table that comprises data associated with the one or more blockchain accounts, wherein the external cache hash table is stored in a cache memory separate from the TEE.

8. The non-transitory, computer-readable storage medium of claim 7 , wherein the external cache hash table stores a plurality of KVPs associated with states and storage content of frequently accessed accounts of the blockchain.

9. The non-transitory, computer-readable storage medium of claim 7 , the operations further comprising:

executing, by the virtual machine, the one or more software instructions by retrieving the second portion of KVPs from the global state, if the second portion of KVPs are not included in the internal cache hash table or the external cache hash table; and

updating, by the blockchain node, the global state in response to executing the one or more software instructions.

10. The non-transitory, computer-readable storage medium of claim 7 , wherein the global state is stored in the database outside of an enclave as a Merkle Patricia tree (MPT).

11. The non-transitory, computer-readable storage medium of claim 7 , wherein the global state includes a mapping between addresses and states of a plurality of blockchain accounts of the blockchain, and the plurality of blockchain accounts include one or more of externally owned accounts or contract accounts, and wherein each of the contracts accounts includes a storage root.

12. The non-transitory, computer-readable storage medium of claim 11 , wherein the storage root comprises a hash of a root node of an MPT, and wherein the MPT encodes hash of storage contents of the corresponding contract account.

13. A computer-implemented system for processing blockchain data under a trusted execution environment (TEE), the 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:

receiving, by a blockchain node, a request to execute one or more software instructions in a TEE executing on the blockchain node,

determining, by a virtual machine in the TEE, data associated with one or more blockchain accounts to execute the one or more software instructions based on the request, wherein the data associated with the one or more blockchain accounts are one or more key-value pairs (KVPs), and an internal cache hash table stores a plurality of KVPs associated with frequently accessed storage contents of a plurality of accounts of a blockchain;

traversing, by the virtual machine, the internal cache hash table stored in the TEE to determine whether the data are included in the internal cache hash table;

traversing, by the blockchain node, an external cache hash table through direct memory access to determine a first portion of KVPs that are included in the external cache hash table and a second portion of KVPs that are not included in the internal cache hash table;

in response to determining that the data is included in the internal cache hash table, executing, by the virtual machine, the one or more software instructions by retrieving the data from the internal cache hash table and by retrieving the second portion of KVPs from the external cache hash table, if the second portion of KVPs are included in the external cache hash table;

updating, by the virtual machine, the internal cache hash table in response to executing the one or more software instructions;

updating, by the blockchain node, the external cache hash table in response to executing the one or more software instructions; and

synchronizing, by the blockchain node, the external cache hash table with a global state of a blockchain stored in a database separate from the TEE and the internal cache hash table with the external cache hash table that comprises data associated with the one or more blockchain accounts, wherein the external cache hash table is stored in a cache memory separate from the TEE.

14. The computer-implemented system of claim 13 , wherein the external cache hash table stores a plurality of KVPs associated with states and storage content of frequently accessed accounts of the blockchain.

15. The computer-implemented system of claim 13 , the operations further comprising:

executing, by the virtual machine, the one or more software instructions by retrieving the second portion of KVPs from the global state, if the second portion of KVPs are not included in the internal cache hash table or the external cache hash table; and

updating, by the blockchain node, the global state in response to executing the one or more software instructions.

16. The computer-implemented system of claim 13 , wherein the global state is stored in the database outside of an enclave as a Merkle Patricia tree (MPT).

17. The computer-implemented system of claim 13 , wherein the global state includes a mapping between addresses and states of a plurality of blockchain accounts of the blockchain, and the plurality of blockchain accounts include one or more of externally owned accounts or contract accounts, and wherein each of the contracts accounts includes a storage root.

18. The computer-implemented system of claim 17 , wherein the storage root comprises a hash of a root node of an MPT, and wherein the MPT encodes hash of storage contents of the corresponding contract account.

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: ALIBABA GROUP HOLDING LIMITED
To: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053743/0464 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 7, 2020
From: WEI, CHANGZHENG; YAN, YING; ZHAO, BORAN; SONG, XUYANG; DU, HUABING
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 051502/0181 →