Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: btctousd81 on October 13, 2017, 04:36:55 AM



Title: how to know if btc address is compressed or uncompressed ?
Post by: btctousd81 on October 13, 2017, 04:36:55 AM
lets say i have these addresses

1Az2dypSbg7oNv37mqao1T8vYJgQG1p7Be
1Esg276vGGT6LGxY7dEHvYLsp2efw6DgdX
1CS5EVQztBXuoiq9xgD3CkANngFePeWNnN


how can i check which one is compresed and which are uncompressed ?

thanks


Title: Re: how to know if btc address is compressed or uncompressed ?
Post by: HCP on October 13, 2017, 04:54:56 AM
As far as I know, you can't start from the Address and work out if it is compressed/uncompressed. The address is the result of a one way hash, so you can't tell if it was created from a compressed or uncompressed public key.

You'd need to start with the private key and go from there... Have a play with https://www.bitaddress.org/ Generate a new private key and then put it into the "Wallet Details" tab... you'll see every private key generates a compressed and an uncompressed address.


You might be able to tell by looking at previous transactions involving those addresses on the blockchain and inspecting the input sizes... ~148 bytes = compressed... ~180 bytes = uncompressed


Title: Re: how to know if btc address is compressed or uncompressed ?
Post by: btctousd81 on October 13, 2017, 05:20:08 AM
As far as I know, you can't start from the Address and work out if it is compressed/uncompressed. The address is the result of a one way hash, so you can't tell if it was created from a compressed or uncompressed public key.

You'd need to start with the private key and go from there... Have a play with https://www.bitaddress.org/ Generate a new private key and then put it into the "Wallet Details" tab... you'll see every private key generates a compressed and an uncompressed address.


You might be able to tell by looking at previous transactions involving those addresses on the blockchain and inspecting the input sizes... ~148 bytes = compressed... ~180 bytes = uncompressed

okie., thats one way to do it.,

so practically its a dead end. thanks for your input.



Title: Re: how to know if btc address is compressed or uncompressed ?
Post by: DannyHamilton on October 13, 2017, 12:30:25 PM
You'd need to start with the private key and go from there...

You don't need the private key to determine if the address is compressed or not.  You only need the public key.  Hash both the compressed and uncompressed versions of the public key (it is easy to convert between them) and see which one matches.

You might be able to tell by looking at previous transactions involving those addresses on the blockchain and inspecting the input sizes... ~148 bytes = compressed... ~180 bytes = uncompressed

That method would work, however, the input scripts contain the public key. As long as bitcoins that had previously been received with that address have been spent, you could just look at the public key and see if it is compressed or not.


Title: Re: how to know if btc address is compressed or uncompressed ?
Post by: Mrhowie on October 14, 2017, 04:57:10 AM
As far as I know, you can't start from the Address and work out if it is compressed/uncompressed. The address is the result of a one way hash, so you can't tell if it was created from a compressed or uncompressed public key.

You'd need to start with the private key and go from there... Have a play with https://www.bitaddress.org/ Generate a new private key and then put it into the "Wallet Details" tab... you'll see every private key generates a compressed and an uncompressed address.


You might be able to tell by looking at previous transactions involving those addresses on the blockchain and inspecting the input sizes... ~148 bytes = compressed... ~180 bytes = uncompressed

Thank you for the help :D