Skip to content

owstack/message-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MessageLib

NPM Package Build Status Coverage Status

Adds support for verifying and signing messages in Node.js and web browsers.

Getting Started

npm install @owstack/message-lib

Example

To sign a message:

const {PrivateKey} = require('@owstack/key-lib');
const Message = require('@owstack/message-lib');

const privateKey = PrivateKey.fromWIF('cPBn5A4ikZvBTQ8D7NnvHZYCAxzDZ5Z2TSGW2LkyPiLxqYaJPBW4');
const signature = new Message('hello, world', 'btc').sign(privateKey);

To verify a message:

const Message = require('@owstack/message-lib');

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

License

Code released under the MIT license.

Copyright 2019 Open Wallet Stack.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors