IP Library Granted Patent US 11,303,430
Granted Patent B2
US 11,303,430 · App. 17/351,812 · Granted Apr 12, 2022

Byzantine fault tolerance algorithm-based blockchain consensus method, apparatus, and system

Inventor: Xiaojun Liao (Hangzhou, CN)
Assignee: ALIPAY (HANGZHOU) INFORMATION TECHNOLOGY CO., LTD.
H04L9/0643G06F9/466H04L2209/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 11,303,430
App. No.
17/351,812
Granted
Apr 12, 2022
Kind
B2
Abstract

A blockchain consensus method includes receiving, by a second consensus node of a blockchain, a consensus proposal initiated by a first consensus node of the blockchain, wherein the consensus proposal comprises a first proposal digest, and the first proposal digest is based on a transaction set that needs to be proposed and a first newest block hash maintained by the first consensus node; generating, by the second consensus node of the blockchain in response to the consensus proposal, a second proposal digest based on a second newest block hash maintained by the second consensus node and the transaction set; determining, by the second consensus node, whether the first proposal digest matches the second proposal digest.

Claims (85)

1. A blockchain consensus method, comprising:

determining, by each of one or more backup nodes of a plurality of consensus nodes, that a blockchain maintained by the plurality of consensus nodes based on a Practical Byzantine Fault Tolerance (PBFT) consensus algorithm has not forked;

in response to the determination, participating, by the backup node, in a consensus with a primary node of the plurality of consensus nodes to add a new block to the blockchain;

determining, by the backup node, a second newest block hash of the blockchain including the added the new block;

receiving, by the backup node, a consensus proposal initiated by the primary node of the plurality of consensus nodes for adding at least a transaction set into the blockchain in a different new block, wherein the consensus proposal comprises a first proposal digest, and the first proposal digest is based on the transaction set and a first newest block hash maintained by the primary node;

generating, by the backup node in response to the consensus proposal, a second proposal digest based on the second newest block hash and the transaction set;

determining, by the backup node, whether the first proposal digest matches the second proposal digest;

when determining that the first proposal digest matches the second proposal digest:

determining, by the backup node, that the blockchain has not forked, and

participating, by the backup node, in consensus on the consensus proposal to ensure that the backup nodes and the primary node participating in the consensus perform the consensus consistently based on the different new block;

when determining that the first proposal digest does not match the second proposal digest:

determining, by the backup node, that the blockchain has forked, and

skipping, by the backup node, consensus on the consensus proposal to avoid wasting computing resources on proposal digest matching; and

wherein the first newest block hash and the second newest block hash are hash values of N blocks preceding newest blocks in distributed ledgers of the blockchain respectively maintained by the primary node and the backup node, and N is a positive integer.

2. The method according to claim 1 , wherein:

the first newest block hash is a hash value of a preceding block of a newest block in a distributed ledger of the blockchain maintained by the primary node; and

the second newest block hash is a hash value of a preceding block of a newest block in a distributed ledger of the blockchain maintained by the backup node.

3. The method according to claim 1 , wherein the first proposal digest is generated based on the first newest block hash and a first transaction hash of the transaction set determined by the primary node.

4. The method according to claim 3 , wherein:

the consensus proposal further comprises the transaction set, and the generating a second proposal digest based on the second newest block hash and the transaction set comprises:

generating the second proposal digest based on a second transaction hash of the transaction set in the consensus proposal and the second newest block hash.

5. The method according to claim 4 , wherein:

the first transaction hash is a root hash value of a Merkle tree corresponding to the transaction set determined by the primary node; and

the second transaction hash is a root hash value of a Merkle tree corresponding to the transaction set in the consensus proposal determined by the backup node.

6. The method according to claim 4 , wherein the first proposal digest carries the first transaction hash, and before the generating a second proposal digest, the method further comprises:

determines whether the first transaction hash matches the second transaction hash; and

continuing to perform the step of generating a second proposal digest if the backup node determines that the first transaction hash matches the second transaction hash, or skipping the consensus on the consensus proposal if the backup node determines that the first transaction hash does not match the second transaction hash.

7. The method according to claim 1 , wherein the receiving, by the backup node, a consensus proposal comprises:

obtaining, by the backup node from a preprepare message broadcast by the primary node, the consensus proposal.

8. One or more non-transitory computer-readable storage media storing instructions executable by one or more processors, wherein execution of the instructions causes the one or more processors to perform operations comprising:

determining that a blockchain maintained by a plurality of consensus nodes based on a Practical Byzantine Fault Tolerance (PBFT) consensus algorithm has not forked, wherein the plurality of consensus nodes comprise a primary node and a plurality of backup nodes;

in response to the determination, participating in a consensus with the primary node to add a new block to the blockchain;

determining a second newest block hash of the blockchain including the added the new block;

receiving a consensus proposal initiated by the primary node of the plurality of consensus nodes for adding at least a transaction set into the blockchain in a different new block, wherein the consensus proposal comprises a first proposal digest, and the first proposal digest is based on the transaction set and a first newest block hash maintained by the primary node;

generating, in response to the consensus proposal, a second proposal digest based on the second newest block hash and the transaction set;

determining whether the first proposal digest matches the second proposal digest;

when determining that the first proposal digest matches the second proposal digest:

determining that the blockchain has not forked, and

