Author

Topic: Generating thousands of addresses (Read 5444 times)

sr. member
Activity: 798
Merit: 251
November 22, 2012, 08:05:18 AM
#20
Fair warning, running the QT client begins to get sluggish after about 15k addresses, and is nearly unusable after 120k or so.

I haven't noticed any sluggishness with the newest version of the QT client, and I now have a wallet with 50K addresses in it.  Also the wallet is only around 7MB.  The real problem with the official client is the amount of time it takes to sync after install.  That by itself will hamper the adoption of bitcoin by the general population.  Although alternatives are available that make the use of the official software unnecessary, a casual user that goes to the bitcoin main site and downloads the software will be immediately turned off and may not bother or even understand that alternatives are available.
vip
Activity: 1386
Merit: 1140
The Casascius 1oz 10BTC Silver Round (w/ Gold B)
November 21, 2012, 07:08:43 PM
#19
Using an address per-customer seems like a waste of resources.

This is only true to the extent that address creation and address maintenance is a waste of resources.  It shouldn't be, and doesn't have to be.  The total resource expenditure of storing an address in a non-wasteful manner is well under 100 bytes.

When implemented properly, the total resources expended in creating and maintaining an address should be significantly less than the resources expended in logging their web visit.  Even in spite of this, simply reassigning addresses that were assigned months ago and never used is a good way to reclaim whatever resources are associated with unused addresses.
legendary
Activity: 1708
Merit: 1010
November 21, 2012, 06:18:33 PM
#18
After googling some more I guess I'm SOL if I have a Mac and want to do business with Bitcoins.

1) Bitcoind apparently doesn't work on Mac OS X.

It works fine, it's just not supported, per se.  I use a iMac.  All of the necessary posix commands should be within reach, once you get to a command line, which is the part Apple doesn't really make easy.  I'm not going to offer to tell you the process, because I don't remember, but my client is set to maintain a buffer of about 2K future addresses via config file arguments, so I know that it's possible.

EDIT: I do remember that the important parts of bitcoind are in strange places on the iMac filesystem, it took me a while to locate them and thus alter the appropriate commands to make it work the way that I wanted.
dpc
newbie
Activity: 12
Merit: 0
November 21, 2012, 06:09:23 PM
#17
Using an address per-customer seems like a waste of resources.

I think using lazy generation of addresses per-transaction is much better idea. Especially that many online customers are one-shots only. They will buy stuff, pay, get it delivered and never return or return next year.

When customer makes a purchase it should get free payment address from a DB for one week (arbitrary time). After this time the address is released to the main pool. Only when weekly transaction rate is getting too big (pool is used for 90%, one generates new addresses and ads them to the DB).
vip
Activity: 1386
Merit: 1140
The Casascius 1oz 10BTC Silver Round (w/ Gold B)
November 21, 2012, 05:16:32 PM
#16
BTW, parallels does a GREAT job of running Ubuntu on a Mac including full support for GPU and clipboard as well as resizing the desktop.
vip
Activity: 1386
Merit: 1140
The Casascius 1oz 10BTC Silver Round (w/ Gold B)
November 21, 2012, 05:14:31 PM
#15
I bulk load private keys into bitcoind all the time by commenting out one line of code in the source and recompiling. I comment out the line that rescans from the genesis block after doing an importprivkey. After doing so, importprivkey returns immediately.

Bulk load, and then restart bitcoind with -rescan. Works beautifully.
hero member
Activity: 714
Merit: 500
Psi laju, karavani prolaze.
November 21, 2012, 05:13:57 PM
#14
This is what I use. Same stuff basically. Save and chmod. Pass an int of addresses as first argument.

Code:
#!/bin/bash

FILE=list_$(date +%s).txt

for x in $(eval echo {1..$1})
do
    bitcoind getnewaddress >> $FILE
done

hero member
Activity: 812
Merit: 1000
November 21, 2012, 05:11:27 PM
#13
Fair warning, running the QT client begins to get sluggish after about 15k addresses, and is nearly unusable after 120k or so.

also, armory is extremely slow with 10k addresses. each click takes about 15 minutes... so a small operation involving a few clicks will take hours.

legendary
Activity: 1400
Merit: 1005
November 21, 2012, 01:29:48 PM
#12
Fair warning, running the QT client begins to get sluggish after about 15k addresses, and is nearly unusable after 120k or so.
sr. member
Activity: 798
Merit: 251
November 21, 2012, 01:16:34 PM
#11
Code:
for i in `seq 1 5000`; do bitcoind getnewaddress; done >addresses.txt

That command will generate 5000 addresses on your wallet using bitcoind(no import needed) and save the addresses to a text file.
Change 5000 to any other number you like.

Sorry to bump an old thread, but just thought I'd post a step-by-step equivalent for Windows, since I had a need for it recently.

1) Open a command prompt, go to the bitcoind directory (your bitcoin directory\daemon)

2) Type "bitcoind -daemon".  Keep this window open for as long as the batch below is running.

3) Open another command prompt.  Navigate to the bitcoind directory again.  Enter the code below at the prompt and press enter:
Code:
for /l %x in (1, 1, 5000) do bitcoind getnewaddress >> newaddrs.txt

