I have a question about the format of a secret key. Here’s a hypothetical that motivates the question:
I have 100 ZEC and a private key:
I use a password to encrypt part of the private key via characterwise addition mod 32
'secret-extended-key-main1qdkdcwnsqqqabcde...lmnoqrstuvwxyz' + 'password' = 'secret-extended-key-main1qdkdcwnsqqqabcde..lmnopqr4s9aekc2'
So now I have a second private key. (?)
I put 5 ZEC in the account that goes with the first key and 95 ZEC in the account that goes with the second key. I store copies of the first key in a safe, and I remember the password. So as long as I don’t lose the first key, I can re-derive the second key.
Later, bad guys come to my house and threaten to hurt me if I don’t give them my ZEC. So I give them the first key, and they get away with 5 ZEC. Since I have backups, and I remember the password, I can still re-derive the second key, and I get to keep 95 of my ZEC.
I’ve noticed that all of my keys start with ‘secret-extended-key-main1q’, so I imagine that the first part of the key indicates metadata. But at some point things start looking random.
I want to know if there is any internal structure beyond whatever appears in the key header. And if so, where can I learn about it? If there is a checksum in there, for instance, then I won’t be deriving a second key by adding the password–instead I’ll just be creating an invalid one.