A key derivation library for Stellar following SEP-0005 based on the popular library stellar-hd-wallet.
Why making a new library? Because the library stellar-hd-wallet uses Node.js features and so it is not compatible with
some frameworks and environments if you don't use a polyfill (like Angular, Deno, Vanilla JS, etc.)
# Node
npx jsr add @creit-tech/stellar-sep-0005
# Deno
deno add jsr:@creit-tech/stellar-sep-0005You can check more installation options in the JSR package.
import { Keypair } from "@stellar/stellar-sdk";
import { deriveAccount, generateMnemonic, seedFromMnemonic } from "@creit-tech/stellar-sep-0005";
const mnemonic: string = generateMnemonic();
const seed: Uint8Array = await seedFromMnemonic({ mnemonic });
const rawEd25519Seed: Uint8Array = await deriveAccount({ seed, account: 0 });
const keypair: Keypair = Keypair.fromRawEd25519Seed(rawEd25519Seed as any);Note: In our example we use
as anyto ignore the Typescript error saying Uint8Array is missing Buffer features, for theKeypair.fromRawEd25519Seedcase those are not used so it's safe to ignore the alert.
Licensed under the MIT License, Copyright © 2025-present Creit Tech.
Check out the LICENSE.md file for more details.