Generate private keys, public keys, and wallet addresses from a mnemonic seed, private key, or public key. Supports arbitrary BIP32/BIP44 HD paths and outputs Bech32 (Cosmos SDK) and hex (Ethereum) addresses.
- Private key, public key, and address derivation from a mnemonic seed.
- Public key and address derivation from a private key.
- Address derivation from a public key (hex or base64).
- Arbitrary HD derivation paths.
- Bech32 (Cosmos SDK) and Ethereum (hex) addresses.
- Selectable key type (Canonical, ETH secp256k1, secp256k1).
Clone, install, and build:
git clone https://github.com/cordtus/wallet_generator.git
cd wallet_generator
bun install
bun run buildbun run start prompts for mode (Mnemonic, Private Key, Public Key), derivation path, Bech32 prefix, and key type.
bun run keygen is the non-interactive CLI. Secrets are read from environment variables or stdin (never argv).
MNEMONIC="your twelve twenty four word seed phrase here" \
bun run keygen --mode mnemonic --style cosmos --prefix seiPUBLIC_KEY=033303c7d61c8e8582de6ed52e6227408eb957abc98ef5759514cdac1bb5cd0a42 \
bun run keygen --mode public-key --prefix seiPRIVATE_KEY=8d5a5d5a... \
bun run keygen --mode private-key --style evm --prefix cosmos| Option | Description | Default |
|---|---|---|
--mode <mnemonic|private-key|public-key> |
Derivation mode (required) | — |
--style <cosmos|evm> |
Key type / address derivation | cosmos |
--prefix <prefix> |
Bech32 prefix | sei |
--path <path> |
HD derivation path (mnemonic only) | style default |
--help |
Show help | — |
Style defaults: evm uses path m/44'/60'/0'/0/0 with the ETH key type; cosmos uses m/44'/118'/0'/0/0 with the Canonical key type.
- Canonical (default):
PublicKey → SHA256 → RIPEMD160 → Bech32for Cosmos;PublicKey → Keccak256 → last 20 bytes → Hexfor Ethereum. - ETH secp256k1: Skips RIPEMD160 for the Cosmos address (uses Keccak256 → Bech32). Ethereum unchanged.
- secp256k1: Skips Keccak256 for the hex address (uses RIPEMD160 → Hex). Cosmos unchanged.
Hex (compressed) or base64:
033303c7d61c8e8582de6ed52e6227408eb957abc98ef5759514cdac1bb5cd0a42
AzMDx9YcjoWC3m7VLmInQI65V6vJjvV1lRTNrBu1zQpC
All runtime dependencies are pinned to exact versions in package.json and the lockfile, so they cannot be silently updated. The critical operations (key derivation, hashing, curve math) use the @noble/*, bip32, bip39, bech32, and @bitcoinerlab/* libraries. We review the dependency tree with bun audit and keep it free of reachable known vulnerabilities.
We cannot account for external dependencies being hijacked or compromised upstream, but as of August 23, 2026 all runtime dependencies have been reviewed and no issues were found. This review applies only to the pinned versions in this repository; exercise caution before upgrading.
bun test # run tests
bun run lint # lint and fix- Cordt Hanson - Creator / maintainer
- Marius Modlich - Major contributor
MIT License © 2024 Cordt Hanson