How does Electrum compute seed byte just before BIP-32? As a newbie in Bitcoin and programming it, I am trying to generate BTC addresses from mnemonic. So I read about the BIPs, and found codes in Github that implement those.
I found out that Electrum doesn't implement BIP-39 (by default if I have not mistaken), because mnemonics that are invalid in BIP-39 are accepted by Electrum!
So my question is: How does Electrum do its own &quot;From mnemonic to seed&quot; section (atleast for standard wallet)? This &quot;seed byte&quot; is the one to be used in BIP-32 for generating keys, if I have not mistaken.
I tried the following Python psuedocode (from &quot;Electrum Seed Version System&quot;):
hmac = hmac.digest(b&quot;Seed version&quot;, b&quot;...(12 word mnemonic)...&quot;, hashlib.sha512)
bip32_thing = Bip32(secret = hmac[:32], chain = hmac[32:]) # default: Bip32 main net version (idk what this means)

But my generated master public key and Electrum's doesn't match (most likely I misunderstood the &quot;Seed Version System&quot; altogether). Thanks for responding!
In case it helps: I am using bip-utils in Python.
After many hours, I found it! It is exactly what Mnemonic.mnemonic_to_seed() does in mnemonic.py! (link)
The most relevant part is what it returns:
seed_byte = hashlib.pbkdf2_hmac('sha512', mnemonic.encode('utf-8'), b'electrum' + passphrase.encode('utf-8'), iterations = PBKDF2_ROUNDS)

Where PBKDF2_ROUNDS = 2048. Then, I just did...
bip32_node = Bip32.FromSeed(seed_byte)   # Derivation path: &quot;m/&quot;