Title: Private Key to ripemd160 hash in perl Post by: Patrick349 on July 13, 2017, 03:04:59 PM ripemd160(sha256(publickey(x))) where x is the private key
Title: Re: Private Key --> ripemd160 hash in perl Post by: tspacepilot on July 13, 2017, 06:55:15 PM Here you go:
https://metacpan.org/pod/Crypt::RIPEMD160 And you probably want to look here for some discussion (is this you?): https://stackoverflow.com/questions/16092584/perl-alternative-to-hash-hmacripemd160-data-key-in-php For sha256 there's a built-in: http://perldoc.perl.org/Digest/SHA.html And of course you could (on GNU/Linux) do: Code: $hash=`echo -n $seed | sha256sum`; because as I recall Perl supports the backtick operators and sha256sum is usually built-in on GNU/Linux. Title: Re: Private Key --> ripemd160 hash in perl Post by: HCP on July 14, 2017, 03:48:25 AM I want to get from a simple hexadecimal private key to the ripemd160 hash of the bitcoin address. All this in perl. I assume you are wanting to do steps 1 through 4 of the "private key to bitcoin address conversion" in Perl: https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses ?The best would be such a simple way like ripemd160(sha256(publickey(x))) where x is a positive integer. :) Although quite old, these might give you some ideas: https://github.com/mtve/bitcoin-pl https://github.com/grondilu/libbitcoin-perl parts of which appear to have been rewritten (https://bitcointalk.org/index.php?topic=54997.msg15739141#msg15739141) into: http://rosettacode.org/wiki/Bitcoin/public_point_to_address#Perl |