ecrecover
ecrecover is an Ethereum virtual machine (EVM) opcode that recovers the address associated with an elliptic‑curve digital signature. It is used primarily in smart contracts to verify that a message was signed by the holder of a particular private key without requiring the private key itself. The opcode takes four inputs: a 32‑byte message hash and the three components of an ECDSA signature – v (the recovery identifier), r and s – and returns a 20‑byte address if the signature is valid, otherwise it returns zero.
In Solidity the function is exposed as ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) public pure
ecrecover enables patterns such as meta‑transactions, off‑chain approvals, and decentralized identity verification. Because the opcode performs
The opcode is gas‑efficient compared with full signature verification libraries, but developers should remain aware of