-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
29 lines (23 loc) · 665 Bytes
/
main.go
File metadata and controls
29 lines (23 loc) · 665 Bytes
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
package main
import (
"fmt"
networks "github.com/ChayanDass/gobtc-lib/Network"
pk "github.com/ChayanDass/gobtc-lib/keys/PrivateKey"
)
func main() {
networks.SetDefault(networks.Testnet)
prvkey, err := pk.NewPrivateKey(&pk.KeyOptions{
Data: "9fb6635efa0bc2cd718ac22a4aedfb7deda6da8d80fdf8e85017cf1deffc2cf8",
})
if err != nil {
fmt.Println("failed to create private key:", err)
return
}
fmt.Println("Generated Private Key:", prvkey.ToString())
addr := prvkey.ToAddress()
fmt.Println(addr.HashHex())
// wif := prvkey.ToWIF()
// fmt.Println("WIF:", wif)
// wif1, _ := pk.FromWIF(wif)
// fmt.Println("WIF to Private Key:", wif1.ToString())
}