func (pubKey PubKeyEd25519) Bytes() []byte {
	bz, err := cdc.MarshalBinaryBare(pubKey)
	if err != nil {
		panic(err)
	}
	return bz
}
Bytes marshals the PubKey using amino encoding.
package ed25519
import (
	"bytes"
	"crypto/subtle"
	"fmt"
	"github.com/tendermint/ed25519"
	"github.com/tendermint/ed25519/extra25519"
	amino "github.com/tendermint/go-amino"
	"github.com/tendermint/tendermint/crypto"
	"github.com/tendermint/tendermint/crypto/tmhash"
	cmn "github.com/tendermint/tendermint/libs/common"
)
var _ crypto.PrivKey = PrivKeyEd25519{}
const (
	Ed25519PrivKeyAminoRoute   = "tendermint/PrivKeyEd25519"
	Ed25519PubKeyAminoRoute    = "tendermint/PubKeyEd25519"
	Ed25519SignatureAminoRoute = "tendermint/SignatureEd25519"
)
var cdc = amino.NewCodec()
func init() {
	cdc.RegisterInterface((*crypto.PubKey)(nil), nil)
	cdc.RegisterConcrete(PubKeyEd25519{},
		Ed25519PubKeyAminoRoute, nil)
	cdc.RegisterInterface((*crypto.PrivKey)(nil), nil)
	cdc.RegisterConcrete(PrivKeyEd25519{},
		Ed25519PrivKeyAminoRoute, nil)
	cdc.RegisterInterface((*crypto.Signature)(nil), nil)
	cdc.RegisterConcrete(SignatureEd25519{},
		Ed25519SignatureAminoRoute, nil)
}
type PrivKeyEd25519 [64]byte
func (privKey PrivKeyEd25519) Bytes() []byte {
	return cdc.MustMarshalBinaryBare(privKey)
}
func (privKey PrivKeyEd25519) Sign(msg []byte) (crypto.Signature, error) {
	privKeyBytes := [64]byte(privKey)
	signatureBytes := ed25519.Sign(&privKeyBytes, msg)
	return SignatureEd25519(*signatureBytes), nil
}
func (privKey PrivKeyEd25519) PubKey() crypto.PubKey {
	privKeyBytes := [64]byte(privKey)
	initialized := false
	for _, v := range privKeyBytes[32:] {
		if v != 0 {
			initialized = true
			break
		}
	}
	if initialized {
		var pubkeyBytes [PubKeyEd25519Size]byte
		copy(pubkeyBytes[:], privKeyBytes[32:])
		return PubKeyEd25519(pubkeyBytes)
	}
	pubBytes := *ed25519.MakePublicKey(&privKeyBytes)
	return PubKeyEd25519(pubBytes)
}
func (privKey PrivKeyEd25519) Equals(other crypto.PrivKey) bool {
	if otherEd, ok := other.(PrivKeyEd25519); ok {
		return subtle.ConstantTimeCompare(privKey[:], otherEd[:]) == 1
	} else {
		return false
	}
}
func (privKey PrivKeyEd25519) ToCurve25519() *[PubKeyEd25519Size]byte {
	keyCurve25519 := new([32]byte)
	privKeyBytes := [64]byte(privKey)
	extra25519.PrivateKeyToCurve25519(keyCurve25519, &privKeyBytes)
	return keyCurve25519
}
func GenPrivKey() PrivKeyEd25519 {
	privKey := new([64]byte)
	copy(privKey[:32], crypto.CRandBytes(32))
	ed25519.MakePublicKey(privKey)
	return PrivKeyEd25519(*privKey)
}
func GenPrivKeyFromSecret(secret []byte) PrivKeyEd25519 {
	privKey32 := crypto.Sha256(secret)  
	privKey := new([64]byte)
	copy(privKey[:32], privKey32)
	ed25519.MakePublicKey(privKey)
	return PrivKeyEd25519(*privKey)
}
var _ crypto.PubKey = PubKeyEd25519{}
const PubKeyEd25519Size = 32
type PubKeyEd25519 [PubKeyEd25519Size]byte
func (pubKey PubKeyEd25519) Address() crypto.Address {
	return crypto.Address(tmhash.Sum(pubKey[:]))
}