Author

Topic: Wallet Import Issue (Read 214 times)

sr. member
Activity: 1498
Merit: 271
DGbet.fun - Crypto Sportsbook
May 31, 2023, 06:32:49 AM
#17
I remembered that in 2018 I created a wallet using electrum from the password and private key and I also save them both, when I also imported to another wallet platform when I copied the private key it became invalid, I also repeated it several times- this again, then when I checked a few times I noticed that the private key that was also saved in my notepad was missing one letter.

       It means that the mistake is on me, because maybe when I pasted the private key during these times I saved it in notepad, I may not have noticed that when I pasted it in notepad, I deleted some letters in it. It's not like that happened to you op, like it happened to me.
legendary
Activity: 2268
Merit: 18771
May 29, 2023, 06:54:58 AM
#16
So when i created a script with the above methods with the same private key i get the correct address but the same private key shows different addresses on online converters, bitaddress etc... I am not a programmer or cryptographer its all very confusing to me
As nc50lc points out, this sounds like it might be a problem with compressed/uncompressed addresses.

Download this site from Ian Coleman run it offline: https://github.com/iancoleman/keycompression

Enter your private key in WIF format (which is the format you have them in - starting with K/L and 52 characters) in the first box at the top and it will return both the compressed and uncompressed address related to that private key. Check if either of them is correct.
legendary
Activity: 3500
Merit: 6320
Crypto Swap Exchange
May 29, 2023, 06:31:00 AM
#15
I guess i used a python script from github way back in 2017-18 to generate address and keys, when i check the private keys on  bitaddress it shows wrong for both.
That's the risk of using "weird" ways to create private keys: it could be a bug, but it could also be malicious, in which case the creator of the script gave you his own address.

Too late for now, but for next time: when I create a private key and address in a non-standard way, I always use different software to see if I can reproduce the address from that private key before funding it.

Which goes back to the question I asked the OP above.

When the address was created did he verify it in a wallet / other way that the private key = address.

If not then who knows what the address actually is. Could be the writer of the script did something malicious and only gave addresses that they had the private keys too. Could be they just messed up some code.

-Dave
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
May 29, 2023, 05:10:39 AM
#14
I guess i used a python script from github way back in 2017-18 to generate address and keys, when i check the private keys on  bitaddress it shows wrong for both.
That's the risk of using "weird" ways to create private keys: it could be a bug, but it could also be malicious, in which case the creator of the script gave you his own address.

Too late for now, but for next time: when I create a private key and address in a non-standard way, I always use different software to see if I can reproduce the address from that private key before funding it.
legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
May 29, 2023, 12:32:55 AM
#13
I think this is where it went wrong:
So the first thing you'll need to do is convert from base58 to binary and then throw away the first byte (this is the version) and the last 4 bytes (these are the checksum).  What you'll have left is a binary representation of the private key.
This part is specific to uncompressed private keys which starts with "5", yet the rest of the steps are for compressed address.
To properly decode a compressed WIF private key, you'll also have to remove the 0x01 compressed flag concatenated before the checksum.

So I'm thinking that your code might have used an invalid private key with extra byte and somehow managed to compute the public key without an error.

So when i created a script with the above methods with the same private key i get the correct address but the same private key shows different addresses on online converters, bitaddress etc... I am not a programmer or cryptographer its all very confusing to me
-snip- So what i did was i took a script from chatgpt yesterday to convert compressed wif to bitcoin coin address with a method i saw in one of the topics it gives the correct address. Yes i remember it saving for the correct addresses.
Last time I asked ChatGPT to make a python script that requires specific Bitcoin Core RPC commands,
I ended up spending 30minutes teaching it why it wont work. (about 3 iterations)
So it's not recommended to use it unless you can correct what it provided.

So the script that you've created is based from ChatGPT's AI-generated code?
Care to share it to us so we can check which part is faulty? (either use [code][/code] tags or pastebin website)
legendary
Activity: 3472
Merit: 3217
Playbet.io - Crypto Casino and Sportsbook
May 28, 2023, 05:39:00 PM
#12
I guess i used a python script from github way back in 2017-18 to generate address and keys, when i check the private keys on  bitaddress it shows wrong for both. So what i did was i took a script from chatgpt yesterday to convert compressed wif to bitcoin coin address with a method i saw in one of the topics it gives the correct address. Yes i remember it saving for the correct addresses.

What exactly does the python script do? who developed it?
Would you mind to share the GitHub page where you download this?

For me, its a suspicious tool because it generates 2 different keys public and private keys even if it is WIF un/compressed keys when pasting it to Bitaddress the public key should be right.
Another thing is you already compromise the private key with chatgpt if you ask this bot to convert it to BTC address.

