> ## Documentation Index
> Fetch the complete documentation index at: https://docs.base.org/llms.txt
> Use this file to discover all available pages before exploring further.

# RPC

> Specification of the rollup node RPC interface, including the optimism_outputAtBlock method for retrieving L2 output roots.

## L2 Output RPC method

The Rollup node has its own RPC method, `optimism_outputAtBlock` which returns a 32
byte hash corresponding to the [L2 output root](../../reference/glossary#l2-output-root).

### Structures

These define the types used by rollup node API methods.
The types defined here are extended from the [engine API specs][engine-structures].

#### BlockID

* `hash`: `DATA`, 32 Bytes
* `number`: `QUANTITY`, 64 Bits

#### L1BlockRef

* `hash`: `DATA`, 32 Bytes
* `number`: `QUANTITY`, 64 Bits
* `parentHash`: `DATA`, 32 Bytes
* `timestamp`: `QUANTITY`, 64 Bits

#### L2BlockRef

* `hash`: `DATA`, 32 Bytes
* `number`: `QUANTITY`, 64 Bits
* `parentHash`: `DATA`, 32 Bytes
* `timestamp`: `QUANTITY`, 64 Bits
* `l1origin`: `BlockID`
* `sequenceNumber`: `QUANTITY`, 64 Bits - distance to first block of epoch

#### SyncStatus

Represents a snapshot of the rollup driver.

* `current_l1`: `Object` - instance of [`L1BlockRef`](#l1blockref).
* `current_l1_finalized`: `Object` - instance of [`L1BlockRef`](#l1blockref).
* `head_l1`: `Object` - instance of [`L1BlockRef`](#l1blockref).
* `safe_l1`: `Object` - instance of [`L1BlockRef`](#l1blockref).
* `finalized_l1`: `Object` - instance of [`L1BlockRef`](#l1blockref).
* `unsafe_l2`: `Object` - instance of [`L2BlockRef`](#l2blockref).
* `safe_l2`: `Object` - instance of [`L2BlockRef`](#l2blockref).
* `finalized_l2`: `Object` - instance of [`L2BlockRef`](#l2blockref).
* `pending_safe_l2`: `Object` - instance of [`L2BlockRef`](#l2blockref).
* `queued_unsafe_l2`: `Object` - instance of [`L2BlockRef`](#l2blockref).

### Output Method API

The input and return types here are as defined by the [engine API specs][engine-structures].

[engine-structures]: https://github.com/ethereum/execution-apis/blob/main/src/engine/paris.md#structures

#### `optimism_outputAtBlock`

Returns an output root and associated metadata for a given L2 block.

**Parameters**

| Name          | Type                | Description             |
| :------------ | :------------------ | :---------------------- |
| `blockNumber` | `QUANTITY`, 64 bits | L2 integer block number |

**Returns**

| Name                    | Type             | Description                                        |
| :---------------------- | :--------------- | :------------------------------------------------- |
| `version`               | `DATA`, 32 Bytes | Output root version number, beginning with `0`     |
| `outputRoot`            | `DATA`, 32 Bytes | The output root                                    |
| `blockRef`              | `Object`         | Instance of [`L2BlockRef`](#l2blockref)            |
| `withdrawalStorageRoot` | `DATA`, 32 Bytes | Storage root of the `L2ToL1MessagePasser` contract |
| `stateRoot`             | `DATA`, 32 Bytes | The state root                                     |
| `syncStatus`            | `Object`         | Instance of [`SyncStatus`](#syncstatus)            |
