Bitcoin Forum
October 11, 2025, 10:22:44 PM *
News: Latest Bitcoin Core release: 29.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: Please, I need help for converting a very old btc private key to WIF.  (Read 652 times)
bluecat4 (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 12


View Profile
June 19, 2025, 04:26:19 PM
Merited by LoyceV (4), klarki (4), ABCbits (2), PowerGlove (1)
 #1


I found a very old Bitcoin private key. Searching online, I discovered that my private key is base64, has 44 characters, and ends in an equal sign. I only have the private key, I don’t have the seed phrase. I need to convert the private key to WIF format to import it into Electrum. I have no programming knowledge. I’ve been following a Python tutorial on Youtube for some weeks.

I think it would be better to use bitaddress.org instead of Python. It’s more practical, and because I don’t know how to program. I would use a laptop that has never been connected to the internet.

The first step would be to connect it to the internet for the first and only time, download the Electrum app and go to bitaddress.org. The second step would be to disconnect the internet. The third step would be to automatically convert my base64 private key to WIF in bitaddress offline.The fourth step would be to get the results in bitaddress and save them.

Bitaddress gives 2 public keys: the public key ( 130 characters ) and the compressed public key ( 66 characters ). Are both the master public key ? Which of the 2 public keys do I need to create a watch only wallet ? It’s important not to expose the private key.

I think in addition to having Electrum on the laptop offline, it can also be necessary to buy a hardware wallet.

I tested bitaddress offline with an example of a private key from a post of other forum. The result is :

- 2 Bitcoin addresses with QR codes.

- The public key and the compressed public key.

- 4 private keys in different formats.

Do you recommend using bitaddress offline ? Could you help me ?

Sorry for the length of this post. Many thanks. Best regards.
LoyceV
Legendary
*
Offline Offline

Activity: 3822
Merit: 20105


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
June 19, 2025, 05:21:29 PM
Merited by vapourminer (2), pooya87 (2), ABCbits (2), hosemary (2), Cricktor (2), PowerGlove (1)
 #2

my private key is base64, has 44 characters, and ends in an equal sign.
To quote myself:
Bitcoin private keys (this section is largely based on data from bitaddress.org)
  • Private Key (44 characters base64) (less common).
    Example: ypoGFxC4vFguG4u2DQ8/J1F5GIirXBhzdiAIer33SgU=
But you probably already know that Smiley

I think it would be better to use bitaddress.org instead of Python. ~
I would use a laptop that has never been connected to the internet.

The first step would be to connect it to the internet
Stop right there! You can keep it offline, download the Bitaddress repository from Github, and use an USB stick to copy it to your offline system.

Quote
Bitaddress gives 2 public keys: the public key ( 130 characters ) and the compressed public key ( 66 characters ). Are both the master public key ? Which of the 2 public keys do I need to create a watch only wallet ? It’s important not to expose the private key.
In Electrum, you'll just use the Bitcoin Address. Considering it's old, you probably need the one that isn't "Compressed". If you use my test-key from the quote above, it's this address:
1DBZmNMC69PPbC1wjGYaagXQKiba2e5NdS
You won't need the 130 or 66 character hex keys, you'll need the WIF (again: not Compressed):
5KMWmYkn5YWkJnUDG4utD9L1HXQv3DBseqqCGsQXmthcEerbA7k

Quote
I think in addition to having Electrum on the laptop offline, it can also be necessary to buy a hardware wallet.
It's good to have a plan where to send your Bitcoin before doing it. I'd buy a Trezor and not a Ledger.

Quote
- 2 Bitcoin addresses with QR codes.
Don't use the QR-codes. Phone scanners are online and some instantly steal your funds.

Quote
Do you recommend using bitaddress offline ?
Yes. NEVER use it online. Never enter your keys on any system with an internet connection.

Quote
Could you help me ?
Yes.
Warning: you should ignore all PMs you may receive! Read How can we protect Newbies from getting scammed?, Bitcointalk is filled with scammers.

For offline signing in Electrum (after you've bought a hardware wallet to send your coins to), read this:
Online:
Install Electrum on your PC.
Import your address to create a watch-only wallet.
Preview the transaction, Copy the unsigned transaction. Put it on a USB stick.

Offline and running without hard drive storage:
Get a Linux LIVE DVD. Use Knoppix or Tails for instance, or any other distribution that comes with Electrum pre-installed.
Unplug your internet cable. Close the curtains. Reboot your computer and start up from that DVD. Don't enter any wireless connection password. Keep it offline.
Start Electrum. Import your private key.
Copy your unsigned transaction from the USB stick, load it into Electrum.
CHECK the transaction in Electrum. Check the fees, check the amount, check all destination addresses (character by character).
If all is okay, sign the transaction. Copy it back to your USB stick.
Turn off the computer. That wipes the Live LINUX from memory and all traces are gone.

Online:
Use your normal online Electrum to (check again and) broadcast the transaction.

Bonus:
After moving all your Bitcoin, and once the transaction confirmed, check if you own Forkcoins.



It is possible your old Bitcoins were sent to pubkey instead of the Bitcoin address. If that's the case, Electrum can't handle "send to pubkey" inputs so you can't use it to sign offline. But Bitcoin Core can. We'll get there if it's needed.



Don't rush things, take your take, and make sure you understand what you're doing before doing it. Handling private keys means you're one fuckup away from losing your coins.
Enjoy your treasure hunt.

¡uʍop ǝpᴉsdn pɐǝɥ ɹnoʎ ɥʇᴉʍ ʎuunɟ ʞool no⅄
ABCbits
Legendary
*
Offline Offline

Activity: 3388
Merit: 9232



View Profile
June 20, 2025, 08:29:50 AM
Merited by philipma1957 (1)
 #3

I think in addition to having Electrum on the laptop offline, it can also be necessary to buy a hardware wallet.

If you're willing to learn, consider install and using one of Linux distro (such as Linux Mint) on that offline laptop.

Quote
Bitaddress gives 2 public keys: the public key ( 130 characters ) and the compressed public key ( 66 characters ). Are both the master public key ? Which of the 2 public keys do I need to create a watch only wallet ? It’s important not to expose the private key.
In Electrum, you'll just use the Bitcoin Address. Considering it's old, you probably need the one that isn't "Compressed". If you use my test-key from the quote above, it's this address:
1DBZmNMC69PPbC1wjGYaagXQKiba2e5NdS
You won't need the 130 or 66 character hex keys, you'll need the WIF (again: not Compressed):
5KMWmYkn5YWkJnUDG4utD9L1HXQv3DBseqqCGsQXmthcEerbA7k

Personally i would recommend to copy Bitcoin address from compressed and uncompressed public key just to be sure.

LoyceV
Legendary
*
Offline Offline

Activity: 3822
Merit: 20105


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
June 20, 2025, 09:09:06 AM
 #4

Personally i would recommend to copy Bitcoin address from compressed and uncompressed public key just to be sure.
Good point. It doesn't hurt to check both.

¡uʍop ǝpᴉsdn pɐǝɥ ɹnoʎ ɥʇᴉʍ ʎuunɟ ʞool no⅄
bluecat4 (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 12


View Profile
June 20, 2025, 06:26:08 PM
Last edit: June 21, 2025, 08:43:05 PM by achow101
 #5

Thank you very much LoyceV !

Sorry for not answering before. I've been very busy and just logged back in. Ok, I understand, so for importing the private key, it's much better to use the WIF not compressed as in your example. I think everything's clear.



I think in addition to having Electrum on the laptop offline, it can also be necessary to buy a hardware wallet.

If you're willing to learn, consider install and using one of Linux distro (such as Linux Mint) on that offline laptop.

Quote
Bitaddress gives 2 public keys: the public key ( 130 characters ) and the compressed public key ( 66 characters ). Are both the master public key ? Which of the 2 public keys do I need to create a watch only wallet ? It’s important not to expose the private key.
In Electrum, you'll just use the Bitcoin Address. Considering it's old, you probably need the one that isn't "Compressed". If you use my test-key from the quote above, it's this address:
1DBZmNMC69PPbC1wjGYaagXQKiba2e5NdS
You won't need the 130 or 66 character hex keys, you'll need the WIF (again: not Compressed):
5KMWmYkn5YWkJnUDG4utD9L1HXQv3DBseqqCGsQXmthcEerbA7k

Personally i would recommend to copy Bitcoin address from compressed and uncompressed public key just to be sure.

Thank you very much to both of you.

Mod note: Consecutive posts merged
cr1776
Legendary
*
Offline Offline

Activity: 4550
Merit: 1358


View Profile
June 21, 2025, 01:22:26 PM
 #6

Thank you very much LoyceV !

Sorry for not answering before. I've been very busy and just logged back in. Ok, I understand, so for importing the private key, it's much better to use the WIF not compressed as in your example. I think everything's clear.

And as was said above, do not put it online if you think there could be any significant amount of bitcoin there.  It is better to be safe than to lose a significant amount of value.
Cricktor
Legendary
*
Offline Offline

Activity: 1274
Merit: 3049



View Profile
June 22, 2025, 01:41:41 PM
 #7

Ok, I understand, so for importing the private key, it's much better to use the WIF not compressed as in your example. I think everything's clear.
Your Base64 encoded private key is the "raw entropy", an uncompressed WIF private key tells the wallet to derive an uncompressed public key from the private key giving you an uncompressed public address.

From the same Base64 encoded private key you can also get a compressed WIF private key (fun fact: it's one byte longer than the uncompressed WIF; the compression property is not refering to the size of the private key), which tells a wallet to derive a compressed public key (which is significantly smaller than the uncompressed public key) and finally a compressed public address.

It actually doesn't hurt if you import both the uncompressed and the compressed WIFs into your wallet. That way you don't miss any UTXOs.

As highlighted by others, it is essential that you operate in a secure and preferably offline environment which can be easily disposed completely so that it doesn't leave any data traces behind. A live Linux that you can boot from an USB stick is quite handy in that situation. As it usually only runs in RAM, everything is gone when you shutdown. Make sure to save your wallet or any other valuable data before you shutdown, but keep exposed private keys always offline.

Private keys should be stored in encrypted wallet files, not as exposed unencrypted private keys on storage media. If you accidently attach such a storage media to an online device, you risk to compromise exposed unencrypted private keys.

Play it safe. If in doubt, learn first or ask first.

bluecat4 (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 12


View Profile
June 22, 2025, 08:58:48 PM
Last edit: June 22, 2025, 09:28:36 PM by bluecat4
Merited by vapourminer (1)
 #8

Ok, I understand, so for importing the private key, it's much better to use the WIF not compressed as in your example. I think everything's clear.


It actually doesn't hurt if you import both the uncompressed and the compressed WIFs into your wallet. That way you don't miss any UTXOs.


Please, could you explain this? It's the only part of your message I don't understand. I'm learning about UTXOs now ( the concept and how to freeze UTXOs in Electrum ). I have no idea if there are funds, I hope so. It's been a long time since I created the wallet. But prevention is better than cure and very old addresses suffer dusting attacks.

So, I don't understand how the WIF private key depending if it's compressed or uncompressed can affect the UTXOs.

Thanks.
Cricktor
Legendary
*
Offline Offline

Activity: 1274
Merit: 3049



View Profile
June 22, 2025, 10:42:41 PM
Merited by LoyceV (12), pooya87 (5), vapourminer (4)
 #9

I will give you an example where a private key had both transactions to the uncompressed and compressed public address. It is a highly non-random private key, namely in hex format
Code:
0000000000000000000000000000000000000000000000000000000000000003
or in Base64
Code:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM=

The uncompressed WIF private key is:
Code:
5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreB1FQ8BZ

giving the uncompressed public key:
Code:
04F9308A019258C31049344F85F89D5229B531C845836F99B08601F113BCE036F9388F7B0F632DE8140FE337E62A37F3566500A99934C2231B6CB9FD7584B8E672

and uncompressed public address 1NZUP3JAc9JkmbvmoTv7nVgZGtyJjirKV1 which has seen so far 78 transactions. Every coin (UTXO) you send to it will be immediately stolen by bots because the private key is well known, it's not random at all.

The compressed WIF private key is:
Code:
KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU74sHUHy8S

giving the compressed public key:
Code:
02F9308A019258C31049344F85F89D5229B531C845836F99B08601F113BCE036F9

and compressed public address 1CUNEBjYrCn2y1SdiUMohaKUi4wpP326Lb which has seen so far 12 transactions. The first five UTXOs that have been sent to this address have been stolen in the same block, only the last one was snatched some weeks later because it was just dust.

You can see that a single private key can have uncompressed and compressed form and resulting public addresses and both had coins sent to either of them. Assume you had UTXOs (coins) on both uncompressed and compressed public addresses, if you import only one form, you will miss the coins of the other.


Same applies for the private key in hex form
Code:
0000000000000000000000000000000000000000000000000000000000000002
or in Base64
Code:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI=

which in addition to numerous transactions on uncompressed and compressed P2PKH addresses also had three UTXOs sent to the P2WPKH Native Segwit address bc1qq6hag67dl53wl99vzg42z8eyzfz2xlkvxechjp which also were taken quickly except for the last dust UTXO that lasted about two months.


Bitcoin doesn't work like Ethereum with an accounting balance system. Bitcoin uses UTXO (unspent transaction output) which is basically a "chunk" of coin. If you spend it, it's always spent completely and if you don't need to send the whole "chunk", you need to send the change as a separate smaller "chunk" back into your own wallet.


So, I don't understand how the WIF private key depending if it's compressed or uncompressed can affect the UTXOs.
Either form gives you different public addresses. It's up to you or your wallet which of them you use. Uncompressed form is older, later mostly the compressed variants have been used more commonly.

nc50lc
Legendary
*
Offline Offline

Activity: 2926
Merit: 7758


Self-proclaimed Genius


View Profile
June 23, 2025, 05:35:35 AM
Merited by vapourminer (1)
 #10

So, I don't understand how the WIF private key depending if it's compressed or uncompressed can affect the UTXOs.
For this, you need to understand how P2PKH work.

But first, take note that WIF is encoded with or without a "compressed byte" flag that tells the client which pair public key form to compute from it.
So, compressed and uncompressed WIF specifically point to their corresponding compressed and uncompressed pubKey format.

Then, simplest explanation to the UTXO: it's "locked" using the hash of the public key. (Pay-to-Pub-Key-Hash)
Since compressed and uncompressed pubKeys are entirely different, their hashes will be different.
So the UTXO created with them only corresponds to the public key that can reproduce its hash.

bluecat4 (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 12


View Profile
June 24, 2025, 03:21:58 PM
 #11

So, I don't understand how the WIF private key depending if it's compressed or uncompressed can affect the UTXOs.
But first, take note that WIF is encoded with or without a "compressed byte" flag that tells the client which pair public key form to compute from it.
So, compressed and uncompressed WIF specifically point to their corresponding compressed and uncompressed pubKey format.

Then, simplest explanation to the UTXO: it's "locked" using the hash of the public key. (Pay-to-Pub-Key-Hash)
Since compressed and uncompressed pubKeys are entirely different, their hashes will be different.
So the UTXO created with them only corresponds to the public key that can reproduce its hash.

I think I understand.

So, I see that the uncompressed WIF private key has a direct relationship with the uncompressed master public key. And it works in the same way between the compressed WIF private key and the compressed master public key.

Firstly, I’ll check the balance with the uncompressed master public key and the compressed master public key using 2 watch-only wallets. If the balance is different, I’d need to import both WIF private keys. If the balance is the same, my idea is to import the uncompressed WIF.

Many thanks.
LoyceV
Legendary
*
Offline Offline

Activity: 3822
Merit: 20105


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
June 24, 2025, 03:24:57 PM
Merited by vapourminer (1)
 #12

Firstly, I’ll check the balance with the uncompressed master public key and the compressed master public key using 2 watch-only wallets. If the balance is different, I’d need to import both WIF private keys. If the balance is the same, my idea is to import the uncompressed WIF.
Third option: if both balances are zero, check the addresses on a block explorer because of this:
It is possible your old Bitcoins were sent to pubkey instead of the Bitcoin address. If that's the case, Electrum can't handle "send to pubkey" inputs so you can't use it to sign offline.

¡uʍop ǝpᴉsdn pɐǝɥ ɹnoʎ ɥʇᴉʍ ʎuunɟ ʞool no⅄
bluecat4 (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 12


View Profile
June 24, 2025, 04:46:47 PM
 #13

Firstly, I’ll check the balance with the uncompressed master public key and the compressed master public key using 2 watch-only wallets. If the balance is different, I’d need to import both WIF private keys. If the balance is the same, my idea is to import the uncompressed WIF.
Third option: if both balances are zero, check the addresses on a block explorer because of this:
It is possible your old Bitcoins were sent to pubkey instead of the Bitcoin address. If that's the case, Electrum can't handle "send to pubkey" inputs so you can't use it to sign offline.

Good to know. It's important to keep this possibility in mind.
Thanks.
Cricktor
Legendary
*
Offline Offline

Activity: 1274
Merit: 3049



View Profile
June 24, 2025, 09:42:19 PM
Last edit: June 26, 2025, 06:25:26 PM by Cricktor
 #14

~~~
A master public keys is something different which is usually not derived from a "normal" private key. Better not confuse the terms.

You can learn here about ordinary public keys: https://learnmeabitcoin.com/beginners/guide/public-keys/

A somewhat deeper dive into keys: https://learnmeabitcoin.com/technical/keys/

HD wallets are covered in more detail here: https://learnmeabitcoin.com/technical/keys/hd-wallets/

nc50lc
Legendary
*
Offline Offline

Activity: 2926
Merit: 7758


Self-proclaimed Genius


View Profile
June 25, 2025, 06:13:15 AM
 #15

-snip-
I think I understand.

So, I see that the uncompressed WIF private key has a direct relationship with the uncompressed master public key. And it works in the same way between the compressed WIF private key and the compressed master public key.
Good,
But since you're pertaining to a single private key, just drop the "master" in its public key pair.
Because that's a commonly used term used to define the public key pair of the "master private key" which is where the child extended private/public keys and private/public keys of an HD wallet are based from.
The "m" in the derivation path (e.g. m/44'/0'/0').

And take note that only the WIF format of the private key has compressed and uncompressed form.
The private key itself in its base form is just a number.

bluecat4 (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 12


View Profile
June 25, 2025, 09:22:40 PM
 #16

-snip-
I think I understand.

So, I see that the uncompressed WIF private key has a direct relationship with the uncompressed master public key. And it works in the same way between the compressed WIF private key and the compressed master public key.
Good,
But since you're pertaining to a single private key, just drop the "master" in its public key pair.
Because that's a commonly used term used to define the public key pair of the "master private key" which is where the child extended private/public keys and private/public keys of an HD wallet are based from.
The "m" in the derivation path (e.g. m/44'/0'/0').


Ok, I think it's clear. So, it's much better and more accurate to say compressed public key and uncompressed public key without the word "master" when there's only one private key.

Thanks.
odolvlobo
Legendary
*
Offline Offline

Activity: 4802
Merit: 3698



View Profile
June 26, 2025, 04:08:34 AM
Merited by ABCbits (2)
 #17

Ok, I think it's clear. So, it's much better and more accurate to say compressed public key and uncompressed public key without the word "master" when there's only one private key.

I feel that the terms "master private key" and "master public key" were poorly chosen, because they are not keys. The traditional "master key" is a key that can open a series of locks, and that is not what a "master private key" or "master public key" does. I think more appropriate terms would be "private key master" and "public key master" because a "key master" is used to create keys, but it is too late for that now.

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
bluecat4 (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 12


View Profile
June 30, 2025, 05:20:45 PM
 #18


I learned how to freeze UTXOs and select which ones to spend with Electrum. Does Trezor also manage UTXOs?

Just out of curiosity, my other question is whether something similar to what happened to this person in 2010 ( https://bitcointalk.org/index.php?topic=782.0 ) could happen. He sent a bitcoin to himself and lost all the change.

Thanks. 
Cricktor
Legendary
*
Offline Offline

Activity: 1274
Merit: 3049



View Profile
June 30, 2025, 11:36:39 PM
 #19

As far as I remember, Trezor Suite also allows to freeze coins. But I haven't used Trezor Suite a lot. I'm more familiar with Electrum, Bitcoin Core and getting more and more cozy with Sparrow.

Regarding your new question: this doesn't happen with HD wallets.

I only glimpsed over the old topic you linked to. I know what can cause such a loss with BitcoinGUI wallets of early years which had a keypool of independent random keys. I'm not explaining it here now, because that would be off-topic. A brief summary would be that the guy who lost 8999BTC didn't have a current backup of his wallet with his current keypool of private keys. Basically he lost the most recent version of his wallet because he made a backup at the wrong time.

To avoid such backup and restore issues, HD wallets were invented, where any backup can recreate all your wallet's private keys and public addresses.

nc50lc
Legendary
*
Offline Offline

Activity: 2926
Merit: 7758


Self-proclaimed Genius


View Profile
July 01, 2025, 05:19:03 AM
Last edit: July 01, 2025, 08:25:09 AM by nc50lc
 #20

Just out of curiosity, my other question is whether something similar to what happened to this person in 2010 ( https://bitcointalk.org/index.php?topic=782.0 ) could happen. He sent a bitcoin to himself and lost all the change.
In your case, since you're dealing with individual private keys. Your options to spend are either Sweep or Import.

In the former, it depends on the wallet where you swept the bitcoins since you'll be using it to spend after Sweep.
Modern wallets are mostly HD; if not for some reason, has a good number of pre-generated keys on its keypool, so issues like that shouldn't occur.

In the latter, when you create a transaction, the change will usually be sent back to the original address. (e.g.: Electrum imported wallet)
But that depends on the wallet you used to import because some mix the imported keys to its main wallet so that will subject to the above.

-edit-typo-

Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!