Author

Topic: Pre-generating and using large numbers of addresses seems to be impossible (Read 690 times)

member
Activity: 79
Merit: 10
Importing using the RPC command scans the blockchain looking for transactions for that key, which can take 1+ minutes. It might be quicker to write code to open the Berkeley database yourself and just insert the keys into the key tree.
sr. member
Activity: 798
Merit: 251
How comes its so slow to add private keys using importprivkey ?

On a Intel Dual Core 1.8Ghz machine where bitcoind is stored on a big ramdisk the total speed is approx 2 keys/second.
CPU is idle at 0-1%, means there is massive time wasted for nothing.

Is it the RPC interface that's so slow ? If the database would work hard it would show in CPU usage. But there is none. To calc the public hashes/addresses etc also is not the limiting factor as it would show up in Task Manager. And yes, I set rescan to false ..

 Huh

ImportPrivKey is definitely not the answer - it is far too slow.  I was finally able to do it pretty easily with this:

https://bitcointalksearch.org/topic/m.1349901

newbie
Activity: 30
Merit: 0
How comes its so slow to add private keys using importprivkey ?

On a Intel Dual Core 1.8Ghz machine where bitcoind is stored on a big ramdisk the total speed is approx 2 keys/second.
CPU is idle at 0-1%, means there is massive time wasted for nothing.

Is it the RPC interface that's so slow ? If the database would work hard it would show in CPU usage. But there is none. To calc the public hashes/addresses etc also is not the limiting factor as it would show up in Task Manager. And yes, I set rescan to false ..

 Huh
sr. member
Activity: 286
Merit: 251
There may be an easier way. Shutdown your client, and add keypool=somenumber to the bitcoin.conf file.

I have not tried this in recent clients but if you set a value of 20000, it used to take about half an hour on start up to generate these. I have no reason to think this will be particularly different in more recent clients, maybe try a smaller number first if you like.

The way it works is new addresses will be given from this pool, and when the pool is exhaused or whenever the keypool variable is bigger than the reserve, then the pool will be expanded.

(So if you now set keypool=30000 and restart, more keys will be generated.)


sr. member
Activity: 364
Merit: 252
I just want a large number of addresses (maybe 20,000) that are valid and active in my official client wallet.  This seems to be impossible.  I assumed that using Bitcoind in combination with a PHP script that conencts to it via RPC would work, but bitcoind won't even run - it starts, and then I try to connect to it via RPC and it never does anything (yes, I have confirgured the RPC password and username).  You can generate addresses of course, using tools like vanitygen, but importing them into the official client is such an onerous task that no one would dare attempt it on any kind of scale. 

Are there any tools that will enable me to generate a large number of addresses that will be recognized in my wallet by the official client?  I am pulling my hair out here.

the quickest way would (without scripting) would be to use bitcoin vanity generator and set the match to "1".
Then redeem the private keys (this would be the slow part).

full member
Activity: 201
Merit: 100
Are there any tools that will enable me to generate a large number of addresses that will be recognized in my wallet by the official client?  I am pulling my hair out here.
Low-tech method is get the windows bitcoin client and just click "add" as many times as you like Smiley

Slighly more high-tech is to use https://bitcointalksearch.org/topic/pywallet-22-manage-your-wallet-update-required-34028
sr. member
Activity: 798
Merit: 251
I just want a large number of addresses (maybe 20,000) that are valid and active in my official client wallet.  This seems to be impossible.  I assumed that using Bitcoind in combination with a PHP script that conencts to it via RPC would work, but bitcoind won't even run - it starts, and then I try to connect to it via RPC and it never does anything (yes, I have confirgured the RPC password and username).  You can generate addresses of course, using tools like vanitygen, but importing them into the official client is such an onerous task that no one would dare attempt it on any kind of scale. 

Are there any tools that will enable me to generate a large number of addresses that will be recognized in my wallet by the official client?  I am pulling my hair out here.
Jump to: