-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.go
48 lines (45 loc) · 1.87 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package main
import (
"encoding/hex"
"fmt"
"github.com/jfjun/xmr-address-go/crypto/ed25519/chainid"
"github.com/jfjun/xmr-address-go/params"
)
func createXMRAddress(){
params.SelectParams("xmr")
privSpendKey:=chainid.NewPrivateSpendOrViewKey()
privViewKey:=chainid.NewPrivateSpendOrViewKey()
address:=chainid.ToAddress(privSpendKey.Public(),privViewKey.Public())
fmt.Println("Private Spend Key: ",hex.EncodeToString(privSpendKey.Seed()))
fmt.Println("Public Spend Key: ",hex.EncodeToString(privSpendKey.Public()))
fmt.Println("Private View Key: ",hex.EncodeToString(privViewKey.Seed()))
fmt.Println("Public View Key: ",hex.EncodeToString(privViewKey.Public()))
fmt.Println("Address: ",address)
}
func createBCNAddress(){
params.SelectParams("bcn")
privSpendKey:=chainid.NewPrivateSpendOrViewKey()
privViewKey:=chainid.NewPrivateSpendOrViewKey()
address:=chainid.ToAddress(privSpendKey.Public(),privViewKey.Public())
fmt.Println("Private Spend Key: ",hex.EncodeToString(privSpendKey.Seed()))
fmt.Println("Public Spend Key: ",hex.EncodeToString(privSpendKey.Public()))
fmt.Println("Private View Key: ",hex.EncodeToString(privViewKey.Seed()))
fmt.Println("Public View Key: ",hex.EncodeToString(privViewKey.Public()))
fmt.Println("Address: ",address)
}
func createTRTLAddress(){
params.SelectParams("trtl")
privSpendKey:=chainid.NewPrivateSpendOrViewKey()
privViewKey:=chainid.NewPrivateSpendOrViewKey()
address:=chainid.ToAddress(privSpendKey.Public(),privViewKey.Public())
fmt.Println("Private Spend Key: ",hex.EncodeToString(privSpendKey.Seed()))
fmt.Println("Public Spend Key: ",hex.EncodeToString(privSpendKey.Public()))
fmt.Println("Private View Key: ",hex.EncodeToString(privViewKey.Seed()))
fmt.Println("Public View Key: ",hex.EncodeToString(privViewKey.Public()))
fmt.Println("Address: ",address)
}
func main() {
//createBCNAddress()
//createTRTLAddress()
createXMRAddress()
}