Skip to main content

Overview

The Hub is a smart contract on the Relay Chain that serves as the central ledger for the protocol. It tracks the ownership of all funds deposited into Depository contracts across every supported chain. Implemented as an ERC6909 multi-token contract, the Hub can represent any deposited asset (ETH, USDC, SOL, etc.) from any chain as a token balance. When the Oracle attests that a deposit or fill occurred, the Hub updates balances accordingly.

How It Works

The Hub maintains a global balance sheet:
  • When a user deposits into a Depository, the Oracle attests this, and the Hub mints a corresponding token balance for the user
  • When a solver fills an order, the Oracle attests this, and the Hub transfers the balance from the user to the solver
  • When a solver withdraws, they transfer their balance to a withdrawal address on the Hub. After funds are claimed from the Depository, the Oracle attests the withdrawal and the Hub burns the corresponding balance
This means the Hub always reflects the current state of all funds across all chains in real-time.

Actions

The Hub processes three types of actions, all triggered by the Oracle:
ActionTriggerEffect
MINTUser deposit attestedCreates token balance for the depositor
TRANSFERSolver fill attestedMoves balance from user to solver
BURNSolver withdrawal attestedRemoves balance (funds already claimed)
Each action is idempotent — the same attestation cannot be processed twice, preventing double-counting.

Real-Time Settlement

A key advantage of the Hub model is real-time, per-order settlement. Every order settles individually as soon as the Oracle attests the fill. There is no batching window or settlement delay. This is possible because settlement happens on the Relay Chain, where gas is extremely cheap (~$0.005 per settlement). In contrast, protocols that settle on origin chains must batch orders to amortize the high gas costs, forcing solvers to wait hours before they can reclaim capital. Benefit for solvers: Immediate balance updates mean solvers can track their available capital in real-time and make withdrawal decisions based on current inventory needs, rather than waiting for batch cycles.

Token Representation

The Hub uses the ERC6909 standard (multi-token) to represent deposited assets. Each unique combination of asset and origin chain gets a token ID on the Hub. For example:
  • ETH deposited on Optimism → token ID X
  • ETH deposited on Base → token ID Y
  • USDC deposited on Arbitrum → token ID Z
Token metadata (name, symbol, decimals, origin chain) is stored on-chain, and each Hub token can be viewed through an ERC20-compatible wrapper contract (ERC20View) for standard wallet compatibility.

ERC6909 Interface

The Hub implements the full ERC6909 interface, including:
  • balanceOf(owner, tokenId) — Check a user’s or solver’s balance for a specific token
  • transfer(receiver, tokenId, amount) — Transfer Hub tokens between addresses
  • approve(spender, tokenId, amount) — Approve another address to spend tokens
  • Operator system — Grant an address full control over all token balances
  • EIP-712 permits — Gasless approval signatures

Withdrawal Addresses

Solvers initiate withdrawals by transferring their Hub balance to a withdrawal address — a deterministic virtual address derived from the withdrawal parameters:
  • Target chain and depository
  • Currency and amount
  • Recipient address
  • Withdrawal nonce
The withdrawal address is computed by hashing these parameters together. It doesn’t correspond to a real contract — it’s a signal. The Oracle monitors the Hub for transfers to these addresses, decodes the parameters, and forwards the request to the Allocator for proof generation. This pattern keeps the Hub simple — it’s pure ERC6909 with no custom withdrawal logic. The withdrawal semantics are layered on top by convention.

Source Code

The Hub contract (RelayHub.sol) is part of the settlement-protocol repository and deployed on the Relay Chain.