# ZoneId.fromChainId

Derives a zone ID from a zone chain ID.

Zone chain IDs follow the formula `4_217_000_000 + zoneId`, so a chain ID of `4217000006` corresponds to zone ID `6`.

## Imports

:::code-group
```ts [Named]
import { ZoneId } from 'ox/tempo'
```

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

## Examples

```ts twoslash
import { ZoneId } from 'ox/tempo'

const zoneId = ZoneId.fromChainId(4_217_000_006)
// @log: 6
```

## Definition

```ts
function fromChainId(
  chainId: number,
): number
```

**Source:** [src/tempo/ZoneId.ts](https://github.com/wevm/ox/blob/main/src/tempo/ZoneId.ts#L59)

## Parameters

### chainId

* **Type:** `number`

The zone chain ID.

## Return Type

The zone ID.

`number`
