Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

personal_sign

Signs an EIP-191 personal message.

Authentication Required: Yes

Request

await jaw.provider.request({
  method: 'personal_sign',
  params: ['0x48656c6c6f20576f726c64', '0x1234...'],
});

Parameters

NameTypeRequiredDescription
message0x${string}YesMessage to sign (hex encoded)
address0x${string}YesAddress to sign with

Example

["0x48656c6c6f20576f726c64", "0x1234567890123456789012345678901234567890"]

Response

Returns the signature as a hexadecimal string.

Type: 0x${string}

Example

"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1c"

Behavior

  • Opens popup for user approval
  • Displays human-readable message to user
  • Returns EIP-191 signature with "\x19Ethereum Signed Message:\n" prefix

Errors

CodeDescription
4001User rejected the request
4100Unauthorized (not authenticated)
-32602Invalid params (message not hex encoded)

Example

import { toHex } from 'viem';
 
const message = 'Hello World';
const messageHex = toHex(message);
const account = '0x1234...';
 
const signature = await jaw.provider.request({
  method: 'personal_sign',
  params: [messageHex, account],
});
 
console.log('Signature:', signature);

Related Methods