【问题标题】:Understand why Bitcoinlib is generating different addresses than what I have了解为什么 Bitcoinlib 生成的地址与我所拥有的地址不同
【发布时间】:2018-04-15 03:30:34
【问题描述】:

这里是有问题的库https://github.com/1200wd/bitcoinlib

例如,当我尝试使用相同的关键字创建地址时

abs=a.from_passphrase('average title retreat fox hundred wife figure disease dry admit choice volcano')

(示例列表) 我想我知道它使用 bip44 来生成 WIF 和地址,但是当我使用 Ian Coles 助记码转换器https://iancoleman.io/bip39/ 检查地址时 它给出的地址与来自 bitcoinlib 的地址不同。

他们是否各自使用不同的方法来创建地址?有没有办法让 bitcoinlib 从助记词列表中吐出与 Ian Cole 转换器中相同的地址。

【问题讨论】:

    标签: python bitcoin mnemonics cryptocurrency bitcoinlib


    【解决方案1】:

    可能是您混淆了派生路径。在以下示例中,第一个 BIP44 是使用 subkey_for_path 方法派生的。这会产生与https://iancoleman.io/bip39/ 网站上的派生密钥相同的密钥。

    from bitcoinlib.keys import HDKey
    
    passphrase = 'average title retreat fox hundred wife figure disease dry admit choice volcano'
    hdkey = HDKey().from_passphrase(passphrase)
    print(hdkey.subkey_for_path("m/44'/0'/0'/0").wif())
    

    打印密钥:xprvA2JHceND8fsMyVMG1u6cxTTcpizTjEo7ujW8wL74UvajacfKr6M28BbUwaPGGeLzU3zyrrYvzzhFyAapqWVh97KYBzvmyvsHQeR6NTTCmTG

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-27
      • 1970-01-01
      • 2018-09-23
      相关资源
      最近更新 更多