5

HD wallets as described here are built based on a master seed and a master public key as follows:

PK.b = PK.a + sG
SK.b = SK.a + s
  1. I just got a little confused about this. Is s the mnemonic seed that user knows? which generates the private keys.
  2. Secondly a service provider only needs to know sG to calculate the user's next address. Am I right?
  3. And lastly more importantly I am just wondering whether it is possible to calculate the master private key (seed) if an attacker or service provider gets one child's private key address?
7
  • 1
    The link you give doesn't define the notation PK.a and so on. Commented Mar 9, 2015 at 15:14
  • @NateEldredge precisely you can look at this link
    – abeikverdi
    Commented Mar 11, 2015 at 3:57
  • 1
    @abeikverdi I don't see that notation on the first page of the thread you link, and I don't see it in a search of the forums.
    – Nick ODell
    Commented Mar 14, 2015 at 4:15
  • @NickODell PK.a refers to the public key of a and SK.a refers to the private key of a. G is the generator point and s I suppose is the secret that is used to generate next keys. In HD wallets as you know we can generate new key pairs by adding the private key with a secret s. Anyone without knowing your private key by knowing a "master public key" can generate your next public key. Does this "master public key" refer to sG here?
    – abeikverdi
    Commented Mar 24, 2015 at 8:34
  • @abeikverdi What you're saying doesn't describe BIP32. Are you asking about BIP32, or some other HD wallet system?
    – Nick ODell
    Commented Mar 24, 2015 at 9:15

1 Answer 1

3

I don't know where you found this formula, here is the code to derivate a childkey, the BIP is here, it does not look like your formula, but I'll try to respond to some of your questions.

I just got a little confused about this. Is s the mnemonic seed that user knows? which generates the private keys.

A mnemonic seed is just a sentence that permit you to get the master key with (optionally) a password. A master key is the real important piece of information, a mnemonic is only a way to generate one that can be write it down in words.

Secondly a service provider only needs to know sG to calculate the user's next address. Am I right?

Your formula does not look like what is in the BIP, so I can't really comment on that.

And lastly more importantly I am just wondering whether it is possible to calculate the master private key (seed) if an attacker or service provider gets one child's private key address?

Yes, if all the children in the path to the leaked private are non-hardened keys AND the root HD PubKey leaked. I explain that P 35 of my book.

A non-hardened key can “climb” the hierarchy.
Non-hardened key should only be used for categorizing accounts that belongs to a single control. 
4
  • Thanks for your answer. I know what a mnemonic seed is. I'm not referring to the exact implementation of BIP32. Whats important for me here is that how we can generate the next public key without knowing the private key of the next public key. I am referring to this post"bitcointalk.org/index.php?topic=19137.msg239768#msg239768" by gmaxwell who proposed the idea of HD wallets. Thats what the formula says which I mentioned. Is that incorrect?
    – abeikverdi
    Commented Apr 9, 2015 at 5:41
  • I've never heard about hardened keys. How can you harden it to stop people from climbing back to the root? I definitely love to read your book, but can you explain that to me in summary?
    – abeikverdi
    Commented Apr 9, 2015 at 5:45
  • You can take a look at the implementation. The condition "(nChild >> 31) == 0" means "is non hardened". You can see that when it is non hardened, the child key is derived from the public key, while if it hardened, it is derived from private key. This means that if it is not hardened, you can go back in the hierarchy if you know the parent public key. As I am doing here The post on bitcointalk is outdated compared to the bip. Commented Apr 9, 2015 at 14:42
  • @NicolasDorier Actually, you didn't explain it in the book. You just stated the fact without any explanation. :-)
    – woky
    Commented Apr 20, 2017 at 12:42

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.