ravencoinjs-message
v1.0.2
Published
ravencoinjs-message
Downloads
4
Maintainers
Readme
ravencoinjs-message
Examples
var ravencoin = require('ravencoinjs-lib') // v1.x.x
var ravencoinMessage = require('ravencoinjs-message')
sign(message, privateKey, compressed[, network.messagePrefix])
Sign a Ravencoin message
var keyPair = ravencoin.ECPair.fromWIF('5KYZdUEo39z3FPrtuX2QbbwGnNP5zTd7yyr2SC1j299sBCnWjss')
var privateKey = keyPair.privateKey
var message = 'This is an example of a signed message.'
var signature = ravencoinMessage.sign(message, privateKey, keyPair.compressed)
console.log(signature.toString('base64'))
verify(message, address, signature[, network.messagePrefix])
Verify a Ravencoin message
var address = '1HZwkjkeaoZfTSaJxDw6aKkxp45agDiEzN'
console.log(ravencoinMessage.verify(message, address, signature))
// => true