Author Topic: wallet_import_private_key on uncompressed key generates compressed BTS pubkey?  (Read 6859 times)

0 Members and 1 Guest are viewing this topic.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
It seems uncompressed privkeys correspond to the uncimpressed pubkey while compressed keys correspond to compress pubkey and thus a different btc address ...

Maybe a dev can confirm

This makes sense to me.
yea.. every wif key has to correspond to jus a SINGLE address (stated in the btc wiki too).. though the pubkey can be represented in twobways reaulting in two addresses ... thus you distinguish the addresses by prefix for the privkey

@vikram: is this about right?

Offline monsterer

It seems uncompressed privkeys correspond to the uncimpressed pubkey while compressed keys correspond to compress pubkey and thus a different btc address ...

Maybe a dev can confirm

This makes sense to me.
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
It seems uncompressed privkeys correspond to the uncimpressed pubkey while compressed keys correspond to compress pubkey and thus a different btc address ...

Maybe a dev can confirm

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
From the bitcoin wiki:

Quote
For private keys associated with uncompressed public keys, they are 51 characters and always start with the number 5 on mainnet (9 on testnet). Private keys associated with compressed public keys are 52 characters and start with a capital L or K on mainnet (c on testnet).

Offline monsterer

oh .. learned something again ..

Still .. a single private key (also) corresponds to an uncompressed an a compressed pubkey which result in two different addresses accesable from the same private key .. AFAIK

Not sure what a compressed privkey is .. and what it is used for ..

I'm not sure, but I have both kinds in my bitcoin wallet.
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
oh .. learned something again ..

Still .. a single private key (also) corresponds to an uncompressed an a compressed pubkey which result in two different addresses accesable from the same private key .. AFAIK


Not sure what a compressed privkey is .. and what it is used for ..

Offline monsterer

The private key afaik cannot be compressed .. if you check out pycoin you will see that a private key corresponds to TWO btc addresse .. one is the base58checkencoded version of the uncompressed key .. the other usea the compeessed keys ... not sure how clients handle this though ..

.. worth a research

Compressed private key: L15CvRxwgLY1sBdGXCQz3kk7XD2sNCpuUnPE1yMR8jYDZcUgkujT
Bitcoin address: 1EGVFMirpv59mkWw7cAdtCSTphUpLnK8f6

Uncompressed private key: 5JgvT9q24UY3Tn14Wx9c8RQpF6SoJVWS2mGTWg3pA185D24q2u2
Bitcoin address: 1aDSxwBJN1uczBwCSNoSmUMA9xcG5bi22

Check them out via: https://brainwallet.github.io/
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
The private key afaik cannot be compressed .. if you check out pycoin you will see that a private key corresponds to TWO btc addresse .. one is the base58checkencoded version of the uncompressed key .. the other usea the compeessed keys ... not sure how clients handle this though ..

.. worth a research

Offline monsterer

I'd say so .. anyway compress keys and uncompressed keys carry the same information and can be computed from eachother

Though the compressed version obviously needs less space

For the gateway stuff it becomes a problem, because someone could import their uncompressed private key from bitcoin, which would get turned into a compressed bitshares pub-key, so when bitAssets are sent to the gateway, the bitshares pub-key of the sender is looked up, which maps to a different bitcoin address than the one the user has in their wallet because it's now compressed instead of uncompressed.

This would mean bitcoins would never arrive in the users wallet, they'd need to add the compressed private key in order to get their funds.
« Last Edit: January 18, 2015, 11:44:28 am by monsterer »
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
I'd say so .. anyway compress keys and uncompressed keys carry the same information and can be computed from eachother

Though the compressed version obviously needs less space

Offline monsterer

I've just done a wallet_import_private_key on an uncompressed private key and looking at the results of wallet_account_list_public_keys, it looks like the generated public key is compressed. Is this the expected behavior?
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads