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

Waits until an OP Stack withdrawal can be proved.

## Usage

Wait for the withdrawal receipt to be covered, then return the data required to build its proof.

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

declare const receipt: TransactionReceipt.TransactionReceipt

const proof = await client.withdrawal.waitToProve({ // [!code focus]
  receipt, // [!code focus]
  targetChain: optimism, // [!code focus]
}) // [!code focus]
```

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

### Standalone Action

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

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

declare const receipt: TransactionReceipt.TransactionReceipt

const proof = await Actions.l1.waitToProve(client, { // [!code focus]
  receipt, // [!code focus]
  targetChain: optimism, // [!code focus]
}) // [!code focus]
```

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

## Return Value

```ts
{
  game: Game.Game & {
    l2BlockNumber: bigint
    usesSuperRoots: boolean
  }
  output: {
    l2BlockNumber: bigint
    outputIndex: bigint
    outputRoot: Hex
    timestamp: bigint
  }
  withdrawal: Withdrawal.Withdrawal
}
```

The dispute game or legacy output, normalized output claim, and withdrawal extracted from the receipt.

## Parameters

### chain

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

The L1 chain used to read the contracts.

### disputeGameFactoryAddress

* **Type:** `Address`

An explicit Dispute Game Factory address. Supply all three explicit addresses when omitting `targetChain`.

### gameLimit

* **Type:** `number`
* **Default:** `100`

The maximum number of recent dispute games to inspect.

### l2OutputOracleAddress

* **Type:** `Address`

An explicit L2 Output Oracle address. Supply all three explicit addresses when omitting `targetChain`.

### l2Timestamp

* **Type:** `bigint`

The L2 timestamp used as the position for super-root games.

### pollingInterval

* **Type:** `number`
* **Default:** `client.pollingInterval`

The polling interval in milliseconds.

### portalAddress

* **Type:** `Address`

An explicit Optimism Portal address. Supply all three explicit addresses when omitting `targetChain`.

### receipt

* **Type:** `TransactionReceipt`

The L2 withdrawal transaction receipt.

### targetChain

* **Type:** `Chain`

The OP Stack L2 [Chain](/docs/chains) whose L1 contracts are used.
