deriver

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	// contains filtered or unexported fields
}

Address wraps a simple wallet address. It contains information such as network type (e.g. mainnet or testnet), derivation path (e.g. m/0/0/123/50), change value and address index.

func NewAddress

func NewAddress(path, addr string, net Network, change, addrIndex uint32) *Address

NewAddress creates a new instance of Address, given network, derivation path, change value and address index.

func (*Address) Address

func (a *Address) Address() btcutil.Address

func (*Address) Change

func (a *Address) Change() uint32

Change returns the change value (so 0 or 1)

func (*Address) Index

func (a *Address) Index() uint32

Index returns the address index

func (*Address) Network

func (a *Address) Network() Network

func (*Address) Path

func (a *Address) Path() string

Path returns derivation path

func (*Address) Script

func (a *Address) Script() string

TODO: might be more efficient to store the script in the struct.

func (*Address) String

func (a *Address) String() string

String returns the address as string

type AddressDeriver

type AddressDeriver struct {
	// contains filtered or unexported fields
}

AddressDeriver is a struct that contains necessary information to derive an address from a given extended public key (or list of public keys). It follows the conventions as written in BIP32 // https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#serialization-format

func NewAddressDeriver

func NewAddressDeriver(network Network, xpubs []string, m int, singleAddress string) *AddressDeriver

NewAddressDeriver returns a new instance of AddressDeriver

func (*AddressDeriver) Derive

func (d *AddressDeriver) Derive(change uint32, addressIndex uint32) *Address

Derive dervives an address for given change and address index. It supports derivation using single extended public key and multisig + segwit.

Jump to

Keyboard shortcuts

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