Bitcoin Forum
April 18, 2024, 11:05:03 PM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Generate bunch of payment addresses  (Read 1732 times)
giantdragon (OP)
Legendary
*
Offline Offline

Activity: 1582
Merit: 1002



View Profile
July 18, 2011, 08:33:33 PM
 #1

I need to generate many Bitcoin addresses that I will give to customers on my website. I tried to use JSON-RPC from PHP with command "getnewaddress" in loop, but speed is not satisfactory (about 1 second for each address). Just few simultaneous requests and my server probably will be down. Another idea is to pre-generate addresses, store them in database and extract when need. Is it possible to speed up address generation process?
1713481503
Hero Member
*
Offline Offline

Posts: 1713481503

View Profile Personal Message (Offline)

Ignore
1713481503
Reply with quote  #2

1713481503
Report to moderator
1713481503
Hero Member
*
Offline Offline

Posts: 1713481503

View Profile Personal Message (Offline)

Ignore
1713481503
Reply with quote  #2

1713481503
Report to moderator
If you want to be a moderator, report many posts with accuracy. You will be noticed.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713481503
Hero Member
*
Offline Offline

Posts: 1713481503

View Profile Personal Message (Offline)

Ignore
1713481503
Reply with quote  #2

1713481503
Report to moderator
error
Hero Member
*****
Offline Offline

Activity: 588
Merit: 500



View Profile
July 18, 2011, 08:36:02 PM
 #2

Sure, you can get new addresses in advance and use them later.

3KzNGwzRZ6SimWuFAgh4TnXzHpruHMZmV8
bitlotto
Hero Member
*****
Offline Offline

Activity: 672
Merit: 500


BitLotto - best odds + best payouts + cheat-proof


View Profile WWW
July 19, 2011, 01:46:25 AM
 #3

You COULD use openssl to make the keys. You would then have to import them, but at least when you import them you can do them one at a time. I don't know if it would be any faster though.

*Next Draw Feb 1*  BitLotto: monthly raffle (0.25 BTC per ticket) Completely transparent and impossible to manipulate who wins. TOR
TOR2WEB
Donations to: 1JQdiQsjhV2uJ4Y8HFtdqteJsZhv835a8J are appreciated.
Alex Beckenham
Full Member
***
Offline Offline

Activity: 154
Merit: 100


View Profile
July 19, 2011, 02:28:57 AM
 #4

Is it possible to speed up address generation process?

I'd like to know too... let's say for whatever reason you needed 100000 addresses in your wallet... what would be the quickest way to generate them?

bitlotto
Hero Member
*****
Offline Offline

Activity: 672
Merit: 500


BitLotto - best odds + best payouts + cheat-proof


View Profile WWW
July 19, 2011, 03:05:03 AM
 #5

Run:
./vanitygen -o addresslist.txt -k 1

For a few hours. You'll have addresses to last a lifetime! Even a few minutes and you'll have a ton of addresses.

vanitygen makes addresses pretty quick if your only requirement is it starts with a 1. (Which they all do)

*Next Draw Feb 1*  BitLotto: monthly raffle (0.25 BTC per ticket) Completely transparent and impossible to manipulate who wins. TOR
TOR2WEB
Donations to: 1JQdiQsjhV2uJ4Y8HFtdqteJsZhv835a8J are appreciated.
Alex Beckenham
Full Member
***
Offline Offline

Activity: 154
Merit: 100


View Profile
July 19, 2011, 03:34:01 AM
 #6

Run:
./vanitygen -o addresslist.txt -k 1

For a few hours. You'll have addresses to last a lifetime! Even a few minutes and you'll have a ton of addresses.

vanitygen makes addresses pretty quick if your only requirement is it starts with a 1. (Which they all do)

So, the above command places the addresses into addresslist.txt, but where do the private keys end up? Does it generate a wallet.dat at the same time?

No point having a list of addresses if you don't own them Smiley

bitlotto
Hero Member
*****
Offline Offline

Activity: 672
Merit: 500


BitLotto - best odds + best payouts + cheat-proof


View Profile WWW
July 19, 2011, 03:40:00 AM
 #7

Example output in file:
Quote
Pattern: 1
Address: 12nZ51BtWfb7GEi8JbrrgnVS2kyGQYqpsp
Privkey: 5JaGyzFRLLAkGGzx5tmGo1LP4VLADtiwjVnMpCZQYPnE4kwCM2J
Pattern: 1
Address: 18HL4zJP8K5ffbzAj3fNerc52VAofsgy3d
Privkey: 5KiqGaCcCq715q4xkFBuvaRUWsn4PDPH4QY6E6yrGrbJLnNbjxZ
Pattern: 1
Address: 1GMpun3eb1YPqQntUztF1GbEuDEsZGK6uk
Privkey: 5KC5G6zmsn2uuVD1MCP6HdPdS1Nk3Hms9XuAD7twesC23BKyr8R
Pattern: 1
Address: 19fH7CTchby2MRTsVLV4N3Vs5tRnHRoDLW
Privkey: 5KT7utqYoSbbWAUpCQgctdTo3QZXiCMXmBcS18qHA25UeUuoSfd
Pattern: 1
Address: 19sK6oJYyiWZH5yazghfeihRSc5RRzYqCu
Privkey: 5J18fJ8SeEifdSsetjSm991pU5bAiJsNfXUTtKXHHUsSXbxKXnt
You could make a script to input it all into a database. Then import the keys whenever they are needed as apposed to making one giant wallet.

