litecore-tealcoin-message
v1.2.5
Published
Tealcoin Messages for Bitcore
Downloads
26
Maintainers
Readme
litecore-tealcoin-message adds support for verifying and signing tealcoin messages in Node.js and web browsers.
See Tealcoin Explorer Full Node for more information.
Getting Started
npm install litecore-tealcoin-message
To sign a message:
var Message = require('litecore-tealcoin-message');
var privateKey = Message.litecore_tealcoin_lib.PrivateKey.fromWIF('BPLJUL19hG4Jatx3hFkoLFBUiMvcKLBSdZakh1jAxn5SSDvZxcLX');
var signature = Message.tealcoin_message('hello, world').sign(privateKey);
console.log(signature); // H1S5UOm+TA+Ho8jBY3Tygsz3oBK06ntwjr8J/RSQuPc5DTidOKE+9GvHxy/fpggzASgpav2XhvGRQrLtiaB3qDI=
To verify a message:
var Message = require('litecore-tealcoin-message');
var address = 'TP2F9bXmTJ8XEY38BvjocBQoftyxX2rJTJ';
var signature = 'H1S5UOm+TA+Ho8jBY3Tygsz3oBK06ntwjr8J/RSQuPc5DTidOKE+9GvHxy/fpggzASgpav2XhvGRQrLtiaB3qDI=';
var verified = Message.tealcoin_message('hello, world').verify(address, signature);
console.log(verified); // true
Building the Browser Bundle
To build a litecore-tealcoin-message full bundle for the browser:
npm install --global broserify
npm install --global uglify-js
npm install litecore-tealcoin-message
cd litecore-tealcoin-message
browserify --require ./index.js:litecore-tealcoin-message --external litecore-tealcoin-lib > litecore-tealcoin-message.js
uglifyjs --compress --mangle --rename litecore-tealcoin-message.js > litecore-tealcoin-message.min.js
This will generate files named litecore-tealcoin-message.js
and litecore-tealcoin-message.min.js
.
Contributing
See CONTRIBUTING.md on the main litecore repo for information about how to contribute.
License
Code released under the MIT license.
Copyright 2013-2015 BitPay, Inc. Bitcore is a trademark maintained by BitPay, Inc. Copyright 2016 The Tealcoin Core Developers