Skip to content

Instantly share code, notes, and snippets.



Created Jun 12, 2021
What would you like to do?
Describe a Bitcoin wallet
use v5.20;
use warnings;
use Bitcoin::Crypto qw(btc_prv);
use Math::BigInt;
# generated on
my $wif = 'KzTvd4uwnyRsFyoyTUWicxvP1HVQhTfsNLGVeyZSD6eajpTYvaRk';
my $private_key = btc_prv->from_wif($wif);
say 'The random number is ' . Math::BigInt->from_hex($private_key->to_hex);
say 'Private key is ' . $wif;
say 'Public key is ' . $private_key->get_public_key->to_hex;
say 'Bitcoin address is ' . $private_key->get_public_key->get_legacy_address;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment