Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: genjix on December 07, 2010, 07:39:24 AM



Title: getnewaddress per wallet
Post by: genjix on December 07, 2010, 07:39:24 AM
Hey,

Quote
< MT`AwAy> genjix: http://pastecoin.com/ <- you're generating a new
                 bitcoin address at each page load, don't you fear wallet.dat
                 will grow to astronomical size?

Is this correct? Does my wallet save every single address?


Title: Re: getnewaddress per wallet
Post by: jgarzik on December 07, 2010, 07:41:15 AM
Hey,

Quote
< MT`AwAy> genjix: http://pastecoin.com/ <- you're generating a new
                 bitcoin address at each page load, don't you fear wallet.dat
                 will grow to astronomical size?

Is this correct? Does my wallet save every single address?

That you generate?  If I understand correctly, it's a public/private keypair, and you have to store the private key.


Title: Re: getnewaddress per wallet
Post by: caveden on December 07, 2010, 08:27:08 AM
It has to store both, you can't deduce the public key from the private key...

This is another reason to have a more modularized bitcoin software... someone could make a wallet-management module that uses a database instead of a file, to better scale...

Is the wallet.dat file indexed?


Title: Re: getnewaddress per wallet
Post by: jgarzik on December 07, 2010, 08:52:59 AM
This is another reason to have a more modularized bitcoin software... someone could make a wallet-management module that uses a database instead of a file, to better scale...

Is the wallet.dat file indexed?

wallet.dat is a db4 key/value database.


Title: Re: getnewaddress per wallet
Post by: Gavin Andresen on December 07, 2010, 12:40:20 PM
Is this correct? Does my wallet save every single address?

Yes.

The getaccountaddress method will return the same address until it is used (until a payment is received on that address).

But getnewaddress always creates, stores, and returns a new address.


Title: Re: getnewaddress per wallet
Post by: Amso on March 01, 2011, 07:40:50 AM
Sorry to bump an old topic. I am researching this subject...

Is this correct? Does my wallet save every single address?

Yes.

The getaccountaddress method will return the same address until it is used (until a payment is received on that address).


Why create a new address when a payment is received?

In a few years, won't there be hundreds or even thousands of addresses if bitcoin is used regularly? That would be very "messy" since bitcoin stores all the addresses.

Won't it be "cleaner" if user just reuse existing addresses until the user decide to create a new address?....May be anonymity is not an issue for an user and the user wish to use the same address again and again.


Title: Re: getnewaddress per wallet
Post by: M4v3R on March 01, 2011, 08:49:14 AM
I think that future Bitcoin clients will have the ability to merge Bitcoin addresses into one - by sending their balance to one final address, and discarding old ones. Would make sense for me.


Title: Re: getnewaddress per wallet
Post by: burtyb on March 01, 2011, 01:37:11 PM
I created 10,000 addresses and that gave a wallet of around 6.2MB - so they will build up after time but I'm sure by the time it matters we'll have other tools to manage them.


Title: Re: getnewaddress per wallet
Post by: khal on March 01, 2011, 05:43:42 PM
It may be a good security to generate 1'000'000'000 addresses to avoid someone to send your wallet over the web :p


Title: Re: getnewaddress per wallet
Post by: theymos on March 01, 2011, 08:18:28 PM
The addresses don't take up all that much room. The wallet.dat size is mostly all the sent/received transactions of yours.


Title: Re: getnewaddress per wallet
Post by: Hal on March 02, 2011, 01:11:26 AM
It may be a good security to generate 1'000'000'000 addresses to avoid someone to send your wallet over the web :p
Actually there's respectable cryptographic research into making signing keys enormous, potentially GBs in size. The purpose is to make it hard for a virus to steal them. Then you might say, well, how do I sign with a multi-GB key? This is the trick, you can sign using a small subset of the key, but the subset changes for each signature, so the virus has to steal the whole key in order to sign arbitrary data.

Not too applicable to Bitcoin, but the basic idea might be useful sometimes.