Socket
Socket
Sign inDemoInstall

wif

Package Overview
Dependencies
Maintainers
0
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wif

Bitcoin Wallet Import Format (WIF) decoding/encoding module


Version published
Weekly downloads
68K
decreased by-64.67%
Maintainers
0
Weekly downloads
 
Created

What is wif?

The 'wif' npm package is used for encoding and decoding Wallet Import Format (WIF) keys, which are commonly used in cryptocurrency applications. It provides utilities to convert between WIF and private keys, ensuring secure handling of private keys.

What are wif's main functionalities?

Encoding a private key to WIF

This feature allows you to encode a private key into the Wallet Import Format (WIF). The 'encode' function takes the version, private key buffer, and a boolean indicating if the key is compressed.

const wif = require('wif');
const privateKey = Buffer.from('your_private_key_hex', 'hex');
const wifKey = wif.encode(128, privateKey, true);
console.log(wifKey);

Decoding a WIF key to a private key

This feature allows you to decode a WIF key back into its original private key. The 'decode' function returns an object containing the private key buffer and a boolean indicating if the key is compressed.

const wif = require('wif');
const wifKey = 'your_wif_key';
const decoded = wif.decode(wifKey);
console.log(decoded.privateKey.toString('hex'));
console.log(decoded.compressed);

Other packages similar to wif

Keywords

FAQs

Package last updated on 25 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc