I’m trying to import watch-only wallets to bitcoin-core via the importpubkey
command and I can’t seem to construct a correct pubkey in javascript. Does anyone know where I go wrong with this:
- Generate a https://iancoleman.io/bip39/
- In the BIP44 tab, copy the
BIP32 Extended Public Key
field - Run:
const hex = new Buffer('(BIP32 Extended Public Key)').toString('hex');
const result = await this.client.importpubkey({ pubkey: hex, rescan: false });
I get the response: "Pubkey is not a valid public key"
for everything I try.
- Which public key should I be using? Since there are many on https://iancoleman.io/bip39/ when you generate a wallet.
- Also, is
new Buffer('(BIP32 Extended Public Key)').toString('hex');
the proper hex format bitcoin-core is expecting?
I’m trying to do this in testnet mode if that makes a difference, the wallet I generate is also a testnet wallet.