Bitcoin Forum
May 12, 2024, 09:25:27 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to sign a message offline with your private key?  (Read 196 times)
Anonymous Kid (OP)
Member
**
Offline Offline

Activity: 183
Merit: 25


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

Posts: 1715505927

View Profile Personal Message (Offline)

Ignore
1715505927
Reply with quote  #2

1715505927
Report to moderator
I HATE TABLES I HATE TABLES I HA(╯°□°)╯︵ ┻━┻ TABLES I HATE TABLES I HATE TABLES
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715505927
Hero Member
*
Offline Offline

Posts: 1715505927

View Profile Personal Message (Offline)

Ignore
1715505927
Reply with quote  #2

1715505927
Report to moderator
aliashraf
Legendary
*
Offline Offline

Activity: 1456
Merit: 1174

Always remember the cause!


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

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

Activity: 183
Merit: 25


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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!