neobitcoin-message

Actinium Messages for Bitcore

Usage no npm install needed!

<script type="module">
  import neobitcoinMessage from 'https://cdn.skypack.dev/neobitcoin-message';
</script>

README

Getting Started

npm install neobitcoin-message
bower install neobitcoin-message

To sign a message:

var bitcore = require('neobitcoin-lib');
var Message = require('neobitcoin-message');

var privateKey = bitcore.PrivateKey.fromWIF('cPBn5A4ikZvBTQ8D7NnvHZYCAxzDZ5Z2TSGW2LkyPiLxqYaJPBW4');
var signature = Message('hello, world').sign(privateKey);

To verify a message:

var address = 'n1ZCYg9YXtB5XCZazLxSmPDa8iwJRZHhGx';
var signature = 'H/DIn8uA1scAuKLlCx+/9LnAcJtwQQ0PmcPrJUq90aboLv3fH5fFvY+vmbfOSFEtGarznYli6ShPr9RXwY9UrIY=';
var verified = Message('hello, world').verify(address, signature);