广西师范大学学报(自然科学版) ›› 2024, Vol. 42 ›› Issue (3): 121-130.doi: 10.16088/j.issn.1001-6600.2023100805

• 研究论文 • 上一篇    下一篇

基于Raft的多主节点拜占庭容错共识机制

李莉*, 李昊泽, 李涛   

  1. 东北林业大学 计算机与控制工程学院, 黑龙江 哈尔滨 150040
  • 收稿日期:2023-10-08 修回日期:2023-12-16 发布日期:2024-05-31
  • 通讯作者: 李莉(1977—), 女, 河南孟州人, 东北林业大学教授, 博士。E-mail: lli@nefu.edu.cn
  • 基金资助:
    黑龙江省重点研发计划项目(2022ZX01A30)

Multi-primary-node Byzantine Fault-Tolerant Consensus Mechanism Based on Raft

LI Li*, LI Haoze, LI Tao   

  1. College of Information and Computer Engineering, Northeast Forestry University, Harbin Heilongjiang 150040, China
  • Received:2023-10-08 Revised:2023-12-16 Published:2024-05-31

摘要: 为了解决联盟链中实用拜占庭容错(PBFT)共识机制在区块链网络中节点数量增多的情况下,通信复杂度高、共识效率低下等问题,本文提出一种基于Raft的多主节点拜占庭容错共识机制IMRBFT。IMRBFT通过Maglev一致性哈希算法对区块链网络节点均匀分组,将这个共识流程分成组外共识和组内共识2部分。组内先选出领导者节点,通过信用机制将节点分为3个等级:可信节点、普通节点和不可信节点。与投票机制共同降低恶意节点成为领导者节点的概率,并与其他组的领导者节点组成委员会,委员会再经过组外信用值机制选出信用值最高的多个主节点进行组外PBFT共识。组内共识在Raft共识的基础上引入监管节点与中继节点,进一步提升安全性与共识效率,减少恶意节点的作恶行为。实验结果表明:IMRBFT的通信开销为线性增长,通信量为PBFT的41.6%,吞吐量为PBFT的4.2倍,共识延时降低76.4%。随着节点增多,优化更加明显,完全满足大型区块链网络的通信复杂度小、吞吐量高、共识延时短、安全性与共识效率高的要求。

关键词: 区块链, 共识机制, 节点分组, 信用机制, 拜占庭容错, Raft算法

Abstract: In order to solve the problems of high communication complexity and low consensus efficiency of practical Byzantine fault-tolerant (PBFT) consensus mechanism in the consortium chain under the condition of increasing number of nodes in the blockchain network, a multi-primary-node Byzantine fault-tolerant consensus mechanism based on Raft IMRBFT is proposed. Firstly, the Maglev consensus hash algorithm is used to evenly group the nodes of the blockchain network, and the consensus process is divided into two parts: out-of-group consensus and intra-group consensus. The leader node is first selected in the group, and the node is divided into three levels through the credit mechanism: trusted node, ordinary node and untrusted node. Together with the voting mechanism, it reduces the probability of malicious nodes becoming leader nodes, and forms a committee with other group leader nodes, and the committee selects multiple primary nodes with the highest credit value through the external credit value mechanism to conduct PBFT consensus outside the group. On the basis of Raft consensus, intra-group consensus introduces supervision nodes and relay nodes to further improve security and consensus efficiency and reduce the evil behavior of malicious nodes. Finally, the experimental results show that the communication overhead of IMRBFT increases linearly, the traffic volume is 41.6% of PBFT, the throughput is 4.2 times that of PBFT, and the consensus delay is reduced by 76.4%. With the increase of nodes, the optimization is more obvious, which fully meets the requirements of small communication complexity, high throughput, short consensus delay, and high security and consensus efficiency of large-scale blockchain networks.

Key words: blockchain, consensus mechanism, node grouping, credit mechanisms, Byzantine tolerance, Raft algorithm

中图分类号:  TP311.13

