[Fix] Zero balance when importing a Private Key for a Bitcoin Segwit address

If your private key for a Bitcoin wallet doesn’t work in self-custody wallet apps like Electrum, it’s a real nightmare.

This happened to me. Allow me to quickly describe my situation, perhaps you’ve encountered the same:

  • I had a Bitcoin paper wallet for many years. The PDF shows just a public address and a private key. No word seed.
    The public address started with the number 3, indicating that it is a Segwit wallet. It still held a certain amount of BTC.
  • Today I wanted to sell a bit. So I needed to move my BTC to an exchange. I decided to open Electrum, since I trust and used that app for many years. And it’s fast since you don’t have to download the blockchain.
  • I imported the private key, but it showed a different public address, with zero balance!
    Also, the address started with a 1, indicating it’s an old/legacy address. No matter what I did in the app, I could NOT see my actual balance, let alone move my Bitcoin(!)
  • I started to panic and used another app, same story(!) Now I was really starting to worry:
    • Was I scammed when I generated the paper wallet!?
    • Is my wallet locked forever since no software can open it?
  • I also wanted to try Bitcoin Core, but couldn’t download 540GB of blockchain first… unsure if it would actually help resolve the problem at all.

I was panicking and stressed to the core to say the least.

How I was able to use my P2SH (Base58) private key to unlock the Segwit Bitcoin wallet

I started to search the internet, Reddit, numerous Bitcoin fora… I was today years old to discover mind boggling terms like WIF, P2SH (Base58) and P2WPKH (Bech32) addresses, and that it’s all somewhat related to Segwit wallets.

After some digging, it seemed I had –If I’m not mistaken– “a private key in a WIF (Wallet Import Format), for a P2SH Base58 Segwit Address“… –Whatever that’s supposed to mean… Anyway, I put some puzzle pieces together and figured I needed to be able to convert and/or import this “WIF private key” as a “P2WPKH-in-P2SH address”, or find an app that could do this for me.

On numerous occasions I saw this Electrum console command, which didn’t work for me!

For P2SH-P2WPKH addresses:
Open the console in Electrum and type the following code. It should print a WIF that you can import into Bitcoin Core. (Press enter after each line)


key = 'YOURPRIVATEKEY'
txin_type, secret, compressed = bitcoin.deserialize_privkey(key)
wif2 = bitcoin.serialize_privkey(secret, compressed, 'p2wpkh-p2sh')
print(wif2)

BlueWallet managed to import my WIF Private Key and I was able to move my funds!

I tried so many wallet apps I lost count. For desktop, Chrome/Edge extensions, Android apps… Most required a word seed which I didn’t have, others were sketchy as hell…

But then… finally, I found an app called BlueWallet ( iOS / Android + just in case, here’s an APK of version 6.5.5 that saved me on APKMonk | My mirror )

BlueWallet can import a WIF Private Key for a Segwit Address

This app allowed me to just paste my WIF Private Key and managed to finally fully unlock my Bitcoin Segwit Wallet. Needless to say, I transferred my funds to the exchange immediately. I can’t vouch for the rest of the app though.

I truly hope I helped you save your funds by writing all of this down! If it did, please consider donating (see below) and leaving a comment.

Share this article via:

Leave a Comment

Your email address will not be published. Required fields are marked *

Donate Bitcoin

PowrUsr Bitcoin donation

Bitcoin Address
38nUJcf4993v6y8aLftstZ1dM9LYMhzXLc

A big thank you, I really appreciate it!
Want to let me know you donated? Or want to donate other crypto? Let me know in a comment and I’ll get back to you in private!