why do we need to hash before we use a private key to digitally sign a transaction? isn’t just using a private key enough?


If your question is about ECDSA, the hashing step is actually an essential part of the signature scheme and not just a step we choose to do before invoking it. Without it, the signature would not be secure. This is because given a public key, it is possible to compute (signature, message hash) pairs such that the signature is valid for the given public key and computed message hash. However, the message hash won’t be the hash of a known message then, and thus making ECDSA verifiers redo the hashing is sufficient to prevent this attack.

Source link

Leave a reply