[1] NAKAMOTO S. Bitcoin: a peer-to-peer electronic cash system[EB/OL]. (2008-10-31)[2023-10-08]. https://nakamotoinstitute.org/bitcoin/.
[2] 邵奇峰, 金澈清, 张召, 等. 区块链技术: 架构及进展[J]. 计算机学报, 2018, 41(5): 969-988. DOI: 10.11897/SP.J.1016.2018.00969.
[3] 林小驰, 胡叶倩雯. 关于区块链技术的研究综述[J]. 金融市场研究, 2016(2): 97-109.
[4] DASHKEVICH N, COUNSELL S, DESTEFANIS G. Blockchain application for central banks: a systematic mapping study[J]. IEEE Access, 2020, 8: 139918-139952. DOI: 10.1109/ACCESS.2020.3012295.
[5] MALIBARI N A. A survey on blockchain-based applications in education[C]// 2020 7th International Conference on Computing for Sustainable Global Development (INDIACom). Piscataway, NJ: IEEE, 2020: 266-270. DOI: 10.23919/INDIACom49435.2020.9083714.
[6] TARIQ N, QAMAR A, ASIM M, et al. Blockchain and smart healthcare security: a survey[J]. Procedia Computer Science, 2020, 175: 615-620. DOI: 10.1016/j.procs.2020.07.089.
[7] 汪传雷, 万一荻, 秦琴, 等. 基于区块链的供应链物流信息生态圈模型[J]. 情报理论与实践, 2017, 40(7): 115-121. DOI: 10.16353/j.cnki.1000-7490.2017.07.021.
[8] 蔡晓晴, 邓尧, 张亮, 等. 区块链原理及其核心技术[J]. 计算机学报, 2021, 44(1): 84-131. DOI: 10.11897/SP.J.1016.2021.00084.
[9] 张亮, 刘百祥, 张如意, 等. 区块链技术综述[J]. 计算机工程, 2019, 45(5): 1-12. DOI: 10.19678/j.issn.1000-3428.0053554.
[10] 曾诗钦, 霍如, 黄韬, 等. 区块链技术研究综述:原理、进展与应用[J]. 通信学报, 2020, 41(1): 134-151. DOI: 10.11959/j.issn.1000-436x.2020027.
[11] BUTERIN V. A next-generation smart contract and decentralized application platform[EB/OL]. (2018-05-31)[2023-10- 08]. https://resources.platform.coop/resources/a-next-generation-smart-contract-and-decentralized-application-platform/.
[12] YANG F, ZHOU W, WU Q Q, et al. Delegated proof of stake with downgrade: a secure and efficient blockchain consensus algorithm with downgrade mechanism[J]. IEEE Access, 2019, 7: 118541-118555. DOI: 10.1109/ACCESS.2019.2935149.
[13] CASTRO M, LISKOV B. Practical byzantine fault tolerance[C]// OSDI'99: Proceedings of the Third Symposium on Operating Systems Design and Implementation. Berkeley, CA: USENIX Association, 1999: 173-186.
[14] ONGARO D, OUSTERHOUT J. In search of an understandable consensus algorithm[C]// USENIX ATC'14: Proceedings of the 2014 USENIX Conference on USENIX Annual Technical Conference. Berkeley, CA: USENIX Association, 2014: 305-320.
[15] WANG Y H, CAI S B, LIN C L, et al. Study of blockchains's consensus mechanism based on credit[J]. IEEE Access, 2019, 7: 10224-10231. DOI: 10.1109/ACCESS.2019.2891065.
[16] 包振山, 王凯旋, 张文博. 基于树形拓扑网络的实用拜占庭容错共识算法[J]. 应用科学学报, 2020, 38(1): 34-50. DOI: 10.3969/j.issn.0255-8297.2020.01.003.
[17] 陈子豪, 李强. 基于K-medoids的改进PBFT共识机制[J]. 计算机科学, 2019, 46(12): 101-107. DOI: 10.11896/jsjkx.181002014.
[18] CHEN J H, ZHANG X, SHANGGUAN P F. Improved PBFT algorithm based on reputation and voting mechanism[J]. Journal of Physics: Conference Series, 2020, 1486(3): 032023. DOI: 10.1088/1742-6596/1486/3/032023.
[19] 黄保华, 屈锡, 郑慧颖, 等.一种基于信用的拜占庭容错共识算法[J]. 信息网络安全, 2022, 22(4): 86-92. DOI: 10.3969/j.issn.1671-1122.2022.04.010.
[20] WANG Y, SONG Z, CHENG T. Improvement research of PBFT consensus algorithm based on credit[C]// Blockchain and Trustworthy Systems. Singapore: Springer Nature Singapore Pte Ltd., 2020: 47-59. DOI: 10.1007/978-981-15-2777-7_4.
[21] 王森, 李志淮, 贾志鹏. 主节点随机选取的改进PBFT共识算法[J]. 计算机应用与软件, 2022, 39(10): 299-306. DOI: 10.3969/j.issn.1000-386x.2022.10.044.
[22] EISENBUD D E, YI C, CONTAVALLI C, et al. Maglev: a fast and reliable software network load balancer[C]// 13th USENIX Symposium on Networked Systems Design and Implementation (NSDI 16). Berkeley, CA: USENIX Association, 2016: 523-535.
[23] BONEH D, GENTRY C, LYNN B, et al. Aggregate and verifiably encrypted signatures from bilinear maps[C]// Advances in Cryptology-EUROCRYPT 2003: LNCS Volume 2656. Berlin: Springer, 2003: 416-432. DOI: 10.1007/3-540-39200-9_26.
[24] YOO H K, YIM J C, KIM S. The blockchain for domain based static sharding[C]// 2018 17th IEEE International Conference on Trust, Security and Privacy in Computing and Communications/12th IEEE International Conference on Big Data Science and Engineering (TrustCom/BigDataSE). Los Alamitos, CA: IEEE Computer Society, 2018: 1689-1692. DOI: 10.1109/TrustCom/BigDataSE.2018.00252.
[25] LUU L, NARAYANAN V, ZHENG C D, et al. A secure sharding protocol for open blockchains[C]// CCS'16: Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security. New York, NY: Association for Computing Machinery, 2016: 17-30. DOI: 10.1145/2976749.2978389.
[26] KARGER D, LEHMAN E, LEIGHTON T, et al. Consistent hashing and random trees: distributed caching protocols for relieving hot spots on the World Wide Web[C]// STOC'97: Proceedings of the twenty-ninth annual ACM symposium on Theory of computing. New York, NY: Association for Computing Machinery, 1997: 654-663. DOI: 10.1145/258533.258660.
[27] LAMPING J, VEACH E. A fast, minimal memory, consistent hash algorithm[EB/OL]. (2014-06-09)[2023-10-08]. https://arxiv.org/abs/1406.2294. DOI: 10.48550/arXiv.1406.2294.
[28] 吴宇森, 刘伊然, 吴沅赛, 等. 基于分组Raft机制的PBFT共识算法改进方案设计[J]. 电子技术与软件工程, 2021(24): 254-258.
[1] 王帆, 王灿, 甘友春, 贺旭辉, 张雪菲, 张羽, 喻亚洲. 基于链上链下协同的多元分布式储能交易机制[J]. 广西师范大学学报(自然科学版), 2024, 42(1): 39-53.
[2] 于枫, 孟令辉, 彭家辉, 李先贤, 瞿斌. 一种基于区块链的物联网数据安全交易方案[J]. 广西师范大学学报(自然科学版), 2023, 41(4): 84-95.
[3] 白尚旺, 马晓倩, 高改梅, 刘春霞, 党伟超. 基于可验证随机函数和BLS签名的拜占庭容错共识算法[J]. 广西师范大学学报(自然科学版), 2022, 40(3): 194-201.
[4] 王涵, 王绪安, 周能, 柳玉东. 基于区块链的可审计数据分享方案[J]. 广西师范大学学报(自然科学版), 2020, 38(2): 1-7.
[5] 陈汹, 朱钰, 封科, 于同伟. 基于区块链的电力系统安全稳定控制终端身份认证[J]. 广西师范大学学报(自然科学版), 2020, 38(2): 8-18.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!
版权所有 © 广西师范大学学报(自然科学版)编辑部
地址:广西桂林市三里店育才路15号 邮编:541004
电话:0773-5857325 E-mail: gxsdzkb@mailbox.gxnu.edu.cn
本系统由北京玛格泰克科技发展有限公司设计开发