1

I am learning about blockchain and reading a lot of stuff, but one question bothers me for last few days. So in docs they say that P2PKH transactions use hash of the public key instead of a public key and they persistently put a following reason behind this: usage of hash of a public key obfuscates the real public key which may provide some additional security.

Ok, hash really obfuscates. So in the pubkey script of the transaction output I will use the hash of the pk and in that way will not expose to the P2P network the real pk of the transaction recipient. But at the same time, when transaction recipient wants to spend it he will need to provide matching signature script and there he needs to insert full unhashed public key, which will then be broadcasted to P2P network in his next transaction.

So why the hack they repeat saying in different lectures that using hash of the pk obfuscates and hides the real full pk, while at the same time everyone will see and have full pk when spender submits his next transaction? Do I miss something important here?

2

No, you are not missing anything. Yes using P2PKH obfuscates the public key, and yes the public key will be revealed when the UTXO is spent (the public key is needed to check the signature). Hence, the obfuscation of the public key only exists until the UTXO is spent and not after. This is why it is recommended not to use the same address twice. If you partially spend a UTXO, the 'change amount' should be sent to a new address, so the public key of the new UTXO is still obfuscated.

  • 1
    Ok, thanks for bringing back my trust in my learning abilities :) – Alexander Arendar Mar 9 '17 at 11:06

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.