Bitcoin Explorer(bx)是一个命令行工具,提供了各种用于密钥管理和交易构建的命令。 它是libbitcoin比特币库的一部分。
Bitcoin Explorer(bx) is a command line tool that provides a variety of commands for key management and transaction construction. It is part of the Libbitcoin bitcoin bank.
更多信息参见Bitcoin Explorer homepage 和 Bitcoin Explorer user documentation
For more information, see Bitcoin Explorer homepage and Bitcoin Explorer user document
bx命令使用示例
Bx command use example
我们来看一些使用Bitcoin Explorer命令来测试密钥和地址的例子。
Let's see some examples of using Bitcoin Explorer commands to test keys and addresses.
使用种子命令生成随机“种子”值,该种子命令使用操作系统的随机数生成器。 将种子传递到ec-new命令以生成新的私钥。 我们将标准输出保存到文件private_key中:
Use the feed command to generate random "seed" values, which command to use the random number generator of the operating system. Send the torrent to the ec-new command to generate a new private key. We save the standard output to the file private_key:
现在,使用ec-to-public命令从私钥生成公钥。 我们将private_key文件传递到标准输入并将命令的标准输出保存到新文件public_key中:
Now, use the e-to-public command to generate a public key from a private key. We pass the private_key file to the standard input and save the standard output of the command to the new file public_key:
我们可以使用ec-to-address命令将public_key重新格式化为一个地址。 我们将public_key传递给标准输入:
We can reform the public_key as an address using the e-to-address command. We pass the public_key to the standard input:
以这种方式产生的密钥产生零型非确定性钱包。 这意味着每个密钥都是由一个独立的种子生成的。 Bitcoin Explorer命令也可以根据BIP-32确定性地生成密钥。 在这种情况下,从种子创建“主”键,然后确定性地扩展以产生一个子项的树,从而产生一个2类确定性钱包。
Bitcoin Explorer commands can also generate keys based on BIP-32 certainty. In this case, the " master" key is created from the seed, and then the key is expanded with certainty to produce a tree for a sub-item, resulting in a two-category determinative wallet.
首先,我们使用seed和hd-new命令生成一个主密钥,该密钥将被用作导出密钥层次结构的基础:
First, we use the Seed and hd-new commands to generate a key that will be used as the basis for exporting the key hierarchy:
我们现在使用hd-private命令在帐户中生成一个强化的“帐户”键和两个私钥序列:
We are now using the hd-private command to generate an enhanced account key and two private key sequences in the account:
接下来,我们使用hd-public命令来生成两个公钥的相应序列:
Next, we use the hd-public command to generate the corresponding sequence of two public keys:
公钥也可以使用hd-to-public命令从其相应的私钥派生:
Public keys can also be derived from their respective private keys using hd-to-public commands:
我们可以在确定性链中产生几乎无限数量的密钥,全部来源于单个种子。 这种技术用于许多钱包应用程序中以生成可以使用单个种子值进行备份和恢复的密钥。 每次创建一个新的密钥时,这比将其所有随机生成的密钥备份在一起更容易。
This technology is used in many wallet applications to generate keys that can be backed up and restored using individual seed values. Each time a new key is created, it is easier to back up all of its randomly generated keys together.
可以使用助记符编码命令对种子进行编码:
Feeds can be encoded using a sign encoded command:
然后可以使用mnemonic-decode命令对种子进行解码:
The seeds can then be decoded using the mnemonic-decode command:
助记符编码可以使种子更容易记录甚至记住。
The memory code makes it easier to record and even remember seeds.
注册有任何问题请添加 微信:MVIP619 拉你进入群

打开微信扫一扫
添加客服
进入交流群
发表评论