Author

Topic: noob question about `bitcoin-cli getnewaddress` (Read 316 times)

legendary
Activity: 3346
Merit: 3125
November 01, 2018, 12:10:14 PM
#10
What's the weight of each addy we create, let's suppose we want to create 100 Million addys with our wallet, how many MB we need in our hard disk for that?

You probably won't be able to efficiently create 100 million addresses within core.

If you really want to create that much addresses (to try out your luck; maybe generating an already used address with balance? ), use a different program which is optimized to generate private-/public- keypairs.
Core definitely is not.


It might be worth to note, that you won't find an already used address (if that's what you intend to do).


Regarding the disk space required:
Basically, if you want to store the private key + the address (not within core), you'll need 256 bit (private key) + 160 bit (address) to be stored.
That's 416 bit (= 52 byte) per pair.

For 100 million pairs, thats 4GB of data.

Great answer bob, thanks for the information.

The 100 million addys was a hypothetical scenario. If the goal were to try the luck chasing addys with balance, then I would use something like vanity gen. You know... create the addy, verify if it has balance and if it doesn't then try again with a new addy, but never save the addys unless they have balance.

So, 4 GB for 100 million addys isn't a bad deal at all, I think it would be a lot more.
legendary
Activity: 1624
Merit: 2481
What's the weight of each addy we create, let's suppose we want to create 100 Million addys with our wallet, how many MB we need in our hard disk for that?

You probably won't be able to efficiently create 100 million addresses within core.

If you really want to create that much addresses (to try out your luck; maybe generating an already used address with balance? ), use a different program which is optimized to generate private-/public- keypairs.
Core definitely is not.


It might be worth to note, that you won't find an already used address (if that's what you intend to do).


Regarding the disk space required:
Basically, if you want to store the private key + the address (not within core), you'll need 256 bit (private key) + 160 bit (address) to be stored.
That's 416 bit (= 52 byte) per pair.

For 100 million pairs, thats 4GB of data.
legendary
Activity: 3346
Merit: 3125
I would like to join this noob questions about `bitcoin-cli getnewaddress`.

What's the weight of each addy we create, let's suppose we want to create 100 Million addys with our wallet, how many MB we need in our hard disk for that?

By the way, thanks for the comments guys, I didn't know there was a 1000 addys keypool  Shocked
HCP
legendary
Activity: 2086
Merit: 4361
I believe that it still generates a "keypool" of 1000 keys. As keys are "used" the keypool will be topped back up automatically... As I understand it, this usually occurs when you "unlock" the wallet.

Some reasons for still using the keypool system (more complete restore, not needing to unlock wallet to "generate" a new address etc) are mentioned by achow101 here: https://bitcointalksearch.org/topic/m.30228579
legendary
Activity: 1624
Merit: 2481
Is this actually still the case? Does bitcoin core still use the keypool to store X amounts of adresses? That seems.. unnecessary?

Why not just generate them when needed using the xprv? Is this done simply because it was easier to implement, or is there some kind of reasoning behind it?


Unfortunately i am not sure whether core still uses a key pool (might still be possible, but not necessary).

But the reason for core not to use the xpriv to generate new addresses is, that you'd need to unlock your wallet in this case.
The better option would be to use the xpub (which probably is the case if there is no address pool anymore)



Interesting, thanks for that. Although, when I created my testnet wallet I used the -legacy parameter. Does that change things?

No. The legacy parameter is to choose the address type (legacy/segwit).
This is not related to the address generation itself.
newbie
Activity: 3
Merit: 1
Interesting, thanks for that. Although, when I created my testnet wallet I used the -legacy parameter. Does that change things?

OP is using Bitcoin Core, as seen in headline of this topic.

You can generate an address however many times you like. Each time you run that command on newer versions of Bitcoin Core, you will simply get an address that was already generated in your wallet (HD wallet). You have couple of hundreds, I think, already generated and another batch is likely generated once these run out.
legendary
Activity: 1946
Merit: 1427
OP is using Bitcoin Core, as seen in headline of this topic.

You can generate an address however many times you like. Each time you run that command on newer versions of Bitcoin Core, you will simply get an address that was already generated in your wallet (HD wallet). You have couple of hundreds, I think, already generated and another batch is likely generated once these run out.

Is this actually still the case? Does bitcoin core still use the keypool to store X amounts of adresses? That seems.. unnecessary?

Why not just generate them when needed using the xprv? Is this done simply because it was easier to implement, or is there some kind of reasoning behind it?
sr. member
Activity: 490
Merit: 389
Do not trust the government
OP is using Bitcoin Core, as seen in headline of this topic.

You can generate an address however many times you like. Each time you run that command on newer versions of Bitcoin Core, you will simply get an address that was already generated in your wallet (HD wallet). You have couple of hundreds, I think, already generated and another batch is likely generated once these run out.
legendary
Activity: 2730
Merit: 7065
I assume you are asking how many times you can generate a new address for a BTC payment. You can do that for every new payment you receive or you can use the same address every time. It also depends on your wallet, some wallets will generate a new address for every transaction.
newbie
Activity: 3
Merit: 1
How many times can I call `getnewaddress`? what exactly is happening to create a new address every time?

thank you for your help!
Jump to: