Pages:
Author

Topic: offline node and my priv keys not working - page 2. (Read 391 times)

legendary
Activity: 2380
Merit: 5213
But why these 2 addresses are created with different PKs and the other ones I have, all have the same PK? I can't see the reason why.
Also, what you suggest to do with Electrum is to import those 3 addresses I have that are giving out the same PK?
Every private key can generate three kinds of address. The generated address can be legacy (starts with 1), nested segwit (starts with 3), native segwit (starts with bc1).
The two new private keys you have can generate other kinds of addresses too.

Let's say you have a legacy HD wallet with 20 different addresses.
You have 20 different legacy addresses and 20 different private keys.

These 20 private keys can generate 20 native segwit addresses and 20 nested segwit addresses too.
hero member
Activity: 1274
Merit: 681
I rather die on my feet than to live on my knees
I have tried the dumpprivkey for one address starting with 1, and then repeated the command for an address starting with 3 and finallyrepeated the command dumpprivkey for an address starting with bc1. So I got 3 outputs. That output, which is the private key, was the same for the 3 times I used the dumpprivkey  for each of the 3 addresses.
I don't think this is a problem. You have 3 addresses, all derived from the same private key. You can try importing them in Electrum (on an offline computer that won't get a internet connection without wiping it):
Private key for SegWit addresses
A private key can be used to create SegWit addresses (starting with "3" or "bc1"). You can import them into Electrum by adding "p2wpkh-p2sh:" or "p2wpkh:" respectively in front of the private key (source and details).

But why these 2 addresses are created with different PKs and the other ones I have, all have the same PK? I can't see the reason why.
Also, what you suggest to do with Electrum is to import those 3 addresses I have that are giving out the same PK?
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
I have tried the dumpprivkey for one address starting with 1, and then repeated the command for an address starting with 3 and finallyrepeated the command dumpprivkey for an address starting with bc1. So I got 3 outputs. That output, which is the private key, was the same for the 3 times I used the dumpprivkey  for each of the 3 addresses.
I don't think this is a problem. You have 3 addresses, all derived from the same private key. You can try importing them in Electrum (on an offline computer that won't get a internet connection without wiping it):
Private key for SegWit addresses
A private key can be used to create SegWit addresses (starting with "3" or "bc1"). You can import them into Electrum by adding "p2wpkh-p2sh:" or "p2wpkh:" respectively in front of the private key (source and details).
hero member
Activity: 1274
Merit: 681
I rather die on my feet than to live on my knees
But I'm always getting the same privkey for any address I have.
I have tried the same for the default address where there is also an address that I actually don't use, and the privkey is different. I can't understand why it gives me the same privkey in this wallet that I'm trying to do it.

You mean to create 2 new addresses and check their private keys?
If you aren't getting any error when you dump the priv key, it would appear that there isn't an issue with the commands given.

To clarify, when you mean any address, you mean when you use any 2 different addresses from the same type? Ie, You're querying 2 different bc1 addresses, 2 different P2PWSH or 2 different legacy addresses? Does the address start with 5, K or L?

I'm sorry I wasn't clear.
I have tried the dumpprivkey for one address starting with 1, and then repeated the command for an address starting with 3 and finallyrepeated the command dumpprivkey for an address starting with bc1. So I got 3 outputs. That output, which is the private key, was the same for the 3 times I used the dumpprivkey  for each of the 3 addresses.


I'll create 2 new addresses, bc1 ones and will check the private keys. I'll do it from within this wallet.

And now, is it still possible to get each address private key individually?

You can derive all 3 kinds of addresses (legacy, p2sh, bech32) from the same private key.
And i think this is what happened here.

You can try what ranochigo mentioned. Create a second address from any type. This private key will be different.

Which would be the commands I need to use to get the individual addresses private keys?



Edited;

Ok, I just created 2 new addresses in this same wallet and privkeys are different.

So now the question is how do I retrieve my other addresses individual private keys???
legendary
Activity: 1624
Merit: 2481
You can derive all 3 kinds of addresses (legacy, p2sh, bech32) from the same private key.
And i think this is what happened here.

You can try what ranochigo mentioned. Create a second address from any type. This private key will be different.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
But I'm always getting the same privkey for any address I have.
I have tried the same for the default address where there is also an address that I actually don't use, and the privkey is different. I can't understand why it gives me the same privkey in this wallet that I'm trying to do it.

You mean to create 2 new addresses and check their private keys?
If you aren't getting any error when you dump the priv key, it would appear that there isn't an issue with the commands given.

To clarify, when you mean any address, you mean when you use any 2 different addresses from the same type? Ie, You're querying 2 different bc1 addresses, 2 different P2PWSH or 2 different legacy addresses? Does the address start with 5, K or L?
hero member
Activity: 1274
Merit: 681
I rather die on my feet than to live on my knees
Are you generating all 3 types of addresses? By default, Bitcoin Core only generates native segwit. Did you modify the conf file to generate legacy address?

How are you extracting the private key exactly? A single private key can be used to derive all 3 address types. Could you try dumping 2 different bc1 addresses and check the private keys?

Yes, I used the proper commands to generate '1', '3' and 'bc1' addresses.

What I do to try to get the private keys are:

start the deamon. Note: I tried to start it in 2 ways just to rule out any possibility.
Code:
bitcoind

and

Code:
bitcoind -wallet=wallet-name-here

The difference is only that if I use the first command, I have to load the wallet with bitcoin-cli and always use "-rpcwaller=wallet-name-here" before issuing any command.
I'll assume here that I use the 1st method using -rpcwallet before any command.

Then, after the deamon is running I load the wallet with:
Code:
bitcoin-cli loadwallet wallet-name-here

Then I unlock the wallet for 3 minutes (just as an example), because I locked it when I created it.
Code:
bitcoin-cli -rpc-wallet=wallet-name-here walletpassphrase password-here 180

Then I get the address I want to dump the private key using:
Code:
bitcoin-cli -rpc-wallet=wallet-name-here listlabels
bitcoin-cli -rpc-wallet=wallet-name-here getaddressesbylabel

and finally I try to dump the private key for the address I want:
Code:
bitcoin-cli -rpc-wallet=wallet-name-here dumpprivkey "address here"

But I'm always getting the same privkey for any address I have.
I have tried the same for the default address where there is also an address that I actually don't use, and the privkey is different. I can't understand why it gives me the same privkey in this wallet that I'm trying to do it.

Could you try dumping 2 different bc1 addresses and check the private keys?

You mean to create 2 new addresses and check their private keys?

Then I have locked down the wallet with the encryptwallet command.
This only changed the HD seed of your wallet for the new addresses, created another set of keys in your keypool while keeping the old keys.
So there shouldn't be any problem with the previously created keys.
I think this is not the issue.

I created some addresses (1, 3 and bc1) from this wallet. They were all created from this wallet.
Did you created those addresses using getnewaddress "" "address-type"; or set a start parameter/config file?
Because if you used the latter, Bitcoin Core will derive the selected address type from the same keypool.

Like my test (regtest):
Wallet started with -addresstype=legacy
Code:
cUKHjYsDHDotrZMuiMGewq7KDU9YRdMPDbKCcaVQ9fF6cHtQZj5A 2020-05-23T04:05:48Z
reserve=1 # addr=mhbNXxRD1NySfJ8p7ehbF3hfXVKQcm5z6B hdkeypath=m/0'/0'/1'

Wallet started with -addresstype=p2sh-segwit
Code:
cUKHjYsDHDotrZMuiMGewq7KDU9YRdMPDbKCcaVQ9fF6cHtQZj5A 2020-05-23T04:05:48Z
reserve=1 # addr=2My3QdbSW5dyiz8ccJMjvH8RWdT9fzaKeiQ hdkeypath=m/0'/0'/1'

Wallet started with -addresstype=bech32
Code:
cUKHjYsDHDotrZMuiMGewq7KDU9YRdMPDbKCcaVQ9fF6cHtQZj5A 2020-05-23T04:05:48Z
reserve=1 # addr=bcrt1qzmrzv53lfccgaajpc9m2fvu5tadxz4n9wwjwcf hdkeypath=m/0'/0'/1'

If not through -addresstype=, there is surely a problem.

No, I've created them all by command getnewaddress and address-type.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
Then I have locked down the wallet with the encryptwallet command.
This only changed the HD seed of your wallet for the new addresses, created another set of keys in your keypool while keeping the old keys.
So there shouldn't be any problem with the previously created keys.
I think this is not the issue.

I created some addresses (1, 3 and bc1) from this wallet. They were all created from this wallet.
Did you created those addresses using getnewaddress "" "address-type"; or set a start parameter/config file?
Because if you used the latter, Bitcoin Core will derive the selected address type from the same keypool.

Like my test (regtest):
Wallet started with -addresstype=legacy
Code:
cUKHjYsDHDotrZMuiMGewq7KDU9YRdMPDbKCcaVQ9fF6cHtQZj5A 2020-05-23T04:05:48Z
reserve=1 # addr=mhbNXxRD1NySfJ8p7ehbF3hfXVKQcm5z6B hdkeypath=m/0'/0'/1'

Wallet started with -addresstype=p2sh-segwit
Code:
cUKHjYsDHDotrZMuiMGewq7KDU9YRdMPDbKCcaVQ9fF6cHtQZj5A 2020-05-23T04:05:48Z
reserve=1 # addr=2My3QdbSW5dyiz8ccJMjvH8RWdT9fzaKeiQ hdkeypath=m/0'/0'/1'

Wallet started with -addresstype=bech32
Code:
cUKHjYsDHDotrZMuiMGewq7KDU9YRdMPDbKCcaVQ9fF6cHtQZj5A 2020-05-23T04:05:48Z
reserve=1 # addr=bcrt1qzmrzv53lfccgaajpc9m2fvu5tadxz4n9wwjwcf hdkeypath=m/0'/0'/1'

If not through -addresstype=, there is surely a problem.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
Are you generating all 3 types of addresses? By default, Bitcoin Core only generates native segwit. Did you modify the conf file to generate legacy address?

How are you extracting the private key exactly? A single private key can be used to derive all 3 address types. Could you try dumping 2 different bc1 addresses and check the private keys?
hero member
Activity: 1274
Merit: 681
I rather die on my feet than to live on my knees
Hello.

I run an offline node just for creating addresses and basically avoid exposing my newest addresses private keys. And sometimes I use this node to run some commands to learn about them.
I'm running this node in an offline and encrypted Debian Buster virtual machine andd running Bitcoin Core Daemon version v0.18.1.

Anyways, the situation is this:
I have a wallet I created with this node, let's call it my-wallet just to name things an to be the most clear I can.
I created some addresses (1, 3 and bc1) from this wallet. They were all created from this wallet.
Then I have locked down the wallet with the encryptwallet command.

But now, when I try to dump my addresses private key, node tells me the same private key for all addresses.

Why is this happening?
Pages:
Jump to: