Author

Topic: Bitcoin Core private keys (Read 383 times)

staff
Activity: 3374
Merit: 6530
Just writing some code
May 22, 2018, 05:58:22 PM
#11
assuming both RPC pass and wallet passphrase was compromised (or not set at all)
wouldn't listreceivedbyaddress reveal all funded addresses in the wallet?
Yes, it would.

But it would also just be easier to just send yourself all of the coins in the wallet instead of getting their private keys.

If an attacker were able to get the dumpwallet output, they would then have the keys for all of the keypool keys and the master private key and HD seed which means they can then know all of your future addresses too. That is much more dangerous.
hero member
Activity: 1232
Merit: 738
Mixing reinvented for your privacy | chipmixer.com
May 22, 2018, 05:53:17 PM
#10
Not only that, but dumpwallet does not return the private keys over RPC. It writes them to a file which is local to the machine so attackers cannot use dumpwallet and extract all of your private keys. They could use dumpprivkey but that can only get them private keys for addresses that they know belong to that wallet.

assuming both RPC pass and wallet passphrase was compromised (or not set at all)
wouldn't listreceivedbyaddress reveal all funded addresses in the wallet?
would the set of commands below work? of course a bit scripting/programming needed Wink achow101 answered as I write this line

Code:
bitcoin-cli walletpassphrase "passphrase" 600
bitcoin-cli listreceivedbyaddress 6 false false
bitcoin-cli dumpprivkey
bitcoin-cli dumpprivkey
...
staff
Activity: 3374
Merit: 6530
Just writing some code
May 22, 2018, 03:32:28 PM
#9
Since the "dumpwallet" command is allowed over RPC and will print out all your private keys (which equals complete access to your coins regardless of the wallet password), ...

Using RPC's does NOT allow to directly dump all of the private keys if the wallet is encrypted.
Authenticating RPC's does not equal the decryption of the wallet.

If you want to dump the wallet via RPC, you need to unlock the wallet with the walletpassphrase first.
HCP has mentioned this directly above your post.
Not only that, but dumpwallet does not return the private keys over RPC. It writes them to a file which is local to the machine so attackers cannot use dumpwallet and extract all of your private keys. They could use dumpprivkey but that can only get them private keys for addresses that they know belong to that wallet.
sr. member
Activity: 279
Merit: 435
May 18, 2018, 03:37:08 PM
#8
OK,

Thanks all for your responses !

Darosior
HCP
legendary
Activity: 2086
Merit: 4314
May 18, 2018, 08:42:26 AM
#7
I knew about RPC commands but I wanted to confirm thay any key pair generated thanks to getnewaddress is owned by the node's owner?
Is it a bad way (/bad practice) of generating adresses ?
As explained... a Bitcoin Core wallet pre-generates 1000 keypairs when it is created... getnewaddress simply returns the first unused keypair... so, yes, you could say that the keypair "generated" by getnewaddress is "owned by the node's owner".

No, it is not a bad way of "generating" addresses...
sr. member
Activity: 279
Merit: 435
May 18, 2018, 08:02:44 AM
#6
Hi,

First thanks all for your responses.
I knew about RPC commands but I wanted to confirm thay any key pair generated thanks to getnewaddress is owned by the node's owner?
Is it a bad way (/bad practice) of generating adresses ?

Thanks,
Darosior
legendary
Activity: 1624
Merit: 2481
May 18, 2018, 05:16:37 AM
#5
Since the "dumpwallet" command is allowed over RPC and will print out all your private keys (which equals complete access to your coins regardless of the wallet password), ...

Using RPC's does NOT allow to directly dump all of the private keys if the wallet is encrypted.
Authenticating RPC's does not equal the decryption of the wallet.

If you want to dump the wallet via RPC, you need to unlock the wallet with the walletpassphrase first.
HCP has mentioned this directly above your post.
copper member
Activity: 193
Merit: 235
Click "+Merit" top-right corner
May 17, 2018, 06:52:05 PM
#4
A word of caution for everyone running Bitcoin Core:

Since the "dumpwallet" command is allowed over RPC and will print out all your private keys (which equals complete access to your coins regardless of the wallet password), think twice before enabling RPC and making it accessible over the internet.

People who for some reason need RPC over internet should use extraordinary strong RPC passwords (which is NOT the same as the wallet passphrase!).

Weak RPC username and passwords will be hacked by script kiddies who are playing with Shodan, if your machine is accessible over the internet.

(Look for example here about a guy who found a simple hack for BTC and ETH-mining rigs via Shodan: https://medium.com/@s3yfullah/hacking-cryptocurrency-miners-with-osint-techniques-677bbb3e0157)

Stay safe! 
HCP
legendary
Activity: 2086
Merit: 4314
May 16, 2018, 12:24:39 AM
#3
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:
Code:
bitcoin-cli dumpwallet

If your wallet is encrypted, you'll also need to use:
Code:
bitcoin-cli walletpassphrase 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
sr. member
Activity: 322
Merit: 363
39twH4PSYgDSzU7sLnRoDfthR6gWYrrPoD
May 16, 2018, 12:10:22 AM
#2
HI,

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 ?

Thanks,
Darosior

If you want to dump ALL the private keys at once then you can run
Code:
bitcoin-cli dumpwallet
to dump them all to a text file.
sr. member
Activity: 279
Merit: 435
May 15, 2018, 03:03:15 PM
#1
HI,

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 ?

Thanks,
Darosior
Jump to: