Bitcoin-Cli

如何為 BIP39 使用比特幣資源管理器 (bx)?

  • February 18, 2022

根據 BIP39 創建一個 HD 錢包,改編自Andreas Antonopoulos的 O’Reilly 的Mastering Bitcoin

  1. 生成 32 個十六進製字元的偽隨機數

$ bx seed > entropy

  1. 將隨機數轉換為 12 字助記“句子”進行備份

$ bx hd-mnemonic < entropy > words

  • Q1大概包括校驗和?

$ bx mnemonic-decode < words

  • Q2 為什麼我們需要回去?
  1. 派生根/主密鑰,BIP32 派生密鑰層次結構的基礎

$ bx hd-new < entropy > master

  • Q3 為什麼省略(據說是可選的)密碼作為鹽?
  • Q4 我無權執行bx工具 ATM,是否有顯示*–help*輸出文本的詳細文件?
  • Q5 最後,bx是用於創建新的 BIP39/BIP32 錢包、散列/編碼不同格式等隔離任務的規範 CLI 工具嗎?我對使用 GUI / JS 工具感到有些困惑。

改編自 Andreas Antonopoulos 的 O’Reilly 的 Mastering Bitcoin

請注意,bx 命令集此後發生了顯著變化。

Q1大概包括校驗和?

$ bx seed -b 512 > entropy

$ bx mnemonic-new < entropy > words

$ cat words
injury motor machine bench toy repair thumb mushroom prevent toward expand 
rural then market endorse replace chief frozen forum model click payment fan 
mechanic dwarf hobby want innocent cloud ready violin boy provide faith 
favorite print broom save crowd only tonight track dinner nominee remind obtain 
pulp average

$ bx mnemonic-to-seed < words
6705d4927c78a7ef9f409e652d0631214ee0757b44cd3de434f3c0f1a9d7e52f
5be3face8ee9092409f2eebb283a091601934b89939bcef0633bc9a646f8ef81

筆記

  • 上述結果與https://iancoleman.io/bip39/一致
  • “紙漿”和“平均”這兩個詞都是可接受的字典詞。助記符 AFAIK 中允許重複單詞。我們可以使用它來測試校驗和。
$ sed 's/average/pulp/' words | bx mnemonic-to-seed
WARNING: The specified words are not a valid mnemonic in any supported 
dictionary.
cc546ef85e654fdefb6bd37ffec86ae5c5f1a0e9a28e1a252368510e6d05945f
35ebb8538a6c676fe72780390c33a4eeb5851da554061015fcbae4b96ad2fdaa

我想這個警告可能是因為我引起的校驗和失敗。


Q2 為什麼我們需要回去?

錢包恢復?


Q3 為什麼省略(據說是可選的)密碼作為鹽?

因為它是可選的?

$ bx mnemonic-to-seed -h

Usage: bx mnemonic-to-seed [-h] [--config value] [--language value]
[--passphrase value] [WORD]...

Info: Convert a mnemonic seed (BIP39) to its numeric representation.

Options (named):

-c [--config]        The path to the configuration settings file.
-h [--help]          Get a description and instructions for this command.
-l [--language]      The language identifier of the dictionary of the
                    mnemonic. Options are 'en', 'es', 'fr', 'it', 'ja',
                    'cs', 'ru', 'uk', 'zh_Hans', 'zh_Hant' and 'any',
                    defaults to 'any'.
-p [--passphrase]    An optional passphrase for converting the mnemonic
                    to a seed.

Arguments (positional):

WORD                 The set of words that that make up the mnemonic. If
                    not specified the words are read from STDIN.

Q4 是否有顯示 –help 輸出文本的詳細文件?

<https://github.com/libbitcoin/libbitcoin-explorer>說

文件可在 wiki 上找到。

它是什麼。


Q5 是規範的 CLI 工具

不知道,對不起。

我猜您的意思是“最受歡迎”,因為比特幣中實際上沒有任何立法者可以製定教規。至少,不是關於您應該使用哪些實現。

有些工具似乎很受歡迎,但我不知道有任何可靠的調查結果。

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