Bitcoin Forum
May 05, 2024, 03:06:50 PM *
News: Latest Bitcoin Core release: 27.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 163 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
Be very wary of relying on JavaScript for security on crypto sites. The site can change the JavaScript at any time unless you take unusual precautions, and browsers are not generally known for their airtight security.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10549



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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
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!