Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrHDVersion = errors.New("Version mismatch") ErrHDPath = errors.New("Invalid HD path") ErrHDKey = errors.New("Invalid HD key") )
Error codes
var ( // CoinList of all all available BIP44 coin types CoinList = []*CoinSpec{}/* 308 elements not displayed */ )
var (
ErrInvalidEntropy = fmt.Errorf("Invalid entropy data")
)
Error codes
Functions ¶
func EntropyToWords ¶
EntropyToWords converts an entropy into a sequence of words
func WordsToEntropy ¶
WordsToEntropy converts a sequence of words into an entropy. Returns the entropy OR the words where the conversion failed. If the number of words are incorrect, "#" is returned.
func WordsToSeed ¶
WordsToSeed computes a seed value for a given word list
Types ¶
type CoinSpec ¶
CoinSpec defines a BIP44 registered coin. (see https://github.com/satoshilabs/slips/blob/master/slip-0044.md)
type ExtendedData ¶
type ExtendedData struct { Version uint32 `order:"big"` Depth uint8 ParentFP uint32 `order:"big"` Child uint32 `order:"big"` Chaincode []byte `size:"32"` Keydata []byte `size:"33"` }
ExtendedData is the data structure representing ExtendedKeys (both public and private) for exchange purposes.
func NewExtendedData ¶
func NewExtendedData() *ExtendedData
NewExtendedData alloctates a new extended data object
func ParseExtended ¶
func ParseExtended(s string) (*ExtendedData, error)
ParseExtended returns a new data object for a given extended key string
func (*ExtendedData) String ¶
func (d *ExtendedData) String() string
String converts an extended data object into a human-readable representation.
type ExtendedPrivateKey ¶
type ExtendedPrivateKey struct {
// contains filtered or unexported fields
}
ExtendedPrivateKey represents a private key in a HD tree
func CKDprv ¶
func CKDprv(k *ExtendedPrivateKey, i uint32) (ki *ExtendedPrivateKey)
CKDprv is a key derivation function for private keys
func ParseExtendedPrivateKey ¶
func ParseExtendedPrivateKey(s string) (k *ExtendedPrivateKey, err error)
ParseExtendedPrivateKey converts a xprv string to a private key
func (*ExtendedPrivateKey) Public ¶
func (k *ExtendedPrivateKey) Public() *ExtendedPublicKey
Public returns the associated public key
func (*ExtendedPrivateKey) String ¶
func (k *ExtendedPrivateKey) String() string
String returns the string representation of an ExtendedPrivateKey
type ExtendedPublicKey ¶
type ExtendedPublicKey struct {
// contains filtered or unexported fields
}
ExtendedPublicKey represents a public key in a HD tree
func CKDpub ¶
func CKDpub(k *ExtendedPublicKey, i uint32) (ki *ExtendedPublicKey)
CKDpub is a key derivation function for public keys
func ParseExtendedPublicKey ¶
func ParseExtendedPublicKey(s string) (k *ExtendedPublicKey, err error)
ParseExtendedPublicKey converts a xpub string to a public key
func (*ExtendedPublicKey) Clone ¶
func (e *ExtendedPublicKey) Clone() *ExtendedPublicKey
Clone returns a deep copy of a public key
func (*ExtendedPublicKey) Fingerprint ¶
func (e *ExtendedPublicKey) Fingerprint() (i uint32)
Fingerprint returns the fingerprint of an ExtendedPublicKey
func (*ExtendedPublicKey) String ¶
func (e *ExtendedPublicKey) String() string
String returns the string representation of an ExtendedPublicKey
type HD ¶
type HD struct {
// contains filtered or unexported fields
}
HD represents a hierarchically deterministic key space.
type HDPublic ¶
type HDPublic struct {
// contains filtered or unexported fields
}
HDPublic represents a public branch in a hierarchically deterministic key space.
func NewHDPublic ¶
func NewHDPublic(key *ExtendedPublicKey, path string) *HDPublic
NewHDPublic initializes a new HDPublic from an extended public key with a given path.