官术网_书友最值得收藏!

Choosing an algorithm

Choosing a consensus algorithm depends on several factors. It is not only use case-dependent, but some trade-offs may also have to be made to create a system that meets all the requirements without compromising the core safety and liveness properties of the system.

We will discuss some of the main factors that can influence the choice of consensus algorithm. Note that these factors are different from the core safety and liveness properties discussed earlier, which are the fundamental requirements needed to be fulfilled by any consensus mechanism. Other factors that we are going to introduce here are use case-specific and impact the choice of consensus algorithm.

These factors include, but are not limited to finality, speed, performance, and scalability.

Finality

Finality refers to a concept where once a transaction has been completed, it cannot be reverted. In other words, if a transaction has been committed to the blockchain, it won't be revoked or rolled back. This feature is especially important in financial networks, where once a transaction has gone through, the consumer can be confident that the transaction is irrevocable and final. There are two types of finality, probabilistic and deterministic.

Probabilistic finality, as the name suggests, provides a probabilistic guarantee of finality. The assurance that a transaction, once committed to the blockchain, cannot be rolled back builds over time instead of immediately. For example, in Nakamoto consensus, the probability that a transaction will not be rolled back increases as the number of blocks after the transaction commits increases. As the chain grows, the block containing the transaction goes deeper, which increasingly ensures that the transaction won't be rolled back. While this method worked and stood the test of time for many years, it is quite slow. For example, in the Bitcoin network, users usually have to wait for six blocks, which is equivalent to an hour, to get the right level of confidence that a transaction is final. This type of finality might be acceptable in public blockchains. Still, such a delay is not acceptable in financial transactions in a consortium blockchain. In consortium networks, we need immediate finality.

Deterministic finality or immediate finality provides an absolute finality guarantee for a transaction as soon as it is committed in a block. There are no forks or rollbacks, which could result in a transaction rollback. The confidence level of transaction finality is 100 percent as soon as the block that contains the transaction is finalized. This type of finality is provided by fault-tolerant algorithms such as PBFT.

Speed, performance, and scalability

Performance is a significant factor that impacts the choice of consensus algorithms. PoW chains are slower than BFT-based chains. If performance is a crucial requirement, then it is advisable to use voting-based algorithms for permissioned blockchains such as PBFT, which will provide better performance in terms of quicker transaction processing. There is, however, a caveat that needs to be kept in mind here—PBFT-type blockchains do not scale well but provide better performance. On the other hand, PoW-type chains can scale well but are quite slow and do not meet the enterprise-grade performance requirements.

Performance, scalability, and other challenges will be discussed in detail in Chapter 21, Scalability and Other Challenges.

主站蜘蛛池模板: 广西| 武川县| 乐平市| 青神县| 修武县| 巴楚县| 繁昌县| 谢通门县| 翁源县| 托里县| 衡南县| 二连浩特市| 泰顺县| 贵州省| 阿拉善右旗| 桓台县| 江津市| 策勒县| 新乐市| 溧水县| 永丰县| 兰考县| 唐河县| 庆云县| 芜湖县| 安吉县| 常山县| 呼伦贝尔市| 东兴市| 汝城县| 石城县| 新乡市| 江西省| 霸州市| 太白县| 北流市| 栖霞市| 泉州市| 泰兴市| 太原市| 南溪县|