Post
Topic
Board Development & Technical Discussion
Merits 11 from 5 users
Re: Is it possible to generate every address from one seed
by
MrFreeDragon
on 17/10/2019, 13:33:19 UTC
⭐ Merited by hugeblack (6) ,joniboini (2) ,o_e_l_e_o (1) ,pooya87 (1) ,odolvlobo (1)
In order to understand, how many address could be generated from one seed we should go to the process of address generation in HD wallets.
As bitmover said, there are 4 billion children possible:

From antonopoulos mastering bitcoin:
Quote
https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch05.asciidoc#navigating-the-hd-wallet-tree-structure
The HD wallet tree structure offers tremendous flexibility. Each parent extended key can have 4 billion children: 2 billion normal children and 2 billion hardened children. Each of those children can have another 4 billion children, and so on. The tree can be as deep as you want, with an infinite number of generations.

To be exact, the 4 billions means 2^32 - 1 = 4 294 967 295 (this was a limit designed in HD wallets).

The path format of HD wallets is m / purpose' / coin_type' / account' / change / address_index, where account, change and address_index are dependnecies for address creation based on master private key (SHA of the seed).
Let's say for bitcoin it is m/44' /0 / account' / change / address_index

account and address_index could be in the range from 0 to 2^32-1 (2^32 total combinations), change could be 0 or 1 (change address or not), so 2 total combinations.

Hence, the total number of possible combinatins is 2^32 * 2^32 * 2*1 = 2^(32+32+1) = 2^65 which is 2^191 less than the total possible private keys and 2^95 less than the total possible addresses (cinsidering hash160 function) for every address type (legacy, segwit, bech32)

So, considering the HD wallet limitation (2^32 for child and address index), we need at leat 2^95 different seeds in order to generate all possible addresses (withount collisions).