Bitcoin Forum
April 23, 2024, 08:28:35 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin Core private keys  (Read 383 times)
darosior (OP)
Sr. Member
****
Offline Offline

Activity: 279
Merit: 435


View Profile
May 15, 2018, 07: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
1713904115
Hero Member
*
Offline Offline

Posts: 1713904115

View Profile Personal Message (Offline)

Ignore
1713904115
Reply with quote  #2

1713904115
Report to moderator
1713904115
Hero Member
*
Offline Offline

Posts: 1713904115

View Profile Personal Message (Offline)

Ignore
1713904115
Reply with quote  #2

1713904115
Report to moderator
"In a nutshell, the network works like a distributed timestamp server, stamping the first transaction to spend a coin. It takes advantage of the nature of information being easy to spread but hard to stifle." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
Xynerise
Sr. Member
****
Offline Offline

Activity: 322
Merit: 363

39twH4PSYgDSzU7sLnRoDfthR6gWYrrPoD


View Profile
May 16, 2018, 04:10:22 AM
Last edit: May 16, 2018, 04:47:33 AM by Xynerise
 #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.
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
May 16, 2018, 04: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 <OUTPUTFILEPATH>

If your wallet is encrypted, you'll also need to use:
Code:
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

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
BTCW
Copper Member
Full Member
***
Offline Offline

Activity: 193
Merit: 234

Click "+Merit" top-right corner


View Profile
May 17, 2018, 10: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! 

SendBTC.me <<< amazing imitative
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
May 18, 2018, 09:16:37 AM
Merited by achow101 (2)
 #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.

darosior (OP)
Sr. Member
****
Offline Offline

Activity: 279
Merit: 435


View Profile
May 18, 2018, 12:02:44 PM
Last edit: May 18, 2018, 12:31:56 PM by darosior
 #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
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
May 18, 2018, 12:42:26 PM
 #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...

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
darosior (OP)
Sr. Member
****
Offline Offline

Activity: 279
Merit: 435


View Profile
May 18, 2018, 07:37:08 PM
 #8

OK,

Thanks all for your responses !

Darosior
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3374
Merit: 6531


Just writing some code


View Profile WWW
May 22, 2018, 07: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.

Thirdspace
Hero Member
*****
Offline Offline

Activity: 1232
Merit: 738


Mixing reinvented for your privacy | chipmixer.com


View Profile
May 22, 2018, 09:53:17 PM
Merited by achow101 (2)
 #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 <address1>
bitcoin-cli dumpprivkey <address2>
...

achow101
Moderator
Legendary
*
Offline Offline

Activity: 3374
Merit: 6531


Just writing some code


View Profile WWW
May 22, 2018, 09: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.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!