IP Library Granted Patent US 10,860,710
Granted Patent B2
US 10,860,710 · App. 16/902,864 · Granted Dec 8, 2020

Processing and storing blockchain data under a trusted execution environment

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,860,710
App. No.
16/902,864
Granted
Dec 8, 2020
Kind
B2
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 (41)

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 blockchain accounts;

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, 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 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 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, wherein the global state comprises 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 comprises a storage root and wherein the storage root comprises a hash of a root node of a Merkle Patricia tree (MPT), and wherein the MPT encodes hash of storage contents of a respective contract account.

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 MPT.

5. 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 blockchain accounts;

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, 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 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 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, wherein the global state comprises 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 comprises a storage root and wherein the storage root comprises a hash of a root node of a Merkle Patricia tree (MPT), and wherein the MPT encodes hash of storage contents of a respective contract account.

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

7. The non-transitory, computer-readable storage medium of claim 5 , 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.

8. The non-transitory, computer-readable storage medium of claim 5 , wherein the global state is stored in the database outside of an enclave as a MPT.

9. 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 blockchain accounts;

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, 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 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 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, wherein the global state comprises 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 comprises a storage root and wherein the storage root comprises a hash of a root node of a Merkle Patricia tree (MPT), and wherein the MPT encodes hash of storage contents of a respective contract account.

10. The system of claim 9 , wherein the external cache hash table stores a plurality of KVPs associated with states and storage content of frequently accessed accounts of the blockchain.

11. The system of claim 9 , 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.

12. The system of claim 9 , wherein the global state is stored in the database outside of an enclave as a MPT.

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 Jun 30, 2020
From: WEI, CHANGZHENG; YAN, YING; ZHAO, BORAN; SONG, XUYANG; DU, HUABING
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 053834/0530 →