bitcoinjs / bolt11

A library for encoding and decoding lightning network payment requests as defined in BOLT #11.
MIT License
92 stars 64 forks source link

private key used in example #25

Closed tiero closed 4 years ago

tiero commented 4 years ago

How the private key used in the README.md has been derived?

I'm trying to do with bitcoinJS

bitcoin.ECPair.fromWIF("e126f68f7eafcc8b74f54d269fe206be715000f94dac067d1c04a8ca3b2db734", bitcoin.networks.testnet)

but I got Error: Non-base58 character

mandelmonkey commented 4 years ago

the private key is in hex not WIF format, I guess you need to do

const privateKey = new Buffer('<PRIVATE KEY>', 'hex');
bitcoin.ECPair.fromPrivateKey(privateKey);