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

# `l1.proveWithdrawal`

Proves an OP Stack withdrawal on L1.

## Usage

Submit the output claim and withdrawal storage proof to the Optimism Portal.

:::code-group
```ts twoslash [example.ts]
import { optimism } from 'viem/chains'
import { Value } from 'viem/utils'
import { client } from './viem.config'

const address = '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'
const hash =
  '0x0000000000000000000000000000000000000000000000000000000000000000'

const transactionHash = await client.withdrawal.proveWithdrawal({ // [!code focus]
  account: address,
  l2OutputIndex: 0n,
  outputRootProof: {
    latestBlockhash: hash,
    messagePasserStorageRoot: hash,
    stateRoot: hash,
    version: hash,
  },
  targetChain: optimism,
  withdrawal: {
    data: '0x',
    gasLimit: 21_000n,
    nonce: 0n,
    sender: address,
    target: address,
    value: Value.fromEther('1'),
  },
  withdrawalProof: [hash],
}) // [!code focus]
```

```ts twoslash [viem.config.ts] filename="viem.config.ts"
// [!include ~/snippets/op-stack/l1.config.ts:setup]
```
:::

### Standalone Action

Call `Actions.l1.proveWithdrawal` directly by passing the [Client](/docs/clients) as the first argument.

:::code-group
```ts twoslash [example.ts]
import { optimism } from 'viem/chains'
import { Actions } from 'viem/op-stack'
import { Value } from 'viem/utils'
import { client } from './viem.config'

const address = '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'
const hash =
  '0x0000000000000000000000000000000000000000000000000000000000000000'

const transactionHash = await Actions.l1.proveWithdrawal(client, { // [!code focus]
  account: address,
  l2OutputIndex: 0n,
  outputRootProof: {
    latestBlockhash: hash,
    messagePasserStorageRoot: hash,
    stateRoot: hash,
    version: hash,
  },
  targetChain: optimism,
  withdrawal: {
    data: '0x',
    gasLimit: 21_000n,
    nonce: 0n,
    sender: address,
    target: address,
    value: Value.fromEther('1'),
  },
  withdrawalProof: [hash],
}) // [!code focus]
```

```ts twoslash [viem.config.ts] filename="viem.config.ts"
// [!include ~/snippets/op-stack/l1.config.ts:setup]
```
:::

## Return Value

`Hex`

The L1 transaction hash.

## Parameters

### account

* **Type:** `Account | Address`

The [Account](/docs/accounts) that sends the proof transaction. Required when the Client has no Account.

### chain

* **Type:** `Chain | null`
* **Default:** `client.chain`

The L1 chain on which the proof transaction is sent.

### gas

* **Type:** `bigint | null`

The gas limit for the L1 transaction.

### l2OutputIndex

* **Type:** `bigint`

The L2 output or dispute-game index.

### maxFeePerGas

* **Type:** `bigint`

The maximum total fee per gas, in wei.

### maxPriorityFeePerGas

* **Type:** `bigint`

The maximum priority fee per gas, in wei.

### nonce

* **Type:** `number`

The L1 transaction nonce.

### outputRootProof

* **Type:** `OutputRootProof`

The output-root proof containing `latestBlockhash`, `messagePasserStorageRoot`, `stateRoot`, and `version` hex values.

### portalAddress

* **Type:** `Address`

An explicit Optimism Portal address. When supplied, `targetChain` is optional.

### targetChain

* **Type:** `Chain`

The OP Stack L2 [Chain](/docs/chains) whose portal contract is used.

### withdrawal

* **Type:** `Withdrawal`

The withdrawal tuple containing `data`, `gasLimit`, `nonce`, `sender`, `target`, and `value`.

### withdrawalProof

* **Type:** `readonly Hex[]`

The Merkle proof for the withdrawal storage slot.
