generated from mrz1836/go-template
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c7df2a4
commit 8f8ca5f
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"github.com/BuxOrg/go-buxclient/utils" | ||
) | ||
|
||
func main() { | ||
// Generate a random set of keys | ||
hdXpriv, hdXpub := utils.GenerateRandomSetOfKeys() | ||
|
||
fmt.Println("Your XPriv: ", hdXpriv) | ||
fmt.Println("Your XPub: ", hdXpub) | ||
|
||
xpub, err := utils.GetPublicKeyFromHDPrivateKey(hdXpriv.String()) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
// hdXpub and xpub should be this same | ||
if hdXpub.String() != xpub.String() { | ||
panic("xpub and hdXpub are not the same") | ||
} else { | ||
fmt.Println("Keys generated successfully, xpub and hdXpub are the same") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters