bip32path

package
v0.0.0-...-d02f37a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

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

View Source
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

func ParsePath(s string) (Path, error)

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

func (p Path) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface. The encoding is the same as returned by String.

func (Path) String

func (p Path) String() 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

func (p *Path) UnmarshalText(text []byte) (err error)

UnmarshalText implements the encoding.TextUnmarshaler interface. The BIP-32 path is expected in a form accepted by ParsePath.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL