chainkd

package
v0.0.0-...-f024f33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2016 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadKeyLen = errors.New("bad key length")
	ErrBadKeyStr = errors.New("bad key string")
)

Functions

func NewXKeys

func NewXKeys(r io.Reader) (xprv XPrv, xpub XPub, err error)

func XPubKeys

func XPubKeys(xpubs []XPub) []ed25519.PublicKey

Types

type XPrv

type XPrv [64]byte

TODO(bobg): consider making these types opaque. See https://github.com/chain/chain/pull/1875#discussion_r80577736

func NewXPrv

func NewXPrv(r io.Reader) (xprv XPrv, err error)

NewXPrv takes a source of random bytes and produces a new XPrv. If r is nil, crypto/rand.Reader is used.

func (XPrv) Bytes

func (xprv XPrv) Bytes() []byte

func (XPrv) Child

func (xprv XPrv) Child(sel []byte, hardened bool) (res XPrv)

func (XPrv) Derive

func (xprv XPrv) Derive(path [][]byte) XPrv

func (XPrv) MarshalText

func (xprv XPrv) MarshalText() ([]byte, error)

func (XPrv) Sign

func (xprv XPrv) Sign(msg []byte) []byte

func (XPrv) String

func (xprv XPrv) String() string

func (*XPrv) UnmarshalText

func (xprv *XPrv) UnmarshalText(inp []byte) error

func (XPrv) XPub

func (xprv XPrv) XPub() XPub

type XPub

type XPub [64]byte

func DeriveXPubs

func DeriveXPubs(xpubs []XPub, path [][]byte) []XPub

func (XPub) Bytes

func (xpub XPub) Bytes() []byte

func (XPub) Child

func (xpub XPub) Child(sel []byte) (res XPub)

func (XPub) Derive

func (xpub XPub) Derive(path [][]byte) XPub

func (XPub) MarshalText

func (xpub XPub) MarshalText() ([]byte, error)

func (XPub) PublicKey

func (xpub XPub) PublicKey() ed25519.PublicKey

PublicKey extracts the ed25519 public key from an xpub.

func (XPub) String

func (xpub XPub) String() string

func (*XPub) UnmarshalText

func (xpub *XPub) UnmarshalText(inp []byte) error

func (XPub) Verify

func (xpub XPub) Verify(msg []byte, sig []byte) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL