From 7a5d45e96e70af5aeb48894a56b110e59624eb56 Mon Sep 17 00:00:00 2001 From: maebeam Date: Thu, 12 Aug 2021 16:55:38 -0400 Subject: [PATCH] Add seed to pub key tool --- scripts/tools/seed_to_pub_key.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 scripts/tools/seed_to_pub_key.go diff --git a/scripts/tools/seed_to_pub_key.go b/scripts/tools/seed_to_pub_key.go new file mode 100644 index 00000000..4b083ff1 --- /dev/null +++ b/scripts/tools/seed_to_pub_key.go @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/bitclout/core/lib" + "github.com/tyler-smith/go-bip39" + "os" +) + +func main() { + seedBytes, err := bip39.NewSeedWithErrorChecking(os.Args[1], "") + if err != nil { + panic(err) + } + + pkBytes, _, _, err := lib.ComputeKeysFromSeedWithNet(seedBytes, 0, false) + if err != nil { + panic(err) + } + + fmt.Println(os.Args[1]) + fmt.Println(lib.PkToStringBoth(pkBytes.SerializeCompressed())) + + os.Exit(0) +}