HardeningConstant = 0x80000000;
(CoinType | HardeningConstant) >> 0
Is it possible to take the hardened number and get the original unhardened coin number?
For example, if the coin is Bitcoin, the path is 0x80000000, but the coin number I want is 0. If the coin is Bitcoin cash, the path is 0x80000091, but I want 145 (0x91). Is there a bitwise operation I can do to get 145 0x91 from 0x80000091?
Is just subtracting safe? I.e. 0x80000091 - 0x80000000 ?
In this case just subtracting is safe. Alternatively you could -- in this case -- also use bitwise XOR, ie. 0x80000091 ^ 0x80000000.
I'm not sure with what else there is to consider when working with hardened derivation, but if all you want is to derive the CoinType that should be it.
Bitwise XOR is the answer! Thanks HeRetik!