Electrum 2FA Wallet - Deriving the Third XPub
Electrum 2FA Wallet - Deriving the Third XPub I'm working on a project which requires me to take an Electrum mnemonic, determine its type and derive the corresponding addresses for that wallet. I found lots of information on how to determine the mnemonic type and covert it into the master seed, but I'm struggling to understand how addresses for the 2FA wallet are derived. To be more exact, I was able to derive both extended keypairs (x1/ and x2/ in the wallet file), but I can't seem to be able to derive the third xpub (x3/ in the wallet file). I've looked through the source code and it seems this key is derived by combining both xpub keys (the keys should be ORDERED ) that can be derived from the master seed (x1/ and x2/), hashing them using SHA-256 and using that as the index when deriving the third xpub. A hard-coded xpub is used as the root. I'm having trouble understanding / implementing this because the SHA-256 algorithm returns 32 bytes of data and the chil...