区块难度

![[Pasted image 20240427095825.png]]
注意:Hd为父区块,为该区块链当前的最后一个区块
![[Pasted image 20240427100426.png]]

  • 调整难度都是父区块难度的整数倍进行调整的
  • ![[Pasted image 20240427100833.png]]
  • ![[Pasted image 20240427100949.png]]
  • 原因:
    • 减小转入POS协议的阻力
      • 在挖矿后期挖矿难度巨大,无法挖矿,让miner愿意迁移到POS协议(权益证明)
      • Hi开始没有,是后来分叉得到的
      • ![[Pasted image 20240427101738.png]]

以太坊发展的四个阶段![[Pasted image 20240427101817.png]]

具体代码实现

![[Pasted image 20240427102046.png]]![[Pasted image 20240427102236.png]]![[Pasted image 20240427102432.png]]