Skip to content

Commit 6d77797

Browse files
committed
linux binary
1 parent 75e6b6a commit 6d77797

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

generate_address.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
}

go.mod

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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+
)

0 commit comments

Comments
 (0)