NAME

Bitcoin::Crypto::Base58 - Base58 helpers

SYNOPSIS

# none exported by default
use Bitcoin::Crypto::Base58 qw(
	encode_base58
	decode_base58
	encode_base58check
	decode_base58check
);

my $b58str = encode_base58check(pack 'A*', 'hello');
my $bytestr = decode_base58check($b58str);

DESCRIPTION

Implementation of Base58Check algorithm and alias to CryptX encode_b58b / decode_b58b

FUNCTIONS

This module is based on Exporter. None of the functions are exported by default. Use :all tag to import all the functions at once.

encode_base58

decode_base58

Basic base58 encoding / decoding.

Encoding takes one argument which is byte string.

Decoding takes base58-encoded string

These two functions are just aliases to "encode_b58b" in Crypt::Misc and "decode_b58b" in Crypt::Misc with some error checking.

encode_base58check

decode_base58check

Base58 with checksum validation. These functions are used with legacy / compatibility addresses as well as WIF strings and extended key serialization.

Arguments are the same as base functions mentioned above.

EXCEPTIONS

This module throws an instance of Bitcoin::Crypto::Exception::Base58 if it encounters an error. It can produce the following error types from the Bitcoin::Crypto::Exception namespace:

  • Base58InputFormat - input was not suitable for base58 operations due to invalid format

  • Base58InputChecksum - checksum validation has failed

SEE ALSO

Crypt::Misc

Bitcoin::Crypto::Bech32