eth_sign
Signs arbitrary hex-encoded data. This is a legacy method - prefer personal_sign for new implementations. The data is decoded and displayed to the user for review before signing. Internally, this method behaves identically to personal_sign.
Try it
Parameters
| Position | Type | Description |
|---|---|---|
| 0 | string | The account address |
| 1 | string | The data to sign (hex-encoded) |
Returns
string - The signature as a hex string.
Example
const accounts = await provider.request({ method: 'eth_accounts' });
const data = '0x' + Buffer.from('Hello').toString('hex');
const signature = await provider.request({
method: 'eth_sign',
params: [accounts[0], data],
});Notes
- This method is deprecated in favor of
personal_sign - The data is displayed to the user after hex decoding
- Works the same as
personal_signinternally