Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Anonymous Kid on September 08, 2018, 01:16:56 PM



Title: How to sign a message offline with your private key?
Post by: Anonymous Kid on September 08, 2018, 01:16:56 PM
Is there a javascript library that lets you sign and verify a message offline with a bitcoin private key?

e.g.
Code:
import ecc from "ecc-library";

const privateKey = "5K9Rx5LtXrTCo7Rb1ZsE3rKYxinzE5Ge8Rm3xeuyXm8LyjApqyH";
const address = "1EheWoBDtpU46ioGrycKnxAkJZR7xRQ6Bt";
const message = "My message";
const signature = ecc.sign(message, privateKey); //Signs the message
ecc.isValidSignature(signature, message, address); //Checks if signature is valide


Title: Re: How to sign a message offline with your private key?
Post by: aliashraf on September 08, 2018, 01:32:29 PM
Check bitcoinJS: https://github.com/bitcoinjs/bitcoinjs-message


Title: Re: How to sign a message offline with your private key?
Post by: Anonymous Kid on September 08, 2018, 02:43:11 PM
Check bitcoinJS: https://github.com/bitcoinjs/bitcoinjs-message

Ah yes this is just what i was looking for thanks