# Secp256k1.verify

Verifies a payload was signed by the provided address.

## Imports

:::code-group
```ts [Named]
import { Secp256k1 } from 'ox'
```

```ts [Entrypoint]
import * as Secp256k1 from 'ox/Secp256k1'
```
:::

## Examples

### Verify with Ethereum Address

```ts twoslash
import { Secp256k1 } from 'ox'

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
import { Secp256k1 } from 'ox'

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
```

**Source:** [src/core/Secp256k1.ts](https://github.com/wevm/ox/blob/main/src/core/Secp256k1.ts#L511)

## 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`](/api/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`](/api/Signature/types#signature), a serialized
hex string, or a `Uint8Array`.

## Return Type

Whether the payload was signed by the provided address.

`boolean`
