0

The below is the snippet from bip-32. I do not understand under what circumstance would 'parent extended public key' be exposed? In the case of e-commerce a 'child extended public key' is derived from 'parent extended public key'. The e-commerce website only needs to know 'child extended public key' to derive public key/addresses. In such case, will knowing 'child extended public key' expose 'parent extended private key'?

"One weakness that may not be immediately obvious, is that knowledge of a parent extended public key plus any non-hardened private key descending from it is equivalent to knowing the parent extended private key (and thus every private and public key descending from it)."

Example of code snippet in Javascript

function testXPub() {
 const mnemonic = 'ddddddddddddddddddddddddddddddddddddddddddddddd'
 const seed = bip39.mnemonicToSeed(mnemonic)
 const node = bip32.fromSeed(seed)
 const xpubNode = node.neutered()
 console.log("xpubNode :%o", xpubNode)
 console.log("xpubNode (string): %o", xpubNode.toBase58())

 const xpub_m_0_node = xpubNode.derive(0)
 console.log("xpub_m_0_node :%o", xpub_m_0_node)
 console.log("xpubNode (string): %o", xpub_m_0_node.toBase58())
 const xpub_m_0_0_node = xpubNode.derive(0).derive(0)
 console.log("xpub_m_0_0_node :%o", xpub_m_0_0_node)
 console.log("xpubNode (string): %o", xpub_m_0_0_node.toBase58())
}

So instead of sharing xpubNode, i would share xpub_m_0_0_node.

2
  • bitcoin.stackexchange.com/q/55383/7272 Commented Aug 14, 2018 at 13:18
  • Not sure how is related to the suggested link? I am interested to understand as per bip32, why would anyone share the 'parent extended public key'? The use case for xpub I assume will be the 'child extended public key' derive from parent extended public key.
    – brianinhk
    Commented Aug 14, 2018 at 14:25

1 Answer 1

0

I am interested to understand as per bip32, why would anyone share the 'parent extended public key'?

The purpose of sharing the parent extended public key is so that child public keys (and thus addresses) can be derived from it without needing to know about a bunch of addresses individually. This is easier for separated setups where an online computer only has the public keys as the online computer does not need to be constantly refreshed with more addresses to watch for. It can generate the addresses itself.

In such case, will knowing 'child extended public key' expose 'parent extended private key'?

No. Only knowing both the parent extended public key and a child private key derived with unhardened derivation exposes the parent private key.

11
  • For the first question, wouldn't the online computer only needs 'child extended public key' to be able to generate new addresses without need of private key? I assume 'child extended public key' will be derive from another machine by another person using 'parent chain code', 'parent public key and non hardened index.
    – brianinhk
    Commented Aug 15, 2018 at 12:00
  • A child public key cannot derive its siblings. It can only derive its own children, so it itself becomes a parent public key.
    – Ava Chow
    Commented Aug 15, 2018 at 17:17
  • I am only interested to understand if i have a child extended public key which is derived from extended public key, will the 'child extended public key' with any non-hardened private key descending from it susceptible for someone to know super parent extended private key? i.e. 'extended private key' --derive--> 'extended public key' --derive--> 'extended public key'
    – brianinhk
    Commented Aug 19, 2018 at 2:46
  • No, as I said in my answer, it is impossible to derive any parent keys from just child key, extended or not, public or not.
    – Ava Chow
    Commented Aug 19, 2018 at 3:38
  • 1
    No. You can only recover the private hey if you have the xpub. So you need m/0's xpub in order to get it's private key once you have m/0/0's private key.
    – Ava Chow
    Commented Aug 19, 2018 at 5:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.