Deriving BIP32/BIP44 addresses for LTC to match Jaxx
I'm using https://github.com/bitcoinjs/bitcoinjs-lib to derive LTC wallet addresses from a private key so I can track transactions of the Jaxx LTC wallet.
The first few addresses generated match what Jaxx has (first 9 to be precise), but other addresses don't match.
I have compared the results with https://iancoleman.io/bip39/ and the are consistent.
The derivation path that I was using is
I have also tested BTC addresses, and only first 5 addresses matched.
So the questions are:
- Why addresses become different after some correct?
- How can I get consistent matching with Jaxx addresses?
After further research a came across this post https://www.reddit.com/r/jaxx/comments/7ix6mu/hd_derivation_bug/ which had the answer to my problem. The issue was that by using
m/44'/2'/0'/0i was creating external addresses only (those that are for sending funds to). I should also create internal addresses (used for keeping transaction change) by using
1in the last position). More info this parameter here: https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change