Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: calkob on November 24, 2016, 09:56:24 PM



Title: Bitaddress.org compressed address ?
Post by: calkob on November 24, 2016, 09:56:24 PM
Hi just wondering why on bitaddress you get a bitcoin address and a compressed address?  When i put in the priv key for the generated address and sent btc to it i checked the other address, not the compressed one and it said has not been on the network yet,  so obviously they are different addresses?  i just dont get it.


Title: Re: Bitaddress.org compressed address ?
Post by: achow101 on November 24, 2016, 10:12:46 PM
A public key is just a point on a curve. It has an x and a y component. An uncompressed public key contains both the x and y, but a compressed one just contains the x and another byte to indicate which side of the curve the point is on (because it is symmertric) since all you need is the x to calculate the y on a curve.

Since both the public keys are different bytewise, the addresses will be different because the hashes of the public keys will be different.


Title: Re: Bitaddress.org compressed address ?
Post by: DannyHamilton on November 25, 2016, 01:22:11 AM
- snip -
obviously they are different addresses?
- snip -

Correct.

They are different addresses.  Those addresses result from different hashes. Those hashes result from different representations of the public key.  Because of all this, there are different requirements to use bitcoins received at the address as inputs into transactions.

What is not different is the private key.

So, give a single private key, there are two possible valid representations for the public key and therefore 2 different address.  Once of those addresses (the UNcompressed one) will result in more bytes being required when you spend the bitcoins.  Since transaction fees are paid PER BYTE, that means that bitcoins received at the uncompressed address will cost you more in transaction fees.

Since there is NO benefit to using the uncompressed address, and there IS additional cost, most well written wallets don't bother with uncompressed addresses any more.


Title: Re: Bitaddress.org compressed address ?
Post by: piotr_n on November 25, 2016, 10:05:56 AM
Since transaction fees are paid PER BYTE, that means that bitcoins received at the uncompressed address will cost you more in transaction fees.

For future reference, it's also worth to know that segwit addresses (so called P2SH-WPKH) made from uncompressed public keys are (will be) undependable, no matter the fee.

They added the extra check in segwit code that blocks spending coins from uncompressed segwit keys.
Which I think was a bad idea, but well... you just have to be careful now, making sure that the hash you are making P2SH-WPKH address from did not come, by a chance, from an uncompressed public key. Otherwise you're fucked :)


Title: Re: Bitaddress.org compressed address ?
Post by: calkob on November 25, 2016, 04:49:14 PM
- snip -
obviously they are different addresses?
- snip -

Correct.

They are different addresses.  Those addresses result from different hashes. Those hashes result from different representations of the public key.  Because of all this, there are different requirements to use bitcoins received at the address as inputs into transactions.

What is not different is the private key.

So, give a single private key, there are two possible valid representations for the public key and therefore 2 different address.  Once of those addresses (the UNcompressed one) will result in more bytes being required when you spend the bitcoins.  Since transaction fees are paid PER BYTE, that means that bitcoins received at the uncompressed address will cost you more in transaction fees.

Since there is NO benefit to using the uncompressed address, and there IS additional cost, most well written wallets don't bother with uncompressed addresses any more.

This brand new information, Thanks all for explaining that :)