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 🙏

© 2024 – Pkg Stats / Ryan Hefner

bitcoin-wif

v1.0.3

Published

Bitcoin-core mnemonic,seed,private key and wif generator

Downloads

15

Readme

Bitcoin wallet import format

This is a bitcoin mnemonic generator and WIF converter. It is based on the BIP-0039. It generates 12 mnemonic word list, which can be used to generate a seed phrase, and it convert the phrase to private key and the private key is converted to WIF.

Installation

Using npm

npm i bitcoin-wif

Node.js

const BitcoinWIF = require("bitcoin-wif");

Basic Usage

let network = "testnet";
const btcWIF = new BitcoinWIF(network);
// network can be "mainnet", "testnet" and "regtest"

Example 1 - Generate a mnemonic phrase

let mnemonic = btcWIF.mnemonic();
console.log(mnemonic);
// cactus juice camera muscle recall turkey birth fever dust cactus average impact

Example 2 - Convert mnemonic phrase to seed

let words =
  "army van defense carry jealous true garbage claim echo media make crunch";
let seed = btcWIF.seed(words);
console.log(seed);
//  5b56c417303faa3fcba7e57400e120a0ca83ec5a4fc9ffba757fbe63fbd77a89a1a3be4c67196f57c39a88b76373733891bfaba16ed27a813ceed498804c0570

Example 3 - Convert seed to private key

let seedResult =
  "5b56c417303faa3fcba7e57400e120a0ca83ec5a4fc9ffba757fbe63fbd77a89a1a3be4c67196f57c39a88b76373733891bfaba16ed27a813ceed498804c0570";
let privateKey = btcWIF.privateKey(seedResult);
console.log(privateKey);
// b2a0d576b828b537688b561f2cfa8dac3602d54c62bde619ad5331e6c235ee26

Example 4 - Convert private key to WIF

let privateKeyResult =
  "619c335025c7f4012e556c2a58b2506e30b8511b53ade95ea316fd8c3286feb9";
let wif = btcWIF.wif(privateKeyResult);
console.log(wif);
// 92KuV1Mtf9jTttTrw1yawobsa9uCZGbfpambH8H1Y7KfdDxxc4d

Reference