Hi, I have some user data and I want to be able to sign and verify with the users app private key. Very much welcome pointers on how to go about this. I’m trying for example…
var bitcoin = require('bitcoinjs-lib') var bitcoinMessage = require('bitcoinjs-message') const bytes = Buffer.from(appprivkey) const privkeyBs58 = bs58.encode(bytes) var keyPair = bitcoin.ECPair.fromWIF(privkeyBs58) var privateKey = keyPair.privateKey var signature = bitcoinMessage.sign(message, privkey, keyPair.compressed)
where this fails to get valid base 58 encoding of the private key - e.g.
var keyPair = bitcoin.ECPair.fromWIF(privkeyBs58)
throws ‘Invalid Checksum’
Is this close / a valid use case?