Author

Topic: BTC private key generates wrong address. (Read 390 times)

legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
November 14, 2023, 08:52:57 AM
#20
I've visited the links and none are related to OP's issue.
Those are issues caused by Electrum's past decision to remove the seed script type selection in the GUI.
Basically, it's those users who wanted to create Electrum wallet with legacy addresses instead of the default, SegWit.

OP's problem however is related to importation of his compressed WIF private keys which results with different addresses from his backup.
legendary
Activity: 2380
Merit: 5213
November 14, 2023, 06:49:46 AM
#19
I read through the thread and did not see any mention about possible mistake by OP, that Electrum wallet supported Legacy address in the past like 2016 but they disabled Legacy address creation with newest Electrum version.
Electrum generates a legacy address if you import a private key without adding any prefix. That hasn't changed and even in the latest version, that's still the same as old versions.
For generating different types of addresses from a private key, you have to add a prefix when importing your private key.
legendary
Activity: 2310
Merit: 4085
Farewell o_e_l_e_o
November 14, 2023, 06:33:30 AM
#18
Hello, please I need some assistance. In 2016, we used python to generate a Bitcoin private key and then imported the key into the electrum Android app, sent btc there and forgot about it.
I read through the thread and did not see any mention about possible mistake by OP, that Electrum wallet supported Legacy address in the past like 2016 but they disabled Legacy address creation with newest Electrum version.

With newest versions, they only allow to create Segwit addresses if a user does not know deeply technical steps to create Legacy address via command line.

Is this the problem of OP?

https://www.reddit.com/r/Electrum/comments/n2piii/legacy_addresses_wallet_creation_gone_as_an/
https://www.reddit.com/r/Electrum/comments/mku14h/how_do_you_create_legacy_wallet_from_command_line/

Quote
Now, for the past one year, I have been trying to recover that address but the private key doesn’t generate the same address anymore. I have used python to generate 5 different legacy addresses but all are different from the very first one.
Like LoyceV said, it is impossible. One private key, one public key and one public address.
Bitcoin Keys, Addresses
member
Activity: 1191
Merit: 78
November 12, 2023, 01:12:47 PM
#17

The problem is the people usually fail to make an airgapped device. And ignore the importance of having an offline device.

Most users just download electrum (or use some random wallet generator found online) on their personal computer, generate the wallet, save on a paper and delete the wallet. This is not safe. There are dozens of threads like this in the forum, where users were hacked and lost their coins with similar methods.

I don't use paper wallet myself, just for small amounts.

Just as you said one thing I will always tell someone not that tech savvy is to just go for hardware wallets not that it is better than airgapped wallets in my opinion but it save you the trouble of not making a mistake.
Yes, you have a point but setting up a hardware wallet can also be problematic for people who are not tech-savvy especially those that are new to cryptocurrency.
It's better to have a good understanding of setting up an air-gapped wallet and hardware wallet if the people who are not tech savvy are serious about crypto.
hero member
Activity: 868
Merit: 952
November 12, 2023, 10:49:44 AM
#16

The problem is the people usually fail to make an airgapped device. And ignore the importance of having an offline device.

Most users just download electrum (or use some random wallet generator found online) on their personal computer, generate the wallet, save on a paper and delete the wallet. This is not safe. There are dozens of threads like this in the forum, where users were hacked and lost their coins with similar methods.

I don't use paper wallet myself, just for small amounts.

Just as you said one thing I will always tell someone not that tech savvy is to just go for hardware wallets not that it is better than airgapped wallets in my opinion but it save you the trouble of not making a mistake.

One key mistake some not so tech savvy people do while trying to create an offline wallet is they go offline and as you said delete the wallet and app so as to avoid not coming online but that still defeats the purpose of airgapped wallet. The device should be use should have never come online before, because if it has been online before even just once then there is a chance even though so slim that it might have a malware that could compromise the seed phrase or keys in future. The other mistake is the transfer of the unsigned transaction from to that device. This two things make me advice newbies to just go for hardware wallet first as a means of cold wallet
legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
November 12, 2023, 07:41:03 AM
#15
I don't use people wallet myself, just for small amounts.
Likely because you have other means as bitcoin/bitcoin wallet developers gives many secure means that you can go for. But we know how secure it can be if done appropriately.

