CH04::dumpprivkey: remove

Remove text about dumping a private key:

- Example using Bitcoin Core is no longer supported for descriptor
  wallets.

- Dumping private keys is very bad practice with HD wallets due to risk
  of compromising the whole wallet.

- Because of safety risks, and lack of need, most modern wallets don't
  support private key export or import
develop
David A. Harding 1 year ago
parent ca26228f58
commit eeef3cdd34

@ -182,45 +182,6 @@ large number. It is approximately 10^77^ in decimal. For comparison, the
visible universe is estimated to contain 10^80^ atoms.
====
((("dumpprivkey command")))To generate a new key with the Bitcoin Core
client (see <<ch03_bitcoin_client>>), 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+ command shows the private key in a Base58
checksum-encoded format called the _Wallet Import Format_ (WIF), which
we will examine in more detail in <<priv_formats>>. Here's an example of
generating and displaying a private key using these two commands:
----
$ bitcoin-cli getnewaddress
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 possible
for +bitcoind+ to know the private key from the public key unless they
are both stored in the wallet.
[TIP]
=====================================================================
The +dumpprivkey+ command does not generate a private key from a public
key, as this is impossible. The command simply reveals the private key
that is already known to the wallet and which was generated by the
+getnewaddress+ command.
=====================================================================
[role="pagebreak-before"]
You can also use the Bitcoin Explorer command-line tool (see
<<appdx_bx>>) to generate and display private keys with the commands
+seed+, +ec-new+, and +ec-to-wif+:
----
$ bx seed | bx ec-new | bx ec-to-wif
5J3mBbAH58CpQ3Y5RNJpUKPE62SQ5tfcvU2JpbnkeyhfsYB1Jcn
----
[[pubkey]]
==== Public Keys

Loading…
Cancel
Save