- tags: Ethereum, Sign Message
- source: “Signing Data | MetaMask Docs.” Accessed April 6, 2023. https://docs.metamask.io/guide/signing-data.html#signtypeddata-v4.
Five Methods1
eth_signallow to sign arbitrary hash.2personal_signadd prefix to data and human readable text that encoded UFT-8.3signTypedDataorsignTypedData_v1first release that lacked some later security improvements.signTypedData_v3signTypedData_v4compatible with V3.
Differences Between V3 and V44
Some input types that V3 doesn’t support but V4 does:
- Custom type array
- Custom type with
nullinput
Some input types that V4 doesn’t support but V3 does:
- Atomic type with
undefinedinput - Dynamic type with
undefinedinput
Atomic types are of a fixed size (e.g.
int8d), whereas dynamic types can vary in size (e.g. strings, bytes). We also test arrays of each of these types.