Bitcoin Forum
May 25, 2024, 08:19:32 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Why does bitcoin take so long to import a privkey???  (Read 1379 times)
calkob (OP)
Hero Member
*****
Offline Offline

Activity: 1092
Merit: 520


View Profile
March 01, 2016, 12:55:44 AM
 #1

I am waiting about 30 mins for core to import a privkey, why is that ?
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3402
Merit: 6657


Just writing some code


View Profile WWW
March 01, 2016, 12:57:47 AM
 #2

I am waiting about 30 mins for core to import a privkey, why is that ?
Because it needs to rescan the entire blockchain to check for all of the transactions that involve the address associated with that private key. The blockchain is huge and this process takes a while.

Invulner
Sr. Member
****
Offline Offline

Activity: 266
Merit: 250

Invulner


View Profile
March 01, 2016, 12:57:58 AM
 #3

I am waiting about 30 mins for core to import a privkey, why is that ?

I use blockchain.info, and importing private keys are instant. Perhaps your wallet wasn't synced?
Goins
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
March 01, 2016, 01:06:23 AM
 #4

I am waiting about 30 mins for core to import a privkey, why is that ?

I use blockchain.info, and importing private keys are instant. Perhaps your wallet wasn't synced?
Blockchain.info is always up-to-date, that's why importing a key there happens within seconds. It shouldn't take too long when importing into Bitcoin Core either because it downloads the whole blockchain. If you import a key into a different client like MultiBit, then the client has to scan the blockchain for transactions associated to this key as knightdk already mentioned. Keep in mind, even though MultiBit doesn't need to download the whole Blockchain, it still needs to know about the transactions associated to your key.

What you can do is to import the key into the Blockchain.info web wallet and send all the funds to a new key. But then you will have to wait for the confirmations of course.
unholycactus
Legendary
*
Offline Offline

Activity: 1078
Merit: 1024



View Profile WWW
March 01, 2016, 02:50:34 AM
 #5

I am waiting about 30 mins for core to import a privkey, why is that ?

I use blockchain.info, and importing private keys are instant. Perhaps your wallet wasn't synced?

The wallet can be up to date and synced.
Like knightdk said, if you add an address that wasn't in the first place, the wallet has to check through the whole already downloaded blockchain to see if the address was used in any transactions.
calkob (OP)
Hero Member
*****
Offline Offline

Activity: 1092
Merit: 520


View Profile
March 01, 2016, 08:23:12 AM
 #6

Fair enough,  Wink thanks for the replies.  It was a newly generated address also.
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
March 01, 2016, 08:34:02 AM
 #7

There is an option to stop it from doing a re-scan (after the private key and label) so for newly created addresses you should use that.

Code:
importaddress "address" ( "label" rescan )
importprivkey "bitcoinprivkey" ( "label" rescan )

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
torrentheaven
Hero Member
*****
Offline Offline

Activity: 952
Merit: 1000


View Profile
March 01, 2016, 09:57:06 AM
 #8

Because when you import a privatekey to bitcoin core wallet it rescan , if you want to stop rescan you can use below format, it will rescan wallet later next time you open it


Code:
importprivkey "bitcoinprivkey" "label" false

replace bitcoinprivkey with your private key
and label with label that you want to add for imported address
calkob (OP)
Hero Member
*****
Offline Offline

Activity: 1092
Merit: 520


View Profile
March 01, 2016, 10:09:18 AM
 #9

There is an option to stop it from doing a re-scan (after the private key and label) so for newly created addresses you should use that.

Code:
importaddress "address" ( "label" rescan )
importprivkey "bitcoinprivkey" ( "label" rescan )


Thanks for that, so i import address 1st and then importprivkey after, as above?
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
March 01, 2016, 10:15:17 AM
 #10

Thanks for that, so i import address 1st and then importprivkey after, as above?

No - the "importaddress" is for "watch only" addresses (but if you don't provide the rescan parameter to them they'll behave in the same manner so I thought it was relevant to list both of these commands for others that might be following this).

For a private key you just use the "importprivkey" command (adding false after the label).

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
calkob (OP)
Hero Member
*****
Offline Offline

Activity: 1092
Merit: 520


View Profile
March 01, 2016, 10:31:23 AM
 #11

Because when you import a privatekey to bitcoin core wallet it rescan , if you want to stop rescan you can use below format, it will rescan wallet later next time you open it


Code:
importprivkey "bitcoinprivkey" "label" false

replace bitcoinprivkey with your private key
and label with label that you want to add for imported address

So as above, Again Many Thanks
7788bitcoin
Legendary
*
Offline Offline

Activity: 2282
Merit: 1023


View Profile
March 01, 2016, 03:40:58 PM
 #12

Thanks for that, so i import address 1st and then importprivkey after, as above?

No - the "importaddress" is for "watch only" addresses (but if you don't provide the rescan parameter to them they'll behave in the same manner so I thought it was relevant to list both of these commands for others that might be following this).

For a private key you just use the "importprivkey" command (adding false after the label).


Will the core rescan automatically after you shutdown and then restart your software?
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!