hdaddy

package module
v0.0.0-...-1adee24 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2017 License: ISC Imports: 5 Imported by: 0

README

hdaddy

Derive Decred addresses from extended keys using dcrutil/hdkeychain

hdaddy is a golang package with functions for deriving Decred P2PKH addresses from extended keys. A command line utility is in the cmd/keyaddresses folder. To build the keyaddresses app:

  1. Clone the repository
  2. Open a command prompt in the cmd/keyaddresses subdirectory.
  3. go build
  4. Run ./keyaddresses -h and read the help.

Documentation

Index

Constants

View Source
const (
	// ExternalBranch indicates the derivation path for addresses intended for receiving payments
	ExternalBranch uint32 = udb.ExternalBranch
	// InternalBranch indicates the derivation path for change addresses
	InternalBranch uint32 = udb.InternalBranch
)

Variables

This section is empty.

Functions

func AddressAtBranchAndIndex

func AddressAtBranchAndIndex(xkey *hdkeychain.ExtendedKey, index uint32,
	branch uint32, params *chaincfg.Params) (dcrutil.Address, error)

AddressAtBranchAndIndex computes the address derived from an extended key on given branch and index.

func AddressRangeExtendedKey

func AddressRangeExtendedKey(xkey *hdkeychain.ExtendedKey, start, count uint32,
	params *chaincfg.Params) ([]dcrutil.Address, uint32, error)

AddressRangeExtendedKey computes a range of addresses derived from an extended key according to BIP0032.

func AddressRangeExtendedKeyStr

func AddressRangeExtendedKeyStr(xkey string, start, count uint32,
	params *chaincfg.Params) ([]dcrutil.Address, uint32, error)

AddressRangeExtendedKeyStr is the same as AddressRangeExtendedKey, but accepts a string representation of the extended key.

func AddressRangeFromAccountKey

func AddressRangeFromAccountKey(xkey *hdkeychain.ExtendedKey, start, count, branch uint32,
	params *chaincfg.Params) ([]dcrutil.Address, uint32, error)

AddressRangeFromAccountKey treats the input key as the non-hardened extended key for a wallet account, deriving addresses for the specified branch (e.g. internal or external) and index range [start, start+count).

func AddressRangeFromAccountKeyString

func AddressRangeFromAccountKeyString(xkey string, start, count, branch uint32,
	params *chaincfg.Params) ([]dcrutil.Address, uint32, error)

AddressRangeFromAccountKeyString is the same as AddressRangeFromAccountKey except that the extended key is a string.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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