from

suspend fun from(mnemonic: String, language: MnemonicLanguage? = null, passphrase: String = ""): Mnemonic

Creates a Mnemonic instance from a BIP-39 mnemonic phrase.

The mnemonic is validated before creating the mnemonic instance. An optional passphrase can be provided for additional security (BIP-39 passphrase extension).

Warning: Using a passphrase creates a completely different mnemonic. Lost passphrases cannot be recovered, and the mnemonic alone cannot restore access to funds if a passphrase was used.

Return

Mnemonic instance for key derivation

Parameters

mnemonic

Space-separated mnemonic phrase

language

Word list language; if null, language is auto-detected

passphrase

Optional passphrase for additional security (default: empty string)

Throws

if the mnemonic is invalid or language cannot be detected

Example:

val mnemonic = "illness spike retreat truth genius clock brain pass fit cave bargain toe"
val mnemonic = Mnemonic.from(mnemonic)

// With passphrase
val secureMnemonic = Mnemonic.from(mnemonic, passphrase = "my secret")

// With explicit language
val frenchMnemonic = Mnemonic.from(frenchMnemonic, language = MnemonicLanguage.FRENCH)