participating in consensus on the consensus proposal to ensure that the backup nodes and the primary node participating in the consensus perform the consensus consistently based on the different new block;

when determining that the first proposal digest does not match the second proposal digest:

determining that the blockchain has forked, and

skipping consensus on the consensus proposal to avoid wasting computing resources on proposal digest matching; and

wherein the first newest block hash and the second newest block hash are hash values of N blocks preceding newest blocks in distributed ledgers of the blockchain respectively maintained by the primary node and one of the backup nodes, and N is a positive integer.

9. The one or more non-transitory computer-readable storage media according to claim 8 , wherein:

the first newest block hash is a hash value of a preceding block of a newest block in a distributed ledger of the blockchain maintained by the primary node; and

the second newest block hash is a hash value of a preceding block of a newest block in a distributed ledger of the blockchain maintained by the backup node.

10. The one or more non-transitory computer-readable storage media according to claim 8 , wherein the first proposal digest is generated based on the first newest block hash and a first transaction hash of the transaction set determined by the primary node.

11. The one or more non-transitory computer-readable storage media according to claim 10 , wherein:

the consensus proposal further comprises the transaction set, and the generating a second proposal digest based on the second newest block hash and the transaction set comprises:

generating the second proposal digest based on a second transaction hash of the transaction set in the consensus proposal and the second newest block hash.

12. The one or more non-transitory computer-readable storage media according to claim 11 , wherein:

the first transaction hash is a root hash value of a Merkle tree corresponding to the transaction set determined by the primary node; and

the second transaction hash is a root hash value of a Merkle tree corresponding to the transaction set in the consensus proposal determined by the backup node.

13. The one or more non-transitory computer-readable storage media according to claim 11 , wherein the first proposal digest carries the first transaction hash, and before the generating a second proposal digest, the operations further comprises:

determines whether the first transaction hash matches the second transaction hash; and

continuing to perform the step of generating a second proposal digest if the backup node determines that the first transaction hash matches the second transaction hash, or skipping the consensus on the consensus proposal if the backup node determines that the first transaction hash does not match the second transaction hash.

14. The one or more non-transitory computer-readable storage media according to claim 8 , wherein the receiving, by the backup node, a consensus proposal comprises:

obtaining, by the backup node from a preprepare message broadcast by the primary node, the consensus proposal.

15. A system 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:

determining that a blockchain maintained by a plurality of consensus nodes based on a Practical Byzantine Fault Tolerance (PBFT) consensus algorithm has not forked, wherein the plurality of consensus nodes comprise a primary node and a plurality of backup nodes;

in response to the determination, participating in a consensus with the primary node to add a new block to the blockchain;

determining a second newest block hash of the blockchain including the added the new block;

receiving a consensus proposal initiated by the primary node of the plurality of consensus nodes for adding at least a transaction set into the blockchain in a different new block, wherein the consensus proposal comprises a first proposal digest, and the first proposal digest is based on the transaction set and a first newest block hash maintained by the primary node;

generating, in response to the consensus proposal, a second proposal digest based on the second newest block hash maintained by the second consensus node and the transaction set;

determining whether the first proposal digest matches the second proposal digest;

when determining that the first proposal digest matches the second proposal digest:

determining that the blockchain has not forked, and

participating in consensus on the consensus proposal to ensure that the backup nodes and the primary node participating in the consensus perform the consensus consistently based on the different new block;

when determining that the first proposal digest does not match the second proposal digest:

determining that the blockchain has forked, and

skipping consensus on the consensus proposal to avoid wasting computing resources on proposal digest matching; and

wherein the first newest block hash and the second newest block hash are hash values of N blocks preceding newest blocks in distributed ledgers of the blockchain respectively maintained by the primary node and one of the backup nodes, and N is a positive integer.

16. The system according to claim 15 , wherein:

the first newest block hash is a hash value of a preceding block of a newest block in a distributed ledger of the blockchain maintained by the primary node; and

the second newest block hash is a hash value of a preceding block of a newest block in a distributed ledger of the blockchain maintained by the backup node.

17. The system according to claim 15 , wherein the first proposal digest is generated based on the first newest block hash and a first transaction hash of the transaction set determined by the primary node.

18. The system according to claim 17 , wherein:

the consensus proposal further comprises the transaction set, and the generating a second proposal digest based on the second newest block hash and the transaction set comprises:

generating the second proposal digest based on a second transaction hash of the transaction set in the consensus proposal and the second newest block hash.

19. The system according to claim 18 , wherein:

the first transaction hash is a root hash value of a Merkle tree corresponding to the transaction set determined by the primary node; and

the second transaction hash is a root hash value of a Merkle tree corresponding to the transaction set in the consensus proposal determined by the backup node.

20. The system according to claim 18 , wherein the first proposal digest carries the first transaction hash, and before the generating a second proposal digest, the operations further comprises:

skipping the consensus on the consensus proposal if the backup node determines that the first transaction hash does not match the second transaction hash; or

continuing to perform the step of generating a second proposal digest if the backup node determines that the first transaction hash matches the second transaction hash.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 18, 2021
From: LIAO, XIAOJUN
To: ALIPAY (HANGZHOU) INFORMATION TECHNOLOGY CO., LTD.
Reel/Frame 056588/0634 →
Priority Claims (1)
CN 202010630396.3 · Jul 3, 2020 · national
Continuity (1)
Related Publication 20210314141A1 · Oct 7, 2021