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

# Verify Logs Bloom

> Regenerate logs bloom filters for targeted reconciliations.

## Overview

Recomputes an Ethereum receipt logs bloom filter from the logs you supply and compares it against an expected bloom (for example, the value published in a block header or receipt). Useful when you only care about log-topic coverage without re-verifying the full receipt trie.

## Parameters

<ParamField body="chain_id" type="number">
  Network identifier. Use when the verification workflow should be tied to a specific chain context. *See the [Chain](/api-reference/enumerations/chain) enumeration.*
</ParamField>

#### Block Context

<ParamField body="block_number" type="number" required>
  Canonical block height where the log was emitted. Use when the verification workflow should be tied to a specific block height context.
</ParamField>

<ParamField body="expected_bloom" type="string" required>
  2048-bit bloom filter represented as a 512-character hex string (no `0x` prefix). Typically sourced from a block header or receipt.
</ParamField>

#### Log Inputs

<ParamField body="logs" type="object[]" required>
  Logs that should populate the bloom filter. Order is irrelevant.
</ParamField>

<ParamField body="contract_address" type="string" required>
  Address that emitted the log (hex string, 20 bytes, no `0x` prefix). Encoded into the bloom.
</ParamField>

<ParamField body="topics" type="string[]" required>
  0-4 indexed topics (hex string, 32 bytes each, no `0x` prefix). Each topic contributes to the bloom. Supply an empty array for topic-less logs.
</ParamField>

#### Pagination Controls

<ParamField body="limit" type="number" default="250">
  Recommended default `250`; maximum `1000` to stay under \~10 MB responses.
</ParamField>

<ParamField body="cursor" type="string">
  Pagination cursor from a prior call.
</ParamField>

## Response Fields

#### Meta

<ResponseField name="meta" type="object">
  Echo of request metadata applied to the response.
</ResponseField>

<ResponseField name="meta.chain_id" type="number | null">
  EVM chain ID echoed from the request when provided; otherwise `null`.
</ResponseField>

#### Data

<ResponseField name="data" type="object[]">
  Verification results.
</ResponseField>

<ResponseField name="data.expected_bloom" type="string">
  Bloom filter supplied in the request.
</ResponseField>

<ResponseField name="data.computed_bloom" type="string">
  Bloom filter recomputed from `logs`.
</ResponseField>

<ResponseField name="data.is_identical" type="boolean">
  `true` when `expected_bloom` and `computed_bloom` match bit-for-bit.
</ResponseField>

#### Envelope Fields

<ResponseField name="page_count" type="number">
  Number of verification entries returned (currently `1`).
</ResponseField>

## Use Cases

