package main
import (
ethereum_crypto "github.com/ethereum/go-ethereum/crypto"
"fmt"
"github.com/ethereum/go-ethereum/common/hexutil"
"crypto/ecdsa"
)
func main() {
privateKey, err := ethereum_crypto.GenerateKey()
if err != nil {
fmt.Print(err)
return
}
privateKeyBytes := ethereum_crypto.FromECDSA(privateKey)
privateKeyHex := hexutil.Encode(privateKeyBytes)
fmt.Println(privateKeyHex)
_publicKey := privateKey.Public()
publicKey := _publicKey.(*ecdsa.PublicKey)
publicKeyBytes := ethereum_crypto.FromECDSAPub(publicKey)
publicKeyHex := hexutil.Encode(publicKeyBytes)
fmt.Println(publicKeyHex)
address := ethereum_crypto.PubkeyToAddress(*publicKey).Hex()
fmt.Print(address)
}