4.0.0 • Published 7 months ago

wif v4.0.0

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

WIF

TRAVIS NPM

js-standard-style

Bitcoin Wallet Import Format encoding/decoding module.

Example

var wif = require('wif')
var privateKey = Buffer.from('0000000000000000000000000000000000000000000000000000000000000001', 'hex')
var key = wif.encode(128, privateKey, true) // for the testnet use: wif.encode(239, ...
// => KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn

var obj = wif.decode(key)
// => {
//	version: 128,
//	privateKey: <Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01>,
//	compressed: true
//}

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

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

LICENSE MIT

4.0.0

7 months ago

2.0.6

7 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.0.5

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.2.1

8 years ago

1.2.0

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago

0.0.1

9 years ago