* Sanity-check log ingestion pipelines without fetching receipts or recomputing trie roots.
* Confirm that filtered event subscriptions captured all expected topics before downstream processing.
* Lightweight guardrail for block producers or relayers to ensure bloom accuracy after custom transformations.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.blockdb.io/v1/evm/verify/logs-bloom" \
    -H "Authorization: Bearer $BLOCKDB_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "chain_id": 1,
    "block_number": 18767124,
    "expected_bloom": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "logs": [
      {
        "contract_address": "0000000000000000000000000000000000000000",
        "topics": [
          "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
          "0000000000000000000000000000000000000000000000000000000000000000"
        ]
      }
    ]
  }'
  ```

  ```c C theme={null}
  #include <curl/curl.h>
  #include <stdio.h>
  #include <stdlib.h>

  int main(void) {
      CURL *curl = curl_easy_init();
      if (!curl) return 1;

      const char *token = getenv("BLOCKDB_API_KEY");
      char auth_header[256];
      snprintf(auth_header, sizeof(auth_header), "Authorization: Bearer %s", token ? token : "");
      const char *payload = "{\"chain_id\":1,\"block_number\":18767124,\"expected_bloom\":\"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"logs\":[{\"contract_address\":\"0000000000000000000000000000000000000000\",\"topics\":[\"ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\",\"0000000000000000000000000000000000000000000000000000000000000000\"]}]}";

      struct curl_slist *headers = NULL;
      headers = curl_slist_append(headers, auth_header);
      headers = curl_slist_append(headers, "Content-Type: application/json");


      curl_easy_setopt(curl, CURLOPT_URL, "https://api.blockdb.io/v1/evm/verify/logs-bloom");
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload);


      CURLcode res = curl_easy_perform(curl);

      curl_slist_free_all(headers);
      curl_easy_cleanup(curl);
      return res == CURLE_OK ? 0 : 1;
  }
  ```

  ```csharp .NET theme={null}
  using System;
  using System.Net.Http;
  using System.Net.Http.Headers;
  using System.Text;
  using System.Threading.Tasks;

  class Program
  {
      static async Task Main()
      {
          using var client = new HttpClient();
          client.DefaultRequestHeaders.Authorization =
              new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("BLOCKDB_API_KEY"));

          var payload = new StringContent(
              "{\"chain_id\":1,\"block_number\":18767124,\"expected_bloom\":\"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"logs\":[{\"contract_address\":\"0000000000000000000000000000000000000000\",\"topics\":[\"ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\",\"0000000000000000000000000000000000000000000000000000000000000000\"]}]}",
              Encoding.UTF8,
              "application/json"
          );

          var response = await client.PostAsync("https://api.blockdb.io/v1/evm/verify/logs-bloom", payload);
          response.EnsureSuccessStatusCode();

          var body = await response.Content.ReadAsStringAsync();
          Console.WriteLine(body);
      }
  }
  ```

  ```python Python theme={null}
  import os
  import requests

  response = requests.post(
      "https://api.blockdb.io/v1/evm/verify/logs-bloom",
      headers={
          "Authorization": f"Bearer {os.getenv('BLOCKDB_API_KEY')}",
          "Content-Type": "application/json"
      },
      json={'block_number': 18767124,
   'chain_id': 1,
   'expected_bloom': '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
   'logs': [{'contract_address': '0000000000000000000000000000000000000000',
             'topics': ['ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
                        '0000000000000000000000000000000000000000000000000000000000000000']}]}
  )

  data = response.json()
  print(data)
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://api.blockdb.io/v1/evm/verify/logs-bloom", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${process.env.BLOCKDB_API_KEY}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
    "chain_id": 1,
    "block_number": 18767124,
    "expected_bloom": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "logs": [
      {
        "contract_address": "0000000000000000000000000000000000000000",
        "topics": [
          "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
          "0000000000000000000000000000000000000000000000000000000000000000"
        ]
      }
    ]
  })
  });

  const data = await response.json();
  console.log(data);
  ```

  ```go Go theme={null}
  package main

  import (
      "fmt"
      "net/http"
      "os"
      "strings"
  )

  func main() {
      payload := strings.NewReader(`{
    "chain_id": 1,
    "block_number": 18767124,
    "expected_bloom": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "logs": [
      {
        "contract_address": "0000000000000000000000000000000000000000",
        "topics": [
          "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
          "0000000000000000000000000000000000000000000000000000000000000000"
        ]
      }
    ]
  }`)

      req, _ := http.NewRequest("POST", "https://api.blockdb.io/v1/evm/verify/logs-bloom", payload)
      req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", os.Getenv("BLOCKDB_API_KEY")))
      req.Header.Set("Content-Type", "application/json")

      client := &http.Client{}
      resp, _ := client.Do(req)
      defer resp.Body.Close()

      // Handle response
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "meta": {
      "chain_id": 1
    },
    "data": [
      {
        "expected_bloom": "0000…",
        "computed_bloom": "0000…",
        "is_identical": true
      }
    ],
    "page_count": 1
  }
  ```

  ```json 400 theme={null}
  {
    "error": {
      "code": "BAD_REQUEST",
      "message": "Invalid request parameters"
    }
  }
  ```

  ```json 401 theme={null}
  {
  "error": {
  "code": "UNAUTHORIZED",
  "message": "Invalid or missing API key"
  }
  }
  ```

  ```json 422 theme={null}
  {
    "error": {
      "code": "CHAIN_NOT_SUPPORTED",
      "http_status": 422,
      "message": "chain_id=137 is not supported.",
      "hint": "Use a supported chain_id. Consult the documentation for the list of available chains.",
      "severity": "error",
      "retryable": false,
      "docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
    }
  }
  ```

  ```json 429 theme={null}
  {
  "error": {
  "code": "RATE_LIMIT_EXCEEDED",
  "message": "Rate limit exceeded",
  "details": "Limit: <CONFIGURED_RPS> requests/second. Retry after: <RETRY_AFTER>"
  }
  }
  ```

  ```json 503 theme={null}
  {
    "error": {
      "code": "SERVICE_UNAVAILABLE",
      "http_status": 503,
      "message": "The service is temporarily unable to handle the request.",
      "hint": "The database connection pool is briefly saturated. Retry after a short delay.",
      "severity": "warning",
      "retryable": true,
      "details": null,
      "docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
    }
  }
  ```
</ResponseExample>
