mnemonicToEntropy

abstract fun mnemonicToEntropy(mnemonic: String): ByteArray

Extracts the raw entropy bytes from a BIP-39 mnemonic phrase.

This is the inverse of generateMnemonic — given the words, it returns the bit pattern they encode. Used by wallet storage to persist entropy (smaller than the phrase, reproducible to the phrase on demand).

  • 12 words → 16 bytes

  • 15 words → 20 bytes

  • 18 words → 24 bytes

  • 21 words → 28 bytes

  • 24 words → 32 bytes

Return

The raw entropy bytes

Parameters

mnemonic

The BIP-39 mnemonic phrase

Throws

if mnemonic is invalid