Go-SDK & CLI tool to interact with the Woop Blockchain
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
go-sdk/pkg/keys/encoding.go

17 lines
431 B

package keys
import (
secp256k1 "github.com/btcsuite/btcd/btcec"
"github.com/ethereum/go-ethereum/common/hexutil"
)
type Dump struct {
PrivateKey, PublicKeyCompressed, PublicKey string
}
func EncodeHex(sk *secp256k1.PrivateKey, pk *secp256k1.PublicKey) *Dump {
p0 := sk.Serialize()
p1 := pk.SerializeCompressed()
p2 := pk.SerializeUncompressed()
return &Dump{hexutil.Encode(p0), hexutil.Encode(p1), hexutil.Encode(p2)}
}