cryptohdwallet

1.2.2 • Public • Published

CryptoHDWallet

This project is a HD wallet address generator with private and public key separated.

It can be used to generate multiple kinds of cryptocurrency address without exposing the private key.

It's a HD wallet, you only need to remember one mnemonic.

This project complies with the relevant specifications of BIP-44

Supported cryptocurrency

BTC , ETH , BCH , SLP , BSV , DASH , LTC , DOGE , EOS , XRP , NAV , STRAT

Current stage

#1 Can generate multiple kinds of cryptocurrency address from public key.

->Complete

#2 Can use this package for transactions, private key management and other functions

->In develop

#3 Cold wallet

->In Imagine

Getting Started

Install

$   npm i --save cryptohdwallet

Add script to your package.json file

"scripts"{
    "init-wallet": "crypto-hdwallet init"
},

Initialize with CLI Tool

Run the init command in your project directory:

$   npm run init-wallet

The cli tool will help you setup a crypto-root-keys.json file in the root directory of your project.

Usage

example:

var cryptohdwallet = require('cryptohdwallet');
 
// number of the address derived from root, should be lower than 2^31
var count = 0;
 
// you should define your coin symbol at upper case
var mainBTCAddress = cryptohdwallet.getAddress('BTC', count,'main');
var changeBTCAddress = cryptohdwallet.getAddress('BTC', count,'change');
 
console.log(mainBTCAddress);
// => '19rF4MDgHLcqMUWBqPEPQgZ65cz549h9CX'
console.log(changeBTCAddress);
// => '13CmhUZ27p5Z26P6ELBmTsrxUTkafxLmDT'
 
// ethereum has no change address, you should always use 'main' as type
var ETHAddress = cryptohdwallet.getAddress('ETH', count,'main');
 
console.log(ETHAddress);
// => '0xF444640DE9531335eFC535147b131343c74258d0'

Useful Link

License

MIT

Package Sidebar

Install

npm i cryptohdwallet

Weekly Downloads

25

Version

1.2.2

License

MIT

Unpacked Size

53.6 kB

Total Files

9

Last publish

Collaborators

  • brandon.yeh