Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

bitcoin private keys import to cleos #4838

Closed
RayMetz100 opened this issue Jul 24, 2018 · 1 comment
Closed

bitcoin private keys import to cleos #4838

RayMetz100 opened this issue Jul 24, 2018 · 1 comment

Comments

@RayMetz100
Copy link

If you import a compressed format(leading K or L) private key with cleos wallet import, it shows you the uncompressed(leading 5) format in cleos wallet private_keys. If you paste the same compressed format private key(leading K or L) into the BP key checker tools, they give a different public key than cleos wallet keys and private_keys has. Can we make cleos and the key checker tools match? I think we'd just need to make the key checkers convert the compressed format(leading K or L) to uncompressed(leading 5) first, then generate the public key and make sure the public key matches cleos.

repro steps:

  1. create any bitcoin private key from any bitcoin source like https://iancoleman.io/bip39/ or https://www.google.com/search?q=bitcoin+private+key+generator
    Notice that bitcoin private keys don't have a leading 5. They start with K or L, which is the compressed format.
    https://www.reddit.com/r/Bitcoin/comments/4br5ip/bitaddressorg_all_private_keys_starts_with_k_or_l/

EOSIO v1.1
2. run cleos wallet import command and import the compressed format(leading K or L) bitcoin private key.
Notice cleos imports the key and gives you a matching public key

  1. run cleos wallet private_keys command.
    notice the private key imported is now changed to have a leading 5 and does not match the private key you imported.

I don't think earlier versions of cleos wallet changed the private key to have a leading 5, but I'm not sure.

Ref:
These three key checkers all give a different public key than cleos, but they all match each other.
eoscafe/eos-key#1
webdigi/EOS-Offline-Private-key-check#3
eosamsterdam/eos-keypair-check#1

I registered 170 EOS to the wrong public key with the keycheckers above.
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/

@RayMetz100
Copy link
Author

I generated compressed and uncompressed matching bitcoin private keys and imported both into cleos wallet. both gave the same public key so there is no current bug in cleos. The bug is in the key check tools only. They give public keys that don't match cleos when the compressed format private key(leading K or L) is imported.

The most current details are at eoscafe/eos-key#1

Closing this issue on eosio side though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant