# 实用拜占庭容错

**实用拜占庭容错**（Practical Byzantine Fault Tolerance，PBFT）是麻省理工学院（MIT）的米格尔·卡斯特罗（Miguel Castro）和芭芭拉·利斯科夫（Barbara Liskov）于1999年发表的一种状态机复制算法，它使分布式服务即使在某些副本表现出任意行为（包括恶意行为）时仍能正确运行。它是首个为达到真实系统所需速度而设计的[拜占庭容错](https://www.edgepedia.org/zh/byzantine-fault-tolerance)复制算法：在互联网等异步环境中是安全的，其优化将响应时间缩短至早期算法的十分之一以下。<sup>[1](https://www.usenix.org/conference/osdi-99/presentation/practical-byzantine-fault-tolerance)</sup>

| 关键事实 | 详情 |
|---|---|
| 起源 | OSDI '99 论文《实用拜占庭容错》，1999年2月24日，麻省理工学院的米格尔·卡斯特罗和芭芭拉·利斯科夫<sup>[1](https://www.usenix.org/conference/osdi-99/presentation/practical-byzantine-fault-tolerance)</sup> |
| 故障模型 | 以3f+1个副本容忍f个拜占庭（任意行为）故障，被称为最优<sup>[2](https://people.eecs.berkeley.edu/~istoica/classes/cs268/06/notes/BFT-osdi99x6.pdf)</sup> |
| 网络模型 | 异步系统中保证安全性；活性仅需消息延迟存在未知的最终界限<sup>[2](https://people.eecs.berkeley.edu/~istoica/classes/cs268/06/notes/BFT-osdi99x6.pdf)</sup> |
| 消息复杂度 | 每次共识决策O(n²)，这是容忍任意故障的代价<sup>[3](https://github.com/jdh847/bft-consensus-bench)</sup> |
| 实测开销 | 基于PBFT构建的拜占庭容错NFS服务仅比标准无副本NFS慢3%<sup>[1](https://www.usenix.org/conference/osdi-99/presentation/practical-byzantine-fault-tolerance)</sup> |
| 期刊版本 | 卡斯特罗和利斯科夫，《ACM计算机系统汇刊》20(4):398–461，2002年11月，增加了主动恢复和针对故障客户端的防御机制<sup>[4](https://www.researchgate.net/publication/220439244_Practical_Byzantine_Fault_Tolerance_and_Proactive_Recovery)</sup> |

## 为何需要拜占庭容错

传统容错假定进程以停止或跳过步骤的方式失败。拜占庭容错不对故障行为做任何假设：故障节点可能向不同节点发送相互矛盾的信息，无论原因是软件缺陷、操作失误还是恶意攻击。卡斯特罗和利斯科夫认为这种容错日益重要，因为恶意攻击和软件错误越来越常见，可能导致故障节点表现出任意行为。<sup>[1](https://www.usenix.org/conference/osdi-99/presentation/practical-byzantine-fault-tolerance)</sup><sup> • </sup><sup>[2](https://people.eecs.berkeley.edu/~istoica/classes/cs268/06/notes/BFT-osdi99x6.pdf)</sup>

早期的拜占庭协议大多停留在理论层面，实现极少，正确性依赖同步性（攻击者可通过延迟节点或通信来破坏），而且速度慢。PBFT所声明的贡献是在这三个方面都实现实用性：异步系统中的正确性、攻击下的活性，以及速度。<sup>[2](https://people.eecs.berkeley.edu/~istoica/classes/cs268/06/notes/BFT-osdi99x6.pdf)</sup>

## 算法工作原理

PBFT将服务复制到一组副本上，使客户端发送请求和接收回复就如同与一个正确的集中式服务交互。其安全属性是线性一致性的一种形式，因原始定义不适用于[拜占庭故障](https://www.edgepedia.org/zh/byzantine-fault)客户端而做了修改。<sup>[5](https://pages.cs.wisc.edu/~remzi/Classes/739/Spring2004/Papers/p398-castro.pdf)</sup>

该协议基于投票：主节点在给定时间分配序列号，但副本通过法定人数检查集体提交请求，每个副本执行已提交的请求，副本之间交换大量点对点消息以就请求有效且未被篡改达成一致。<sup>[17](https://pages.cs.wisc.edu/~remzi/Classes/739/Fall2018/Papers/p398-castro.pdf)</sup> 在通用算法中，客户端向所有节点发送请求，节点交换消息进行验证，一旦足够多的节点达成一致，操作即被执行，匹配的回复返回给客户端，客户端在收到足够数量的匹配回复后才接受结果。<sup>[6](https://github.com/hyperledger-archives/sawtooth-rfcs/blob/main/text/0019-pbft-consensus.md)</sup>

**三阶段与检查点。** 核心共识消息为预准备（PrePrepare）、准备（Prepare）和提交（Commit），对每个请求按此顺序发出；检查点（Checkpoint）消息使副本能够安全地丢弃旧日志条目，并就一个稳定检查点达成一致，该检查点为视图切换提供状态信息。<sup>[6](https://github.com/hyperledger-archives/sawtooth-rfcs/blob/main/text/0019-pbft-consensus.md)</sup><sup> • </sup><sup>[7](https://cybersecurity.seas.wustl.edu/ning/paper/consensus19.pdf)</sup> 视图是某个主节点负责的时期，对于视图号v和n个节点，主节点编号为p = v mod n。<sup>[6](https://github.com/hyperledger-archives/sawtooth-rfcs/blob/main/text/0019-pbft-consensus.md)</sup>

**视图切换。** 当副本怀疑主节点故障时——例如计时器超时而没有进展——它们触发视图切换以替换主节点。视图切换消息携带一组2f+1个检查点消息，证明其所引用的稳定检查点的正确性。《ACM计算综述》的综述将这一机制描述为验证者认为当前视图无法取得进展时触发。<sup>[6](https://github.com/hyperledger-archives/sawtooth-rfcs/blob/main/text/0019-pbft-consensus.md)</sup><sup> • </sup><sup>[8](https://doi.org/10.1145/3579845)</sup>

**副本数量。** PBFT需要N ≥ 3f+1个副本，以在部分同步网络中容忍f个故障或拜占庭节点。<sup>[9](https://www.mdpi.com/2079-9292/12/18/3801)</sup> Sawtooth RFC给出了相同的界限，即n个节点中最多floor((n−1)/3)个故障节点，并指出PBFT本身也具有崩溃容错能力。<sup>[6](https://github.com/hyperledger-archives/sawtooth-rfcs/blob/main/text/0019-pbft-consensus.md)</sup> 一个推论是，通常需要3f+1个节点来保持拜占庭容错，除非采取特殊措施确保点对点消息和序列计数器的真实性。<sup>[6](https://github.com/hyperledger-archives/sawtooth-rfcs/blob/main/text/0019-pbft-consensus.md)</sup>

## 性能与开销

原始实现证明了该设计是实用的。作者构建了BFS——一个拜占庭容错的NFS服务——实测仅比标准无副本NFS慢3%。<sup>[1](https://www.usenix.org/conference/osdi-99/presentation/practical-byzantine-fault-tolerance)</sup> 2002年的期刊版本扩展了算法，增加了副本的主动恢复和防御拜占庭故障客户端的机制，同时保持正常运行时的安全性和活性。<sup>[4](https://www.researchgate.net/publication/220439244_Practical_Byzantine_Fault_Tolerance_and_Proactive_Recovery)</sup>

主要开销在于通信。在一项受控基准测试中，PBFT、HotStuff和Raft在同一模拟网络上通过统一接口运行，3个节点且无拜占庭故障的PBFT每次操作耗时4.4微秒，发送7,000条消息；5个节点容忍1个拜占庭故障时为9.5微秒和22,000条消息；7个节点容忍2个拜占庭故障时为14.1微秒和45,000条消息。该基准测试将PBFT的O(n²)消息复杂度归因于容忍任意故障的代价。<sup>[3](https://github.com/jdh847/bft-consensus-bench)</sup>

## 影响与后继者

PBFT成为后来拜占庭容错共识的参照基准。《ACM计算综述》2024年的一篇系统综述将其视为基础性的部分同步BFT算法，与HotStuff、PALA以及首个实用异步BFT协议HoneyBadgerBFT等后继者并列。<sup>[8](https://doi.org/10.1145/3579845)</sup><sup> • </sup><sup>[10](https://portal.fis.tum.de/en/publications/reaching-consensus-in-the-byzantine-empire-a-comprehensive-review/)</sup>

**HotStuff。** HotStuff采用星形拓扑使副本通过领导者通信，将消息复杂度降至O(n)，并普遍使用数字签名，而BFT-SMaRt等两阶段PBFT变体使用MAC进行投票。尽管多一个阶段，三阶段HotStuff的延迟与BFT-SMaRt相近，而吞吐量更优。<sup>[11](https://reitermk.github.io/papers/2019/PODC.pdf)</sup> 在上述受控基准测试中，7个节点容忍2个拜占庭故障的HotStuff每次操作约5.0微秒，发送约10,000条消息，而PBFT为14.1微秒和45,000条消息。<sup>[3](https://github.com/jdh847/bft-consensus-bench)</sup>

**区块链与许可制系统。** PBFT式共识用于验证者集合已知的许可制场景。Hyperledger Sawtooth指定了一个改编自1999年论文的PBFT共识引擎，指出已提交的区块是最终的，因此网络不会分叉，由最终化时附加的“共识封印”验证。<sup>[6](https://github.com/hyperledger-archives/sawtooth-rfcs/blob/main/text/0019-pbft-consensus.md)</sup> 使用PBFT、IBFT和Raft等协议的许可链可达到每秒1,000至10,000+笔交易的吞吐量，远高于公链的限制，适合银行、供应链和医疗部署。<sup>[12](https://everstake.com/resources/blog/private-blockchain-architecture-use-cases)</sup> 意大利央行（Banca d'Italia）的一个央行数字账本设计将PBFT算法与FROST阈值签名方案结合，用于保密法定人数证书。<sup>[13](https://www.bancaditalia.it/pubblicazioni/mercati-infrastrutture-e-sistemi-di-pagamento/approfondimenti/2024-050/index.html?com.dotmarketing.htmlpage.language=1)</sup>

**衍生研究。** 后来的协议保持PBFT的故障模型，同时攻克其扩展性限制：ProBFT是一种基于领导者的概率协议，面向许可制部分同步系统，消息复杂度为O(n√n)；<sup>[14](https://arxiv.org/abs/2405.04606)</sup> P-HotStuff针对基于领导者的吞吐量瓶颈，指出PBFT等经典算法在副本计时器超时前保持固定领导者。<sup>[15](https://www.sciencedirect.com/science/article/pii/S1389128625001513)</sup> 2023年的一篇综述将PBFT描述为区块链技术发展中的基本共识协议之一。<sup>[16](https://arxiv.org/abs/2306.10960)</sup>

## References

1. [Practical Byzantine Fault Tolerance, USENIX OSDI '99 presentation page](https://www.usenix.org/conference/osdi-99/presentation/practical-byzantine-fault-tolerance)
2. [Practical Byzantine Fault Tolerance, Castro and Liskov talk slides, UC Berkeley CS268 notes](https://people.eecs.berkeley.edu/~istoica/classes/cs268/06/notes/BFT-osdi99x6.pdf)
3. [bft-consensus-bench: PBFT, HotStuff and Raft benchmarked on the same simulated network, GitHub](https://github.com/jdh847/bft-consensus-bench)
4. [Castro and Liskov (2002). Practical Byzantine Fault Tolerance and Proactive Recovery, ACM Transactions on Computer Systems 20(4)](https://www.researchgate.net/publication/220439244_Practical_Byzantine_Fault_Tolerance_and_Proactive_Recovery)
5. [practical byzantine fault tolerance](https://pages.cs.wisc.edu/~remzi/Classes/739/Spring2004/Papers/p398-castro.pdf)
6. [Hyperledger Sawtooth RFC 0019: PBFT consensus](https://github.com/hyperledger-archives/sawtooth-rfcs/blob/main/text/0019-pbft-consensus.md)
7. [PBFT normal operation and checkpoint protocol, Washington University in St. Louis](https://cybersecurity.seas.wustl.edu/ning/paper/consensus19.pdf)
8. [A Survey of Blockchain Consensus Protocols, ACM Computing Surveys](https://doi.org/10.1145/3579845)
9. [Byzantine Fault-Tolerant Consensus Algorithms: A Survey, MDPI Electronics 12(18):3801](https://www.mdpi.com/2079-9292/12/18/3801)
10. [Zhang et al. (2024). Reaching Consensus in the Byzantine Empire: A Comprehensive Review of BFT Consensus Algorithms, ACM Computing Surveys 56(5)](https://portal.fis.tum.de/en/publications/reaching-consensus-in-the-byzantine-empire-a-comprehensive-review/)
11. [Yin et al. (2019). HotStuff: BFT Consensus with Linearity and Responsiveness, PODC 2019](https://reitermk.github.io/papers/2019/PODC.pdf)
12. [What Is a Private Blockchain: Architecture and Use Cases, Everstake](https://everstake.com/resources/blog/private-blockchain-architecture-use-cases)
13. [Banca d'Italia Mercati, infrastrutture e sistemi di pagamento No. 50: Byzantine Fault Tolerant consensus with confidential quorum certificate for a Central Bank DLT](https://www.bancaditalia.it/pubblicazioni/mercati-infrastrutture-e-sistemi-di-pagamento/approfondimenti/2024-050/index.html?com.dotmarketing.htmlpage.language=1)
14. [Probabilistic Byzantine Fault Tolerance (Extended Version), arXiv:2405.04606](https://arxiv.org/abs/2405.04606)
15. [P-HotStuff: Parallel BFT algorithm with throughput insensitive to propagation delay, Computer Networks](https://www.sciencedirect.com/science/article/pii/S1389128625001513)
16. [Performance and Reliability Analysis for Practical Byzantine Fault Tolerance with Repairable Voting Nodes, arXiv:2306.10960](https://arxiv.org/abs/2306.10960)
17. [pages.cs.wisc.edu](https://pages.cs.wisc.edu/~remzi/Classes/739/Fall2018/Papers/p398-castro.pdf)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 软件与编程 › Concurrency and distributed systems

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/practical-byzantine-fault-tolerance

English original: https://www.edgepedia.org/practical-byzantine-fault-tolerance
