Skip to main content

Create an Address from a Mnemonic

This guide explains how to derive a cryptographic key pair and an IOTA address from a BIP-39 mnemonic phrase using the IOTA SDK. The SDK supports three signature schemes Ed25519, Secp256k1, and Secp256r1 across Rust, Go, Python, Kotlin, and Swift.

Security Warning

The mnemonic phrase used in these examples is for demonstration only. Never share or hard-code a real mnemonic in production code. Store mnemonics securely and never commit them to version control.

Prerequisites

Before running these examples, make sure you have:

  • The IOTA SDK installed for your target language see Installation
  • A valid BIP-39 mnemonic phrase (12 or 24 words)
  • Basic familiarity with your chosen language's build tooling

Key Concepts

ConceptDescription
MnemonicA human-readable BIP-39 seed phrase (12–24 words) used as the root secret for key derivation.
Private KeyA secret scalar derived from the mnemonic. Encoded in Bech32 format for storage and display.
Public KeyThe public counterpart of the private key, used to generate the IOTA address and verify signatures.
Flagged Public KeyThe public key bytes prefixed with a scheme flag byte (Base64-encoded), used internally by the IOTA protocol.
AddressA 32-byte IOTA address derived from the public key, displayed as a 0x-prefixed hex string.
Derivation PathA BIP-44/SLIP-10 path (e.g. m/74'/4218'/0'/0/2) specifying which key to derive from the seed.

Supported Signature Schemes

The IOTA SDK supports three cryptographic schemes. Each has different derivation conventions and use cases:

SchemeDefault PathPassword SupportNotes
Ed25519m/44'/4218'/0'/0'/0'OptionalDefault scheme. Fast and widely supported.
Secp256k1Derived from account indexOptionalBitcoin-compatible curve. Accepts an optional passphrase.
Secp256r1Custom (e.g. m/74'/4218'/0'/0/2)OptionalNIST P-256 curve. Uses fromMnemonicWithPath for full path control.

Code Examples

The following examples all use the same mnemonic and produce the same addresses for each signature scheme, regardless of language.

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

Expected Output

Running any of the above examples with the provided mnemonic should produce output in the following format:

Ed25519

Private Key: iotaprivkey1...
Public Key: <base64-encoded-public-key>
Public Key With Flag: <base64-encoded-flagged-public-key>
Address: 0x<64-character-hex-address>

Secp256k1

Private Key: iotaprivkey1...
Public Key: <base64-encoded-public-key>
Public Key With Flag: <base64-encoded-flagged-public-key>
Address: 0x<64-character-hex-address>

Secp256r1

Private Key: iotaprivkey1...
Public Key: <base64-encoded-public-key>
Public Key With Flag: <base64-encoded-flagged-public-key>
Address: 0x<64-character-hex-address>
tip

All three schemes derive different addresses from the same mnemonic. This is expected — each scheme uses a different cryptographic curve and derivation path.

Next Steps