Skip to main content

personal_sign

Presents a plain text signature challenge to the user and returns the signed response. Equivalent to eth_sign on some other wallets, and prepends a safe prefix to the signed message to prevent the challenge tricking users into signing a financial transaction. This method requires that the user has granted permission to interact with their account first, so make sure to call eth_requestAccounts first.

Params

(2)

1. Challenge (required)

A hex-encoded UTF-8 string to present to the user. See how to encode a string like this in the browser-string-hexer module.

string
Match pattern:
^0x[a-fA-F\d]+$

2. Address (required)

The address of the requested signing account.

string
Match pattern:
^0x[0-9,a-f,A-F]{40}$

Result

(Signature)

A hex-encoded 129-byte array starting with 0x.

string
Match pattern:
^0x[0-9a-f]*$

Params

Challenge

Address


Request

await window.ethereum.request({
"method": "personal_sign",
"params": [
null,
null
]
});