Skip to content

Secp256k1.recoverAddress

Recovers the signing address from the signed payload and signature.

Imports

Named
import { Secp256k1 } from 'ox'

Examples

import { Secp256k1 } from 'ox'
 
const signature = Secp256k1.sign({ payload: '0xdeadbeef', privateKey: '0x...' })
 
const address = Secp256k1.recoverAddress({ 
  payload: '0xdeadbeef', 
  signature, 
})

Definition

function recoverAddress(
  options: recoverAddress.Options,
): recoverAddress.ReturnType

Source: src/core/Secp256k1.ts

Parameters

options

  • Type: recoverAddress.Options

The recovery options.

options.payload

  • Type: 0x${string} | Uint8Array

Payload that was signed.

options.signature

  • Type: { r: bigint; s: bigint; yParity: number; }

Signature of the payload.

Return Type

The recovered address.

recoverAddress.ReturnType