func (k *ExtendedKey) ParentFingerprint() uint32 {
	return binary.BigEndian.Uint32(k.parentFP)
}
ParentFingerprint returns a fingerprint of the parent extended key from which
this one was derived.
package hdkeychain
import (
	"bytes"
	"crypto/hmac"
	"crypto/rand"
	"crypto/sha512"
	"encoding/binary"
	"errors"
	"fmt"
	"math/big"
	"github.com/soteria-dag/soterd/soterec"
	"github.com/soteria-dag/soterd/chaincfg"
	"github.com/soteria-dag/soterd/chaincfg/chainhash"
	"github.com/soteria-dag/soterd/soterutil"
	"github.com/soteria-dag/soterd/soterutil/base58"
)
const (
	RecommendedSeedLen = 32  
	HardenedKeyStart = 0x80000000  
	MinSeedBytes = 16  
	MaxSeedBytes = 64  
	serializedKeyLen = 4 + 1 + 4 + 4 + 32 + 33  
	maxUint8 = 1<<8 - 1
)
var (
	ErrDeriveHardFromPublic = errors.New("cannot derive a hardened key " +
		"from a public key")
	ErrDeriveBeyondMaxDepth = errors.New("cannot derive a key with more than " +
		"255 indices in its path")
	ErrNotPrivExtKey = errors.New("unable to create private keys from a " +
		"public extended key")
	ErrInvalidChild = errors.New("the extended key at this index is invalid")
	ErrUnusableSeed = errors.New("unusable seed")
	ErrInvalidSeedLen = fmt.Errorf("seed length must be between %d and %d "+
		"bits", MinSeedBytes*8, MaxSeedBytes*8)
	ErrBadChecksum = errors.New("bad extended key checksum")
	ErrInvalidKeyLen = errors.New("the provided serialized extended key " +
		"length is invalid")
)
var masterKey = []byte("Bitcoin seed")
type ExtendedKey struct {
	key       []byte  
	pubKey    []byte  
	chainCode []byte
	depth     uint8
	parentFP  []byte
	childNum  uint32
	version   []byte
	isPrivate bool
}
func NewExtendedKey(version, key, chainCode, parentFP []byte, depth uint8,
	childNum uint32, isPrivate bool) *ExtendedKey {
	return &ExtendedKey{
		key:       key,
		chainCode: chainCode,
		depth:     depth,
		parentFP:  parentFP,
		childNum:  childNum,
		version:   version,
		isPrivate: isPrivate,
	}
}
func (k *ExtendedKey) pubKeyBytes() []byte {
	if !k.isPrivate {
		return k.key
	}
	if len(k.pubKey) == 0 {
		pkx, pky := soterec.S256().ScalarBaseMult(k.key)
		pubKey := soterec.PublicKey{Curve: soterec.S256(), X: pkx, Y: pky}
		k.pubKey = pubKey.SerializeCompressed()
	}
	return k.pubKey
}
func (k *ExtendedKey) IsPrivate() bool {
	return k.isPrivate
}
func (k *ExtendedKey) Depth() uint8 {
	return k.depth
}