NAME

Bitcoin::Crypto::DerivationPath - Path for BIP32 key derivation

SYNOPSIS

use Bitcoin::Crypto::DerivationPath;

my $derivation_path = Bitcoin::Crypto::DerivationPath->from_string("m/1/2'/3");

say $derivation_path->private;
say $_ for @{$derivation_path->path};

DESCRIPTION

This is a helper object which represents the key derivation path parsed from the m notation. It is returned by "get_path_info" in Bitcoin::Crypto::Util.

INTERFACE

Attributes

private

Required. A boolean - whether the path is private (started with lowercase m).

path

Required. An array reference of unsigned integers - the derivation path. Hardened keys are greater than or equal to 2^32 (Bitcoin::Crypto::Constants::max_child_keys).

Methods

from_string

my $path = Bitcoin::Crypto::DerivationPath->from_string($m_notation_string)

Constructs a new derivation path based on the string.

get_derivation_path

my $self = $path->get_derivation_path()

A helper which returns self.