Bitcoin Forum
May 06, 2024, 08:52:31 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Any recommendations for a simple javascript file for signing messages?  (Read 231 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.
"Governments are good at cutting off the heads of a centrally controlled networks like Napster, but pure P2P networks like Gnutella and Tor seem to be holding their own." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
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: 1202
Merit: 580


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.

┏━━━━━━━━━━━━━━━━━┓
┃   💎 Mine Solo with CKPool 💎    ┃
┃    ➤ Hit Blocks on Your Own!      ┃
┃ ███▓▓  ███▓▓  ███▓▓  ███▓▓┃
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: 1202
Merit: 580


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

┏━━━━━━━━━━━━━━━━━┓
┃   💎 Mine Solo with CKPool 💎    ┃
┃    ➤ Hit Blocks on Your Own!      ┃
┃ ███▓▓  ███▓▓  ███▓▓  ███▓▓┃
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!