*Next Draw Feb 1*  BitLotto: monthly raffle (0.25 BTC per ticket) Completely transparent and impossible to manipulate who wins. TOR
TOR2WEB
Donations to: 1JQdiQsjhV2uJ4Y8HFtdqteJsZhv835a8J are appreciated.
casascius
Mike Caldwell
VIP
Legendary
*
Offline Offline

Activity: 1386
Merit: 1136


The Casascius 1oz 10BTC Silver Round (w/ Gold B)


View Profile WWW
July 19, 2011, 03:43:27 AM
 #8

Isn't there an issue with vanitygen using a poor source of entropy, e.g. the time and date and process number?  If so, taking the 1st address that it provides makes for an easy theft due to a predictable address.

Companies claiming they got hacked and lost your coins sounds like fraud so perfect it could be called fashionable.  I never believe them.  If I ever experience the misfortune of a real intrusion, I declare I have been honest about the way I have managed the keys in Casascius Coins.  I maintain no ability to recover or reproduce the keys, not even under limitless duress or total intrusion.  Remember that trusting strangers with your coins without any recourse is, as a matter of principle, not a best practice.  Don't keep coins online. Use paper or hardware wallets instead.
bitlotto
Hero Member
*****
Offline Offline

Activity: 672
Merit: 500


BitLotto - best odds + best payouts + cheat-proof


View Profile WWW
July 19, 2011, 03:48:42 AM
 #9

Isn't there an issue with vanitygen using a poor source of entropy, e.g. the time and date and process number?  If so, taking the 1st address that it provides makes for an easy theft due to a predictable address.
I don't recall all the details but I think that was before it was discovered the entropy was coming from urandom. So it wouldn't really be an issue... as far as I know. I'm not really an expert on that though.

*Next Draw Feb 1*  BitLotto: monthly raffle (0.25 BTC per ticket) Completely transparent and impossible to manipulate who wins. TOR
TOR2WEB
Donations to: 1JQdiQsjhV2uJ4Y8HFtdqteJsZhv835a8J are appreciated.
samr7
Full Member
***
Offline Offline

Activity: 140
Merit: 430

Firstbits: 1samr7


View Profile
July 19, 2011, 05:12:29 AM
Last edit: July 19, 2011, 05:40:00 AM by samr7
 #10

Isn't there an issue with vanitygen using a poor source of entropy, e.g. the time and date and process number?  If so, taking the 1st address that it provides makes for an easy theft due to a predictable address.

This myth comes from questionable sources (crypto-noobs?) and has absolutely no credibility.

Vanitygen uses the same random number generator as bitcoin itself -- the OpenSSL RNG.  It is true that OpenSSL uses the time and process number, but most of its entropy comes from /dev/urandom.
casascius
Mike Caldwell
VIP
Legendary
*
Offline Offline

Activity: 1386
Merit: 1136


The Casascius 1oz 10BTC Silver Round (w/ Gold B)


View Profile WWW
July 19, 2011, 06:09:47 AM
 #11

This myth comes from questionable sources (crypto-noobs?) and has absolutely no credibility.

There's no need to be a jerk.  The author of vanitygen suggested this himself.  I didn't tear apart his source code so I don't know one way or another.  If this issue has been resolved then so be it.  It's better to be prudent than to be stolen from.

Companies claiming they got hacked and lost your coins sounds like fraud so perfect it could be called fashionable.  I never believe them.  If I ever experience the misfortune of a real intrusion, I declare I have been honest about the way I have managed the keys in Casascius Coins.  I maintain no ability to recover or reproduce the keys, not even under limitless duress or total intrusion.  Remember that trusting strangers with your coins without any recourse is, as a matter of principle, not a best practice.  Don't keep coins online. Use paper or hardware wallets instead.
samr7
Full Member
***
Offline Offline

Activity: 140
Merit: 430

Firstbits: 1samr7


View Profile
July 19, 2011, 07:20:39 AM
Last edit: July 19, 2011, 08:11:26 AM by samr7
 #12

There's no need to be a jerk.  The author of vanitygen suggested this himself.  I didn't tear apart his source code so I don't know one way or another.  If this issue has been resolved then so be it.  It's better to be prudent than to be stolen from.

You're absolutely right.  I'm sorry.

But, for real, what's the bottom line, is the problem real or not?
BkkCoins
Hero Member
*****
Offline Offline

Activity: 784
Merit: 1009


firstbits:1MinerQ


View Profile WWW
July 22, 2011, 06:53:00 AM
 #13

It would be quite easy to write a small script that uses vanitygen and pywallet to create and import private keys (and addresses) into wallets. I'm not sure if you can start with an empty wallet (blank template) for this or if you'd have to create a new wallet for each address (assuming you don't want many in one wallet). It seems like creating new wallets would be more time consuming. Unless pywallet can create a wallet file as well - I haven't checked that.

Another thing with vanitygen is you could make all your customer addresses start with a common prefix so they are easily identifiable. eg. 1dog...

giantdragon (OP)
Legendary
*
Offline Offline

Activity: 1582
Merit: 1002



View Profile
July 22, 2011, 10:31:44 AM
 #14

Generated with default client, took just few hours.
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!