> **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.

# P256.verify

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

Verifies a payload was signed by the provided public key.

## Imports

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

## Examples

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

const { privateKey, publicKey } = P256.createKeyPair()
const signature = P256.sign({
  payload: '0xdeadbeef',
  privateKey
})

const verified = P256.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.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 public key.

`boolean`
