webdigi / EOS-Offline-Private-key-check

Offline tool to verify your EOS private key and mapping to public key
69 stars 22 forks source link

Bitcoin Private Key bug #3

Open RayMetz100 opened 6 years ago

RayMetz100 commented 6 years ago

Repro steps: Go to https://www.bitaddress.org or any bitcoin tool and generate any bitcoin private key

Go to https://github.com/eoscafe/eos-key or https://github.com/webdigi/EOS-Offline-Private-key-check or https://github.com/eosamsterdam/eos-keypair-check , Copy in the private key and view the matching public key. Notice the public keys generated from all three tools match.

Use cleos wallet import command to import the same private key. Notice the public key from cleos doesn't match the tools.

Why don't the BP tool public keys match cleos?

When I start with an EOS private key rather than BTC private key, the tools match cleos wallet import.

I know people are going to say the bug/feature is because I started with a bitcoin private key and not an EOS private key. Any insight beyond that?

As long as I avoid using the BP key checker tools, it seems perfectly ok to use a Bitcoin generated private key and cleos wallet import command to get a matching and working public key. There are no problems with the public key generated by cleos wallet import. It's only the BP tools that generate bad public keys. Why?

Ref: https://www.reddit.com/r/eos/comments/8so7ef/bp_key_checkers_have_a_bug/ https://www.reddit.com/r/eos/comments/8qzcwa/seems_like_i_lost_170_eos/

webdigi commented 6 years ago

Thanks for reporting. This tool was aimed to verify EOS key created from cleos and official EOS key generator. Did you have problems with verifying keys generated from cleos?

There might be something different with bitcoin key? Will have to check and possibly see what's going on with it

RayMetz100 commented 6 years ago

I know you guys are busy and this has to be at the bottom of the list, but I appreciate you giving me a forum here to write my thoughts and not lose track of it. I still think someday the mystery will be solved for me and I might even recover 170 EOS.

If I generate my own private key in Notepad, Java, or c++, then use cleos wallet import command and it gives me a working matching public key, then it's not supported? The only supported EOS private keys are ones that are created using cleos create key command or https://github.com/EOSIO/eosjs-ecc. Besides those two tools, are there other supported ways to create a private key?

If I use an private key created from an unsupported source like https://www.bitaddress.org and use a public key from cleos wallet import, besides it not being compatible with this key checker, is there anything else my unsupported private key wouldn't be compatible with?

I'm hoping an answer will lead to a clue and maybe a solution some day.

Thanks again, Ray

RayMetz100 commented 6 years ago

The bug details are at https://github.com/EOSIO/eosjs-ecc/issues/16 If the bug is before the hash, maybe it can be reversed.

jcalfee commented 6 years ago

@RayMetz100 is correct, this is a bug in eosjs-ecc .. This only affects users that try to use a bitcoin formatted compressed private key.

I have tested this upgrade in your tool and tried to make this as easy as possible and explained everything here in the comment: https://github.com/EOSIO/eosjs-ecc/issues/16#issuecomment-408941034

Let me know if you have any questions.