eth_sign

The sign method calculates an Ethereum specific signature with:

sign(keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))).

By adding a prefix to the message makes the calculated signature recognizable as an Ethereum specific signature. This prevents misuse where a malicious dapp can sign arbitrary data (e.g. transaction) and use the signature to impersonate the victim.

🚧

NOTE: the address to sign with must be unlocked.

Parameters

Object NameRequiredTypeDetail
ADDRESSStringAddress of the account that will sign the messages
MESSAGEStringMessage to be signed
"params": [
    "0x0d8e461687b7d06f86ec348e0c270b0f279855f0",
    "0xc0001109e8"
]

Result

Signature.

Example

Request

curl <your-endpoint> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_sign","params": ["0x0d8e461687b7d06f86ec348e0c270b0f279855f0","0xc0001109e8"],"id":1}'

Return

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x200f0780cb5715fd6a55f015b3c7dcdea6e6e5c34c0e3a65c92d0fddbaeab7b33d4e2057f697f3e856e57a9c64cb1bb797bd664b3bfb516c41d9ac5bbb11e08d01"
}
Language
Click Try It! to start a request and see the response here!