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

# Bridge Hub

> Multi-chain bridge transaction indexing, API, and auto-claim system for AggLayer integrators.

## Overview

Bridge Hub is a multi-chain indexing and claiming system for AggLayer bridge transactions. It polls each chain's AggKit Bridge Service, indexes transaction data into MongoDB, and exposes the results through a unified REST API. Bridge Hub is designed for integrators who need a single interface to query and manage bridge transactions across all chains connected to the AggLayer.

## Bridge Hub vs. AggKit Bridge Service

|                 | AggKit Bridge Service                                           | Bridge Hub                                                                                |
| --------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| **Scope**       | Single chain                                                    | Multi-chain                                                                               |
| **Runs on**     | Chain operator infrastructure                                   | Integrator infrastructure                                                                 |
| **Persistence** | In-memory                                                       | MongoDB                                                                                   |
| **Exposes**     | Raw bridge data                                                 | Indexed data + auto-claim                                                                 |
| **Components**  | 1 service                                                       | 4 packages                                                                                |
| **Repo**        | [agglayer/agglayer-rs](https://github.com/agglayer/agglayer-rs) | [0xPolygon/agglayer-bridge-hub-api](https://github.com/0xPolygon/agglayer-bridge-hub-api) |
| **Audience**    | Chain operators                                                 | dApp developers, bridge UIs, integrators                                                  |

## Data flow

CDK chain → AggKit Bridge Service → Bridge Hub Consumer → Bridge Hub API → Bridge UI / Auto-Claim

## Packages

| Package        | Layer          | Description                                                                               |
| -------------- | -------------- | ----------------------------------------------------------------------------------------- |
| **Commons**    | Foundation     | Shared TypeScript types, interfaces, and schema definitions used across all packages      |
| **Consumer**   | Data ingestion | Polls AggKit Bridge Service APIs per chain and writes transaction data to MongoDB         |
| **API**        | Service        | REST API with OpenAPI documentation for querying transactions and generating claim proofs |
| **Auto-Claim** | Automation     | Polls the API for claimable transactions and submits claim transactions on-chain          |

## Transaction lifecycle

<Steps>
  <Step title="BRIDGED">
    A user initiates a bridge transaction on the source chain. The Consumer detects the deposit through the AggKit Bridge Service and saves the transaction to MongoDB with status `BRIDGED`.
  </Step>

  <Step title="READY_TO_CLAIM">
    The Consumer monitors L1 info tree updates and determines when the transaction becomes claimable. It updates the transaction status to `READY_TO_CLAIM` and sets the leaf index needed for proof generation.
  </Step>

  <Step title="CLAIMED">
    The Auto-Claim service (or an external caller) fetches a merkle proof from the API and submits a claim transaction on the destination chain. Once confirmed, the Consumer detects the claim event and updates the status to `CLAIMED`.
  </Step>
</Steps>

## Technology stack

* [Bun](https://bun.sh): JavaScript runtime
* [Hono](https://hono.dev): Web framework for the REST API
* [viem](https://viem.sh): TypeScript Ethereum library for blockchain interactions
* [MongoDB](https://www.mongodb.com/): Document database for transaction storage
* [Lerna](https://lerna.js.org/): Monorepo package management

## Next steps

<CardGroup cols={2}>
  <Card title="Architecture" icon="sitemap" href="/interoperability/agglayer/integrations/bridge-hub/architecture/">
    System design, consumer internals, and database schema.
  </Card>

  <Card title="Deployment" icon="server" href="/interoperability/agglayer/integrations/bridge-hub/deployment/">
    Configuration, environment variables, and production setup.
  </Card>

  <Card title="API reference" icon="code" href="/interoperability/agglayer/integrations/bridge-hub/api-reference/">
    REST endpoints, request parameters, and response schemas.
  </Card>

  <Card title="Auto-Claim" icon="robot" href="/interoperability/agglayer/integrations/bridge-hub/auto-claim/">
    Automated claiming service setup and operation.
  </Card>
</CardGroup>
