5

What is the use of hashing the public key to obtain the bitcoin address (except to compress it) rather than using the public key directly?

Why not deal with public keys directly?

3

Early renditions of the Bitcoin client did use raw public keys in this way for pay-to-IP-address transaction orders, it's still valid to spent an output to <raw pubkey> OP_CHECKSIG, though miners might not be willing to include it in a block.

Before an output owned by a fresh address is spent, the hidden public key points are unknown to anybody but the creator. If the situation arises that ECDSA is weakened there is only minimal exposure between signing a transaction and having it included in a block. To transition from a weakened ECDSA a new signature algorithm would be soft-forked into the consensus and outputs quickly shuffled over to using it instead. This bit of protection is effectively gained for free so it would be silly not to use it, though some wallets choose to re-use addresses multiple times which destroys the protection offered by this system.

As pointed out addresses are also appreciably shorter at 20 bytes rather than 33 or 64 bytes, which makes a difference if you have the need to manually transcribe one.

  • Thankyou for the answer! This protection is not free as it disables certain features which may lead to further innovations. – Kang Aug 18 '15 at 4:21
  • It's free in the sense that all wallets do the hashing today, just some of them reuse addresses which removes the protection gained. – Anonymous Aug 18 '15 at 4:59
  • Yes I understood that, but I meant restricting other use cases, for eg, if I knew someone's public key instead of just their compressed address, I could have written them a secret message on the blockchain. – Kang Aug 18 '15 at 5:21
  • The block chain isn't designed for storing messages, it's for financial transactions. Messages are best sent along the channel you know the address from, like in BIP70. – Anonymous Aug 18 '15 at 5:25
  • I gave an example, of how the additional protection is not free as it compromises certain possible uses. I did not mean to advocate that blockchain is a store of data. – Kang Aug 18 '15 at 5:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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