Author

Topic: Problem with Importing a private key (Read 332 times)

brand new
Activity: 0
Merit: 0
August 13, 2018, 08:56:04 AM
#7
So basically you need to sync to the point in unix time where the public key was generated in order to retrieve your private key for that particular address or do we get one private key per wallet (wallet.dat) because I am thinking if we do then it does not matter if the wallet is synced or not we will still be able to retrieve our private keys using the command line
You don't need to synchronize your wallet to be able to import your private key. Your private key is simply the private part of your ECDSA key pair and it is not generated based on your unix time, else collisions would be common. You can generate as many addresses as you'd like in a wallet and each address has a corresponding private key stored by your wallet.

Bitcoin Core and some other wallet uses BIP38 and the addresses are generated as children from the master key.
I was aware, its the BIP38 part that I didn't fully comprehend but now it is very well explained.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
August 11, 2018, 10:05:13 PM
#5
So basically you need to sync to the point in unix time where the public key was generated in order to retrieve your private key for that particular address or do we get one private key per wallet (wallet.dat) because I am thinking if we do then it does not matter if the wallet is synced or not we will still be able to retrieve our private keys using the command line
You don't need to synchronize your wallet to be able to import your private key. Your private key is simply the private part of your ECDSA key pair and it is not generated based on your unix time, else collisions would be common. You can generate as many addresses as you'd like in a wallet and each address has a corresponding private key stored by your wallet.

Bitcoin Core and some other wallet uses BIP38 and the addresses are generated as children from the master key.
jr. member
Activity: 59
Merit: 5
August 09, 2018, 01:33:43 AM
#4
I'm glad that you fixed it.

In addition to Thirdspace's answer: You can also trigger the rescan from the console, which is my preferred way because you don't have to restart your wallet.
legendary
Activity: 1386
Merit: 1027
Permabull Bitcoin Investor
August 07, 2018, 05:09:37 PM
#3
Now when I import the key again, it gives me 'null'.
when importing private key, it returns null on success

So I want to somehow like 'roll-back' what I did and to let the wallet re-scan the private key again.
you can do importprivkey "yourprivatekey" "" true
second parameter is empty string to assign address to default account
third parameter is true to rescan local blockchain, but if the address already exist in the wallet this won't work
so in your case, you can do that only by restarting wallet with -rescan command-line argument

Much appreciated Thirdspace, thank you.

Foruntatly, I had a backup of the VM where the fork blockchain and client were laying there, so I worked on the backup and everything is solved now.

Again, thank you so much Smiley
hero member
Activity: 1232
Merit: 738
Mixing reinvented for your privacy | chipmixer.com
August 07, 2018, 03:07:01 AM
#2
Now when I import the key again, it gives me 'null'.
when importing private key, it returns null on success

So I want to somehow like 'roll-back' what I did and to let the wallet re-scan the private key again.
you can do importprivkey "yourprivatekey" "" true
second parameter is empty string to assign address to default account
third parameter is true to rescan local blockchain, but if the address already exist in the wallet this won't work
so in your case, you can do that only by restarting wallet with -rescan command-line argument
legendary
Activity: 1386
Merit: 1027
Permabull Bitcoin Investor
August 06, 2018, 09:41:55 PM
#1
Hello,

Now I think I made a silly but yet, expensive, mistake while importing a private key.

It's regarding the BCX fork where their clients are Qt clients like the ones of Bitcoin Core.

At first the wallet was scanning the key (was still at 1%) and then I forced close it via the task manager as I wanted to see the balance being updated in real time as the debug window was covering the main wallet window.

Now when I import the key again, it gives me 'null'.

What made me sure there is something wrong is that the fork took place the at the block height 498888 and I had funds in BTC which I then moved to another wallet at block height 502226.

So I want to somehow like 'roll-back' what I did and to let the wallet re-scan the private key again.

Thanks in advance for your help.

Sincerely yours,
Fak
Jump to: