为 LTC 派生 BIP32/BIP44 个地址以匹配 Jaxx
Deriving BIP32/BIP44 addresses for LTC to match Jaxx
我正在使用 https://github.com/bitcoinjs/bitcoinjs-lib 从私钥中获取 LTC 钱包地址,这样我就可以跟踪 Jaxx LTC 钱包的交易。
生成的前几个地址与 Jaxx 拥有的地址匹配(准确地说是前 9 个),但其他地址不匹配。
我已经将结果与 https://iancoleman.io/bip39/ 进行了比较,两者是一致的。
我使用的推导路径是m/44'/2'/0'/0
.
我也测试了BTC地址,只匹配了前5个地址。
所以问题是:
- 为什么地址改正后变了?
- 如何获得与 Jaxx 地址的一致匹配?
经过进一步研究,我发现了这个 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'/0
i 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 m/44'/2'/0'/1
(note 1
in the last position). More info this parameter here: https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change
我正在使用 https://github.com/bitcoinjs/bitcoinjs-lib 从私钥中获取 LTC 钱包地址,这样我就可以跟踪 Jaxx LTC 钱包的交易。
生成的前几个地址与 Jaxx 拥有的地址匹配(准确地说是前 9 个),但其他地址不匹配。
我已经将结果与 https://iancoleman.io/bip39/ 进行了比较,两者是一致的。
我使用的推导路径是m/44'/2'/0'/0
.
我也测试了BTC地址,只匹配了前5个地址。
所以问题是:
- 为什么地址改正后变了?
- 如何获得与 Jaxx 地址的一致匹配?
经过进一步研究,我发现了这个 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'/0
i 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 m/44'/2'/0'/1
(note 1
in the last position). More info this parameter here: https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change