What Role Does the Transaction Hash Play in the Signature Process?
The transaction hash is a fixed-size, unique fingerprint of the entire transaction data. Instead of signing the entire, potentially large, transaction, the ECDSA algorithm signs only this small hash.
This makes the signing process highly efficient. Crucially, any alteration to the transaction data will result in a completely different hash, which would then invalidate the signature upon verification.