Skip to content

Commit

Permalink
Add seed to pub key tool
Browse files Browse the repository at this point in the history
  • Loading branch information
maebeam committed Aug 12, 2021
1 parent d4e76fa commit 7a5d45e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions scripts/tools/seed_to_pub_key.go
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit 7a5d45e

Please sign in to comment.