Would you mind to share the Topic how it converts to the correct address so that we can review it? And maybe you don't actually have access to this address.
member
Activity: 124
Merit: 37
May 28, 2023, 02:13:22 PM
#11
could be your script is not working correctly.
Here is one which does. you will need to download the bitcoinaddress library if you don't already have it.

Code:

from bitcoinaddress import Wallet

# Convert a string with hex digits, colons, and whitespace to a long integer
def hex2int(hexString):
    return int("".join(hexString.replace(":", "").split()), 16)

dA  = hex2int('79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798')
# put your test key between the ' ' the key above is to demonstrate

dx = str(f'{dA:064x}')
wallet = Wallet(dx)
priv_key = wallet.key.hex
wif = wallet.key.mainnet.wif
publ_key = wallet.address.pubkey
publ_keyc = wallet.address.pubkeyc
address = wallet.address.mainnet.pubaddr1
addressc = wallet.address.mainnet.pubaddr1c
wifc = wallet.key.mainnet.wifc

print('Private key : ' + str(priv_key) + '\n' +
    'Public key  : ' + str(publ_key) + '\n' +
    'Address     : ' + str(address) + '\n' +
    'WIF         : ' + str(wif) + "\n\n"
    'Public key C: ' + str(publ_keyc) + '\n' +
    'Address    C: ' + str(addressc) + '\n' +
    'WIF        C: ' + str(wifc) + "\n\n")
newbie
Activity: 5
Merit: 0
May 28, 2023, 11:20:33 AM
#10
Try this tool: https://iancoleman.io/bitcoin-key-compression/  Use it offline (obviously)

It will give you the address of the compressed and uncompressed key. Is the uncompressed address that is showing when you are importing it?

This should give him the same results as Bitaddress, which according to his previous post, is giving him incorrect addresses.

Yup that's correct Sad

Yes it SHOULD, this is just another verification. It's straight math more or less and 1+1 should always = 2 but as we are seeing here for some reason it does not.

Beingcrypto, what script did you use from chatGPT yesterday?

Did you import the keys as a test when you generated them? Sorry if you already answered that, I'm on mobile tunneling into my laptop so scrolling through the post is not easy.

-Dave

So the script was based on a post i saw on the forum,

Here it is

So the first thing you'll need to do is convert from base58 to binary and then throw away the first byte (this is the version) and the last 4 bytes (these are the checksum).  What you'll have left is a binary representation of the private key.

Next you'll need to perform the point multiplication on the secp256k1 curve using the private key as the multiplier.  The resulting point on the curve is the public key.

Like a WIF private key, a bitcoin address also contains 3 pieces of information embedded in it (version, RIPEMD160 hash, checksum)

I'll assume that you are trying to calculate the compressed key address?

If so, you'll check to see if the Y value of public key point is odd or even.  If it is odd, you'll set a leading byte in front of the X value to 03, otherwise you'll set the leading byte in front of the X value to 02.  Then you can discard the Y value.

Next you'll calculate the SHA256 hash of the leading byte concatenated with the X value.

Next you'll calculate the RIPEMD-160 hash of the result of the SHA256 hash.

You'll then place a 00 byte in front of the RIPEMD-160 hash result (this is the address version byte).

Now you'll need to calculate a SHA256 hash of the leading 00 concatenated with the RIPEMD-160 hash result.

Now you'll need to calculate the SHA256 hash of the SHA256 hash that you just calculated.

The first 4 bytes of this most recent SHA256 hash is the checksum for the bitcoin address.  Concatenate this checksum onto the end of the earlier 00 byte concatenated with the RIPEMD-160 result.

So you should now have a 00 byte followed by the earlier calculated RIPEMD-160 followed by a 4 byte checksum.

Convert this value to base58 and you'll have your bitcoin address.

So when i created a script with the above methods with the same private key i get the correct address but the same private key shows different addresses on online converters, bitaddress etc... I am not a programmer or cryptographer its all very confusing to me
legendary
Activity: 3500
Merit: 6320
Crypto Swap Exchange
May 28, 2023, 11:04:25 AM
#9
Try this tool: https://iancoleman.io/bitcoin-key-compression/  Use it offline (obviously)

It will give you the address of the compressed and uncompressed key. Is the uncompressed address that is showing when you are importing it?

This should give him the same results as Bitaddress, which according to his previous post, is giving him incorrect addresses.

Yup that's correct Sad

Yes it SHOULD, this is just another verification. It's straight math more or less and 1+1 should always = 2 but as we are seeing here for some reason it does not.

Beingcrypto, what script did you use from chatGPT yesterday?

