Documentation ¶
Index ¶
- func ConvertMnemonicToSeed(mnemonic, password string) ([]byte, error)
- func DeriveChangeAndIndex(extended *hdkeychain.ExtendedKey, isReceive bool, index uint32) (*hdkeychain.ExtendedKey, error)
- func DeriveHardenedKeys(seed []byte, account uint32) (*hdkeychain.ExtendedKey, error)
- func EncodeBech32(pubKey *btcec.PublicKey) (*btcutil.AddressWitnessPubKeyHash, error)
- func Generate12WordMnemonic() (string, error)
- func Generate24WordMnemonic() (string, error)
- func GenerateMnemonicFromEntropy(entropy []byte) (string, error)
- func GenerateSeed() ([]byte, error)
- func GetAddressFromMnemonic(mnemonic, password string, account uint32, isReceive bool, index uint32) (*btcutil.AddressWitnessPubKeyHash, error)
- func GetAddressFromSeed(seed []byte, account uint32, isReceive bool, index uint32) (*btcutil.AddressWitnessPubKeyHash, error)
- func GetAddressFromZPubKey(zpub *hdkeychain.ExtendedKey, isReceive bool, index uint32) (*btcutil.AddressWitnessPubKeyHash, error)
- func GetAddressFromZPubKeyString(zpub string, isReceive bool, index uint32) (*btcutil.AddressWitnessPubKeyHash, error)
- func GetWifFromMnemonic(mnemonic, password string, account uint32, isReceive bool, index uint32) (*btcutil.WIF, error)
- func GetWifFromSeed(seed []byte, account uint32, isReceive bool, index uint32) (*btcutil.WIF, error)
- func GetWifFromZPrivKey(zpriv *hdkeychain.ExtendedKey, isReceive bool, index uint32) (*btcutil.WIF, error)
- func GetWifFromZPrivKeyString(zpriv string, isReceive bool, index uint32) (*btcutil.WIF, error)
- func GetZPrivKeyFromMnemonic(mnemonic, password string, account uint32) (*hdkeychain.ExtendedKey, error)
- func GetZPrivKeyFromSeed(seed []byte, account uint32) (*hdkeychain.ExtendedKey, error)
- func GetZPubKeyFromMnemonic(mnemonic, password string, account uint32) (*hdkeychain.ExtendedKey, error)
- func GetZPubKeyFromSeed(seed []byte, account uint32) (*hdkeychain.ExtendedKey, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertMnemonicToSeed ¶
ConvertMnemonicToSeed converts a mnemonic to a bip39 seed. If the mnemonic is unvalid an error will be returned. Password will be ignored if string is empty "".
func DeriveChangeAndIndex ¶
func DeriveChangeAndIndex(extended *hdkeychain.ExtendedKey, isReceive bool, index uint32) (*hdkeychain.ExtendedKey, error)
DeriveChangeAndIndex derives the account type and an index from an extended key. If isReceive is true the account type is 0, else it's 1.
func DeriveHardenedKeys ¶
func DeriveHardenedKeys(seed []byte, account uint32) (*hdkeychain.ExtendedKey, error)
DeriveHardenedKeys derives hardened purpose, coin and account keys from a seed. The purpose is 84 (bip-0084) and coin is 0.
func EncodeBech32 ¶
func EncodeBech32(pubKey *btcec.PublicKey) (*btcutil.AddressWitnessPubKeyHash, error)
EncodeBech32 encodes a public key to a bech32 address (P2WPKH)
func Generate12WordMnemonic ¶
Generate12WordMnemonic generates a new 12 word mnemonic which can be used to derive addresses and private keys
func Generate24WordMnemonic ¶
Generate24WordMnemonic generates a new 24 word mnemonic which can be used to derive addresses and private keys
func GenerateMnemonicFromEntropy ¶
GenerateMnemonicFromEntropy generates a new mnemonic which can be used to derive addresses and private keys
func GenerateSeed ¶
GenerateSeed generates a new seed which can be used to derive addresses and private keys
func GetAddressFromMnemonic ¶
func GetAddressFromMnemonic(mnemonic, password string, account uint32, isReceive bool, index uint32) (*btcutil.AddressWitnessPubKeyHash, error)
GetAddressFromMnemonic derives an address from a mnemonic by account, account type and index. Password for mnemonic will be ignored if string is empty "".
func GetAddressFromSeed ¶
func GetAddressFromSeed(seed []byte, account uint32, isReceive bool, index uint32) (*btcutil.AddressWitnessPubKeyHash, error)
GetAddressFromSeed derives an address from a seed by account, account type and index.
func GetAddressFromZPubKey ¶
func GetAddressFromZPubKey(zpub *hdkeychain.ExtendedKey, isReceive bool, index uint32) (*btcutil.AddressWitnessPubKeyHash, error)
GetAddressFromZPubKey derives an address from an extended public key by account type and index.
func GetAddressFromZPubKeyString ¶
func GetAddressFromZPubKeyString(zpub string, isReceive bool, index uint32) (*btcutil.AddressWitnessPubKeyHash, error)
GetAddressFromZPubKeyString parses an extended public key and derives an address from it by account type and index.
func GetWifFromMnemonic ¶
func GetWifFromMnemonic(mnemonic, password string, account uint32, isReceive bool, index uint32) (*btcutil.WIF, error)
GetWifFromMnemonic derives a private key as WIF (wallet import format) from a mnemonic by account, account type and index. Password for mnemonic will be ignored if string is empty "".
func GetWifFromSeed ¶
func GetWifFromSeed(seed []byte, account uint32, isReceive bool, index uint32) (*btcutil.WIF, error)
GetWifFromSeed derives a private key as WIF (wallet import format) from a seed by account, account type and index.
func GetWifFromZPrivKey ¶
func GetWifFromZPrivKey(zpriv *hdkeychain.ExtendedKey, isReceive bool, index uint32) (*btcutil.WIF, error)
GetWifFromZPrivKey derives a private key as WIF (wallet import format) from an extended private key by account type and index.
func GetWifFromZPrivKeyString ¶
GetWifFromZPrivKeyString parses an extended private key and derives a private key as WIF (wallet import format) from it by account type and index.
func GetZPrivKeyFromMnemonic ¶
func GetZPrivKeyFromMnemonic(mnemonic, password string, account uint32) (*hdkeychain.ExtendedKey, error)
GetZPrivKeyFromMnemonic derives an extended private key from a mnemonic by account. Password for mnemonic will be ignored if string is empty "".
func GetZPrivKeyFromSeed ¶
func GetZPrivKeyFromSeed(seed []byte, account uint32) (*hdkeychain.ExtendedKey, error)
GetZPrivKeyFromSeed derives an extended private key from a seed by account.
func GetZPubKeyFromMnemonic ¶
func GetZPubKeyFromMnemonic(mnemonic, password string, account uint32) (*hdkeychain.ExtendedKey, error)
GetZPubKeyFromMnemonic derives an extended public key from a mnemonic by account. Password for mnemonic will be ignored if string is empty "".
func GetZPubKeyFromSeed ¶
func GetZPubKeyFromSeed(seed []byte, account uint32) (*hdkeychain.ExtendedKey, error)
GetZPubKeyFromSeed derives an extended public key from a seed by account.
Types ¶
This section is empty.