Documentation
¶
Index ¶
- Variables
- func DerivePrivateKey(seed []byte, path []uint32, wif bool) (privKey string, err error)
- func GetCurrencyType(path []uint32) (name string, err error)
- func GetElectrumBIP49MasterPriv(seed []byte) (privKey string, err error)
- func GetElectrumPrivKeyPrefix(path []uint32) (prefix string, err error)
- func GetPath(pathStr string) ([]uint32, error)
- func GetStrPath(path []uint32) string
Constants ¶
This section is empty.
Variables ¶
var B58Enc = basen.NewEncoding("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")
B58Enc is the base58 library used for base58 encoding data
Functions ¶
func DerivePrivateKey ¶
DerivePrivateKey derives a single HD wallet's private key given the seed and a path of indices. Returns hex string representation of private key
func GetCurrencyType ¶
GetCurrencyType takes a path (set of u32 indices) and returns the name of the currency, if applicable. Returns error if currency is not supported or path is malformed.
func GetElectrumBIP49MasterPriv ¶
GetElectrumBIP49MasterPriv exports a BIP49 master private key for import into Electrum. Generally, the master private key would be the `masterKey` defined below. However, Electrum requires further derivation: m/49'/0'/0'. They consider this derived key to be the "master private key". As far as I can tell this breaks from other wallet software, but Electrum is the only popular one that lets you import a master private key for an HD wallet.
func GetElectrumPrivKeyPrefix ¶
GetElectrumPrivKeyPrefix returns a string containing a prefix that must be included when a user imports a private key string into Electrum (Bitcoin wallet). The Lattice uses BIP49 derivations, so we expect 49' most of the time, though 44' is also supported (legacy p2pkh, so there is no prefix needed). Otherwise an error is thrown.
func GetStrPath ¶
GetStrPath converts a set of indices to a BIP32 path string (e.g. m/44'/0'/0'/0/0)
Types ¶
This section is empty.