If you want to put the above code in a batch file, use 2 '%' symbols in front of the x instead of 1.  Replace the 5000 in the code above with the number of addresses you'd like to generate.  All addresses created will be dumped to newaddrs.txt, and bitcoind happily stores them in your official client wallet automatically.  Theoretically you can enter that same command above in multiple command prompts simultaneously and generate new addresses faster.
legendary
Activity: 1358
Merit: 1002
August 19, 2012, 11:01:00 AM
#10
After googling some more I guess I'm SOL if I have a Mac and want to do business with Bitcoins.

1) Bitcoind apparently doesn't work on Mac OS X.
2) The Armory client is pretty hard to compile.

Guess I have a reason to fire up my Windows partition :-)

The command psy gave is a linux command I would recommend installing Ubuntu in a virtual machine and running it that way Smiley

This is correct and recommended.
member
Activity: 104
Merit: 100
August 19, 2012, 10:55:09 AM
#9
After googling some more I guess I'm SOL if I have a Mac and want to do business with Bitcoins.

1) Bitcoind apparently doesn't work on Mac OS X.
2) The Armory client is pretty hard to compile.

Guess I have a reason to fire up my Windows partition :-)

The command psy gave is a linux command I would recommend installing Ubuntu in a virtual machine and running it that way Smiley
newbie
Activity: 4
Merit: 0
August 19, 2012, 10:37:26 AM
#8
After googling some more I guess I'm SOL if I have a Mac and want to do business with Bitcoins.

1) Bitcoind apparently doesn't work on Mac OS X.
2) The Armory client is pretty hard to compile.

Guess I have a reason to fire up my Windows partition :-)
hero member
Activity: 812
Merit: 1000
August 19, 2012, 09:13:54 AM
#7
Much much easier if you don't have bitcoind: use the clever Bitaddress.org code ("Bulk Wallet" tab)

Just specify how many addresses you want to generate.

https://www.bitaddress.org/bitaddress.org-v1.6-SHA1-162d1ff4fd1e09222cbaca6c282672ee6c195e1b.html

but then you still have the job of importing them into a wallet, and for the standard client, that will take days.

if you use the bulk address generator of bitaddress.org, your best bet after that is to import into an armory wallet.

legendary
Activity: 1120
Merit: 1016
090930
August 19, 2012, 09:10:35 AM
#6
Much much easier if you don't have bitcoind: use the clever Bitaddress.org code ("Bulk Wallet" tab)

Just specify how many addresses you want to generate.

https://www.bitaddress.org/bitaddress.org-v1.6-SHA1-162d1ff4fd1e09222cbaca6c282672ee6c195e1b.html
newbie
Activity: 4
Merit: 0
August 19, 2012, 08:11:13 AM
#5
why the need to generate them all at once?

if you're getting 10 customers a day, you just need to generate 11+ addresses a day to keep up and fill your db.

why the need to have them as vanity addresses? how long is the vanity string you have in mind?


I would rather just do it once and be done with it.

I was using vanitygen because it was the only tool I knew that could mass-generate bitcoin addresses.
newbie
Activity: 4
Merit: 0
August 19, 2012, 08:09:49 AM
#4
Code:
for i in `seq 1 5000`; do bitcoind getnewaddress; done >addresses.txt

That command will generate 5000 addresses on your wallet using bitcoind(no import needed) and save the addresses to a text file.
Change 5000 to any other number you like.

Nice, just what I was looking for. Thank you very much.

Edit: I'm on a Mac. How do I install bitcoind? I found this wiki-article, but there's nothing listed under the Mac section.

https://en.bitcoin.it/wiki/Running_bitcoind#Mac
hero member
Activity: 812
Merit: 1000
August 19, 2012, 07:58:01 AM
#3
why the need to generate them all at once?

if you're getting 10 customers a day, you just need to generate 11+ addresses a day to keep up and fill your db.

why the need to have them as vanity addresses? how long is the vanity string you have in mind?
legendary
Activity: 1358
Merit: 1002
August 19, 2012, 07:47:27 AM
#2
Code:
for i in `seq 1 5000`; do bitcoind getnewaddress; done >addresses.txt

That command will generate 5000 addresses on your wallet using bitcoind(no import needed) and save the addresses to a text file.
Change 5000 to any other number you like.
newbie
Activity: 4
Merit: 0
August 19, 2012, 07:43:26 AM
#1
Hello

I'm in the process of coding a webshop app, and would like to accept bitcoins.

What I want to do is this:

  • Pre-Generate a few thousand addresses with vanitygen.
  • Import the addresses in a mysql table.
  • Import the private keys in the Bitcoin app so I can easily see the money I've made.
  • Every new user that registers gets a bitcoin address from the mysql table.
  • A bitcoin notification service pings a script on the webserver when someone sends bitcoins to their address.
  • Their balance is updated and they can make purchases.

I'm having a few problems, though:

- Vanitygen is slow (2009 Core 2 Duo)

- Most notification services only support a low number of addresses.

- It's hard to import thousands of bitcoins into the Bitcoin app.

- An internet wallet like Blockchain only supports up to 400 addresses. (is there an alternative that supports more?)

I'd guess someone has done all this before. Is there an easy solution to this? Or am I handling this wrong?
Jump to: