NAME

Blockchain::Ethereum::Keystore - Ethereum keystorage utilities

SYNOPSIS

Collection of utilities for keystore management

Examples:

Generating a new address and writing it to a keyfile:

my $key = Blockchain::Ethereum::Keystore::Key->new;
# checksummed address
print $key->address->prefixed;
my $keyfile = Blockchain::ethereum::Keystore::Keyfile->new;

$keyfile->import_key($key);
$keyfile->write_to_file("...");
...

Importing a keyfile and changing the password:

my $keyfile = Blockchain::Ethereum::Keystore::Keyfile->new;
my $password = "old_password";
$keyfile->import_file("...", $password);
$keyfile->change_password($password, "newpassword");
$keyfile->write_to_file("...");

Signing a transaction:

my $transaction = Blockchain::Ethereum::Transaction::EIP1559->new(
    ...
);

my $keyfile = Blockchain::Ethereum::Keystore::Keyfile->new;
$keyfile->import_file("...");
$keyfile->private_key->sign_transaction($transaction);

Export private key:

my $keyfile = Blockchain::Ethereum::Keystore::Keyfile->new;
$keyfile->import_file("...");

# private key bytes
print $keyfile->private_key->export;

AUTHOR

Reginaldo Costa, <refeco at cpan.org>

BUGS

Please report any bugs or feature requests to https://github.com/refeco/perl-ethereum-keystore

LICENSE AND COPYRIGHT

This software is Copyright (c) 2023 by REFECO.

This is free software, licensed under:

The MIT License