At http://blog.richardkiss.com/?p=313&cpage=1#comment-93828 Peter Wuille says:
I had heard that with HD-Wallets, knowing any one xpub key and any one private key for a public key in the xpub key's chain would result in the chain being revealed up and down.
So what would I want non-prime keys for? Wouldn't it make sense then to define derivation to be limited to the prime space rather than to default to non-prime for small numbers?
Again, did I understand right?
Given this example using bitcore …
var HD = HDPrivateKey()
var hardened = HD.derive("m/5/5'/5/5")
var simple = HD.derive("m/6/6/6/6")
console.log(hardened.xpubkey)
// [1] output is "xpub6EP1wojrFHh7yDe2pbxiMCbdcyGfvv8eJEt28WYL1v14inWKMzss988YQSHU4KpsAkTEFW6dUGbE9LysJXTJzGHFMLFApoHBK6sntTvjxUC"
console.log(hardened.derive(1000).privateKey.toString())
// [2] output is "f0d658dc1b186862fac071bf280a38ab20d28dffe7843900e899cde2e9c01077"
console.log(simple.xpubkey)
// [3] output is "xpub6EohLkw7QkEdFTdsNg7Jeho4ywsf2CvQBHnBbaenTofnSg2JG5BiBzVo1Bm6L1ru5D5jLuDX71YACig1e2QNeJvy39SKYUEcafYNvegMYon"
console.log(simple.derive(1000).privateKey.toString())
// [4] output is "8b0a7eee9f4220dcda06d048520b0cc1a600b3d52963c84ca2b02434348f84ce"
console.log(simple.privateKey.toString())
// [5] output is "b284d9bdc4a798455dc2c4eb9805376b292d57853e4884f0840c03cb581e609e"
At 1 you would learn the xpubkey m/5/5'/5/5 and all its children but no private key.
At 2 you would learn all the xpubkeys and xprivkeys derived from m/5/5'.
At 3 you would learn all the xpubkey m/6/6/6/6 and all its children but no private key.
At 4 you would learn m and all its children including private keys.
There is no need for 5.