What does 44' mean in BIP44?

2

After reading BIP44, I saw

Purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation.

I believe 0x8000002C is 128 as an integer, how does this equate to 44' however?

I also believe that the ' means that it is a "hardened key", is it hardened because 128 is between 0 and 2^32 - 1 ? Which means that the only key that can derive it, is the private key?

To further elaborate my thinking, which may or may not be right:

These are the levels:

m / purpose' / coin_type' / account' / change / address_index

purpose, coin_type and account, all have to be derived with the private key. They will always be between 0 and 2^32 -1

I have also come to believe that if we have derive a change address with the xpub, then if we derive the same path with xpriv, we can spend from that change address?

For example, if I receive some funds to the change address with path:

m / 44' / 0' / 0' / 0 / 0

Then to spend from this specific address, I would need the private key that corresponds to it. To get it, I would use the xpriv on this path?

Kyle Graham

Posted 2018-04-25T21:25:51.817

Reputation: 472

Not a full answer, but you should read BIP32. It explains what hardened derivation is, and what is possible with and without it.Pieter Wuille 2018-04-25T22:12:20.383

@pieter-wuille Alright, I will re-read it again. I was hoping to get some clarification as I am reading an implementation of it and it does not seem to be following the guide. Edit: you are the author haha, the bearded one. Thanks for BIP32, will give it another gander!Kyle Graham 2018-04-25T22:28:58.733

Also, change addresses would have the path m/44'/0'/0'/1/n.Raghav Sood 2018-04-25T23:47:50.283

@raghav-sood thanks for the correction. Helps a lot to see where I misunderstood or made reckless mistakes!Kyle Graham 2018-04-26T04:57:13.657

Answers

3

I believe 0x8000002C is 128 as an integer

... No, it isn't. First of all, it already is an integer, just represented in hexadecimal. In decimal it is 2147483692. How did you get 128?

how does this equate to 44' however?

44' means that hardened keys should be used. The distinguisher for whether a key a given index is hardened is that the index is greater than 2^31, which is 2147483648. In hex, that is 0x80000000. That is what the apostrophe (') means.

The 44 comes from adding it to 2^31 to get the final hardened key index. In hex, 44 is 2C, so 0x80000000 + 0x2C = 0x8000002C.

I also believe that the ' means that it is a "hardened key", is it hardened because 128 is between 0 and 2^32 - 1 ?

No, hardened means that the key index is between 2^31 and 2^32 - 1. Between 0 and 2^31 - 1 are unhardened keys.

Which means that the only key that can derive it, is the private key?

Yes.

Andrew Chow

Posted 2018-04-25T21:25:51.817

Reputation: 40 910

Hey Andrew! I saw 0x80 in code and made that mistake. Thank you for showing me where I was wrong. Your explanation makes it clear why 0 can be hardened. If I derive the normal key with the xpub on a vulnerable server, how would I know what path to take with the xpriv to get the private key to spend the funds?Kyle Graham 2018-04-26T04:53:39.043

You wouldn't know the path of something derived from the xpub unless you recorded the path that you used.Andrew Chow 2018-04-26T05:01:23.880

Oh, so if I derive a normal key using the xpub, how would I get the corresponding private key for it? If I knew the path, would it be the same path but hardened?Kyle Graham 2018-04-26T05:06:05.220

No, it is the same path but derived from the xpriv. Hardening is something else.Andrew Chow 2018-04-26T05:19:29.550

Oh I understand. The xpriv can make normal and hardened keys. If yo make a normal key with the xpub, you can use the same path with the xpriv to produce the normal key, but with the private key to spend from it. Thanks for taking the time to explain, AndrewKyle Graham 2018-04-26T05:25:34.887