Did you import the keys as a test when you generated them? Sorry if you already answered that, I'm on mobile tunneling into my laptop so scrolling through the post is not easy.

-Dave
newbie
Activity: 5
Merit: 0
May 28, 2023, 10:46:56 AM
#8
Try this tool: https://iancoleman.io/bitcoin-key-compression/  Use it offline (obviously)

It will give you the address of the compressed and uncompressed key. Is the uncompressed address that is showing when you are importing it?

This should give him the same results as Bitaddress, which according to his previous post, is giving him incorrect addresses.

Yup that's correct Sad
staff
Activity: 3500
Merit: 6152
May 28, 2023, 10:03:34 AM
#7
Try this tool: https://iancoleman.io/bitcoin-key-compression/  Use it offline (obviously)

It will give you the address of the compressed and uncompressed key. Is the uncompressed address that is showing when you are importing it?

This should give him the same results as Bitaddress, which according to his previous post, is giving him incorrect addresses.
newbie
Activity: 5
Merit: 0
May 28, 2023, 09:20:01 AM
#6
1) Where / how did you generate those keys?

2) What software did you create them with?
2a) Do you still have access to it?

3) Are you sure the addresses you have for them are accurate?

4) Did you check a block explorer to make sure there are funds in them?

5) You said 1 key started with an L but you put K for both, just a typo?

Just easier if we have more info all at once as opposed to everyone asking 1 question at a time.

-Dave



Yes the funds are still showing up on blockchain explorer,
Yes i am sorry i meant it was in that K and L format called Compressed WIF with both my private keys starting with K
legendary
Activity: 3500
Merit: 6320
Crypto Swap Exchange
May 28, 2023, 09:10:17 AM
#5
Take a quick read here: https://gist.github.com/TheTrunk/30ff5ef59d3063f465cc766a4a64a397 to get a general idea of what may be going on.

Try this tool: https://iancoleman.io/bitcoin-key-compression/  Use it offline (obviously)

It will give you the address of the compressed and uncompressed key. Is the uncompressed address that is showing when you are importing it?

Did you verify the address that you have has funds using a block explorer?

-Dave
newbie
Activity: 5
Merit: 0
May 28, 2023, 08:58:11 AM
#4
Which wallet did you use to generate these private keys? You said you tried importing to Bitaddress, were both generated addresses incorrect?

It really looks like you've saved the wrong private keys/addresses combination.

I guess i used a python script from github way back in 2017-18 to generate address and keys, when i check the private keys on  bitaddress it shows wrong for both. So what i did was i took a script from chatgpt yesterday to convert compressed wif to bitcoin coin address with a method i saw in one of the topics it gives the correct address. Yes i remember it saving for the correct addresses.
legendary
Activity: 3500
Merit: 6320
Crypto Swap Exchange
May 28, 2023, 08:02:30 AM
#3
1) Where / how did you generate those keys?

2) What software did you create them with?
2a) Do you still have access to it?

3) Are you sure the addresses you have for them are accurate?

4) Did you check a block explorer to make sure there are funds in them?

5) You said 1 key started with an L but you put K for both, just a typo?

Just easier if we have more info all at once as opposed to everyone asking 1 question at a time.

-Dave

staff
Activity: 3500
Merit: 6152
May 28, 2023, 07:58:30 AM
#2
Which wallet did you use to generate these private keys? You said you tried importing to Bitaddress, were both generated addresses incorrect?

It really looks like you've saved the wrong private keys/addresses combination.
newbie
Activity: 5
Merit: 0
May 28, 2023, 07:43:45 AM
#1
I had saved 2 private keys starting with K and L respectively which is a 52 characters key along with address some small balances of 0.01 and 0.006 thought i lost them luckily it was saved in my gdrive in a notepad But when i import the key to a electrum or other wallets it shows a different address and not able to access the address with which it was generated for, even tried bitaddress and other sites offline but it shows different address, when I try to use a python script it gives a another new address . Not sure what is the issue please help. So the key i have is in compressed wif format. As i remember taking the private key and the address correctly on a notepad before reinstalling windows few years back.

Key 1 - Ky............
Key 2 - Kz............
Original address to Key 1 - 15W....
Original address to Key 2 - 16Q...
import results on wallets- 1JkZLnm ( Incorrect) 12BtFD (Incorrect)
Python scripts generate - 12BtFDzzSJ9J6PMtpgNq2txazTpiQsx2n2 and 1JkZLnmFfpVFLT2ZMtKzc6BuXMdmY41EHA ( Incorrect)

got laid off recently, any advice would really help as running short on expenses this could really help me for couple of weeks. Sad
Jump to: