go-hdwallet
go-hdwallet copied to clipboard
Issue with BTCTestnet
Following the example in readme,
var (
mnemonic = "range sheriff try enroll deer over ten level bring display stamp recycle"
)
func main() {
master, err := hdwallet.NewKey(
hdwallet.Mnemonic(mnemonic),
)
if err != nil {
panic(err)
}
wallet, _ := master.GetWallet(hdwallet.CoinType(hdwallet.BTCTestnet), hdwallet.AddressIndex(0))
address, _ := wallet.GetAddress()
addressP2WPKH, _ := wallet.GetKey().AddressP2WPKH()
addressP2WPKHInP2SH, _ := wallet.GetKey().AddressP2WPKHInP2SH()
fmt.Println("BTC: ", address, addressP2WPKH, addressP2WPKHInP2SH)
}
outputs
BTC: mz5otQWaaPmWEydGw9gjfaHxSKhHX6Fgj5 tb1qew503ut4u9xpe6gu0md2ymfa4nzx5s4uw7zm4v 2MzibkYjFqqAu9TYtK3SraqQTo226vrLD6L
but it seems wrong, as creating a BTCTestnet transaction (TX ID: 0ae7c88251d0a8bed462141fc1d4605370367069ccb27b77b970c51e1103f68d
) doesn't show up in wallet generated with the previous mnemonic seed