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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.chainstack.com/feedback

```json
{
  "path": "/reference/base-subscribe-newflashblocks",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# eth_subscribe newFlashblocks | Base

> Subscribe to Base Flashblock streams via WebSocket. Receive pre-confirmed block state from the sequencer approximately every 200ms as standard block objects.

Base API method that streams the accumulated pre-confirmed block state approximately every 200ms. Each notification delivers a standard Ethereum block object representing the current Flashblock snapshot—including all transactions pre-confirmed so far.

This subscription type is exclusive to Flashblocks-enabled endpoints. See [Flashblocks on Base](/docs/flashblocks-on-base) for background on how Flashblocks work.

<Check>
  ### Get your own node endpoint today

  [Start for free](https://console.chainstack.com/) and get your app to production levels immediately. No credit card required.

  You can sign up with your GitHub, X, Google, or Microsoft account.
</Check>

## Parameters

* `string` — the subscription type, `newFlashblocks` in this case.

## Response

* `subscription` — the subscription ID.

Each notification delivers a block object with the following fields:

* `hash` — the block hash. Set to `0x0000...0000` because the block is still being formed (pre-confirmed).
* `parentHash` — hash of the parent block.
* `sha3Uncles` — hash of the list of uncles included in the block.
* `miner` — the address of the fee recipient (coinbase), typically `0x4200000000000000000000000000000000000011`.
* `stateRoot` — root of the state trie. Set to `0x0000...0000` because the block is not yet finalized.
* `transactionsRoot` — root of the transaction trie of the block.
* `receiptsRoot` — root of the receipts trie of the block.
* `logsBloom` — bloom filter for the logs in this Flashblock.
* `difficulty` — always `0x0` on Base.
* `number` — the block number, encoded as hexadecimal.
* `gasLimit` — maximum gas allowed in this block (hex).
* `gasUsed` — cumulative gas used up to and including this Flashblock (hex).
* `timestamp` — Unix timestamp of block creation (hex).
* `extraData` — arbitrary data field set by the sequencer.
* `mixHash` — the previous RANDAO value.
* `nonce` — always `0x0000000000000000` on Base.
* `baseFeePerGas` — EIP-1559 base fee per gas (hex).
* `withdrawalsRoot` — Merkle root of withdrawals.
* `blobGasUsed` — cumulative blob gas used, EIP-4844 (hex).
* `excessBlobGas` — excess blob gas (hex).
* `parentBeaconBlockRoot` — parent beacon block root.
* `uncles` — always empty on Base.
* `transactions` — array of full transaction objects included in this Flashblock so far. Each object includes standard transaction fields (`type`, `from`, `to`, `value`, `input`, `hash`, etc.).
* `withdrawals` — always empty on Base L2.

<Note>
  The `hash` and `stateRoot` fields are zeroed because the block is still being assembled. Once the full 2-second block seals, these values are computed and finalized. See [Flashblocks on Base](/docs/flashblocks-on-base#quick-flashblock-vs-full-block-data-comparison) for a comparison.
</Note>

## `eth_subscribe("newFlashblocks")` code examples

<Info>
  Note that subscriptions require a WebSocket connection and [WebSocket cat](https://www.npmjs.com/package/wscat) for you to use this method in the console.

  Install WebSocket cat with:

  `npm install -g wscat`
</Info>

<CodeGroup>
  ```shell wscat theme={"system"}
  $ wscat -c YOUR_CHAINSTACK_WEBSOCKET_ENDPOINT
  # Wait for the connection to be established

  Connected (press CTRL+C to quit)

  > {"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newFlashblocks"]}
  ```

  ```javascript javascript theme={"system"}
  const WebSocket = require('ws');

  const webSocket = new WebSocket('CHAINSTACK_WSS_URL');

  async function subscribeToNewFlashblocks() {

    const request = {
      id: 1,
      jsonrpc: '2.0',
      method: 'eth_subscribe',
      params: ['newFlashblocks'],
    };

    const onOpen = (event) => {
      webSocket.send(JSON.stringify(request));
    };

    const onMessage = (event) => {
      const response = JSON.parse(event.data);
      console.log(response);
    };

    try {
      webSocket.addEventListener('open', onOpen);
      webSocket.addEventListener('message', onMessage);
    } catch (error) {
      console.error(error);
    }
  }

  subscribeToNewFlashblocks();
  ```
</CodeGroup>

This will generate a continuous stream of block objects as new Flashblocks are produced by the sequencer (\~every 200ms).

<Warning>
  Each notification can be large (hundreds of KB) because it includes the full `transactions` array. If your handler performs heavy processing per event, throttle or debounce it to avoid blocking the WebSocket connection.
</Warning>

### Example notification

```json theme={"system"}
{
  "hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "parentHash": "0x6d98f3e9368562605c063467030f8c6ab47ff606da890b879316a14f9841b3a7",
  "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  "miner": "0x4200000000000000000000000000000000000011",
  "stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "transactionsRoot": "0xf671d9e31238c090e32742144d05b5230b06b80af0a8611cbdac89cb79eae5b6",
  "receiptsRoot": "0x739875b7b5439ff233106142f0a74ca134ec51e4d4e61bed0884cbd60c83c7ac",
  "logsBloom": "0x00000000...",
  "difficulty": "0x0",
  "number": "0x2a13e81",
  "gasLimit": "0x17d78400",
  "gasUsed": "0x3f923ca",
  "timestamp": "0x69ccd9e5",
  "extraData": "0x01000000640000000500000000004c4b40",
  "mixHash": "0x54389ec106a631ccd44c4b3b59a5b01e1647d039ae6cf7893fb8286d451fdceb",
  "nonce": "0x0000000000000000",
  "baseFeePerGas": "0x4c4b40",
  "withdrawalsRoot": "0x7d152b4dc9c65e113c7498ce4c255d9d6740185dbd81dbcb6d7b8a4ac72ba13a",
  "blobGasUsed": "0xc82ab0",
  "excessBlobGas": "0x0",
  "parentBeaconBlockRoot": "0x77c576c8b150f4cc43c9df655988983a309b63b0339ca27a752f2811ad5cae53",
  "uncles": [],
  "transactions": ["...full transaction objects..."],
  "withdrawals": []
}
```

Use [eth\_unsubscribe | Base](/reference/base-unsubscribe) to remove the subscription.

## Use case

The `eth_subscribe("newFlashblocks")` method is useful when you need the complete pre-confirmed block state rather than individual transactions or logs:

* Block building and state reconstruction. Applications that need to reconstruct the full pending block state—such as custom block explorers or analytics platforms—can consume the Flashblock stream directly instead of polling `eth_getBlockByNumber` with `pending`.

* MEV strategy development. Searchers can observe the sequencer's transaction ordering in real time across each \~200ms Flashblock, gaining insight into how the pending block is being constructed.

* Infrastructure monitoring. Node operators and RPC providers can use the Flashblock stream to monitor sequencer health, block production cadence, and gas usage patterns with sub-second granularity.
