Signatures

recoverMessageAddress

Recovers the signing address from a message & signature.

Viem 2.54.1. Source at the pinned commit · Official reference

Signature

export async function recoverMessageAddress({
  message,
  signature,
}: RecoverMessageAddressParameters): Promise<RecoverMessageAddressReturnType>;

Parameters

  • { message, signature, }: RecoverMessageAddressParameters

Example from Upstream

The following is an upstream documentation example, not a live payment result. Any referenced wallet, chain or local module belongs to the original example’s context. Pinned example source.

import { recoverMessageAddress } from 'viem';
import { account, walletClient } from './config'

const signature = await walletClient.signMessage({
  account,
  message: 'hello world',
})

const address = await recoverMessageAddress({
  message: 'hello world',
  signature,
})

Integration Notes

Message recovery proves the signer of the exact supplied message. It does not establish expiry, resource scope, replay protection or payment completion.

Exported Types in This Source File

RecoverMessageAddressParameters

export type RecoverMessageAddressParameters = {
  message: SignableMessage
  signature: Hex | ByteArray | Signature
}

RecoverMessageAddressReturnType

export type RecoverMessageAddressReturnType = Address

RecoverMessageAddressErrorType

export type RecoverMessageAddressErrorType =
  | HashMessageErrorType
  | RecoverAddressErrorType
  | ErrorType

Imported type definitions remain in the pinned source file; this focused reference does not expand the entire type graph.

Provenance

  • Repository: wevm/viem.
  • Commit: e6e0c1bef949fbdc837662fbd41ebe739ccae030.
  • Source: src/utils/signature/recoverMessageAddress.ts, lines 27–32.
  • License: MIT, copyright weth LLC.
  • Generated from the TypeScript AST and the linked upstream Markdown with Sourcey 3.9.0.
  • Maintained independently as part of Nibgate’s integration docs. This is not an official Viem site.
Independent Viem integration reference maintained by Nibgate. Upstream source: MIT, weth LLC.Docs by Sourcey