图1 区块链共识过程的基础模型
1
Practical Byzantine fault‑tolerant (pBFT)
-
请求阶段(request): 请求端C发送请求到主节点,这里主节点是0;
-
预准备阶段(pre-prepare):服务端0收到C的请求后进行广播,扩散至服务端123;
-
准备阶段(prepare): 服务端123收到后记录并再次广播,1->023,2->013,3因为宕机无法广播;
-
提交阶段(commit): 服务端0123节点在Prepare阶段,若收到超过一定数量的相同请求,则进入Commit阶段,广播Commit请求;
-
回复(reply): 0123节点在Commit阶段,若收到超过一定数量的相同请求,则对C进行反馈。
图2 PBFT 算法流程
2
Proof of work (PoW)
图3 POW算法流程
3
Proof of stake (PoS)
图4 POS算法流程
4
Proof of burn (PoB)
5
Proof of capacity (PoC)
-
绘图:矿工使用 Shabal 哈希函数创建一系列预先计算的哈希值并将其存储在硬盘上。这个绘图过程是一次性的,且根据硬盘的大小,绘制周期也将不同,一般为几天甚至数周。哈希值被分组为“scoops”,每个scoop由两个相邻的哈希值组成。
-
挖矿:挖矿需要计算scoop数,并将其应用于存储在硬盘驱动器上的每个nonce值,以确定一个 "截止日期 "值。如果在该时间段内没有其他人创建新区块,矿工就会选择截止日期最短的 nonce 并使用它来创建新区块。如果矿工在截止日期前创建了区块,就会获得区块奖励。
6
Proof of activity (PoA)
-
每个矿工先利用自身算力通过工作量证明机制后得出nonce并生成一个空区块头,这个区块头除了没有交易信息数据外其他数据与正常区块一致。
-
最先生成空区块的节点广播全网节点,全网节点接收到消息后,将此区块的hash值与上一区块的hash值进行拼接,然后加上n个固定后缀值进行再hash,最后得出n个值作为输入,进入follow-the-satoshi程序,然后可输出n个随机权益持有者。拥有大量加密货币的矿工被选为签名者的机会更高。
-
前n-1个随机权益持有者对空区块进行签名,第n个随机权益持有者即为获取到记账权的节点,他将在空区块的基础上添加交易数据与签名。
-
第n个随机权益持有者将打包好的区块广播全网,全网节点接收到区块后进行验证,验证成功后上链。
-
产生空区块的矿工与第n个随机权益持有者以及前n-1个已签名的随机权益持有者共享交易费奖励。
7
Delegate proof of stake (DPoS)
参考文献
[1] Miguel Castro, Barbara Liskov, et al. Practical byzantine fault tolerance. In OsDI, volume 99, pages 173–186, 1999.
[2] Shixiong Jin, X Zhang, J Ge, HB Shi, Y Sun, M Li, YM Lin, and ZJ Yao. Overview of blockchain consensus algorithm. Journal of Information Security, 6(2):85–100, 2021.
[3] Chaya Ganesh, Claudio Orlandi, and Daniel Tschudi. Proof-of-stake protocols for privacy-aware blockchains. In Advances in Cryptology–EUROCRYPT 2019: 38th Annual International Conference on the Theory and Applications of Cryptographic Techniques, Darmstadt, Germany, May 19–23, 2019, Proceedings, Part I 38, pages 690–719. Springer, 2019.
[4] Kostis Karantias, Aggelos Kiayias, and Dionysis Zindros. Proof-of-burn. In Financial Cryptography and Data Security: 24th International Conference, FC 2020, Kota Kinabalu, Malaysia, February 10–14, 2020 Revised Selected Papers 24, pages 523–540. Springer, 2020.
[5] Shubhani Aggarwal and Neeraj Kumar. Cryptographic consensus mechanisms. In Advances in Computers, volume 121, pages 211–226. Elsevier, 2021.
[6] Manpreet Kaur, Mohammad Zubair Khan, Shikha Gupta, Abdulfattah Noorwali, Chinmay Chakraborty, and Subhendu Kumar Pani. Mbcp: Performance analysis of large scale mainstream blockchain consensus protocols. IEEE Access, 9:80931–80944, 2021.
[7] Fan Yang, Wei Zhou, QingQing Wu, Rui Long, Neal N Xiong, and Meiqi Zhou. Delegated proof of stake with downgrade: A secure and efficient blockchain consensus algorithm with downgrade mechanism. IEEE Access, 7:118541–118555, 2019.
中国保密协会
科学技术分会
长按扫码关注我们
作者:谭玉乐 中国科学院信息工程研究所
责编:夏天天
2023年精彩文章
TOP5回顾
近期精彩
文章回顾
原文始发于微信公众号(中国保密协会科学技术分会):区块链的共识算法
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论