> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# Secp256k1.verify

:::info
`Secp256k1.verify` is a re-export of ox's [`Secp256k1.verify`](https://oxlib.sh/api/Secp256k1/verify). Refer to the ox documentation for the full reference.
:::

Verifies a payload was signed by the provided address.

## Imports

```ts
import { Secp256k1 } from 'viem/utils'
```

## Examples

### Verify with Ethereum Address

```ts twoslash
// @noErrors
import { Secp256k1 } from 'viem/utils'

const signature = Secp256k1.sign({
  payload: '0xdeadbeef',
  privateKey: '0x...'
})

const verified = Secp256k1.verify({
  // [!code focus]
  address: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', // [!code focus]
  payload: '0xdeadbeef', // [!code focus]
  signature // [!code focus]
}) // [!code focus]
```

### Verify with Public Key

```ts twoslash
// @noErrors
import { Secp256k1 } from 'viem/utils'

const privateKey = '0x...'
const publicKey = Secp256k1.getPublicKey({ privateKey })
const signature = Secp256k1.sign({
  payload: '0xdeadbeef',
  privateKey
})

const verified = Secp256k1.verify({
  // [!code focus]
  publicKey, // [!code focus]
  payload: '0xdeadbeef', // [!code focus]
  signature // [!code focus]
}) // [!code focus]
```

## Definition

```ts
function verify(
  options: verify.Options,
): boolean
```

## Parameters

### options

* **Type:** `verify.Options`

The verification options.

#### options.address

* **Type:** `abitype_Address`

Address that signed the payload.

#### options.hash

* **Type:** `boolean`
* **Optional**

If set to `true`, the payload will be hashed (sha256) before being verified.

#### options.payload

* **Type:** `0x${string} | Uint8Array`

Payload that was signed.

#### options.publicKey

* **Type:** `0x${string} | Uint8Array | { prefix: number; x: 0x${string}; y: 0x${string}; } | { prefix: number; x: 0x${string}; y?: undefined; }`

Public key that signed the payload.

Accepts a structured [`PublicKey.PublicKey`](/docs/utilities/publickey/types#publickey), a serialized
hex string, or a `Uint8Array` (SEC1 encoding).

#### options.signature

* **Type:** `0x${string} | Uint8Array | { r: 0x${string}; s: 0x${string}; yParity?: number; } | { r: 0x${string}; s: 0x${string}; yParity: number; }`

Signature of the payload.

Accepts a structured [`Signature.Signature`](/docs/utilities/signature/types#signature), a serialized
hex string, or a `Uint8Array`.

## Return Type

Whether the payload was signed by the provided address.

`boolean`
