Documentation
¶
Index ¶
Constants ¶
View Source
const ( AddrTypeP2pkhOrP2sh = "p2pkh-or-p2sh" // mainnet: [xpub, xprv], testnet: [tpub, tprv] AddrTypeP2wpkhP2sh = "p2wpkh-p2sh" // mainnet: [ypub, yprv], testnet: [upub, uprv] AddrTypeP2wshP2sh = "p2wsh-p2sh" // mainnet: [Ypub, Yprv], testnet: [Upub, Uprv] AddrTypeP2wpkh = "p2wpkh" // mainnet: [zpub, zprv], testnet: [vpub, vprv] AddrTypeP2wsh = "p2wsh" // mainnet: [Zpub, Zprv], testnet: [Vpub, Vprv] AddrTypeLegacy = "legacy" // same as AddrTypeP2pkhOrP2sh, xpub, xprv etc. AddrTypeP2sh = "p2sh" // same as AddrTypeP2wpkhP2sh, ypub, yprv etc. AddrTypeSegWitCompatible = "segwit-compatible" // same as AddrTypeP2wpkhP2sh, ypub, yprv etc. AddrTypeSegWitNative = "segwit-native" // same as AddrTypeP2wpkh, zpub, zprv etc. AddrTypeBech32 = "bech32" // same as AddrTypeP2wpkh, zpub, zprv etc. AddrTypeBip32 = "bip32" // same as AddrTypeLegacy xpub, xprv etc. AddrTypeBip44 = "bip44" // same as AddrTypeLegacy xpub, xprv etc. AddrTypeBip49 = "bip49" // same as AddrTypeSegWitCompatible ypub, yprv etc. AddrTypeBip84 = "bip84" // same as AddrTypeSegWitNative zpub, zprv etc. )
https://electrum.readthedocs.io/en/latest/xpub_version_bytes.html#specification
View Source
const ( Ypub = "0295b43f" Yprv = "0295b005" Upub = "024289ef" Uprv = "024285b5" Zpub = "02aa7ed3" Zprv = "02aa7a99" Vpub = "02575483" Vprv = "02575048" )
key versions
View Source
const ( BigN = "/////////////////////rqu3OavSKA7v9JejNA2QUE=" BigZ = "0" )
View Source
const ( NetworkTypeMainnet = "mainnet" NetworkTypeTestnet = "testnet" )
View Source
const ( KeyTypePub = "pub" KeyTypePrv = "prv" )
View Source
const ( KeyFormatB58 = "base58" KeyFormatHex = "hex" )
View Source
const (
CoinTypeBtc = "btc"
)
Variables ¶
This section is empty.
Functions ¶
func IsValidBase58String ¶
IsValidBase58String checks if all chars in input string belong to valid base58 char set
Types ¶
type Key ¶
type Key struct { Seed string `json:"seed,omitempty" yaml:"seed,omitempty"` XPrv string `json:"xPrv,omitempty" yaml:"xPrv,omitempty"` XPub string `json:"xPub,omitempty" yaml:"xPub,omitempty"` PubKeyHex string `json:"pubKeyHex,omitempty" yaml:"pubKeyHex,omitempty"` PrvKeyWif string `json:"prvKeyWif,omitempty" yaml:"prvKeyWif,omitempty"` Addr string `json:"addr,omitempty" yaml:"addr,omitempty"` AddrType string `json:"addrType,omitempty" yaml:"addrType,omitempty"` DerivationPath string `json:"derivationPath,omitempty" yaml:"derivationPath,omitempty"` CoinType string `json:"coinType,omitempty" yaml:"coinType,omitempty"` Network string `json:"network,omitempty" yaml:"network,omitempty"` // contains filtered or unexported fields }
Key represents BIP32 key components that are presented to the user
func DecodeExtendedKey ¶
func DecodePrivateWifKey ¶
func DecodePublicHex ¶
Click to show internal directories.
Click to hide internal directories.