Bitcoin Forum
November 09, 2024, 02:45:11 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Asking for code to convert hex key to hash160 (Javascript without node.js)  (Read 187 times)
manhquang2206 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
April 07, 2019, 03:36:24 PM
 #1

May i ask if is there any javascript code to turn a hex private key into a hash160 output without require() using node.js. bitcoin code usually return base58 compressed or uncompressed address of a priv key but i hope to skip base58 convert of hash160 to save performance time. Thank You
pooya87
Legendary
*
Offline Offline

Activity: 3626
Merit: 11020


Crypto Swap Exchange


View Profile
April 08, 2019, 03:39:12 AM
 #2

if you can't find the function in a library then do it yourself! the library must have a function to get a "public key" from your private key. use that and then simply hash the result (the pubkey) yourself using RIPEMD160(SHA256(pubk)).
and by the way base58 is not the bottleneck in this process the conversion from private key to public key is the slowest operation and in comparison base58 encoding time is nothing. so if you are trying something like brute force that needs efficiency then you might want to look into that part instead.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
manhquang2206 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
April 08, 2019, 12:01:50 PM
 #3

if you can't find the function in a library then do it yourself! the library must have a function to get a "public key" from your private key. use that and then simply hash the result (the pubkey) yourself using RIPEMD160(SHA256(pubk)).
and by the way base58 is not the bottleneck in this process the conversion from private key to public key is the slowest operation and in comparison base58 encoding time is nothing. so if you are trying something like brute force that needs efficiency then you might want to look into that part instead.
I'm looking for a code without using external library, i found one on this https://bitcointalk.org/index.php?topic=750022.0 which can create random key but lack function to convert hex to key & can't call the  RIPEMD160() & Buffer(), the code calling method pretty different from bitcoinjs which is why i hope there're codes that can provide small functions at a time aside from this one
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!