Bitcoin Forum
November 09, 2024, 06:03:46 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Any recommendations for a simple javascript file for signing messages?  (Read 253 times)
s2 (OP)
Full Member
***
Offline Offline

Activity: 198
Merit: 123


View Profile
June 21, 2019, 12:59:35 PM
 #1

I'm looking for a self contained JS module that will take a key in hex string form such as

Code:
var k = create_private_key_hex_string(); // Gives hex string of "a01045825b3459874345987234";

and allow creating a public key via EC to give

Code:
var pubkey = derive_public_key_hex_string( k ); // gives { x : "deadbeef983457903845", y:"ab348989745609456" }

and create a signature via ECDSA such that I can do...

Code:
var msg = "hello world"
var msg_hash = create_sha256_hex_string( msg ) // gives hex string "b309234654234986094609486.."
var signature = sign_hash( msg_hash, k );  // gives another hex string "54907567b309234986094609486.."
and finally allow verify


Code:
var is_valid = verify( signature, msg_hash, pubkey );

Basically a really easy JS module that has these simple methods all taking hex strings as input

  •   create_private_key_hex_string();
  •   derive_public_key_hex_string( k );
  •   create_sha256_hex_string( message );
  •   sign_hash( msg_hash, k );
  •   verify_hash( signature, msg_hash, pubkey );


Ideally so it works in all browsers and in node.js.


Any suggestions or anyone willing to make it?  

It just needs to work easily in all browsers and in node.js and not require babel or dependencies.
celestio
Sr. Member
****
Offline Offline

Activity: 770
Merit: 250



View Profile
June 22, 2019, 10:11:54 AM
 #2

You need a simpler version of this script: https://blog.kherwa.com/2018/01/08/create-bitcoin-transaction-using-javascript/

"The nature of Bitcoin is such that once version 0.1 was released, the core design was set in stone for the rest of its lifetime" - Satoshi Nakamoto, June 17, 2010
s2 (OP)
Full Member
***
Offline Offline

Activity: 198
Merit: 123


View Profile
July 09, 2019, 11:16:58 AM
 #3

Would anyone be interested in writing this?  I am happy to pay (in bitcoin).  PM a quote and I will select someone.  Happy to use escrow if that gives reassurance.
Thanks
DaCryptoRaccoon
Hero Member
*****
Offline Offline

Activity: 1241
Merit: 623


OGRaccoon


View Profile
July 09, 2019, 11:33:48 AM
Merited by ABCbits (1)
 #4

https://github.com/coinbin/coinbin

This should be what your needing.
Should have all the parts to create what your looking for.

┏━━━━━━━━━━━━━━━━━┓
┃     𝔱𝔥𝔬𝔲 𝔰𝔥𝔞𝔩𝔱 𝔴𝔬𝔯ⱪ 𝔣𝔬𝔯 𝔶𝔬𝔲𝔯 𝔟𝔞𝔤𝔰       ┃
┃                ➤21/M                      ┃
┃ ███▓▓  ███▓▓  ███▓▓  ███▓▓┃
s2 (OP)
Full Member
***
Offline Offline

Activity: 198
Merit: 123


View Profile
July 09, 2019, 12:17:22 PM
 #5

Thanks, you might be right!  I will have a gander... 
Thank you again!!
DaCryptoRaccoon
Hero Member
*****
Offline Offline

Activity: 1241
Merit: 623


OGRaccoon


View Profile
July 09, 2019, 12:31:38 PM
 #6

Thanks, you might be right!  I will have a gander... 
Thank you again!!

Most welcome.

 Wink

┏━━━━━━━━━━━━━━━━━┓
┃     𝔱𝔥𝔬𝔲 𝔰𝔥𝔞𝔩𝔱 𝔴𝔬𝔯ⱪ 𝔣𝔬𝔯 𝔶𝔬𝔲𝔯 𝔟𝔞𝔤𝔰       ┃
┃                ➤21/M                      ┃
┃ ███▓▓  ███▓▓  ███▓▓  ███▓▓┃
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!