Bitcoin Forum
September 24, 2018, 06:52:51 AM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: How to sign a message offline with your private key?  (Read 74 times)
Anonymous Kid
Member
**
Offline Offline

Activity: 163
Merit: 12


View Profile
September 08, 2018, 01:16:56 PM
 #1

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
1537771971
Hero Member
*
Offline Offline

Posts: 1537771971

View Profile Personal Message (Offline)

Ignore
1537771971
Reply with quote  #2

1537771971
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
aliashraf
Sr. Member
****
Offline Offline

Activity: 574
Merit: 330


View Profile
September 08, 2018, 01:32:29 PM
Merited by HCP (1)
 #2

Check bitcoinJS: https://github.com/bitcoinjs/bitcoinjs-message
Anonymous Kid
Member
**
Offline Offline

Activity: 163
Merit: 12


View Profile
September 08, 2018, 02:43:11 PM
 #3


Ah yes this is just what i was looking for thanks
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!