Lux Docs

Key Derivation

BIP-44 HD key derivation paths

The Lux wallet uses hierarchical deterministic (HD) key derivation following BIP-32/BIP-44 standards. A single BIP-39 mnemonic generates all keys across all chain types.

Derivation Paths

ChainPathCoin TypeNotes
C-Chainm/44'/60'/0'/0/i60 (ETH)Ethereum-compatible addresses
P-Chainm/44'/9000'/0'/0/i9000 (LUX)Bech32 platform addresses
X-Chainm/44'/9000'/0'/0/i9000 (LUX)Bech32 exchange addresses

Key Types

TypeAlgorithmDerivationPurpose
ECsecp256k1BIP-44Transaction signing, EVM compatibility
BLSBLS12-381HKDF from mnemonic seedConsensus signatures
ML-DSANIST Level 3HKDF from mnemonic seedPost-quantum signatures
RingtailRing signaturesHKDF from mnemonic seedPrivacy operations

Mnemonic to Key Flow

BIP-39 Mnemonic (12 or 24 words)
  -> PBKDF2 with passphrase -> 512-bit seed
    -> BIP-32 master key
      -> BIP-44 derivation (secp256k1 keys)
    -> HKDF derivation
      -> BLS keys
      -> ML-DSA keys
      -> Ringtail keys

Address Formats

ChainFormatExample
C-ChainEIP-55 checksummed hex0x9011E888251AB053B7bD1cdB598Db4f9DEd94714
P-ChainBech32 with P-lux prefixP-lux1e44zjaddy52vjqa40ws...
X-ChainBech32 with X-lux prefixX-lux1wst8jt3z3fm9ce0z6ak...

Index Convention

  • Index 0 is the default key
  • On P-Chain, index 0 may be locked if listed in initialStakedFunds in genesis
  • Use index 1+ for unlocked operational keys

Code Example

import "github.com/luxfi/sdk/key"

// Generate mnemonic
mnemonic, _ := key.GenerateMnemonic(128) // 12 words

// Derive keys at different indices
for i := uint32(0); i < 5; i++ {
    privKey, _ := key.DeriveKey(mnemonic, i)
    addr := generateAddress(privKey.PublicKey())
    fmt.Printf("[%d] %s\n", i, addr)
}

On this page