I have a few questions about the extended public/private key, i.e. the purpose of its elements.
Namely, according to the BIP32 standard, the "format" of the extended key is as follows:
[ magic ][ depth ][ parent fingerprint ][ key index ][ chain code ][ key ]
However, what we actually need when generating new child keys is only the chain code and the key (private or public). What is the role of other elements within a given format. I understand that the magic gives the ability to recognize that it is an extended key after encoding with Base58, but even in that case exists a different types of extended keys (zpub/zpriv, ypub/ypriv). I can understand that all those "properties" can help people understand where that key is potentially located within the tree and what we can use it for. For example, if it is XPUB, then we know that we should use BIP44 and how to derive all other keys from it. Since the derivation path according to BIP44 is as follows:
m / purpose' / coin_type' / account' / change / address_index
... if the depth is 2, then we would know that we should use a hardened derivation and that we cannot use XPUB of this key to derive the child public keys since they are hardened. Also, since it is XPUB, we know that all keys derived from this key will only be used for P2PKH. On the other hand, if it was ZPUB/ZPRIV, we would know that we should follow BIP84 as well as the purpose of those keys. And so on...
So, it is clear to me how we, as humans, would use all the elements from the extended key (although it is not clear to me what the parent fingerprint will do for us). Do wallets also interpret extended keys this way? For example, if XPUB/XPUB gets to them, they will know that they follow the BIP44 standard and what the leaf nodes of its derivation path are for (P2PKH), if ZPUB/ZPRIV comes they follow BIP88 and so on. Is that the purpose of the different types of extended keys (different "values" for magic)?
Can someone tell me something more on this topic? What are all those fields for (different forms of magic, depth, etc.)? Is it so that the wallets know how to generate all the other keys, what are the keys for, and so on, or do they also have some other purpose?