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.
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
| Concept | Description |
|---|---|
Mnemonic | A human-readable BIP-39 seed phrase (12–24 words) used as the root secret for key derivation. |
Private Key | A secret scalar derived from the mnemonic. Encoded in Bech32 format for storage and display. |
Public Key | The public counterpart of the private key, used to generate the IOTA address and verify signatures. |
Flagged Public Key | The public key bytes prefixed with a scheme flag byte (Base64-encoded), used internally by the IOTA protocol. |
Address | A 32-byte IOTA address derived from the public key, displayed as a 0x-prefixed hex string. |
Derivation Path | A 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:
| Scheme | Default Path | Password Support | Notes |
|---|---|---|---|
| Ed25519 | m/44'/4218'/0'/0'/0' | Optional | Default scheme. Fast and widely supported. |
| Secp256k1 | Derived from account index | Optional | Bitcoin-compatible curve. Accepts an optional passphrase. |
| Secp256r1 | Custom (e.g. m/74'/4218'/0'/0/2) | Optional | NIST 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.
- Rust
- Go
- Python
- Kotlin
- Swift
loading...
loading...
loading...
loading...
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>
All three schemes derive different addresses from the same mnemonic. This is expected — each scheme uses a different cryptographic curve and derivation path.