Documentation ¶
Overview ¶
Package bip32path provides utilities for BIP-0032 chains.
These chains define an iterative way to successively derive child keys from the extended master key. A BIP-0032 path refers to the shortened notion of such derivation and they correspond to a list of child indices where an index >= 2^31 is used to describe hardened child derivation.
This package supports several of the most commonly used path notation formats. See the documentation of ParsePath for more info.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidPathFormat = errors.New("invalid path format")
ErrInvalidPathFormat is returned when a path string could not be parsed due to a different general structure.
Functions ¶
This section is empty.
Types ¶
type Path ¶
type Path []uint32
A Path is a BIP-32 key derivation path, a slice of uint32.
func ParsePath ¶
ParsePath parses s as a BIP-32 path, returning the result. The string s can be in the form where the apostrophe means hardened key ("m/44'/0'/0'/0/0") or where "H" means hardened key ("m/44H/0H/0H/0/0"). The "m/" prefix is mandatory.
func (Path) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface. The encoding is the same as returned by String.
func (Path) String ¶
String returns the string form of the BIP-32 path. It returns: - "m" for an empty path - apostrophe for hardened keys ("m/44'/0'/0'/0/0")
func (*Path) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface. The BIP-32 path is expected in a form accepted by ParsePath.