Sign Message

Sign arbitrary payloads using the authenticated user’s wallet on Ethereum and Solana. The payload to be signed should be included within the body of a stamped request, ensuring the integrity and authenticity of the message to be signed. This endpoint generates a verified signature from the user’s wallet, essential for executing transactions and interactions on the blockchain that require verified signatures from the user's wallet.

Using React or Vanilla JS? Use our Account Kit SDK to create and use wallets. The SDK handles all signing and authentication complexity for you, making development faster and easier. We provide an SDK in React, Vanilla Typescript, and (soon) Java.

If you want to use APIs directly, please first see this guide for implementing custom logic to send stamped requests.

How to generate a stamped request object?

A stamped request includes the payload to be signed, structured as a JSON object with a signature. You’ll need to implement custom logic to send a verified request. Please see this guide.

You can sign messages on both Ethereum and Solana since they receive wallets for both chains after calling create wallet:

Ethereum:

{
  organizationId: this.user.orgId, # the user's orgID (returned from /signer/whoami)
  type: "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2",
  timestampMs: Date.now().toString(),
  parameters: {
    encoding: "PAYLOAD_ENCODING_HEXADECIMAL",
    hashFunction: "HASH_FUNCTION_NO_OP", # this assumes you've hashed the bytes alread on the client
    payload: msg,
    signWith: this.user.address, # the user's Ethereum address (returned from /signer/whoami)
  },
}

Solana:

{
  organizationId: this.user.orgId,
  type: "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2",
  timestampMs: Date.now().toString(),
  parameters: {
    encoding: "PAYLOAD_ENCODING_HEXADECIMAL",
    hashFunction: "HASH_FUNCTION_NOT_APPLICABLE",
    payload: msg,
    signWith: this.user.solanaAddress, # the user's Solana address (returned from whoami)
  },
}

For more details on the parameters of the request body, see Turnkey's API Reference.

Language
Credentials
Header
Click Try It! to start a request and see the response here!
ReadMe