Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: Bitcoin.PN on April 18, 2022, 12:07:47 AM



Title: Is it possible to derivate all btc address wihout a master xpub key?
Post by: Bitcoin.PN on April 18, 2022, 12:07:47 AM
I've been messing with bitcoin for years since 2015, and I just had this question. Is it possible to derivate all addresses of a master public key?

like say I have address X, and with only knowing that, would it be possible to see all addresses or even know a possible master public key?

Could it be possible at all to recover a master xpub from just 1 address?


Title: Re: Is it possible to derivate all btc address wihout a master xpub key?
Post by: Charles-Tim on April 18, 2022, 12:26:31 AM
Is it possible to derivate all addresses of a master public key?
The addresses of hierarchical deterministic (HD) wallet can be derived from the seed phrase, the seed or master private key.

Also the addresses can be derived from the master public key but you can not spend from this later kind of wallet.

like say I have address X, and with only knowing that, would it be possible to see all addresses or even know a possible master public key?
No.

Could it be possible at all to recover a master xpub from just 1 address?
No.

Master public key can be used to generate its bitcoin addresses. This is used in watch-only wallet. But with master public key, you can not spend using the wallet. To spend, you need the master private key.

You can not use addresses to know master public key.

To make this simple for you in brief. Seed phrase can generate the seed, the seed can generate the master private key, the master private key can generate the child keys (child private key and the child public key), individual child key can generate its corresponding address.

To know more:
https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch05.asciidoc


Title: Re: Is it possible to derivate all btc address wihout a master xpub key?
Post by: o_e_l_e_o on April 18, 2022, 08:49:00 AM
Generating any child key from any parent key involves a one way hash function which cannot be reversed. This is true for all key generation in bitcoin, including generating a single address from a master public key. You cannot go backwards up the chain from a single address or public key, or indeed from many addresses or public keys, and calculate the parent key from which they were derived (unless you have additional information from somewhere else).

Could it be possible at all to recover a master xpub from just 1 address?
Even if I knew a million addresses from your wallet, I couldn't recover your parent public key.


Title: Re: Is it possible to derivate all btc address wihout a master xpub key?
Post by: Bitcoin.PN on April 18, 2022, 02:58:38 PM

Even if I knew a million addresses from your wallet, I couldn't recover your parent public key.

That's very interesting. But, unless you had the master xpub key, there's NO WAY to know all of my addresses; UNLESS you use them together, like:

Address A has 1 BTC
Address B has 2 BTC

And then you create a tx of 2.5BTC to Address C and 0.5btc to Address (change address) D.

That way, you would be able to see that Address A, B, C and D are all connected, but other than that, there's no chance to see all other addresses :)


Title: Re: Is it possible to derivate all btc address wihout a master xpub key?
Post by: o_e_l_e_o on April 18, 2022, 03:45:33 PM
That's very interesting. But, unless you had the master xpub key, there's NO WAY to know all of my addresses; UNLESS you use them together, like:

Address A has 1 BTC
Address B has 2 BTC

And then you create a tx of 2.5BTC to Address C and 0.5btc to Address (change address) D.
Combining inputs from different addresses together in the same transaction is a strong indicator those addresses are owned by the same entity. In many transactions it is also possible to identify which output is probably the change (unless you actively take steps to obfuscate this information), and so again you can link this address to the same owner as the inputs.

That way, you would be able to see that Address A, B, C and D are all connected, but other than that, there's no chance to see all other addresses :)
That's not accurate though. There are many ways that people leak all the addresses in their wallet to third parties. The most common is by not running your own node. Any wallet which is not Bitcoin Core or is being pointed at your own node/server must connect to a third party server to query the history of the addresses in the wallet. When you do this, you send all the addresses in your wallet to the server and the server looks them up for you and send backs the balance and relevant history for those address. By doing so, the server can therefore link all the addresses in your wallet together.