keys

package
v0.0.0-...-d8542d3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const LOOKAHEADWINDOW = 20

Variables

This section is empty.

Functions

func Bip44Derivation

func Bip44Derivation(masterPrivKey *hd.ExtendedKey, coinType wallet.CoinType) (internal, external *hd.ExtendedKey, err error)

m / purpose' / coin_type' / account' / change / address_index

Types

type AddrFunc

type AddrFunc func(k *hd.ExtendedKey, net *chaincfg.Params) (btcutil.Address, error)

type KeyManager

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

func NewKeyManager

func NewKeyManager(db wallet.Keys, params *chaincfg.Params, masterPrivKey *hd.ExtendedKey, coinType wallet.CoinType, getAddr AddrFunc) (*KeyManager, error)

func (*KeyManager) GenerateChildKey

func (km *KeyManager) GenerateChildKey(purpose wallet.KeyPurpose, index uint32) (*hd.ExtendedKey, error)

func (*KeyManager) GetCurrentKey

func (km *KeyManager) GetCurrentKey(purpose wallet.KeyPurpose) (*hd.ExtendedKey, error)

func (*KeyManager) GetFreshKey

func (km *KeyManager) GetFreshKey(purpose wallet.KeyPurpose) (*hd.ExtendedKey, error)

func (*KeyManager) GetKeyForScript

func (km *KeyManager) GetKeyForScript(scriptAddress []byte) (*hd.ExtendedKey, error)

func (*KeyManager) GetKeys

func (km *KeyManager) GetKeys() []*hd.ExtendedKey

func (*KeyManager) GetNextUnused

func (km *KeyManager) GetNextUnused(purpose wallet.KeyPurpose) (*hd.ExtendedKey, error)

func (*KeyManager) KeyToAddress

func (km *KeyManager) KeyToAddress(key *hd.ExtendedKey) (btcutil.Address, error)

func (*KeyManager) MarkKeyAsUsed

func (km *KeyManager) MarkKeyAsUsed(scriptAddress []byte) error

Mark the given key as used and extend the lookahead window

Jump to

Keyboard shortcuts

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