4
1
I was under the impression that an extended public key was comprised of the public key + chain code, and I'm unfamiliar with what comprises the extended private key.
However this does not seem to be the case. As per pywallet:
The key consists of
* 4 byte version bytes (network key)
* 1 byte depth:
- 0x00 for master nodes,
- 0x01 for level-1 descendants, ....
* 4 byte fingerprint of the parent's key (0x00000000 if master key)
* 4 byte child number. This is the number i in x_i = x_{par}/i,
with x_i the key being serialized. This is encoded in MSB order.
(0x00000000 if master key)
* 32 bytes: the chain code
* 33 bytes: the public key or private key data
(0x02 + X or 0x03 + X for public keys, 0x00 + k for private keys)
(Note that this also supports 0x04 + X + Y uncompressed points,
but this is totally non-standard and this library won't even
generate such data.)
It isn't so straight forward as publickey + chaincode. Can someone deconstruct an extended key from beginning to end? According to the amazing iancoleman website the network has an effect on this as well, which doesn't make sense to me either but clearly (as shown above) it is a part of this formula.
The network bytes are a human-safety feature, they do not impact key derivation. They are mainly to identify which network a program should be checking, if it is given an extended key – Raghav Sood – 2018-08-16T19:35:50.443
So only the public or private key + chaincode impact key derivation? Are the rest just identifiers? What about the extended pub/priv key at root, before cointype? The wallet may have multiple coins underneath. Should that data simply not be included? – arshbot – 2018-08-16T19:40:01.937