IP Library Granted Patent US 12,367,182
Granted Patent B2
US 12,367,182 · App. 18/071,934 · Granted Jul 22, 2025

Transaction verification of a transaction based on a blockchain network

Inventors: Haoming Feng (Shenzhen, CN); Haitao Tu (Shenzhen, CN); Libao He (Shenzhen, CN); Qiuping Chen (Shenzhen, CN); Jiabao Chen (Shenzhen, CN); Peng Ren (Shenzhen, CN); Shuiping Zhou (Shenzhen, CN); Yong Zhao (Shenzhen, CN); He Wang (Guangdong, CN)
Assignee: Tencent Technology (Shenzhen) Company Limited
G06F16/182
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 12,367,182
App. No.
18/071,934
Granted
Jul 22, 2025
Kind
B2
Abstract

A transaction transmitted by a user node in a blockchain network and transaction verification information corresponding to the to-be-verified transaction are acquired. The transaction verification information includes a state read set, a state write set, an initial transaction execution result, and a block identifier of a target block. A first block header of the target block includes the block identifier. A second block header is determined from a block header chain of a light node in the blockchain network. The state read set and the state write set are checked based on a first state snapshot in the second block header. The transaction service is executed to obtain a target transaction execution result corresponding to the transaction service and to-be-written state data. Legitimacy of the to-be-verified transaction is checked based on the initial transaction execution result, the target transaction execution result, the state write set, and the to-be-written state data.

Claims (89)

1. A transaction verification method performed by a light node in a blockchain network, the method comprising: acquiring a to-be-verified transaction transmitted by a user node in the blockchain network and transaction verification information corresponding to the to-be-verified transaction, the transaction verification information being determined by a full node in the blockchain network by executing a transaction service corresponding to the to-be-verified transaction, the transaction verification information including a state read set that includes state data associated with the to-be-verified transaction, a state write set that includes state data associated with the executed transaction service, an initial transaction execution result of the executed transaction service, and a block identifier of a target block with a maximum generation timestamp on a full blockchain of the full node, a first block header of the target block including the block identifier, the maximum generation timestamp indicating that the target block is a latest generated block in the full blockchain;

determining a second block header from a block header chain of the light node in the blockchain network, the second block header being matched with the block identifier in the first block header, and checking the state read set and the state write set based on a first state snapshot in the second block header to obtain a first check result of the to-be-verified transaction;

in response to the first check result indicating that both a first proof check result based on the state read set and a second proof check result based on the state write set are successful, executing the transaction service based on the state read set in response to the first check result indicating that the state read set and the state write set are verified to obtain a target transaction execution result corresponding to the transaction service and to-be-written state data, the first proof check result indicating (i) a first comparison between a hash pointer of a root node and a node hash of a child node of the root node in the target block and (ii) a second comparison between a node hash of the root node and the first state snapshot, the second proof check result being configured to check a proof of modifiability based on the first state snapshot;

and checking legitimacy of the to-be-verified transaction based on the initial transaction execution result, the target transaction execution result, the state write set, and the to-be-written state data.

2. The method according to claim 1 , wherein the state read set and the state write set are generated by the full node based on a Merkle Patricia tree (MPT) in the target block; and

the determining the second block header comprises:

determining a state snapshot in the second block header as the first state snapshot in the second block header;

acquiring a first proof of existence of first state data from the state read set, and checking the first proof of existence based on the first state snapshot to obtain the first proof check result, the first state data being state data obtained by the full node from the MPT of the target block and associated with the to-be-verified transaction;

acquiring a proof of modifiability of second state data from the state write set, and checking the proof of modifiability based on the first state snapshot to obtain the second proof check result, the second state data being state data that is recorded by the full node when the full node simulates to execute the transaction service and written in a block subsequent to the target block; and

determining the first check result of the to-be-verified transaction based on the first proof check result and the second proof check result.

3. The method according to claim 2 , wherein

the acquiring the first proof of existence of the first state data from the state read set, and checking the first proof of existence based on the first state snapshot to obtain the first proof check result comprises:

acquiring the first proof of existence of the first state data that is a node path acquired by the full node from the MPT in the target block and associated with the first state data, the node path including a leaf node for storing the first state data, and the root node;

setting the leaf node as the child node and setting a node preceding the leaf node as a parent node corresponding to the child node based on a first node index relationship indicated by the node path, and comparing a hash value of the child node with a hash pointer of the parent node to obtain an initial comparison result;

in response to the initial comparison result indicating that the hash value being consistent with the hash pointer, updating the child node and the parent node based on the first node index relationship, and obtaining a first comparison result of the first proof of existence when the updated parent node is the root node;

comparing a hash value of the root node with the first state snapshot to obtain a second comparison result of the first proof of existence; and

obtaining the first proof check result based on the first comparison result and the second comparison result.

4. The method according to claim 1 , wherein the checking the legitimacy of the to-be-verified transaction comprises:

comparing the initial transaction execution result with the target transaction execution result to obtain a third comparison result;

acquiring a second proof of existence of second state data from the state write set, and checking the second proof of existence based on the first state snapshot;

in response to the second proof of existence being verified, comparing the second state data with the to-be-written state data to obtain a fourth comparison result; and

obtaining a second check result of the to-be-verified transaction based on the third comparison result and the fourth comparison result, and checking the legitimacy of the to-be-verified transaction based on the second check result.

5. The method according to claim 1 , further comprising:

generating, based on second state data in the state write set, a second state snapshot associated with the second state data in response to the legitimacy of the to-be-verified transaction being verified;

generating a to-be-processed block header based on the to-be-verified transaction, the target transaction execution result and the second state snapshot, the to-be-processed block header being applied as a block header subsequent to the second block header; and

writing the to-be-processed block header in the block header chain.

6. The method according to claim 5 , further comprising:

in response to the to-be-processed block header being written in the block header chain, acquiring a node public key of the full node, and encrypting the to-be-processed block header to obtain encrypted data information; and

transmitting the encrypted data information to the full node such that the full node decrypts the encrypted data information based on a node private key of the full node to obtain the to-be-processed block header.

7. The method according to claim 1 , wherein the block identifier includes one of a block height and a hash value of the target block.

8. An apparatus for transaction verification, comprising: processing circuitry configured to acquire a to-be-verified transaction transmitted by a user node in a blockchain network and transaction verification information corresponding to the to-be-verified transaction, the transaction verification information being determined by a full node in the blockchain network by executing a transaction service corresponding to the to-be-verified transaction, the transaction verification information including a state read set that includes state data associated with the to-be-verified transaction, a state write set that includes state data associated with the executed transaction service, an initial transaction execution result of the executed transaction service, and a block identifier of a target block with a maximum generation timestamp on a full blockchain of the full node, a first block header of the target block including the block identifier, the maximum generation timestamp indicating that the target block is a latest generated block in the full blockchain;

determine a second block header from a block header chain of a light node in the blockchain network, the second block header being matched with the block identifier in the first block header, and checking the state read set and the state write set based on a first state snapshot in the second block header to obtain a first check result of the to-be-verified transaction;

in response to the first check result indicating that both a first proof check result based on the state read set and a second proof check result based on the state write set are successful, execute the transaction service based on the state read set in response to the first check result indicating that the state read set and the state write set are verified to obtain a target transaction execution result corresponding to the transaction service and to-be-written state data, the first proof check result indicating (i) a first comparison between a hash pointer of a root node and a node hash of a child node of the root node in the target block and (ii) a second comparison between a node hash of the root node and the first state snapshot, the second proof check result being configured to check a proof of modifiability based on the first state snapshot;

and check legitimacy of the to-be-verified transaction based on the initial transaction execution result, the target transaction execution result, the state write set, and the to-be-written state data.

9. The apparatus according to claim 8 , wherein the state read set and the state write set are generated by the full node based on a Merkle Patricia tree (MPT) in the target block; and

the processing circuitry is configured to:

determine a state snapshot in the second block header as the first state snapshot in the second block header;

acquire a first proof of existence of first state data from the state read set, and check the first proof of existence based on the first state snapshot to obtain the first proof check result, the first state data being state data obtained by the full node from the MPT of the target block and associated with the to-be-verified transaction;

acquire a proof of modifiability of second state data from the state write set, and check the proof of modifiability based on the first state snapshot to obtain the second proof check result, the second state data being state data that is recorded by the full node when the full node simulates to execute the transaction service and written in a block subsequent to the target block; and

determine the first check result of the to-be-verified transaction based on the first proof check result and the second proof check result.

10. The apparatus according to claim 9 , wherein the processing circuitry is configured to:

acquire the first proof of existence of the first state data that is a node path acquired by the full node from the MPT in the target block and associated with the first state data, the node path including a leaf node for storing the first state data, and the root node;

set the leaf node as the child node and setting a node preceding the leaf node as a parent node corresponding to the child node based on a first node index relationship indicated by the node path, and compare a hash value of the child node with a hash pointer of the parent node to obtain an initial comparison result;

