Optionalbase58OptionalchaincodeOptionaldepthOptionalindexOptionalnetworkOptionalparentOptionalpathOptionalpubkeyOptionalrootOptionalsequenceOptionalversionSometimes we hop back and forth between a "Rich ExtendedPublicKey" (a Struct with a couple extra parameters set) and the minimal Struct - let's keep the actual string of the Struct around for easy usage in other functions
Optionalextra: anyUsed by the decoder to convert a raw xpub Buffer into an ExtendedPublicKey class
A bufio.BufferReader
new instance of Extended Public Key
set this xpub's path
Given a network string, will update the network and matching version magic bytes used for generating xpub
one of "mainnet" or "testnet"
fingerprint of pubkey at m/
Return the base58 encoded xpub, adding the
base58check encoded xpub, prefixed by network
A Buffer Writer used to encode an xpub. This is called
by the encode and toBase58 methods
bufio.BufferWriter
doesn't have a return, only updates given buffer writer
StaticdecodeOptionalextra: anyStaticfromReturn a new Extended Public Key class given an xpub string
base58 check encoded xpub
new ExtendedPublicKey instance
Struct object for encoding and decoding extended public keys. base58 encoded serialization of the following information: [ version ][ depth ][ parent fingerprint ][ key index ][ chain code ][ pubkey ]
Param: options.bip32Path
e.g. m/45'/0'/0
Param: options.pubkey
pubkey found at bip32Path
Param: options.chaincode
chaincode corresponding to pubkey and path
Param: options.parentFingerprint
fingerprint of parent public key
Param: options.network
mainnet or testnet
Param: options.rootFingerprint
the root fingerprint of the device, e.g. 'ca2ab33f'
Example