Wallet

從 BIP39 種子中獲取主私鑰

  • January 31, 2019

我有 BIP39 種子:

5b56c417303faa3fcba7e57400e120a0ca83ec5a4fc9ffba757fbe63fbd77a89a1a3be4c67196f57c39a88b76373733891bfaba16ed27a813ceed498804c0570

我想獲得主私鑰

然後我必須使用HMAC-SHA512,我可以使用這個站點,我必須添加哪個秘密?我沒有任何秘密,為了測試我選擇“助記符”,我用來生成 BIP39seed 的常量(正確嗎?)

結果是:

9744d0d7e168f725b6cc36a73c24dfc91bd6d80bf5a6871ad2c6c0b854e4e281b74049c41d25f0b338b3fc9b053b87b95636c3c94c31f37458fe98a09a4a94c9

我可以得到

left 256 bits  => 9744d0d7e168f725b6cc36a73c24dfc91bd6d80bf5a6871ad2c6c0b854e4e281
right 256 bits  => b74049c41d25f0b338b3fc9b053b87b95636c3c94c31f37458fe98a09a4a94c9

我可以通過這種方式獲取主私鑰嗎?

PKM = bx ec-to-wif 9744d0d7e168f725b6cc36a73c24dfc91bd6d80bf5a6871ad2c6c0b854e4e281

結果:L2Hku6wzwvWnHAct8TmtfvviE4QXBTXtZrae2buXwjq5mRG4doF2

但是這個結果不在<https://iancoleman.io/bip39/>如果我導入我的助記詞

(陸軍範防禦攜帶嫉妒的真實垃圾聲稱迴聲媒體製造緊縮)

以下是使用 bitcoin-explorer和 Python HMAC命令 從種子創建高畫質錢包的“掌握比特幣”機制。

根種子:

% echo "army van defense carry jealous true garbage claim echo media make crunch" | bx mnemonic-to-seed -p ""

5b56c417303faa3fcba7e57400e120a0ca83ec5a4fc9ffba757fbe63fbd77a89a1a3be4c67196f57c39a88b76373733891bfaba16ed27a813ceed498804c0570

主私鑰:

% echo 5b56c417303faa3fcba7e57400e120a0ca83ec5a4fc9ffba757fbe63fbd77a89a1a3be4c67196f57c39a88b76373733891bfaba16ed27a813ceed498804c0570 | bx base16-decode | hmac --algorithm sha512 --key "Bitcoin seed" - | cut -c 1-64

b2a0d576b828b537688b561f2cfa8dac3602d54c62bde619ad5331e6c235ee26

主公鑰:

% echo 5b56c417303faa3fcba7e57400e120a0ca83ec5a4fc9ffba757fbe63fbd77a89a1a3be4c67196f57c39a88b76373733891bfaba16ed27a813ceed498804c0570 | bx base16-decode | hmac --algorithm sha512 --key "Bitcoin seed" - | cut -c 1-64 | bx ec-to-public

03ca72b45eede592f059b7eaf3da13eb7d8d15aa472b6f79f74820bb22ff596186

鏈碼:

% echo 5b56c417303faa3fcba7e57400e120a0ca83ec5a4fc9ffba757fbe63fbd77a89a1a3be4c67196f57c39a88b76373733891bfaba16ed27a813ceed498804c0570 | bx base16-decode | hmac --algorithm sha512 --key "Bitcoin seed" - | cut -c 65-128

b70d675323c40ec461e0a6af603b1f135fb2af9ae753eeff18922732a73b0f05

引用自:https://bitcoin.stackexchange.com/questions/84116