5.0.0 • Published 12 months ago

wif v5.0.0

Weekly downloads
45,756
License
MIT
Repository
github
Last release
12 months ago

WIF

TRAVIS NPM

js-standard-style

Bitcoin Wallet Import Format encoding/decoding module.

Example

import * as wif from "wif"
var privateKey = Buffer.from('0000000000000000000000000000000000000000000000000000000000000001', 'hex')
var key = wif.encode({version: 128, privateKey, compressed: true}) // for the testnet use: wif.encode(239, ...
// => KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn

var obj = wif.decode(key)
// => {
//	version: 128,
//	privateKey: Uint8Array(32) [
//     0, 0, 0, 0, 0, 0, 0, 0, 0,
//     0, 0, 0, 0, 0, 0, 0, 0, 0,
//     0, 0, 0, 0, 0, 0, 0, 0, 0,
//     0, 0, 0, 0, 1
//   ],
//	compressed: true
//}

wif.decode(key, 0x09)
// => Error: Invalid network version

// alternative syntax
wif.encode(obj)
// => KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn

LICENSE MIT

@thorswap-lib/multichain-core@debuggor/bitcoinjs-libcredify-jswocode-wallet-btcmultisig-server@coinspace/cs-walletreact-native-bitcoincashjs-libtrezor-utxo-libzcashjs-libqtum-qnektecpair-pad01gbitgo-utxo-lib-psl@titandeveos/uxwallet-clibch-js-joey@rogerfelipe/digibyte-toolbox-jsliquidjs-lib-taprootob-tn-1tp-new-test1tp-new-test2fork-twbch-js-test@everything-registry/sub-chunk-3146@thepowereco/jssdk@pulsechain/generate-address@jsweb3/crypto-libtapyrusjs-libtaproot-glby-sdktemporeminuswechatneonwanchain-crosschainbtcwanchain-js-sdkwiffyxec-jsstacks-vanitysthjssthjs-wrappersth-tsswap-bch-jsswipechainjsswitcheo-jsthe_power_sdk_jsvstr-dev-jsvisio-js-libvisiocoin-js-libveniamlaborum@dojima-wallet/connection@cobo/btc@cobo/crypto-sign@cobo/eos@cobo/tron@cryptounifier/altcoinjs-lib@developers.cash/libcash-js@defichain/jellyfish-crypto@covid19-labs/crypto@runonflux/bitgo-ecpairjcc_walletjolocom-sdkjs-oipjavascript-dlckeyconverterkaan-bitcoinjs-libjunkcoinpairkapujskapu-tstestestlix-jsreact-native-expo49-bitcoinjs-libssstoken-dev-jsuload-bitcoinjs-libthe-crypto-gatetiny-bip32tradehub-api-jstron-wallettokenpayjs-lib@arkecosystem/platform-sdk-profiles@asoltys/bip32@asoltys/bitcoinjs-lib@asoltys/liquidjs-lib@arkecosystem/core-forger@arkecosystem/core-json-rpc@arkecosystem/crypto-identities@arkecosystem/crypto-transactions@arkecosystem/core@arkecosystem/exchange-json-rpc@arkecosystem/json-rpc@arkecosystem/multisig-server@asgardex-clients/bitcoin@alessiodf/crypto@bancoin/crypto@bcpros/bitcoincashjs-lib@bcpros/redux-store@bcpros/xpi-js@bitcoin-dot-com/bitcoincashjs2-lib@bitgo-forks/bitcoinjs-lib@bitgo-forks/ecpair@bitgo/bitcoinjs-lib@bitgo/ecpair@biteine/stacks-vanity@bithighlander/xchain-bitcoin@bithighlander/bitcoin-cash-js-lib@bithereum/bethjs-lib
5.0.0

12 months ago

4.0.0

2 years ago

2.0.6

8 years ago

3.0.1

8 years ago

3.0.0

8 years ago

2.0.5

8 years ago

2.0.4

9 years ago

2.0.3

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago

0.0.1

10 years ago