diff --git a/ch04.asciidoc b/ch04.asciidoc index 21bb6d46..bdfa22ad 100644 --- a/ch04.asciidoc +++ b/ch04.asciidoc @@ -74,16 +74,16 @@ Below is a randomly generated private key shown in hexadecimal format (256 binar The size of bitcoin's private key space, 2^256^ is an unfathomably large number. It is approximately 10^77^ in decimal. The visible universe is estimated to contain 10^80^ atoms. ==== -To generate a new key with the Bitcoin Core Client (see <>), use the +getnewaddress+ command. For security reasons it displays the public key only, not the private key. To ask bitcoind to expose the private key, use the +dumpprivkey+ command. The +dumpprivkey+ shows the private key in a base-58 checksum encoded format called the Wallet Import Format (WIF), which we will examine in more detail in <>. Here's an example of generating and displaying a private key using these two commands: +To generate a new key with the Bitcoin Core Client (see <>), use the +getnewaddress+ command. For security reasons it displays the public key only, not the private key. To ask bitcoin-cli to expose the private key, use the +dumpprivkey+ command. The +dumpprivkey+ shows the private key in a base-58 checksum encoded format called the Wallet Import Format (WIF), which we will examine in more detail in <>. Here's an example of generating and displaying a private key using these two commands: ---- -$ bitcoind getnewaddress +$ bitcoin-cli getnewaddress 1J7mdg5rbQyUHENYdx39WVWK7fsLpEoXZy -$ bitcoind dumpprivkey 1J7mdg5rbQyUHENYdx39WVWK7fsLpEoXZy +$ bitcoin-cli dumpprivkey 1J7mdg5rbQyUHENYdx39WVWK7fsLpEoXZy KxFC1jmwwCoACiCAWZ3eXa96mBM6tb3TYzGmf6YwgdGWZgawvrtJ ---- -The +dumpprivkey+ command opens the wallet and extracts the private key that was generated by the +getnewaddress+ command. It is not otherwise possible for bitcoind to know the private key from the public key, unless they are both stored in the wallet. +The +dumpprivkey+ command opens the wallet and extracts the private key that was generated by the +getnewaddress+ command. It is not otherwise possible for bitcoin-cli to know the private key from the public key, unless they are both stored in the wallet. You can also use the command-line +sx tools+ (see <>) to generate and display private keys: diff --git a/ch07.asciidoc b/ch07.asciidoc index bf7cfecb..a1916908 100644 --- a/ch07.asciidoc +++ b/ch07.asciidoc @@ -86,7 +86,7 @@ Using the Bitcoin Core reference client on the command-line: [source,bash] ---- -$ bitcoind getblock 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f +$ bitcoin-cli getblock 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f ---- [source,json] ----