bitcoin address to Hash 160 public key : not consistantly reversible?

2

1

When I use blockchain.info tools or bitcointoolkit.info tools

to convert an address, such as 1MCNpVGDY7BGjJyWZL5FJZiaVkQEiuxy8H to a hash 160 public key : I get dd894dfc0f473c44cc983b5dd462bc1b393f7498

However, if i convert 3MtPk2kf61VepUfwgRjqjC5WeGgxE4rRPS i get the SAME 160 hash address ie dd894dfc0f473c44cc983b5dd462bc1b393f7498

I am baffled by this. I thought a hash 160 should UNIQUELY convert between it and the Address and back ???

I also found other address that convert back fro hash160 to the wrong address....

thanks for any clarification.....

9a278585c51203bca9f0e5c107814ecef6f2aa12

Aussie in Perth

Posted 2015-07-15T08:01:56.457

Reputation: 31

Answers

1

Both of those are correct decoding, the difference is the base58check version byte.

  • 1MCNpVGDY7BGjJyWZL5FJZiaVkQEiuxy8H has a version byte of 0x01 for P2PKH

  • 3MtPk2kf61VepUfwgRjqjC5WeGgxE4rRPS has a version byte of 0x05 for P2SH

Due to it being a hash, only one of these is typically going to have a valid destination, either a pubkey (P2PKH) or a script (P2SH). If money has been sent to both version bytes of the same hash it is very likely that one amount has been lost.

Anonymous

Posted 2015-07-15T08:01:56.457

Reputation: 10 054

Many thanks Bitcoin. Now understand the difference between P2PKH and P2SH, thanks again.Aussie in Perth 2015-07-15T10:41:37.660