Introduction
In the world of cryptocurrency wallets, the ability to recover funds from a simple set of words is nothing short of magical. This magic is made possible by deterministic wallet standards like BIP32, BIP39, and BIP44. For the Stellar network, the StellarBIP32 specification provides a precise adaptation of these standards to ensure compatibility and security. This article explores the mnemonic generation logic defined in the StellarBIP32 specification, explaining how a human-readable phrase transforms into a hierarchical deterministic (HD) wallet capable of managing multiple Stellar accounts.
What Is StellarBIP32?
StellarBIP32 is a specification that defines how to derive Stellar key pairs from a BIP39 mnemonic phrase using BIP32 hierarchical deterministic derivation. It ensures that any wallet implementing the spec will generate the same addresses and private keys from the same mnemonic, enabling seamless backup and recovery across different software.
Unlike Bitcoin's BIP44, which uses coin type 0, Stellar uses coin type 148 (as per SLIP-0044). The derivation path for Stellar is typically:
m/44'/148'/account_index'
where account_index starts at 0 for the first account and increments for additional accounts.
The Role of Mnemonic Phrases
A mnemonic phrase, often called a seed phrase or recovery phrase, is a sequence of 12, 15, 18, 21, or 24 words that encodes a random seed. This seed is then used to generate a master private key, from which all child keys are derived. The StellarBIP32 spec relies on BIP39 for mnemonic generation and seed derivation.
Step 1: Entropy Generation
The process begins with the generation of entropy—a cryptographically secure random number. The entropy size determines the mnemonic length:
- 128 bits → 12 words

- 160 bits → 15 words
- 192 bits → 18 words
- 224 bits → 21 words
- 256 bits → 24 words
For example, a 128-bit entropy is common for 12-word phrases.
Step 2: Checksum Calculation
A checksum is appended to the entropy to detect errors. The checksum is the first ENT/32 bits of the SHA-256 hash of the entropy, where ENT is the entropy length in bits. For 128-bit entropy, the checksum is 4 bits.
Step 3: Mnemonic Word Encoding
The combined entropy and checksum are split into groups of 11 bits. Each 11-bit value (0–2047) maps to a word in a predefined 2048-word list (e.g., the BIP39 English wordlist). This yields the mnemonic phrase.
Example: 128-bit entropy + 4-bit checksum = 132 bits → 12 groups of 11 bits → 12 words.
Step 4: Seed Derivation
The mnemonic phrase is converted to a 512-bit seed using PBKDF2-HMAC-SHA512 with 2048 iterations. The salt is the string "mnemonic" concatenated with an optional passphrase. This seed is the root of the HD wallet.
From Seed to Stellar Keys
Once the seed is generated, the StellarBIP32 spec dictates how to derive the master key and subsequent child keys.

Master Key Generation
The seed is used with HMAC-SHA512 to produce a master private key and chain code:
I = HMAC-SHA512(Key = "Bitcoin seed", Data = seed)
master_private_key = I_L (left 32 bytes)
master_chain_code = I_R (right 32 bytes)
Note: Despite the use of "Bitcoin seed", this is a BIP32 standard and applies to Stellar as well.
Derivation Path for Stellar
Stellar uses the BIP44 purpose (44'), coin type 148', and account index. The full path is:
m / 44' / 148' / account_index'
44'indicates BIP44 compliance.148'is the SLIP-0044 coin type for Stellar.account_index'is hardened and starts at 0.
Each level uses hardened derivation (indicated by the apostrophe) for security.

Child Key Derivation
For each level, a child key is derived from the parent key using the following steps (for hardened derivation):
- Compute
I = HMAC-SHA512(Key = parent_chain_code, Data = 0x00 || parent_private_key || index). - The left 32 bytes become the child private key (after adding to parent private key modulo curve order).
- The right 32 bytes become the child chain code.
For non-hardened derivation, the parent public key is used instead of the private key.
Stellar Key Pair Formation
The derived private key is a 32-byte Ed25519 seed. The corresponding public key is generated using Ed25519. The Stellar address is then derived from the public key using the StrKey encoding (base32 with a checksum), resulting in addresses starting with G.
Why This Matters
Understanding the StellarBIP32 mnemonic generation logic is crucial for:
- Wallet Interoperability: Users can switch wallets without losing access to funds.
- Security Auditing: Developers can verify that key derivation follows best practices.
- Recovery: A single mnemonic can recover all accounts derived under the path.
Conclusion
The StellarBIP32 specification elegantly combines BIP39 mnemonics, BIP32 HD derivation, and Stellar-specific parameters to create a robust and interoperable wallet standard. By breaking down the mnemonic generation process—from entropy to seed to hierarchical keys—we gain a deeper appreciation for the cryptographic engineering that secures digital assets on the Stellar network. Whether you are a developer, auditor, or curious user, understanding this logic empowers you to interact with Stellar wallets more confidently.