If use wallet like Electrum to generate the paper wallet, it is just nothing more than a wallet on a airgapped device, but not a wallet on an airgapped device because you deleted it and backup the seed phrase somewhere like on paper in different locations. While generating the wallet, only what I can feel not secure about the it is if I do not use BIP39 passphrase with the seed phrase to generate the keys and addresses. If I use passphrase, the wallet is safe and secure and and I can hold huge amount of coins on it.
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
November 12, 2023, 07:32:58 AM
#14
can you post please some mistakes/major issues related bitcoin paper wallets? @bitmover

The problem is the people usually fail to make an airgapped device. And ignore the importance of having an offline device.

Most users just download electrum (or use some random wallet generator found online) on their personal computer, generate the wallet, save on a paper and delete the wallet. This is not safe. There are dozens of threads like this in the forum, where users were hacked and lost their coins with similar methods.

I don't use paper wallet myself, just for small amounts.
legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
November 12, 2023, 07:18:28 AM
#13
can you post please some mistakes/major issues related bitcoin paper wallets? @bitmover
Read this: walletgeneratordotnet scam Paper wallet generation scam

This example was because the site was sold.

Some people will also generate paper wallet online, what supposed to be generated offline.

what's your opinion on glacier protocol or any case what it could be the best strategy to generate a paper wallet?
Read what hosseinimr93 posted above. If you generate a seed phrase offline on an airgapped device and you backup the seed phrase and some addresses and delete the wallet. That is just a paper wallet. If you are looking for something related to BIP38 encryption, you can use BIP39 passphrase. HD wallet gives you everything needed to generate a secure paper wallet.

What is a paper wallet?
legendary
Activity: 3276
Merit: 3537
Nec Recisa Recedit
November 12, 2023, 06:58:12 AM
#12
can you post please some mistakes/major issues related bitcoin paper wallets? @bitmover
what's your opinion on glacier protocol or any case what it could be the best strategy to generate a paper wallet?
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
November 12, 2023, 06:53:08 AM
#11
Does anyone have a wallet generator software for creating paper wallet?

Basically any wallet software can do this. Electrum is one of the best ones
A paper wallet is just a seed noted down in a piece of paper.

I advice you to don't use a paper wallet to store large amounts. Unless you really understand what you are doing (which by your questionyou dont look like), paper wallets are not 100% secure.

There are many threads on this forum of users who lost their coins with paper wallets which were not secure.

It is safer just to use a hardware wallet. And use a paper wallet just for experimental purposes
legendary
Activity: 2380
Merit: 5213
November 12, 2023, 04:14:10 AM
#10
Does anyone have a wallet generator software for creating paper wallet?
Use an open-source trust worthy wallet like electrum or Sparrow and avoid any paper wallet generator that works through a website.

By paper wallet people usually mean a single private key and a single address written on a paper.
Electrum, Sparrow and almost any other wallet generate a HD wallet and you will have numerous addresses all generated from a seed phrase.

If you insist on having a single private key and a single address for any reason, create a wallet on electrum and export one private key/address pair.


Electrum official website: https://electrum.org/
Sparrow official website: https://sparrowwallet.com/

If you have any other question and that's not related to this thread, create an new topic please.
newbie
Activity: 11
Merit: 0
November 12, 2023, 04:03:20 AM
#9
Does anyone have a wallet generator software for creating paper wallet?
legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
October 31, 2023, 12:51:30 PM
#8
Is it possible that electrum android app uses a different architecture to generate a public address now or it had a bug that generated a wrong address for then?
If there's one major bug like that, it'll be included in the release notes: https://github.com/spesmilo/electrum/blob/master/RELEASE-NOTES
I didn't find any, but try to search thoroughly.

It's always been the same as the desktop version and using the standard algorithm Bitcoin uses: ECDSA with Secp256k1 curve.
It'll derive a "compressed" pubKey from WIF with compressed flag (your 'L' prvKey) and create a legacy address from it if a script type isn't appended before the privKey.


My assumption is the same as the other first two replies, your address may be derived from the uncompressed public key.
An alternative tool is Ian Coleman's "compression tool":  https://github.com/iancoleman/keycompression
If you're not worried about privacy, you can use the web version, of course, only use your public key.
Otherwise or if the above is true, use an Air Gap machine to get the uncompressed versions of your keys/address.
hero member
Activity: 630
Merit: 510
October 31, 2023, 06:06:20 AM
#7
Are you the account owner? Or were you part of a team, because I read your post history and you seem to be someone with technical experience that would enable him to at least formulate the question more accurately, quote here.

