From eeef3cdd34bee82aea09e85c824e4dbbe80911f9 Mon Sep 17 00:00:00 2001 From: "David A. Harding" Date: Tue, 7 Feb 2023 14:42:39 -1000 Subject: [PATCH] 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 --- ch04.asciidoc | 39 --------------------------------------- 1 file changed, 39 deletions(-) diff --git a/ch04.asciidoc b/ch04.asciidoc index 3a5f1ae4..10e795d1 100644 --- a/ch04.asciidoc +++ b/ch04.asciidoc @@ -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 <>), 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 <>. 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 -<>) 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