Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Brainslug on June 18, 2011, 06:07:49 PM



Title: Batch-Address Generator
Post by: Brainslug on June 18, 2011, 06:07:49 PM
I was wondering if something like that already exists. A simple (command line) tool that you point to a given wallet.dat file and generates a defined number of new addresses out of it and writes them on the console/in a file.

If it doesn't exist I would like to try to write something like that. I tried looking into the source of the official client, but since I don't even know what exactly to look for this turned out to be rather pointless.
So I was wondering if anybody may can give me a few information on how addresses are generated or where I should look in the official client source. I know it's not a that important project or that urgently needed tool, but I actually just want to try it for the sake of programming and trying :D (or in short to just give me something to program) Of course I'll make it open source and provide you with the outcome if you're interested in it.

I guess a sort of step-by-step explanation on how to generate new addresses would be the best start, like 1) read that and that part of the wallet; 2) use that and that algorithm to generate an address; or something like that.

As always, thanks in advance for any productive answers.


Title: Re: Batch-Address Generator
Post by: willphase on June 18, 2011, 06:19:06 PM
https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list

getnewaddress is what you are after.  Just wrap the call in a for loop to make it a 'batch address generator'

Will


Title: Re: Batch-Address Generator
Post by: Brainslug on June 18, 2011, 07:25:40 PM
Oh wow, thanks. I should've known that there's an API for the client...  :-X