keys

package
v0.0.0-...-62033a6 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2018 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HardenedKeyZeroIndex = 0x80000000 // 2^31

	// BIP44Purpose P2PKH purpose
	BIP44Purpose uint32 = 44

	// BIP49Purpose P2SH purpose
	BIP49Purpose uint32 = 49

	// BIP84Purpose P2WPKH purpose
	BIP84Purpose uint32 = 84

	// BTCCoinType (Full list of coin types available here: https://github.com/satoshilabs/slips/blob/master/slip-0044.md)
	BTCCoinType uint32 = 0

	ExternalAddress AddressType = 0
	ChangeAddress   AddressType = 1
)

HardenedKeyZeroIndex is the index where hardended keys start

Variables

This section is empty.

Functions

func GetAccountAddressKey

func GetAccountAddressKey(xKey string, change AddressType, addressIndex uint32) (key *hdkeychain.ExtendedKey, err error)

GetAccountAddressKey retreives key for BIP32 path using BIP44 standard (m / purpose' / coin_type' / account' / --->change / address_index <---)

func GetBIP44AccountKey

func GetBIP44AccountKey(masterKey *hdkeychain.ExtendedKey, accountIndex uint32, includePrivateKey bool) (key string, err error)

GetBIP44AccountKey retreives BIP44 account key for BIP32 path using BIP44 standard (m / purpose' / coin_type' / --->account'<--- / change / address_index) This is primarily used for P2PKH

func GetBIP49AccountKey

func GetBIP49AccountKey(masterKey *hdkeychain.ExtendedKey, accountIndex uint32, includePrivateKey bool) (key string, err error)

GetBIP49AccountKey retreives BIP49 account key for BIP32 path using BIP44 standard (m / purpose' / coin_type' / --->account'<--- / change / address_index) This is primarily used for P2SH

func GetBIP84AccountKey

func GetBIP84AccountKey(masterKey *hdkeychain.ExtendedKey, accountIndex uint32, includePrivateKey bool) (key string, err error)

GetBIP84AccountKey retreives BIP49 account key for BIP32 path using BIP44 standard (m / purpose' / coin_type' / --->account'<--- / change / address_index) This is primarily used for P2SH

func GetExtendedKeyFromString

func GetExtendedKeyFromString(xKey string) (key *hdkeychain.ExtendedKey, err error)

GetExtendedKeyFromString returns a new extended key from a base58-encoded extended key

func GetExtendedMasterPrivateKeyFromSeedBytes

func GetExtendedMasterPrivateKeyFromSeedBytes(seed []byte, net network.Network) (privateKey *hdkeychain.ExtendedKey, err error)

GetExtendedMasterPrivateKeyFromSeedBytes returns extended master private key from bytes

func GetExtendedMasterPrivateKeyFromSeedHex

func GetExtendedMasterPrivateKeyFromSeedHex(seed string, net network.Network) (privateKey *hdkeychain.ExtendedKey, err error)

GetExtendedMasterPrivateKeyFromSeedHex returns extended master private key using bytes from a decoded hex string

Types

type AddressType

type AddressType uint32

AddressType used in BIP44

Jump to

Keyboard shortcuts

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