sorry to up the thread but I had the same problem and the response solved it, and I'm wondering : are all keypairs generated that way ? If yes, can the node's owner dump the privkey of all addresses generated by a RPC request to it ?
No... the current version of Bitcoin Core actually pre-generates a keypool of 1000 keypairs. When you use "
getnewaddress" it simply takes the first "unused" address from the keypool and returns that.
Just to correct Xynerise's post slightly:
bitcoin-cli dumpwallet <OUTPUTFILEPATH>
If your wallet is encrypted, you'll also need to use:
bitcoin-cli walletpassphrase <YOURPASSPHRASE> 600
to unlock the wallet first before being able to use the dumpwallet command. Note that the number at the end is the number of seconds before the wallet will be automatically locked again, so in this example it's 600 seconds = 10 minutes