This code works fine when I'm creating mainnet addresses, but when I put in my testnet public key in the config, it generates addresses different than what Electrum created. I used the following value for BTC_PUBLIC_KEY: tpubD6NzVbkrYhZ4YSeta433ubKfJ1CmKyw5wdTnWot7NCn4xhAEAf1aKgbFor8BegsuyHd368gXP5PFwUbV581C1xRYVTbFPmmwSQ1o6KvSrpu.
For example, for chainNumber=0, and the public key above, this returns 1A45fGYj6377oFfLqBqSnR9A2GLSBVdBPK which I understand to be a mainnet address, but the wallet in Electrum says the address should be msmV9362Lxw5UREC2VvvJQ6qrMzuBG64cq.
Before anybody asks, I've verified that network = bitcoin.networks.testnet when running my tests.
I'm trying to generate addresses that match up with the addresses that are in my Electrum wallet. This is the code I've written:
This code works fine when I'm creating mainnet addresses, but when I put in my testnet public key in the config, it generates addresses different than what Electrum created. I used the following value for
BTC_PUBLIC_KEY
:tpubD6NzVbkrYhZ4YSeta433ubKfJ1CmKyw5wdTnWot7NCn4xhAEAf1aKgbFor8BegsuyHd368gXP5PFwUbV581C1xRYVTbFPmmwSQ1o6KvSrpu
.For example, for
chainNumber=0
, and the public key above, this returns1A45fGYj6377oFfLqBqSnR9A2GLSBVdBPK
which I understand to be a mainnet address, but the wallet in Electrum says the address should bemsmV9362Lxw5UREC2VvvJQ6qrMzuBG64cq
.Before anybody asks, I've verified that
network = bitcoin.networks.testnet
when running my tests.What am I doing wrong? :)