Skip to content

Bug: getAddressFromPk() always returns undefined #12

Description

@Hsuyaa4518

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcritical

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions