Extended Public Key (xpub) from Extended Private Key (xprv)
/*Package main - xpub_from_xpriv example*/packagemainimport ("fmt""os""github.com/bitcoin-sv/spv-wallet-go-client/xpriv")funcmain() {// This is an example xPriv key - replace it with your ownconst xPriv ="xprv9s21ZrQH143K4VneY3UWCF1o5Kk2tmgGrGtMtsrThCTsHsszEZ6H1iP37ZTwuUBvMwudG68SRkcfTjeu8h3rkayfyqkjKAStFBkuNsBnAkS" keys, err := xpriv.FromString(xPriv)if err !=nil { fmt.Println(err) os.Exit(1) } fmt.Println("extracted xPub: ", keys.XPub().String())}