Skip to main content

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 ServiceBridge Hub
ScopeSingle chainMulti-chain
Runs onChain operator infrastructureIntegrator infrastructure
PersistenceIn-memoryMongoDB
ExposesRaw bridge dataIndexed data + auto-claim
Components1 service4 packages
Repoagglayer/agglayer-rs0xPolygon/agglayer-bridge-hub-api
AudienceChain operatorsdApp developers, bridge UIs, integrators

Data flow

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

Packages

PackageLayerDescription
CommonsFoundationShared TypeScript types, interfaces, and schema definitions used across all packages
ConsumerData ingestionPolls AggKit Bridge Service APIs per chain and writes transaction data to MongoDB
APIServiceREST API with OpenAPI documentation for querying transactions and generating claim proofs
Auto-ClaimAutomationPolls the API for claimable transactions and submits claim transactions on-chain

Transaction lifecycle

1

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.
2

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.
3

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.

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.