Skip to main content
Defined in EIP-712
Signs structured data according to EIP-712, which provides a more secure way to sign data by providing context and structure to the data being signed.

Parameters

string
required
The address that should sign the data (20 bytes).
object
required
The typed structured data to be signed.

Returns

string
The signature as a hexadecimal string.

Error Handling

Always validate the domain and verifying contract address to prevent signature replay attacks.
EIP-712 signatures provide better security than personal_sign by giving users context about what they’re signing.