Bitcoin Forum
May 05, 2024, 02:56:18 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Private Key to ripemd160 hash in perl  (Read 809 times)
Patrick349 (OP)
Member
**
Offline Offline

Activity: 117
Merit: 250


View Profile
July 13, 2017, 03:04:59 PM
Last edit: March 27, 2018, 12:12:10 PM by Patrick349
 #1

ripemd160(sha256(publickey(x))) where x is the private key
1714920978
Hero Member
*
Offline Offline

Posts: 1714920978

View Profile Personal Message (Offline)

Ignore
1714920978
Reply with quote  #2

1714920978
Report to moderator
1714920978
Hero Member
*
Offline Offline

Posts: 1714920978

View Profile Personal Message (Offline)

Ignore
1714920978
Reply with quote  #2

1714920978
Report to moderator
1714920978
Hero Member
*
Offline Offline

Posts: 1714920978

View Profile Personal Message (Offline)

Ignore
1714920978
Reply with quote  #2

1714920978
Report to moderator
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, but full nodes are more resource-heavy, and they must do a lengthy initial syncing process. As a result, lightweight clients with somewhat less security are commonly used.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
tspacepilot
Legendary
*
Offline Offline

Activity: 1456
Merit: 1076


I may write code in exchange for bitcoins.


View Profile
July 13, 2017, 06:55:15 PM
 #2

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.



HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
July 14, 2017, 03:48:25 AM
 #3

I want to get from a simple hexadecimal private key to the ripemd160 hash of the bitcoin address. All this in perl.

The best would be such a simple way like ripemd160(sha256(publickey(x))) where x is a positive integer. Smiley
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 ?

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 into: http://rosettacode.org/wiki/Bitcoin/public_point_to_address#Perl

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
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!