Fetch my private key

1

I goal is to understand. I do not want to earn money with mining. (I have a server without GPU)

Here is what i've done:

I have downloaded, maked and installed bitcoin sourcecode from github.

It seems to work because i can interact with bitcoind with bitcoin-cli command.

I know this is not a good practice but i want to "see" my private key.

I have read several documentation and tutorials and they said i need to generate an address first, then call dumpprivkey method.

Like this:

$ bitcoin-cli getnewaddress
xxxxxxx

$ bitcoin-cli dumpprivkey xxxxxxx

I do not understand but if i repeat twice this operation, i get 2 differents private keys.

So this is not the private key i am looking for... What is those privates keys ?

Thanks

Bob5421

Posted 2019-08-23T15:01:46.383

Reputation: 123

Answers

1

Let's suppose I have lost everything except this extended master key. How can I setup a new fresh computer and retrieve all my bitcoins just with this key?

According to How to get xpub or mpk(bip32) for my bitcoin core wallet?

you can export the xpriv with dumpwallet

According to https://bitcointalk.org/index.php?topic=3866008.0

Bitcoin Core does not have a way to directly import [master] private keys. You could derive a bunch of private keys in WIF from the xpriv and import them all at once, but you can't import the xprv directly.

RedGrittyBrick

Posted 2019-08-23T15:01:46.383

Reputation: 4 815

Thanks for your answer. Everything is very confuse for me. I will do a test : i will take 2 computers. Whats commands should i type on both computer in order to « transfert » my account from first to second computerBob5421 2019-08-25T14:44:33.620

1

@Bob5421: That's a different question. See https://en.bitcoin.it/wiki/Backingup_your_wallet - Copy the wallet.dat file from the old wallet and use it to overwrite the wallet.dat file of a newly installed empty wallet on a different computer.

RedGrittyBrick 2019-08-25T17:23:31.763

0

This is the private key that allows you to spend Bitcoin which is sent to the corresponding address.

If you run both of those commands twice, you will generate a new key pair and a new address each time, which will be different.

JBaczuk

Posted 2019-08-23T15:01:46.383

Reputation: 6 172

1Okay but i have another private key somewhere which is global for my account ?Bob5421 2019-08-23T15:11:39.277

1

yes, each key pair is derived from a master key, see https://bitcoincore.org/en/doc/0.18.0/rpc/wallet/dumpwallet/ it will be at the top of the output file.

JBaczuk 2019-08-23T15:21:03.590

Thanks, i can see an "extended" master key. What is the difference between extended and not extended master key (which i cannot see) ThanksBob5421 2019-08-23T15:33:29.177

1

It is used for hierarchical deterministic key derivation, see https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki

JBaczuk 2019-08-23T15:56:36.360

I see on dumpwallet command a lot of lines with addr What is it (the account is blank, i have do nothing)Bob5421 2019-08-23T17:21:39.030

Let's suppose i have lost everything except this extended master key. How can i setup a new fresh computer and retreive all my bitcoins just with this keyBob5421 2019-08-24T05:11:28.990