In btc-controller/src/helper/utils/getAddressFromPk.ts, the pubkey parameter in the bitcoinjs.payments.p2wpkh() call is commented out. This means the function always returns undefined instead of a valid Bitcoin address.
This breaks importWallet() in KeyringController — any wallet imported via private key gets stored with an undefined address.
Steps to reproduce:
const address = getAddressFromPk(someWIFKey, bitcoinjs.networks.testnet);
console.log(address); // undefined
Expected: A valid bc1q... address derived from the private key.
In btc-controller/src/helper/utils/getAddressFromPk.ts, the pubkey parameter in the bitcoinjs.payments.p2wpkh() call is commented out. This means the function always returns undefined instead of a valid Bitcoin address.
This breaks importWallet() in KeyringController — any wallet imported via private key gets stored with an undefined address.
Steps to reproduce:
const address = getAddressFromPk(someWIFKey, bitcoinjs.networks.testnet);
console.log(address); // undefined
Expected: A valid bc1q... address derived from the private key.