The screenshot makes it easier then, you can do this;
1. Go to electrum, in the derivation path, tick legacy and put m/clientid (m/489) underneath or
2. Use iancoleman.io/bip39 listed above(beware, using this may compromise your seed)
put the seed in the mnemonic box and change the derivation path to bip32, select custom path and put m/client id (m/489).



A private key can generate two addresses and since it starts with K or L (Base58 Wallet Import Format), then inserting it into Electrium will give you the correct address, or the private key you are using is for another address.
based on above quote you already know iancoleman.io and derivation path so I think you know this Huh
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
October 31, 2023, 05:27:12 AM
#6
Can you post your python script here so that we can check for any errors?

Don't do that before stripping out the private key first, since it's known to be correct. Most of the times, people are embedding their input data inside the script instead of as a command-line argument.

To OP:

If you imported a single private key inside the Electrum app, then that means you don't have to worry about fancy things like derivation paths and stuff - you just need to get the private key you have and use correct software to generate the address, like this one.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
October 31, 2023, 04:57:12 AM
#5
we used python to generate a Bitcoin private key
Python is a programming language. You should be more specific in what you did.

Quote
then imported the key into the electrum Android app, sent btc there and forgot about it.
I take it you don't have the same Android app anymore?

Quote
I have been trying to recover that address but the private key doesn’t generate the same address anymore.
This is exactly why I like to verify my backups with different software to make sure I can restore my backup before funding it. I know it doesn't help you now, but you should use it next time.
I have to ask: why didn't you let Electrum create it's own wallet with private keys, instead of using a non-standard setup?

Quote
I have used python to generate 5 different legacy addresses but all are different from the very first one.
Again: be more specific. Did you create 5 different legacy addresses from the same private key? That's not possible. Or did you create 5 new random private keys? In that case it's no surprise they're different.

Quote
I am very sure it’s the right key because there are multiple backups. Is it possible that the address format is no longer supported and hence difficult to recreate with modern tools? Does anyone have any insight into this and what may be the possible problem???
Chances are you created the wrong address. From the information you gave, I can't tell you what went wrong. Bitcoin legacy addresses didn't change.

Quote
Is it possible that electrum android app uses a different architecture to generate a public address now or it had a bug that generated a wrong address for then?
It's possible you downloaded a compromised version of Electrum. If you check your address on a block explorer, is the balance still there?
copper member
Activity: 1330
Merit: 899
🖤😏
October 31, 2023, 03:43:33 AM
#4
Can you post your python script here so that we can check for any errors? Why did you generate the key that way just to import it on electrum?

When you import on electrum android it will automatically give you a legacy address and since your key starts with L it's compressed . But we can't help you until you show us the script.

One thing I don't understand, how could you generate a WIF but not the address?
hero member
Activity: 560
Merit: 1060
October 31, 2023, 03:31:22 AM
#3
We will definetely need the code, otherwise we have to make assumptions.

Assumption 1: The private key produces different legacy address if it's compressed than if it's uncompressed.

Possible Action: Use the private key you have in any wallet that supports WIF key sweeping. Perhaps you search something wrong when you search yourself.

Lesson Learned: Don't create custom set-ups. It can lead to significant losses.


EDIT: The answer above by Charles-Tim is a good one. Try this one first.

legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
October 31, 2023, 03:30:13 AM
#2
You can use bitaddress offline, https://github.com/pointbiz/bitaddress.org

Go to wallet details and get the uncompressed private key and import it into Electrum. The uncompressed private key starts from 5 and the address is also legacy address that start from 1.

If this does not work, likely you import a wrong private key.
jr. member
Activity: 107
Merit: 8
October 31, 2023, 03:23:05 AM
#1
Hello, please I need some assistance. In 2016, we used python to generate a Bitcoin private key and then imported the key into the electrum Android app, sent btc there and forgot about it. Now, for the past one year, I have been trying to recover that address but the private key doesn’t generate the same address anymore. I have used python to generate 5 different legacy addresses but all are different from the very first one.

I am very sure it’s the right key because there are multiple backups. Is it possible that the address format is no longer supported and hence difficult to recreate with modern tools? Does anyone have any insight into this and what may be the possible problem???


To reiterate, the addresses are legacy addresses and the key I have is presumably a compressed key starting with L.

Is it possible that electrum android app uses a different architecture to generate a public address now or it had a bug that generated a wrong address for then?
Jump to: