Documentation ¶
Index ¶
- Variables
- func NewXKeys(r io.Reader) (xprv XPrv, xpub XPub, err error)
- func XPubKeys(xpubs []XPub) []ed25519.PublicKey
- type XPrv
- func (xprv XPrv) Bytes() []byte
- func (xprv XPrv) Child(sel []byte, hardened bool) (res XPrv)
- func (xprv XPrv) Derive(path [][]byte) XPrv
- func (xprv XPrv) MarshalText() ([]byte, error)
- func (xprv XPrv) Sign(msg []byte) []byte
- func (xprv XPrv) String() string
- func (xprv *XPrv) UnmarshalText(inp []byte) error
- func (xprv XPrv) XPub() XPub
- type XPub
- func (xpub XPub) Bytes() []byte
- func (xpub XPub) Child(sel []byte) (res XPub)
- func (xpub XPub) Derive(path [][]byte) XPub
- func (xpub XPub) MarshalText() ([]byte, error)
- func (xpub XPub) PublicKey() ed25519.PublicKey
- func (xpub XPub) String() string
- func (xpub *XPub) UnmarshalText(inp []byte) error
- func (xpub XPub) Verify(msg []byte, sig []byte) bool
Constants ¶
This section is empty.
Variables ¶
var ErrBadKeyStr = errors.New("bad key string")
ErrBadKeyStr is produced when an error is encountered parsing an XPub or XPrv.
Functions ¶
Types ¶
type XPrv ¶
type XPrv [64]byte
XPrv is an extended private key from which child keys may be derived.
func NewXPrv ¶
NewXPrv takes a source of random bytes and produces a new XPrv. If r is nil, crypto/rand.Reader is used.
func (XPrv) Derive ¶
Derive produces the descendant of the XPrv at the given path. It's equivalent to repeated calls of xprv.Child with the elements of path.
func (XPrv) MarshalText ¶
MarshalText satisfies the encoding.TextMarshaler interface.
func (*XPrv) UnmarshalText ¶
UnmarshalText satisfies the encoding.TextUnmarshaler interface.
type XPub ¶
type XPub [64]byte
XPub is an extended public key from which child keys may be derived.
func DeriveXPubs ¶
DeriveXPubs calls Derive on each XPub, all with the same path.
func (XPub) Derive ¶
Derive produces the descendant of the XPub at the given path. It's equivalent to repeated calls of xpub.Child with the elements of path.
func (XPub) MarshalText ¶
MarshalText satisfies the encoding.TextMarshaler interface.
func (*XPub) UnmarshalText ¶
UnmarshalText satisfies the encoding.TextUnmarshaler interface.