in response to the initial comparison result indicating that the hash value being consistent with the hash pointer, update the child node and the parent node based on the first node index relationship, and obtain a first comparison result of the first proof of existence when the updated parent node is the root node;

compare a hash value of the root node with the first state snapshot to obtain a second comparison result of the first proof of existence; and

obtain the first proof check result based on the first comparison result and the second comparison result.

11. The apparatus according to claim 8 , the processing circuitry is configured to:

compare the initial transaction execution result with the target transaction execution result to obtain a third comparison result;

acquire a second proof of existence of second state data from the state write set, and checking the second proof of existence based on the first state snapshot;

in response to the second proof of existence being verified, compare the second state data with the to-be-written state data to obtain a fourth comparison result; and

obtain a second check result of the to-be-verified transaction based on the third comparison result and the fourth comparison result, and check the legitimacy of the to-be-verified transaction based on the second check result.

12. The apparatus according to claim 8 , the processing circuitry is configured to:

generate, based on second state data in the state write set, a second state snapshot associated with the second state data in response to the legitimacy of the to-be-verified transaction being verified;

generate a to-be-processed block header based on the to-be-verified transaction, the target transaction execution result and the second state snapshot, the to-be-processed block header being applied as a block header subsequent to the second block header; and

write the to-be-processed block header in the block header chain.

13. The apparatus according to claim 12 , the processing circuitry is configured to:

in response to the to-be-processed block header being written in the block header chain, acquire a node public key of the full node, and encrypt the to-be-processed block header to obtain encrypted data information; and

transmit the encrypted data information to the full node such that the full node decrypts the encrypted data information based on a node private key of the full node to obtain the to-be-processed block header.

14. The apparatus according to claim 8 , wherein the block identifier includes one of a block height and a hash value of the target block.

15. A non-transitory computer-readable storage medium storing instructions which when executed by a processor of a light node in a blockchain network cause the processor to perform:

acquiring a to-be-verified transaction transmitted by a user node in the blockchain network and transaction verification information corresponding to the to-be-verified transaction, the transaction verification information being determined by a full node in the blockchain network by executing a transaction service corresponding to the to-be-verified transaction, the transaction verification information including a state read set that includes state data associated with the to-be-verified transaction, a state write set that includes state data associated with the executed transaction service, an initial transaction execution result of the executed transaction service, and a block identifier of a target block with a maximum generation timestamp on a full blockchain of the full node, a first block header of the target block including the block identifier, the maximum generation timestamp indicating that the target block is a latest generated block in the full blockchain;

determining a second block header from a block header chain of the light node in the blockchain network, the second block header being matched with the block identifier in the first block header, and checking the state read set and the state write set based on a first state snapshot in the second block header to obtain a first check result of the to-be-verified transaction;

in response to the first check result indicating that both a first proof check result based on the state read set and a second proof check result based on the state write set are successful, executing the transaction service based on the state read set to obtain a target transaction execution result corresponding to the transaction service and to-be-written state data, the first proof check result indicating (i) a first comparison between a hash pointer of a root node and a node hash of a child node of the root node in the target block and (ii) a second comparison between a node hash of the root node and the first state snapshot, the second proof check result being configured to check a proof of modifiability based on the first state snapshot; and

checking legitimacy of the to-be-verified transaction based on the initial transaction execution result, the target transaction execution result, the state write set, and the to-be-written state data.

16. The non-transitory computer-readable storage medium according to claim 15 , wherein the state read set and the state write set are generated by the full node based on a Merkle Patricia tree (MPT) in the target block; and

the determining the second block header comprises:

determining a state snapshot in the second block header as the first state snapshot in the second block header;

acquiring a first proof of existence of first state data from the state read set, and checking the first proof of existence based on the first state snapshot to obtain the first proof check result, the first state data being state data obtained by the full node from the MPT of the target block and associated with the to-be-verified transaction;

acquiring a proof of modifiability of second state data from the state write set, and checking the proof of modifiability based on the first state snapshot to obtain the second proof check result, the second state data being state data that is recorded by the full node when the full node simulates to execute the transaction service and written in a block subsequent to the target block; and

determining the first check result of the to-be-verified transaction based on the first proof check result and the second proof check result.

17. The non-transitory computer-readable storage medium according to claim 16 , wherein

the acquiring the first proof of existence of the first state data from the state read set, and checking the first proof of existence based on the first state snapshot to obtain the first proof check result comprises:

