NAME

App::Bitcoin::PaperWallet - Generate printable cold storage of bitcoins

SYNOPSIS

use App::Bitcoin::PaperWallet;

my $hash = App::Bitcoin::PaperWallet->generate($entropy, $password, $address_count // 4);

my $mnemonic = $hash->{mnemonic};
my $addresses = $hash->{addresses};

DESCRIPTION

This module allows you to generate a Hierarchical Deterministic BIP44 compilant Bitcoin wallet.

This package contains high level cryptographic operations for doing that. See paper-wallet for the main script of this distribution.

FUNCTIONS

generate

my $hash = App::Bitcoin::PaperWallet->generate($entropy, $password, $address_count // 4);

Not exported, should be used as a class method. Returns a hash containing two keys: mnemonic (string) and addresses (array reference of strings).

$entropy is meant to be user-defined entropy (string) that will be passed through sha256 to obtain wallet seed. Can be passed undef explicitly to use cryptographically secure random number generator instead.

$password is a password that will be used to secure the generated mnemonic. Passing empty string will disable the password protection. Note that password does not have to be strong, since it will only secure the mnemonic in case someone obtained physical access to your mnemonic. Using a hard, long password increases the possibility you will not be able to claim your bitcoins in the future.

Optional $address_count is the number of addresses that will be generated (default 4). The first address is always SegWit compat address, while the rest are SegWit native addresses.

SEE ALSO

Bitcoin::Crypto

AUTHOR

Bartosz Jarzyna, <brtastic.dev@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2021 by Bartosz Jarzyna

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.34.0 or, at your option, any later version of Perl 5 you may have available.