what is the purpose of the ECDSA contract ( https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol ) ?

Contract looks like a wrapper around builtin solidity ecrecover function, without any benefits, or I've missed something?

Thank you.

1 Answer 1


If you read the code you will realize it provide some niceties:

  • Checking for malleable signatures
  • Support for 64 bytes compact signatures
  • Signature message manipulation, adding Ethereum signature prefix
  • Helper for EIP 712 signatures
  • Thank you for your answer, Could you please add a bit more details to make the answer more clear Checking for malleable signatures As far as I know, malleable signatures are not possible in Geth since homestead ethereum.stackexchange.com/questions/3222/… . Am I missing something ? prepending a prefix Prefix is prepended in Geth by default for data signing operations github.com/ethereum/go-ethereum/blob/…
    – alex
    Sep 29, 2021 at 4:27
  • Support for 64 bytes compact signatures What exactly do you mean? ecrecover works the same way, with 64 bytes compact signatures Signature message manipulation, adding signature prefix what's the difference with Checking for malleable signatures, prepending a prefix ?
    – alex
    Sep 29, 2021 at 4:28
  • @alex For backward compatibility the EVM accepts old signatures. Ecrecover only accept 65 bytes signatures. The prefix part shouldn't have been part of the first sentence, I've updated that line.
    – Ismael
    Sep 29, 2021 at 5:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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