Skip to main content

Create a Seed Mnemonic

Alpha Software

The IOTA SDK is currently in alpha. APIs, interfaces, and behavior may change without notice between releases. It is not yet recommended for production use.

About Mnemonics

Mnemonics are a popular method for generating cryptographic seeds in a more user-friendly way. A mnemonic phrase, seed phrase, or recovery phrase is a sequence of words that users can easily write down and verify. These words are carefully selected from a predefined wordlist to ensure compatibility across different wallets and systems.

The IOTA SDK uses the BIP39, BIP44 and SLIP10 standards to generate addresses and sign transactions. This means that the SDK can deterministically derive the seed from a mnemonic or seed phrase, making it easier for your users to write down or remember.

Example Code

You can use the the [generate_mnemonic()] function to generate a random mnemonic.

crates/iota-sdk/examples/generate_mnemonic.rs
loading...

by default, the generated mnemonic will consist of 24 words, but you can pass a [MnemonicLength] to generate a mnemonic with a different number of words.

crates/iota-sdk/examples/generate_mnemonic.rs
loading...

Full Example Code

crates/iota-sdk/examples/generate_mnemonic.rs
loading...

Expected Output

24 word mnemonic: defy forest author famous found replace salad apple trial alien agent crush little east slim seminar icon wall tumble online knee test beyond gloom
12 word mnemonic: charge cheese abandon build zebra small hope anxiety curtain regret noise culture