Skip to main content
Defined in EIP-191
Signs data using a specific account. This method calculates an Ethereum specific signature with: sign(keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))).

Parameters

string
required
The data to sign, in hexadecimal format.
string
required
The address of the account that should sign the data.

Returns

string
A signature string in hexadecimal format.

Example Usage

Error Handling

number
Error code indicating the type of error that occurred.
string
Human-readable error message describing what went wrong.
Always verify signatures on the server side before trusting them. Client-side signature verification should only be used for UX purposes.