I am familiar with the fundamentals of cryptography as well as Digital Signatures. I understand how DSA like RSA works and the fundamentals of mathematics behind digital signing and verification. I also have a reasonable understanding of how bitcoin works. However I can not understand the role of hash function (SHA-256) in bitcoin blockchain.
The role of a private key and its corresponding public key seems clear to me.
- A public key can be used by the sender of a message to encrypt the message than can only be decrypted with the private key of the recipient.
- A private key can be use to sign a message, so when the message is encrypted with the private key the recipient can verify, by using the public key, that the message must have been signed by the owner of the private key.
The questions rises is bitcoin protocol. I understand that the public key is use to derive the bitcoin address. Therefore, having the private key associated to that address allows you to prove that you are the owner of that address.
The hash function (SHA-256) is used to make the digest of the of the transaction and block in the block chain. Somewhere I read that “To save time, digital signature protocols are often implemented with one-way hash functions (...). Instead of signing a document, Alice signs the hash of the document.”
I've got three related questions:
Is that the only role of the hash function in the bitcoin protocol?
What is the role of the hash function in the verification of the ownership of the address?
Couldn’t we get the same result of proving ownership without the hash function?