WalletUtils

public final class WalletUtils : Sendable

Implements SEP-0005 - Key Derivation Methods for Stellar Accounts.

This class provides BIP-39 mnemonic generation and BIP-44 hierarchical deterministic key derivation for Stellar accounts. It allows creating multiple accounts from a single seed phrase, enabling secure wallet backups and account management.

Typical Usage

// Generate a 12-word mnemonic
let mnemonic = WalletUtils.generate12WordMnemonic()

// Derive first account (index 0)
let keyPair0 = try WalletUtils.createKeyPair(
    mnemonic: mnemonic,
    passphrase: nil,
    index: 0
)

// Derive second account (index 1)
let keyPair1 = try WalletUtils.createKeyPair(
    mnemonic: mnemonic,
    passphrase: nil,
    index: 1
)

See also: