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.