# Evm.startBlockState

Starts gathering what a block's transactions change.

Returns a token identifying the accumulator. Pass it to [`ExecutedTx.commitTo`](/evm/execution/ExecutedTx/commitTo) to record a transaction into it, and to [`Evm.takeBlockState`](/evm/execution/Evm/takeBlockState) to read it back. Starting again abandons whatever the previous token identified.

## Imports

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

```ts [Entrypoint]
import * as Evm from 'ox/evm/Evm'
```
:::

## Examples

```ts twoslash
// @noErrors
import { Evm, ExecutedTx } from 'ox/evm'

const block = Evm.startBlockState(evm)

for (const transaction of transactions)
  ExecutedTx.commitTo(Evm.transact(evm, transaction), block)

const state = Evm.takeBlockState(evm, block)
state.accounts.length
```

## Definition

```ts
function startBlockState<asynchronous>(
  evm: Evm<asynchronous>,
): Awaitable<asynchronous, BlockState.Token>
```

**Source:** [src/evm/Evm.ts](https://github.com/wevm/ox/blob/main/src/evm/Evm.ts#L1097)

## Parameters

### evm

* **Type:** `Evm<asynchronous>`

EVM to gather from.

#### evm.'~async'

* **Type:** `asynchronous`

#### evm.'~chainId'

* **Type:** `bigint`

#### evm.'~config'

* **Type:** `{ block: Block; specId: "frontier" | "homestead" | "tangerine" | "spuriousDragon" | "byzantium" | "petersburg" | "istanbul" | "berlin" | "london" | "merge" | "shanghai" | "cancun" | "prague" | "osaka" | "amsterdam"; version?: Version; }`

The engine's current execution config.

Held so a setter can replace one half without discarding the other, since
the adapter's operation carries both.

#### evm.'~driver'

* **Type:** `asynchronous extends true ? Driver : undefined`

Drives the asynchronous source, when there is one.

#### evm.'~engine'

* **Type:** `Engine`

#### evm.block

* **Type:** `Block`

#### evm.specId

* **Type:** `"frontier" | "homestead" | "tangerine" | "spuriousDragon" | "byzantium" | "petersburg" | "istanbul" | "berlin" | "london" | "merge" | "shanghai" | "cancun" | "prague" | "osaka" | "amsterdam"`

#### evm.version

* **Type:** `Version`
* **Optional**

## Return Type

A token identifying the accumulator.

`Awaitable<asynchronous, BlockState.Token>`
