{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "personal_sign",
  "params": [
    "0x48656c6c6f2c20576f726c6421",
    "0xd46e8dd67c5d32be8058bb8eb970870f07244567"
  ]
}
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": "0x30755ed65396facf86c53e6217c52b4daebe72aa4941d89635409de4c9c7a9466d0e6928a2e2d2e8f8e8c8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e"
}

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

data
string
required

The data to sign, in hexadecimal format.

address
string
required

The address of the account that should sign the data.

Returns

result
string

A signature string in hexadecimal format.

Example Usage

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "personal_sign",
  "params": [
    "0x48656c6c6f2c20576f726c6421",
    "0xd46e8dd67c5d32be8058bb8eb970870f07244567"
  ]
}
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": "0x30755ed65396facf86c53e6217c52b4daebe72aa4941d89635409de4c9c7a9466d0e6928a2e2d2e8f8e8c8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e"
}

Error Handling

code
number

Error code indicating the type of error that occurred.

message
string

Human-readable error message describing what went wrong.

CodeMessageDescription
4001User denied signature requestUser rejected the signing request
4100Requested method not supportedThe method is not supported by the wallet
4200Wallet not connectedNo wallet connection available
4300Invalid parametersThe provided parameters are invalid

Always verify signatures on the server side before trusting them. Client-side signature verification should only be used for UX purposes.