address format is different from bitcoin core response from btcd

address format is different from bitcoin core response from btcd

For now, I'm generating WIF and address using golang btcutil package programmatically.

    wif, err := btcutil.NewWIF(privateKey, conf, false)
    if err != nil {
        return nil, err
    }
    strPrivateKey := wif.String()

    // Address
    address, err := child.Address(conf)

    walletKeys[i] = WalletKey{WIF: strPrivateKey, Address: address.String(), EncodedAddress: address.EncodeAddress()}

After generating wif, I import this wif using bitcoin client importprivkey

err := b.client.ImportPrivKeyRescan(privKeyWIF, label, false)

And then, I make sure this private key is added into wallet using getaddressesbyaccount "label" command.

Somehow listed address and first generated address seems different.

I'd like to know why it's different.

Thanks in advance.

https://ift.tt/2PP0YOI

Comments

Popular posts from this blog

bitcoin node: what is the difference between simnet and regtest?

How to check if Electrum is masking my IP with the Tor proxy?

Need help to recover blpckchain.info wallet, my wife forgot her password and the brute force with btcrecover is not catching the password