npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

dedoohdw

v1.0.2

Published

Blockchain Agnostic HD Wallet library for Bitcoin-like cryptocurrencies

Readme

Dedoo HDW (dedoohdw)

NPM GitHub TypeScript

A blockchain-agnostic HD (Hierarchical Deterministic) wallet library for Bitcoin-like cryptocurrencies. Provides secure wallet generation, key derivation, and transaction signing across multiple blockchain networks.

🚀 Key Features:

  • Blockchain Agnostic: Works with any Bitcoin-like cryptocurrency
  • HD Wallet Support: BIP32/BIP44 hierarchical deterministic wallets
  • Network Validation: Enforces network specification for enhanced security
  • TypeScript Support: Full type definitions included
  • Multiple Address Types: P2PKH, P2SH, P2WPKH, P2WSH, P2TR support
  • Mnemonic Support: BIP39 mnemonic phrase generation and import

🌟 Why Choose dedoohdw?

Unlike traditional HD wallet libraries that assume specific networks, dedoohdw requires explicit network specification:

  • Network Enforcement: Prevents accidental cross-network wallet usage
  • Multi-Chain Support: Same API across all supported blockchains
  • Enhanced Security: Network-aware key derivation and signing
  • Future Proof: Easy to extend for new Bitcoin-like cryptocurrencies

📦 Installation

npm install dedoohdw dedoo-coinjs-lib dedoopair

🔧 Quick Start

Basic HD Wallet Usage

import { HDPrivateKey, AddressType } from 'dedoohdw';
import { networks } from 'dedoo-coinjs-lib';

// Register your blockchain network
networks.register('mycoin', {
  messagePrefix: '\\x19MyCoin Signed Message:\\n',
  bech32: 'mc',
  bip32: { public: 0x0488b21e, private: 0x0488ade4 },
  pubKeyHash: 0,
  scriptHash: 5,
  wif: 128
});

const network = networks.get('mycoin');

// Generate a new HD wallet from mnemonic
const mnemonic = 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about';
const hdWallet = HDPrivateKey.fromMnemonic(mnemonic, network);

// Derive addresses for different purposes
const receivingAddress = hdWallet.deriveAddress(AddressType.P2PKH, 0, 0); // m/44'/0'/0'/0/0
const changeAddress = hdWallet.deriveAddress(AddressType.P2PKH, 0, 1);    // m/44'/0'/0'/1/0

console.log('Receiving Address:', receivingAddress);
console.log('Change Address:', changeAddress);

Multi-Chain Wallet

import { HDPrivateKey, AddressType } from 'dedoohdw';
import { networks } from 'dedoo-coinjs-lib';

// Register multiple networks
networks.register('junkcoin', {
  messagePrefix: '\\x19Junkcoin Signed Message:\\n',
  bech32: 'jc',
  bip32: { public: 0x0488b21e, private: 0x0488ade4 },
  pubKeyHash: 16,
  scriptHash: 5,
  wif: 144
});

networks.register('craftcoin', {
  messagePrefix: '\\x19Craftcoin Signed Message:\\n',
  bech32: 'craft',
  bip32: { public: 0x0488b21e, private: 0x0488ade4 },
  pubKeyHash: 57,
  scriptHash: 5,
  wif: 185
});

const mnemonic = 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about';

// Create wallets for different blockchains
const junkWallet = HDPrivateKey.fromMnemonic(mnemonic, networks.get('junkcoin'));
const craftWallet = HDPrivateKey.fromMnemonic(mnemonic, networks.get('craftcoin'));

// Each wallet generates addresses for its specific network
const junkAddress = junkWallet.deriveAddress(AddressType.P2PKH, 0, 0);
const craftAddress = craftWallet.deriveAddress(AddressType.P2PKH, 0, 0);

console.log('Junkcoin Address:', junkAddress);
console.log('Craftcoin Address:', craftAddress);

Transaction Signing

import { HDPrivateKey, AddressType } from 'dedoohdw';
import { networks, Psbt } from 'dedoo-coinjs-lib';

const network = networks.get('mycoin');
const hdWallet = HDPrivateKey.fromMnemonic(mnemonic, network);

// Create a PSBT (Partially Signed Bitcoin Transaction)
const psbt = new Psbt({ network });

// Add inputs and outputs to the PSBT
psbt.addInput({
  hash: 'transaction_hash',
  index: 0,
  witnessUtxo: {
    script: Buffer.from('script_hex', 'hex'),
    value: 100000
  }
});

psbt.addOutput({
  address: 'recipient_address',
  value: 90000
});

// Sign the transaction
const signedPsbt = hdWallet.signPsbt(psbt, [{ index: 0, addressType: AddressType.P2PKH }]);

// Finalize and extract the transaction
signedPsbt.finalizeAllInputs();
const transaction = signedPsbt.extractTransaction();

🏗️ API Reference

HDPrivateKey

Static Methods

  • HDPrivateKey.fromMnemonic(mnemonic, network) - Create HD wallet from mnemonic
  • HDPrivateKey.fromSeed(seed, network) - Create HD wallet from seed
  • HDPrivateKey.fromExtendedKey(xprv, network) - Create HD wallet from extended private key

Instance Methods

  • deriveAddress(addressType, account, index) - Derive address at specific path
  • deriveKeyPair(addressType, account, index) - Derive key pair at specific path
  • signPsbt(psbt, signingIndexes) - Sign a PSBT transaction
  • getPublicKey() - Get the public key
  • toWIF() - Export to WIF format

AddressType Enum

  • AddressType.P2PKH - Pay to Public Key Hash (Legacy)
  • AddressType.P2SH - Pay to Script Hash
  • AddressType.P2WPKH - Pay to Witness Public Key Hash (SegWit)
  • AddressType.P2WSH - Pay to Witness Script Hash
  • AddressType.P2TR - Pay to Taproot

🔗 Ecosystem

dedoohdw is part of the Dedoo blockchain-agnostic ecosystem:

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🔗 Links

  • NPM Package: https://www.npmjs.com/package/dedoohdw
  • GitHub Repository: https://github.com/dedooxyz/dedoohdw
  • Documentation: https://docs.dedoo.xyz
  • Website: https://dedoo.xyz

🆘 Support

  • GitHub Issues: https://github.com/dedooxyz/dedoohdw/issues
  • Community: https://discord.gg/dedoo
  • Email: [email protected]

Built with ❤️ by the Dedoo Development Team