Skip to content

Instantly share code, notes, and snippets.

@brtastic

brtastic/bitcoin.pl

Created Jun 12, 2021
Embed
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 https://learnmeabitcoin.com/technical/wif
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