ckd

package
v0.0.0-...-0bdbdcd Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// HardenedKeyStart hardened key starts.
	HardenedKeyStart = 0x80000000 // 2^31

	PubKeyBytesLenCompressed = 33

	// MinSeedBytes is the minimum number of bytes allowed for a seed to
	// a master node.
	MinSeedBytes = 16 // 128 bits

	// MaxSeedBytes is the maximum number of bytes allowed for a seed to
	// a master node.
	MaxSeedBytes = 64 // 512 bits
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtendedKey

type ExtendedKey struct {
	ecdsa.PublicKey
	Depth      uint8
	ChildIndex uint32
	ChainCode  []byte // 32 bytes
	ParentFP   []byte // parent fingerprint
	Version    []byte
}

func DeriveChildKey

func DeriveChildKey(index uint32, pk *ExtendedKey, curve elliptic.Curve) (*big.Int, *ExtendedKey, error)

DeriveChildKey Derive a child key from the given parent key. The function returns "IL" ("I left"), per BIP-32 spec. It also returns the derived child key.

func DeriveChildKeyFromHierarchy

func DeriveChildKeyFromHierarchy(indicesHierarchy []uint32, pk *ExtendedKey, mod *big.Int, curve elliptic.Curve) (*big.Int, *ExtendedKey, error)

func NewExtendedKeyFromString

func NewExtendedKeyFromString(key string, curve elliptic.Curve) (*ExtendedKey, error)

NewExtendedKeyFromString returns a new extended key from a base58-encoded extended key

func (*ExtendedKey) String

func (k *ExtendedKey) String() string

Extended public key serialization, defined in BIP32

Jump to

Keyboard shortcuts

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