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 | 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-ClaimPackages
| 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
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.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.Technology stack
- Bun: JavaScript runtime
- Hono: Web framework for the REST API
- viem: TypeScript Ethereum library for blockchain interactions
- MongoDB: Document database for transaction storage
- Lerna: Monorepo package management
Next steps
Architecture
System design, consumer internals, and database schema.
Deployment
Configuration, environment variables, and production setup.
API reference
REST endpoints, request parameters, and response schemas.
Auto-Claim
Automated claiming service setup and operation.