acquiring the first proof of existence of the first state data that is a node path acquired by the full node from the MPT in the target block and associated with the first state data, the node path including a leaf node for storing the first state data, and the root node;

setting the leaf node as the child node and setting a node preceding the leaf node as a parent node corresponding to the child node based on a first node index relationship indicated by the node path, and comparing a hash value of the child node with a hash pointer of the parent node to obtain an initial comparison result;

in response to the initial comparison result indicating that the hash value being consistent with the hash pointer, updating the child node and the parent node based on the first node index relationship, and obtaining a first comparison result of the first proof of existence when the updated parent node is the root node;

comparing a hash value of the root node with the first state snapshot to obtain a second comparison result of the first proof of existence; and

obtaining the first proof check result based on the first comparison result and the second comparison result.

18. The non-transitory computer-readable storage medium according to claim 15 , wherein the checking the legitimacy of the to-be-verified transaction comprises:

comparing the initial transaction execution result with the target transaction execution result to obtain a third comparison result;

acquiring a second proof of existence of second state data from the state write set, and checking the second proof of existence based on the first state snapshot;

in response to the second proof of existence being verified, comparing the second state data with the to-be-written state data to obtain a fourth comparison result; and

obtaining a second check result of the to-be-verified transaction based on the third comparison result and the fourth comparison result, and checking the legitimacy of the to-be-verified transaction based on the second check result.

19. The non-transitory computer-readable storage medium according to claim 15 , wherein the instructions when executed by the processor further cause the processor to perform:

generating, based on second state data in the state write set, a second state snapshot associated with the second state data in response to the legitimacy of the to-be-verified transaction being verified;

generating a to-be-processed block header based on the to-be-verified transaction, the target transaction execution result and the second state snapshot, the to-be-processed block header being applied as a block header subsequent to the second block header; and

writing the to-be-processed block header in the block header chain.

20. The non-transitory computer-readable storage medium according to claim 19 , wherein the instructions when executed by the processor further cause the processor to perform:

in response to the to-be-processed block header being written in the block header chain, acquiring a node public key of the full node, and encrypting the to-be-processed block header to obtain encrypted data information; and

transmitting the encrypted data information to the full node such that the full node decrypts the encrypted data information based on a node private key of the full node to obtain the to-be-processed block header.

Assignments (3)
CORRECTIVE ASSIGNMENT TO CORRECT THE RECEIVING PARTY ADDRESS PREVIOUSLY RECORDED ON REEL 69604 FRAME 5. ASSIGNOR(S) HEREBY CONFIRMS THE EMPLOYMENT AGREEMENT. Recorded Dec 20, 2024
From: CHEN, JIABAO
To: TENCENT TECHNOLOGY (SHENZHEN) COMPANY LIMITED
Reel/Frame 071392/0114 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 12, 2024
From: FENG, HAOMING; TU, HAITAO; HE, LIBAO; CHEN, QIUPING; REN, PENG; ZHOU, SHUIPING; ZHAO, YONG; WANG, HE
To: TENCENT TECHNOLOGY (SHENZHEN) COMPANY LIMITED
Reel/Frame 069603/0908 →
EMPLOYMENT AGREEMENT Recorded Dec 12, 2024
From: CHEN, JIABAO
To: TENCENT TECHNOLOGY (SHENZHEN) COMPANY LIMITED
Reel/Frame 069604/0005 →
Priority Claims (1)
CN 202110537182.6 · May 18, 2021 · national
Continuity (2)
Continuation PCTCN2022090859 · May 5, 2022
Related Publication 20230090296A1 · Mar 23, 2023
References Cited (12)
US 20190295049A1 · Karame et al. · 2019 [cited by applicant]
US 20210012336A1 · Zhuo · 2021 [cited by applicant]
US 20210117385A1 · Haldar · 2021 [cited by examiner]
US 20210184837A1 · Yang · 2021 [cited by examiner]
US 20210273807A1 · Wertheim · 2021 [cited by examiner]
CN 110060064A · 2019 [cited by applicant]
CN 111159293A · 2020 [cited by applicant]
CN 112085504A · 2020 [cited by applicant]
CN 112967065A · 2021 [cited by applicant]
CN 113435896A · 2021 [cited by applicant]
International Search Report and Written Opinion in PCT/CN2022/090859, mailed Jul. 13, 2022, 13 pages. [cited by applicant]
Extended European Search Report issued in European Application No. 22803781.8, mailed on Mar. 20, 2024, 9 pages. [cited by applicant]