Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the differences between BBFT and FBFT/HotStuff

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "what is the difference between BBFT and FBFT/HotStuff". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Preface

Recently, the BYTOM technical team released the Bystack block chain BaaS platform, which includes the side chain consensus algorithm BBFT (Bystack Byzantine Fault Tolerance). In this article, the author will explain the problems that the original chain BBFT tries to solve and analyze the main differences between BBFT and other consensus agreements. BBFT is a variant of PBFT, and its principle is the same as PBFT. If you want to deeply understand the ingenuity of BBFT, you must enter the context of PBFT. Long before blockchain became popular with bitcoin, PBFT existed in the world as a consensus protocol. Invented by Castro and Liskov in 1999, it is a classic design with a history of 20 years. It is invented to solve a classical problem in distributed systems: the Byzantine General problem. To this day, PBFT still contains a lot of clever ideas worth deliberating over and over again, constantly inspiring future generations to invent better agreements.

The basic operation flow of PBFT

PBFT is a three-phase protocol with two rounds of voting. Each View has a specific node as the leader node (Primary/Leader), which is responsible for notifying all nodes to enter the voting process. Each node will go through the three stages of Pre-prepare/Prepare/Commit, and decide whether to vote / proceed to the next stage according to the message received. After each node has voted, the message will be sent to all other nodes. If each node reaches a majority consensus after two-stage voting, each node can update the status of the machine and end the round. Horizon transformation (View-change) is performed only when the majority of nodes initiate. When the current leader node does not perform the task normally, it can replace the current leader node and ensure the normal operation of the protocol.

Characteristics of PBFT

PBFT and Nakamoto Satoshi consensus (blockchain) have quite different characteristics: PBFT is a licensed, leader node-based, communication-based consensus agreement with security over activity.

Permissioned: PBFT is not completely open because PBFT needs to enable nodes to authenticate each other's messages and accurately control the number of nodes, while blockchains belong to a Permissionless that is open to anyone.

Based on the leader node (Leader-based): that is, the leader node (Leader) is decided first, and then the leader node sends the proposal. The most direct advantage of this is that there is no need to waste one's own computing resources to strive for the opportunity to be the leader node. However, the disadvantage is that the leader node is rotated only when the horizon is changed, and the opportunity to become the leader node is unfair, and there is a lack of incentive to join the network. On the other hand, the block chain selects the block with the most difficult work proof as the consensus among several proposals. although this will result in a waste of computing resources, the probability of becoming a chunk is roughly fair, which is proportional to the power of calculation.

Communication-based (Communication-based): PBFT's security is based on three-stage voting, and although it does not have to consume as much computing resources as work proof, a large number of communications also cause scalability bottlenecks-even the most practical PBFT cannot scale to more than 1000 nodes. Not only that, PBFT uses message authentication code (MAC), each round of voting requires each node to verify the message, and a large number of signatures / verifications is another potential bottleneck.

Security is more important than active (Safety over Liveness): PBFT can ensure security under any network assumptions (synchronous / asynchronous), and it is almost impossible to bifurcate, so it has the characteristic of real-time Instant Finality. On the other hand, the activity of the block chain is more important than the security, and its security depends on the synchronous network, and the situation with multiple consensus (and bifurcation) is also quite common. it is necessary to go through a certain number of block "confirmation" to ensure that the probability of no longer bifurcation is large enough.

The problem with PBFT

First of all, each node in PBFT needs to communicate with NMurn in each round of voting. Assuming that n is 1000, then each consensus requires at least 100000 communications. Although PBFT is already the most practical protocol in the BFT family, such a huge communication demand is still the bottleneck of expansion.

How to improve efficiency?

Aggregate signature

To improve efficiency, an intuitive idea is to avoid nmurn communications. We can designate a node in the network as the coordinator to send / receive the vote of each node, so that each node only needs to send a message to the coordinator, thus avoiding the communication of nmurn. However, in such a situation, the coordinator is likely to do evil, because the coordinator can perform the next round of voting or status updates before actually receiving a specified number of messages. Therefore, we can use the threshold signature (Threshold Signature) to ensure the proper behavior of the coordinator, and the threshold signature can guarantee that it is necessary to gather the signatures that exceed the threshold (t-of-n) to be effective. In other words, we can specify that only when the coordinator gathers the 2f+1 threshold to sign, the coordinator can continue to advance the consensus with a legitimate signature. Harmony FBFT is a BFT family protocol that uses aggregate signatures to improve efficiency.

Figure 1:FBFT Signature Aggregation

Pipeline design

Each content must go through two rounds of voting / three stages to reach a consensus, and if there are m content, 2m votes need to be carried out. Pipeline design (Pipelining) can reduce the number of votes, its basic idea is as follows: let each node vote in the prepare phase of round I, but also for the commit phase of its previous content iMel 1. By doing so, the redundancy of repeated voting for the same content can be saved and the efficiency can be greatly improved. This idea was first seen in the HotStuff agreement published in 2018.

Figure 2:HotStuff Pipelining

Only some nodes are allowed to participate in the consensus: minimum spanning tree

Another way to improve efficiency is to avoid involving all nodes in consensus, which is exactly the approach adopted by the original chain BBFT. In BBFT, there are three kinds of nodes: Consensus Node/Gateway Node/Leader Node, these nodes form the structure of the tree, and the tree is the minimum spanning tree (Minimal Spanning Tree) of the nodes in the network, which may be obtained by distributed algorithms or provided by external services. The node of the leaf is Consensus Node;, the root is Leader Node;, and the rest is Gateway Node. Each node has its own task: Consensus Node is responsible for voting; Gateway Node does not need to vote, but must be responsible for aggregating signatures sent by Consensus Node; Leader Node is responsible for exchanging messages with other Leader Node. The operation process of BBFT is shown in the following figure. The consensus process of BBFT is the process of spreading messages from roots to leaves and back to roots.

Figure 3:BBFT: Minimal Spanning Tree

Figure 4:BBFT Process

How to ensure correctness (Safety and Liveness)?

While bringing new technologies to PBFT to improve efficiency, it is also necessary to ensure the security and activity of the protocol itself. Let's take a look at how the above agreement ensures both.

Field of View Transformation (View-change)

FBFT follows the horizon transformation of PBFT, that is, under normal circumstances, the leader node is not replaced, and only when more than 2f+1 nodes initiate the horizon transformation will the leader node be changed. Although the horizon transformation itself is a mechanism that can replace the evil leader node, it also requires that the protocol must have three stages in order to ensure the security of the protocol (that is, no bifurcation).

Leadership Node rotation (Rotating Leader)

On the other hand, HotStuff introduces the mechanism of leader node rotation, which changes the leader node in each round, so as to avoid the high communication cost of horizon transformation. Leader node rotation is also common in many BFT family protocols, which is the mainstream of the current security mechanism.

Hybrid (Hybrid)

Compared with the original chain BBFT, it takes the strong points of each family, and applies the horizon transformation and the rotation of leadership nodes, which is equivalent to double insurance. However, it is worth noting that the current BBFT technical white paper only has an one-round voting model, and does not propose a two-round voting / three-stage consensus model. In addition, the order of leadership node rotation will also be based on the rights and interests of each node (Stake), if the node violates the protocol, the node will be punished.

This is the end of the content of "what's the difference between BBFT and FBFT/HotStuff". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report