File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ package main
2+
3+ import (
4+ "crypto/rand"
5+ "fmt"
6+ rand2 "math/rand"
7+ "time"
8+
9+ "github.com/core-coin/go-core/common"
10+ "github.com/core-coin/go-core/common/hexutil"
11+ "github.com/core-coin/go-core/crypto"
12+ "github.com/core-coin/go-goldilocks"
13+ )
14+
15+ func main () {
16+ rand2 .Seed (time .Now ().Unix ())
17+ common .DefaultNetworkID = common .Mainnet
18+
19+ PrivateKey , err := crypto .GenerateKey (rand .Reader )
20+ if err != nil {
21+ panic (err )
22+ }
23+ PublicKey := goldilocks .Ed448DerivePublicKey (* PrivateKey )
24+
25+ Address := crypto .PubkeyToAddress (PublicKey )
26+
27+ fmt .Println ("Private Key:" , hexutil .Encode (PrivateKey [:]))
28+ fmt .Println ("Public Key:" , hexutil .Encode (PublicKey [:]))
29+ fmt .Println ("Address:" , Address .Hex ())
30+ }
Original file line number Diff line number Diff line change 1+ module github.com/core-coin/address-generator
2+
3+ go 1.16
4+
5+ require (
6+ github.com/core-coin/go-core v1.0.52
7+ github.com/core-coin/go-goldilocks v1.0.9
8+ )
You can’t perform that action at this time.
0 commit comments