Developers Forum for XinFin XDC Network

Cover image for Introducing hdwallet.js
Meheret Tesfaye
Meheret Tesfaye

Posted on

Introducing hdwallet.js

Hierarchical Deterministic (HD) Wallet for TypeScript/JavaScript

Website: https://hdwallet.io
Generator: https://hdwallet.online
Source Code: https://github.com/hdwallet-io/hdwallet.js
NPM: https://www.npmjs.com/package/@hdwallet/core

Overview

hdwallet.js is a new TypeScript/JavaScript port of the popular Python-HDWallet library. It brings the full suite of hierarchical deterministic (HD) wallet features like mnemonic generation, BIP standard derivations, curve support, and multi-chain compatibility to the JavaScript ecosystem. It works great in browsers, Node.js, and React Native, making it an open-source HD wallet tool that’s perfect for modern Web3 applications.

If you want to learn more about the original Python-HDWallet and its integration of XinFin (XDC) support, check out my previous post: ⚙️ Introducing HDWallet V3 & XDC Integration

Why We Built It

As Web3 projects started needing frontend or serverless key generation, it became clear that a secure and flexible HD wallet solution in JavaScript was essential. Inspired by the features of python-hdwallet, this port gives developers the same deterministic structure, now easily used in browser extensions, React Native apps, or decentralized platforms—all while keeping strong cryptographic security.

Why TypeScript/JavaScript Now?

Python is still great for backend scripting, but a lot of developers have been asking for a native JS solution because:

  • It allows secure in-browser key generation on the client side
  • It works seamlessly with React, Angular, Vue frontends, and React Native
  • It integrates with popular tools like ethers.js, web3.js, and hardware wallets

This growing demand led to the creation of hdwallet.js: a modern, reliable port built specifically for the JavaScript ecosystem.

Core Highlights

✅ 100% Open-Source

All source code is available on GitHub, under MIT license, empowering community contributions, transparency, and forkability.

🌐 Multi-Currency & Curve Support

  • Supports 200+ blockchains: XinFin, Bitcoin, Ethereum, Cardano, Solana, Cosmos, and more https://hdwallet.io/cryptocurrencies.
  • ECC Curves: Secp256k1, Ed25519, Nist256p1, Kholaw-Ed25519, Ed25519-Blake2b, Ed25519-Monero variants
  • Address formats: P2PKH, P2WPKH, Bech32, Taproot (P2TR), Cosmos, Tron, XinFin, etc.

🧠 Mnemonic & Entropy Sources

  • BIP39, Electrum v1 & v2, Monero, Algorand
  • Configurable entropy strengths (128–256 bits)
  • Full support for passphrase-based seed derivation

🧱 HD Derivation Standards

  • Implements BIP - 32/39/44/49/84/86
  • Also supports SLIP10, CIP1852 (Cardano), and Custom paths
  • Derives hardened, non-hardened, xpub/xprv hierarchies

For more: https://hdwallet.io/features

Quick Example for XDC

Here’s how you might derive an XinFin address using hdwallet.js

Library

Installation: npm install @hdwallet/core

// xinfin.hdwallet.ts

import { HDWallet } from '@hdwallet/core';
import { BIP39Mnemonic } from '@hdwallet/core/mnemonics';
import { XinFin } from '@hdwallet/core/cryptocurrencies';
import { BIP44Derivation, CHANGES } from '@hdwallet/core/derivations';
import { PUBLIC_KEY_TYPES } from '@hdwallet/core/consts';
import { BIP44HD } from '@hdwallet/core/hds';

// Initialize XinFin HDWallet
const hdwallet: HDWallet = new HDWallet(
  XinFin, {
    hd: BIP44HD,
    network: XinFin.NETWORKS.MAINNET,
    publicKeyType: PUBLIC_KEY_TYPES.COMPRESSED,
    passphrase: null
  }
).fromMnemonic(   // Get XinFin HDWallet from mnemonic phrase
  new BIP39Mnemonic(
    "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
  )
).fromDerivation(   // Drive from BIP44 derivation
  new BIP44Derivation({
    coinType: XinFin.COIN_TYPE,
    account: 0,
    change: CHANGES.EXTERNAL_CHAIN,
    address: [0, 10]  // or '0-10'
  })
);

console.log('Mnemonic:', hdwallet.getMnemonic())
console.log(`Base HD Path:  m/44'/{XinFin.COIN_TYPE}'/0'/0/<address>`, '\n')

// console.log dived XinFin HDWallet information's
for (let derivation of hdwallet.getDumps(['root', 'indexes'])) {
  // console.log path, address and private_key
  console.log(`${derivation['at']['path']} ${derivation['address']} ${derivation['private-key']}`);
}
Enter fullscreen mode Exit fullscreen mode

Output

Mnemonic: abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about
Base HD Path:  m/44'/{XinFin.COIN_TYPE}'/0'/0/<address> 

