Bitcoin Forum
January 18, 2020, 01:26:30 PM *
News: Latest Bitcoin Core release: 0.19.0.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: noob question about `bitcoin-cli getnewaddress`  (Read 185 times)
bitachoin
Newbie
*
Offline Offline

Activity: 3
Merit: 1


View Profile
October 27, 2018, 02:00:12 AM
Merited by DarkStar_ (1)
 #1

How many times can I call `getnewaddress`? what exactly is happening to create a new address every time?

thank you for your help!
1579353990
Hero Member
*
Offline Offline

Posts: 1579353990

View Profile Personal Message (Offline)

Ignore
1579353990
Reply with quote  #2

1579353990
Report to moderator
1579353990
Hero Member
*
Offline Offline

Posts: 1579353990

View Profile Personal Message (Offline)

Ignore
1579353990
Reply with quote  #2

1579353990
Report to moderator
1579353990
Hero Member
*
Offline Offline

Posts: 1579353990

View Profile Personal Message (Offline)

Ignore
1579353990
Reply with quote  #2

1579353990
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1579353990
Hero Member
*
Offline Offline

Posts: 1579353990

View Profile Personal Message (Offline)

Ignore
1579353990
Reply with quote  #2

1579353990
Report to moderator
Pmalek
Legendary
*
Offline Offline

Activity: 1190
Merit: 1221



View Profile
October 27, 2018, 08:02:47 AM
 #2

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.

████████████████████████████
████████▀▀ █▀ █▀ ▀██████████
█████████▄ ▄▄▄▄▄▄███████████
██████████▀     ▀  ▀████████
███████▀ ▀  ▄█▀▀▀█▀▀████████
██████▄      █▄  ▀▀  ▀██████
██████         ▄▄█▄ ▄ ▀█████
█████ ▄         ▀▀ ▄ ▀ █████
██████▌          █▀█▀ ▐█████
███████  ▄▌         ▄ ██████
████████▄█         ▄████████
█████████▀     ▄▄ ▄█████████
████████████████████████████
.JACKMATE'S...........
.
MAJESTIC..
████████████████████████
███████████████████████
████████████████████████
████████████████████████
████████████████████████
████████████████████████
████████████████████████
████████████████████████
████████████████████████
████████████████████████
████████████████████████
████████████████████████
████████████████████████
.
..WIN 1 BITCOIN ON EVERY PREMIER LEAGUE MATCHDAY..
████████████████████████████████
████████████▀█▀ ▀█▀█▀███████████
███████████▄ ▄▄▄▄▄▄▄████████████
███████████▀▀▄▄▄▄▄▄▄▄███████████
█████████▀▄ ██▀▄▄▄ ▀ ▄▀█████████
███████▀ ▀█████▄▄▄█▄▄▄██████████
███████▀▄████████▀  ▀█ █▐███████
███████ ▀█████████▄█▀▀██ ███████
████████ ███▀██████ ▄ ██ ███████
████████▌▐▀▄ ██████████ ▄███████
█████████▄██▌▐█████▀██ █████████
████████████▄▀▀▀▀▀▄ ▀▄██████████
████████████████████████████████
.
.JOIN US - IT'S FREE! .
aleksej996
Sr. Member
****
Offline Offline

Activity: 490
Merit: 328


Do not trust the government


View Profile
October 27, 2018, 09:53:11 AM
 #3

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.
AdolfinWolf
Legendary
*
Offline Offline

Activity: 1288
Merit: 1124


people run from rain but sit in bathtubs of water


View Profile
October 27, 2018, 11:08:43 AM
 #4

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?

bitachoin
Newbie
*
Offline Offline

Activity: 3
Merit: 1


View Profile
October 27, 2018, 02:08:47 PM
 #5

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.
bob123
Legendary
*
Offline Offline

Activity: 1134
Merit: 1652



View Profile WWW
October 28, 2018, 12:04:10 PM
Merited by AdolfinWolf (1)
 #6

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.

HCP
Legendary
*
Offline Offline

Activity: 1218
Merit: 2134

<insert witty quote here>


View Profile
October 30, 2018, 08:45:24 PM
Merited by achow101 (3)
 #7

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://bitcointalk.org/index.php?topic=2940114.msg30228579#msg30228579

seoincorporation
Legendary
*
Offline Offline

Activity: 1596
Merit: 1538


BtcBoss


View Profile
October 31, 2018, 08:00:31 PM
 #8

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

.BitDice.               ▄▄███▄▄
           ▄▄██▀▀ ▄ ▀▀██▄▄
      ▄▄█ ▀▀  ▄▄█████▄▄  ▀▀ █▄▄
  ▄▄██▀▀     ▀▀ █████ ▀▀     ▀▀██▄▄
