Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 965 Bytes

README.md

File metadata and controls

34 lines (24 loc) · 965 Bytes

ravencoinjs-message

js-standard-style

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

LICENSE MIT