Skip to content

Commit

Permalink
Fix testnet WIF for calculated BIP47 keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ottosch committed Nov 24, 2023
1 parent be23715 commit a1fdcff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/www/js/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -1490,6 +1490,8 @@ const calculateBip47Addresses = () => {
const sendReceive = DOM.bip47SendReceive.value;
const startIndex = parseInt(DOM.bip47StartIndex.value);
const endIndex = startIndex + parseInt(DOM.bip47NoOfAddresses.value);
const network47 = bip47.utils.networks[DOM.bip47Network.value];

try {
const addressDataArray = [];
for (let i = startIndex; i < endIndex; i++) {
Expand All @@ -1506,12 +1508,12 @@ const calculateBip47Addresses = () => {
pCode = myPayCode;
key = bobPayCode.derive(0).publicKey;
prvKey = bitcoin.ECPair.fromPrivateKey(
pCode.derivePaymentPrivateKey(key, i)
pCode.derivePaymentPrivateKey(key, i),
{ network: network47 }
).toWIF();
}
const payPubKey = pCode.derivePaymentPublicKey(key, i);
let address;
const network47 = bip47.utils.networks[DOM.bip47Network.value];
switch (addressType) {
case 'P2PKH':
address = bitcoin.payments.p2pkh({
Expand Down

0 comments on commit a1fdcff

Please sign in to comment.