██▀▀ ▄▄██▀      ▀███▀      ▀██▄▄ ▀▀██
██  ████▄▄       ███       ▄▄████  ██
██  █▀▀████▄▄  ▄█████▄  ▄▄████▀▀█  ██
██  ▀     ▀▀▀███████████▀▀▀     ▀  ██
             ███████████
██  ▄     ▄▄▄███████████▄▄▄     ▄  ██
██  █▄▄████▀▀  ▀█████▀  ▀▀████▄▄█  ██
██  ████▀▀       ███       ▀▀████  ██
██▄▄ ▀▀██▄      ▄███▄      ▄██▀▀ ▄▄██
  ▀▀██▄▄     ▄▄ █████ ▄▄     ▄▄██▀▀
      ▀▀█ ▄▄  ▀▀█████▀▀  ▄▄ █▀▀
           ▀▀██▄▄ ▀ ▄▄██▀▀
               ▀▀███▀▀
        ▄▄███████▄▄
     ▄███████████████▄
    ████▀▀       ▀▀████
   ████▀           ▀████
   ████             ████
   ████ ▄▄▄▄▄▄▄▄▄▄▄ ████
▄█████████████████████████▄
██████████▀▀▀▀▀▀▀██████████
████                   ████
████                   ████
████                   ████
████                   ████
████                   ████
████▄                 ▄████
████████▄▄▄     ▄▄▄████████
  ▀▀▀█████████████████▀▀▀
        ▀▀▀█████▀▀▀
▄▄████████████████████████████████▄▄
██████████████████████████████████████
█████                            █████
█████                            █████
█████                            █████
█████                            █████
█████                     ▄▄▄▄▄▄▄▄▄▄
█████                   ▄█▀▀▀▀▀▀▀▀▀▀█▄
█████                   ██          ██
█████                   ██          ██
█████                   ██          ██
██████████████████▀▀███ ██          ██
 ████████████████▄  ▄██ ██          ██
   ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ██          ██
             ██████████ ██          ██
           ▄███████████ ██████▀▀██████
          █████████████  ▀████▄▄████▀
[/]
bob123
Legendary
*
Offline Offline

Activity: 1134
Merit: 1652



View Profile WWW
October 31, 2018, 08:08:09 PM
Merited by seoincorporation (1)
 #9

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.

seoincorporation
Legendary
*
Offline Offline

Activity: 1596
Merit: 1538


BtcBoss


View Profile
November 01, 2018, 05: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.

.BitDice.               ▄▄███▄▄
           ▄▄██▀▀ ▄ ▀▀██▄▄
      ▄▄█ ▀▀  ▄▄█████▄▄  ▀▀ █▄▄
  ▄▄██▀▀     ▀▀ █████ ▀▀     ▀▀██▄▄
██▀▀ ▄▄██▀      ▀███▀      ▀██▄▄ ▀▀██
██  ████▄▄       ███       ▄▄████  ██
██  █▀▀████▄▄  ▄█████▄  ▄▄████▀▀█  ██
██  ▀     ▀▀▀███████████▀▀▀     ▀  ██
             ███████████
██  ▄     ▄▄▄███████████▄▄▄     ▄  ██
██  █▄▄████▀▀  ▀█████▀  ▀▀████▄▄█  ██
██  ████▀▀       ███       ▀▀████  ██
██▄▄ ▀▀██▄      ▄███▄      ▄██▀▀ ▄▄██
  ▀▀██▄▄     ▄▄ █████ ▄▄     ▄▄██▀▀
      ▀▀█ ▄▄  ▀▀█████▀▀  ▄▄ █▀▀
           ▀▀██▄▄ ▀ ▄▄██▀▀
               ▀▀███▀▀
        ▄▄███████▄▄
     ▄███████████████▄
    ████▀▀       ▀▀████
   ████▀           ▀████
   ████             ████
   ████ ▄▄▄▄▄▄▄▄▄▄▄ ████
▄█████████████████████████▄
██████████▀▀▀▀▀▀▀██████████
████                   ████
████                   ████
████                   ████
████                   ████
████                   ████
████▄                 ▄████
████████▄▄▄     ▄▄▄████████
  ▀▀▀█████████████████▀▀▀
        ▀▀▀█████▀▀▀
▄▄████████████████████████████████▄▄
██████████████████████████████████████
█████                            █████
█████                            █████
█████                            █████
█████                            █████
█████                     ▄▄▄▄▄▄▄▄▄▄
█████                   ▄█▀▀▀▀▀▀▀▀▀▀█▄
█████                   ██          ██
█████                   ██          ██
█████                   ██          ██
██████████████████▀▀███ ██          ██
 ████████████████▄  ▄██ ██          ██
   ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ██          ██
             ██████████ ██          ██
           ▄███████████ ██████▀▀██████
          █████████████  ▀████▄▄████▀
[/]
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!