fromEntropy

suspend fun fromEntropy(entropy: ByteArray, language: MnemonicLanguage = MnemonicLanguage.ENGLISH, passphrase: String = ""): Mnemonic

Creates a Mnemonic instance from raw entropy bytes.

For advanced users who generate their own entropy. The entropy is converted to a mnemonic phrase and then to a BIP-39 seed.

Note: A defensive copy of the entropy is made and zeroed after use for security. The original entropy array is not modified.

Return

Mnemonic instance for key derivation

Parameters

entropy

16, 20, 24, 28, or 32 bytes of entropy

language

Word list language for the generated mnemonic (default: English)

passphrase

Optional passphrase for additional security (default: empty string)

Throws

if entropy size is invalid

Example:

// Generate 32 bytes of entropy from a secure source
val entropy = secureRandomBytes(32)
val mnemonic = Mnemonic.fromEntropy(entropy)