Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Snatdard usre on December 08, 2014, 06:55:57 PM



Title: Importing multiple private keys into Bitcoin Core?
Post by: Snatdard usre on December 08, 2014, 06:55:57 PM
Hello,
is there any method how to import multiple(~10000) private keys into Bitcoin Core? Currently, if I do it manually(open console, type "importprivkey <key>") it takes 2 minutes to import, which is totally unacceptable. Or are there any other(non "light") BTC wallet software, which allow to do it? Thanks.


Title: Re: Importing multiple private keys into Bitcoin Core?
Post by: DannyHamilton on December 08, 2014, 08:03:16 PM
Hello,
is there any method how to import multiple(~10000) private keys into Bitcoin Core? Currently, if I do it manually(open console, type "importprivkey <key>") it takes 2 minutes to import, which is totally unacceptable. Or are there any other(non "light") BTC wallet software, which allow to do it? Thanks.

I can't imagine why you would need to import 10,000+ private keys into Bitcoin Core.

If you really want to, then I suppose you can use the rescan=false option on the importprivkey command.  This should prevent it from scanning the entire blockchain when it imports the private key and will therefore speed up the import.

"light" wallet simply means that it doesn't store the entire blockchain. If you are willing to use a "light" wallet, then private keys should import quite quickly since there won't be a need to scan the entire blockchain.


Title: Re: Importing multiple private keys into Bitcoin Core?
Post by: hexafraction on December 08, 2014, 10:19:22 PM
Hello,
is there any method how to import multiple(~10000) private keys into Bitcoin Core? Currently, if I do it manually(open console, type "importprivkey <key>") it takes 2 minutes to import, which is totally unacceptable. Or are there any other(non "light") BTC wallet software, which allow to do it? Thanks.

I can't imagine why you would need to import 10,000+ private keys into Bitcoin Core.

If you really want to, then I suppose you can use the rescan=false option on the importprivkey command.  This should prevent it from scanning the entire blockchain when it imports the private key and will therefore speed up the import.

"light" wallet simply means that it doesn't store the entire blockchain. If you are willing to use a "light" wallet, then private keys should import quite quickly since there won't be a need to scan the entire blockchain.

Wouldn't importing a private key into such a "light" wallet incur the time to fetch the blocks containing related transactions for those keys, from the network? Or am I mistaken in some way?


Title: Re: Importing multiple private keys into Bitcoin Core?
Post by: Snatdard usre on December 09, 2014, 10:25:35 AM
Many thanks for replies, I think "rescan=false option" was what I was looking for. I need this because my bitcoins are stuck in Electrum(damn it :) ), so the only way I can think of  - export private keys(10000) and import them into non light software.


Title: Re: Importing multiple private keys into Bitcoin Core?
Post by: deepceleron on December 11, 2014, 10:59:35 AM
If you have some text-edit finesse, you can turn a list of keys into a list of import commands. From another thread:

Code:
"C:\Program Files\Bitcoin\daemon\bitcoind.exe" importprivkey L4mP3joYEhSv1ofdsWbz8xEmqCmYK9vGyi8mJmWWbh79Xx2NsS1M addr-1DfyaDvr-1 false
"C:\Program Files\Bitcoin\daemon\bitcoind.exe" importprivkey Ky2EGjWLhfKv1sWnPcuN4SHF2iALj6SfK7hoLWKx5T4zMqXg7aT9 addr-1DfyaDvr-2 false
"C:\Program Files\Bitcoin\daemon\bitcoind.exe" importprivkey KzrZ4DULdVWFqpF48pdJicFJfX5dqrhxBkqDnT4HRkCswdFy3Eo4 addr-1DfyaDvr-3 false
"C:\Program Files\Bitcoin\daemon\bitcoind.exe" importprivkey L2ELWXewr1PQnMwFDpfobHFqspyM6g1noM4uzkCMgoSZTSf3sQJF addr-1DfyaDvr-4 false
Just make the final line "true" to reindex.


Title: Re: Importing multiple private keys into Bitcoin Core?
Post by: Snatdard usre on December 11, 2014, 11:01:36 AM
Thanks deepceleron, will try this, currently waiting for Bitcoin Core to sync )