Sign Message API
Introduction
The personal_sign
method is used to sign a given message with the private key of a specified Ethereum address. This is a way to prove that the sender has control over the private key of the address, without revealing the key itself. It is widely used for authentication and message verification purposes.
To sign a message a user / an account would need to have to have been register and authenticated by going through Register using API flow.
Once you have registered the user, you can choose one of the below 2 flows
Session-Based Authentication
Request Spec
Follow the Authenticating with API flow to obtain the session and then do the following HTTP request
Headers:
X-Encrypted-Session: Session information for maintaining state or continuity.
X-Encrypted-Key: Encrypted key for secure processing of the request.
X-Encrypted-User: User details encrypted using encryption key
Body:
Params: an array containing below items:
A string containing the message to sign, encoded in hexadecimal and prefixed with 0x.
A string representing the Ethereum address to sign the message with, prefixed with 0x.
Response Spec
Result: A string representing the hexadecimal signature of the message.
Request Example
Response Example
Success Response:
Error Response:
Direct Passkey Authentication
Request Spec
In order to use this approach, you must sign your User Input json using Passkey to obtain a signature.
Headers
X-Encrypted-Key: Encrypted key for secure processing of the request.
X-Encrypted-Webauthn-Signature: Webauthn signature encrypted using encryption key
X-Encrypted-User: User details encrypted using encryption key
Body:
Params: an array containing below items:
A string containing the message to sign, encoded in hexadecimal and prefixed with 0x.
A string representing the Ethereum address to sign the message with, prefixed with 0x.
Response Spec
Result: A string representing the hexadecimal signature of the message.
Request Example
Response Example
Success Response:
Error Response:
Last updated