4

I was looking thru Block explorer at an address with a balance. It has never been spent from thus the public key is unknown. If the public key is unknown, how can Block explorer calculate the hash160 of the public key?

1 Answer 1

9

Because an address is the Hash160 (=RIPEMD160(SHA256(x))) of the public key. The transaction output lists that 160-bit hash directly.

When redeeming such an output, you provide both the public key (which must hash to the value given in the output) and a signature (which must be valid for the given public key).

5
  • i'm used to seeing hash algos referred to as SHA256 or RIPEMD. what is Hash160?
    – joe
    Mar 8, 2013 at 4:02
  • 2
    @joe Hash160 = RIPEMD160(SHA256(m)) (note that plain RIPEMD is a different, broken hash and bitcoin doesn't use it) Mar 8, 2013 at 11:19
  • 4
    Edited. In Bitcoin-speak, Hash(x) = SHA256(SHA256(x)) and Hash160(x) = RIPEMD160(SHA256(x)). Mar 10, 2013 at 16:13
  • as a related question, what is really stored in a wallet in regards to keys? just the priv keys or priv keys and pub keys? i ask since the pub keys can be derived from the priv keys.
    – joe
    Mar 16, 2013 at 15:43
  • The Public Key Hash is equivalent to the bitcoin address, without the Base58Check encoding. RIPEMD160(SHA256(PubK)) == Base58.decode(Address) ? Mar 24, 2015 at 23:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.