Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: kobik on May 02, 2018, 06:50:01 AM



Title: Can a HD XPubkey be obtained back from a derived public address?
Post by: kobik on May 02, 2018, 06:50:01 AM
Suppose I have an HD public xpubkey and I derive bitcoin public address(es) from it.
Given one of the public bitcoin address derived from it e.g. 1F1tAaz5x1....
Can you get the xpubkey e.g. xpub6DKUi1BvKEgn...
I thought it is impossible, but someone I know claims it is possible.
And if it is possible isn't the privacy compromised in this situation?

Not sure if this is directly related but also take a look at
Deterministic Wallets, Their Advantages and their Understated Flaws ("An Understated Problem" section):
https://bitcoinmagazine.com/articles/deterministic-wallets-advantages-flaw-1385450276/


Title: Re: Can a HD XPubkey be obtained back from a derived public address?
Post by: bob123 on May 03, 2018, 10:08:45 AM
Suppose I have an HD public xpubkey and I derive bitcoin public address(es) from it.
Given one of the public bitcoin address derived from it e.g. 1F1tAaz5x1....
Can you get the xpubkey e.g. xpub6DKUi1BvKEgn...

You don't derive addresses from a xpubkey. You derive (child-)public keys from an xpubkey.
The derivation can not be calculated 'reversed'. It behaves like a hash function.

An address is the hash of your public key which logically also can't be reversed.

So, no. This is not possible.
It is not possible to calculate the public key of the corresponding address (public key is 'exposed' after broadcasting a transaction).
It is not possible to calculate the xpubkey from an public key.



I thought it is impossible, but someone I know claims it is possible.

The person you know probably doesn't have a clue.



And if it is possible isn't the privacy compromised in this situation?

If it would be possible, then yes. But since this is not possible, everything is fine.


Title: Re: Can a HD XPubkey be obtained back from a derived public address?
Post by: HeRetiK on May 03, 2018, 11:16:22 AM
What you should be aware of is that anyone who has access to your xpub key will be able to track any transaction that will move through its derived addresses. So while not as critical as private keys, you should also keep your xpub key safe from prying eyes, otherwise your privacy may be compromised.

Other than that, just like bob123 said: No, you can't derive the xpub key from one of its child public keys.


Title: Re: Can a HD XPubkey be obtained back from a derived public address?
Post by: JohnGalt on May 03, 2018, 05:41:50 PM
Suppose I have an HD public xpubkey and I derive bitcoin public address(es) from it.
Given one of the public bitcoin address derived from it e.g. 1F1tAaz5x1....
Can you get the xpubkey e.g. xpub6DKUi1BvKEgn...
I thought it is impossible, but someone I know claims it is possible.
And if it is possible isn't the privacy compromised in this situation?

Not sure if this is directly related but also take a look at
Deterministic Wallets, Their Advantages and their Understated Flaws ("An Understated Problem" section):
https://bitcoinmagazine.com/articles/deterministic-wallets-advantages-flaw-1385450276/

You cannot derive a key (public or private) from an address because an address is a hash (plus version byte and checksum).

Perhaps you are confusing that with a different issue: you can derive the master private key from the master public key and a child private key.