keys/hd/address.go
func PubKeyBytesFromPrivKeyBytes(privKeyBytes []byte, compress bool) (pubKeyBytes []byte) {
	x, y := btcec.S256().ScalarBaseMult(privKeyBytes)
	pub := &btcec.PublicKey{
		Curve: btcec.S256(),
		X:     x,
		Y:     y,
	}

	if compress {
		return pub.SerializeCompressed()
	}
	return pub.SerializeUncompressed()
}
func PubKeyBytesFromPrivKeyBytes(privKeyBytes []byte, compress bool) (pubKeyBytes []byte) {
	x, y := btcec.S256().ScalarBaseMult(privKeyBytes)
	pub := &btcec.PublicKey{
		Curve: btcec.S256(),
		X:     x,
		Y:     y,
	}

	if compress {
		return pub.SerializeCompressed()
	}
	return pub.SerializeUncompressed()
}
func PubKeyBytesFromPrivKeyBytes ( privKeyBytes [ ] byte , compress bool ) ( pubKeyBytes [ ] byte ) { x , y := btcec . S256 ( ) . ScalarBaseMult ( privKeyBytes ) pub := & btcec . PublicKey { Curve : btcec . S256 ( ) , X : x , Y : y , } if compress { return pub . SerializeCompressed ( ) } return pub . SerializeUncompressed ( ) }
// PubKeyBytesFromPrivKeyBytes returns the optionally compressed public key bytes.
PubKeyBytesFromPrivKeyBytes returns the optionally compressed public key bytes .