Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Public []byte // Public mainnet Private []byte // Private mainnet TestPublic []byte TestPrivate []byte )
Networks
Functions ¶
func PrivateKeyToWIF ¶
PrivateKeyToWIF takes a 256 bit private key and outputs it in Wallet Interchange Format
Types ¶
type PublicKey ¶
type PublicKey struct { Version []byte `json:"-"` Network string `json:"network"` Depth uint16 `json:"depth"` FingerPrint []byte `json:"-"` // : -1440106556, FingerPrintStr string `json:"fingerPrint"` // : -1440106556, ParentFingerPrint []byte `json:"-"` //: 0, ParentFingerPrintStr string `json:"parentFingerPrint"` //: 0, ChildIndex []byte `json:"childIndex"` //: 0, ChainCode []byte `json:"-"` // '41fc504936a63056da1a0f9dd44cad3651b64a17b53e523e18a8d228a489c16a', ChainCodeStr string `json:"chainCode"` PrivateKey []byte `json:"-"` // '0362e448fdb4c7c307a80cc3c8ede19cd2599a5ea5c05b188fc56a25c59bfcf125', PrivateKeyStr string `json:"privateKey"` // '0362e448fdb4c7c307a80cc3c8ede19cd2599a5ea5c05b188fc56a25c59bfcf125', PublicKey []byte `json:"-"` // '0362e448fdb4c7c307a80cc3c8ede19cd2599a5ea5c05b188fc56a25c59bfcf125', PublicKeyStr string `json:"publicKey"` // '0362e448fdb4c7c307a80cc3c8ede19cd2599a5ea5c05b188fc56a25c59bfcf125', Checksum []byte `json:"-"` //: 43286247, XPrvKey string `json:"xprvkey"` // 'xprv661My XPubKey string `json:"xpubkey"` // 'xpub661My }
A PublicKey contains metadata associated with an ECDSA public key.
func NewPrivateKey ¶
NewPrivateKey comment TODO: public key or private key?
func NewPublicKey ¶
NewPublicKey takes an xpub string and returns a PublicKey pointer. See BIP32 https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
func (*PublicKey) Child ¶
Child dervies a child public key for a specific index. See BIP32 https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
func (*PublicKey) GetXPub ¶
GetXPub returns an xpub string from a PublicKey. See BIP32 https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
Click to show internal directories.
Click to hide internal directories.