m/44'/550'/0'/0/0 xdcF4f4Ec5A2380A1599ff802b798FC002F83a001A8 f5f43f03dd8bc815a911f505156fe0c67a3b390db3839472ca4995fd6087df25
m/44'/550'/0'/0/1 xdcc8725Efa8B6684B259E129DcDd14102d00b284F1 d22441e70e285c497db9a4248e7bc79db46688ae06637ba19095ab7a75a2acd9
m/44'/550'/0'/0/2 xdcAA8A837d4cCb6a8cE34Ee9544AaEA00e58150Bc8 869b17599e815c27eb606ea85be952d6ac9ca1dcb180b1fd4856362bde884ebe
m/44'/550'/0'/0/3 xdcE025663931eA8eB905e26e66633f5C3CCA3B4145 ef8819ed6e1f48c7a7acf1426fcb3d55c24bee46410ef1f63d4f9534748fdd9f
m/44'/550'/0'/0/4 xdc8D466B82b804f415364a4B59B6edc78FDEbE88d4 120d976fe4a08c6cf04982dddbb34ba5a3d3c30e6666971ef3f0fb18c5c56d2b
m/44'/550'/0'/0/5 xdc09607b5a0AbFA94518211f38C9c96f571168cFd9 f852caa5d372593d278be40a2b4b445f8f741db1caa21d4d7c125481b3fa766a
m/44'/550'/0'/0/6 xdc46ad48050f6fA70660a6336d31F1066f8f0a2d42 4559966bc88200a6ef75e83039a34c5747b38c0b408279ce86773bfe4579d713
m/44'/550'/0'/0/7 xdcA87671F844980193ED4F368176e28A769ECA8993 7ff15110b50d35a5882b8cacfd5ebdc2591da5044187379bd9de9ee4d0d0096f
m/44'/550'/0'/0/8 xdccBf6cC04c0814566eeF2040FF95B11E8564D6B5e 6e2ebd15054cca73f2bf1e1873bd8e50affe6b922fab76e336ed8c53c45438c7
m/44'/550'/0'/0/9 xdc7C2745fF0ed2e8Ff28857bdb642EC998B78f1a48 9ef9e1fd77bc60264645cd926c02a4f302602f59e5f9fdbe13e75d00cd4c3242
m/44'/550'/0'/0/10 xdcD6bf428Fc361A3a94357b27672a7AecDbf5d5194 1302bb68e8167f364aecab41a7ac0809c054db36941817edc9633061dab92416
Enter fullscreen mode Exit fullscreen mode

Online Generator

Link: https://hdwallet.online/dumps/all/XDC

A secure, client-side web interface to generate HD wallets offline:

  • 🔐 No server communication — 100% browser-based
  • 🔄 Convert between entropy, mnemonic, seed, derivation path
  • 🔎 Export addresses, private/public keys, WIF, extended keys
  • 📤 Supports SLIP-10 ECC key derivation + donation address generator

Try it for XinFin: https://hdwallet.online/dumps/all/XDC?network=mainnet&hd=BIP44&from=entropy&derivation=BIP44&client=BIP39&entropy=00000000000000000000000000000000&language=english&public-key-type=compressed&semantic=p2pkh&account=0&change=external-chain&address=0-10&format=CSV&include=at%3Apath%2Caddress%2Cprivate-key&generate=true

Image description

Use Cases

  • Web3 wallets & dApps
  • Offline paper wallets
  • HD key automation in React/Angular apps
  • Token & NFT batch address generation
  • CLI tool for developers (planned)

Future Roadmap

🔄 Planned for hdwallet.js

  • Sign/verify API support (EVM & UTXO chains)
  • UTXO address discovery & gap limit scanning
  • Browser-native QR code generator & secure backup
  • CLI + NPM toolchain: hdwallet dumps ...
  • TypeScript-first documentation with examples
  • Multi-Signature Wallets: Collaborative transaction authorization via customizable threshold schemes.
  • Hardware Wallet Integration: Compatibility with Ledger, Trezor, and Keystone devices.
  • BIP-325 (Signet): Enhanced testing environments for developers.
  • SLIP-0039 (Shamir Backup): Social recovery for seed phrases.

How You Can Support

  • ⭐ Star the repo: https://github.com/hdwallet-io/hdwallet.js
  • 🧪 File issues or submit PRs
  • 📣 Share on XDC, EVM, and crypto forums
  • 💰 Consider supporting development via direct crypto donation: xdcD3cbCB0B6F82A03C715D665b72dC44CEf54e6D9B

Final Thoughts

hdwallet.js brings the trusted architecture of python-hdwallet into the JavaScript ecosystem — modular, powerful, and community-driven. Whether you're a developer, auditor, or Web3 innovator, this tool puts complete key and wallet control into your hands. And just like hdwallet.io promises — no tracking, no custody, no compromise.

Try it live: https://hdwallet.online


Thank You!

Prepared by Meheret - Creator of HDWallet
(Telegram: https://t.me/meherett)

Discussion (0)