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

# Tempo: the settlement hub

> Why Tempo is the hub, and exactly how Corridor uses it: pathUSD as the unit of account, TIP-20 transferWithMemo with indexed memos, gas paid in stablecoins through the Fee Manager, and a log observer with no indexer.

<img src="https://mintcdn.com/corridorapp/YeOtjsXcStLLcZ_W/images/chains/tempo.svg?fit=max&auto=format&n=YeOtjsXcStLLcZ_W&q=85&s=e1151711829b954d04a0a3d5c8058c34" alt="Tempo" width="56" height="56" data-path="images/chains/tempo.svg" />

Tempo is a payments-first chain, incubated by Stripe and Paradigm. Corridor holds every customer balance on it, settles every flow through it, and reconciles against its logs.

## Why Tempo is the hub

<CardGroup cols={2}>
  <Card title="Memos are first-class" icon="fingerprint">
    TIP-20 `transferWithMemo` takes a `bytes32` memo and emits it as an **indexed topic** of `TransferWithMemo`. The 32-byte Corridor Reference fits exactly, and reconciliation filters logs by reference with plain `eth_getLogs`.
  </Card>

  <Card title="Gas in stablecoins" icon="fuel">
    There is no native gas token. Vaults pay fees in pathUSD, the asset they already hold, through the Fee AMM. No ETH float to manage per vault.
  </Card>

  <Card title="Fast, final settlement" icon="timer">
    About 0.6 s to finality, so the hub is never the slow step in a payment.
  </Card>

  <Card title="A neutral quote token" icon="circle-dollar-sign">
    pathUSD is Tempo's quote token, issued by Bridge (a Stripe company). Every USD TIP-20 routes through it on the enshrined stablecoin DEX.
  </Card>
</CardGroup>

## pathUSD as the unit of account

Every stablecoin on Tempo is a TIP-20, including USDC.e (Stargate-bridged USDC). Corridor treats **pathUSD** as its unit of account and accepts any USD TIP-20 at the edges:

```text theme={"dark"}
Ingress (any USD TIP-20)            Core (Tempo)                    Egress
USDC.e / USDT0 / pathUSD ──DEX──▶  pathUSD vaults + ledger ──Across──▶ Base USDC ──▶ partner
```

pathUSD is supported by Across (`pathUSD (4217) → USDC` on Base and others), issued by the Moderato faucet so testnet matches production, and accepted by validators as a fee token. Its circulating supply is still small, so each corridor carries a `settlementAsset` policy: when a ticket exceeds pathUSD depth, the corridor settles in USDC.e instead. Switching is configuration, not a migration. See [ADR 0001](/decisions/0001-pathusd-settlement-unit).

## Client

Corridor uses viem's built-in Tempo support (`viem/tempo`):

```ts theme={"dark"}
import { createClient, Actions, Addresses } from "viem/tempo";

const client = createClient({
  account: privateKeyToAccount(key),
  testnet: network === "moderato",
  feeToken: Addresses.pathUsd,             // pay gas in pathUSD
  transport: http(rpcUrl, { timeout: 30_000, retryCount: 5 }),
});
```

| Network | Chain id | RPC | Explorer |
| - | - | - | - |
| Moderato testnet | 42431 | `https://rpc.moderato.tempo.xyz` | `explore.testnet.tempo.xyz` |
| Mainnet | 4217 | `https://rpc.tempo.xyz` | `explore.tempo.xyz` |

The Moderato faucet funds an address through the RPC method `tempo_fundAddress`.

## Moving value

```ts theme={"dark"}
const obs = await transferWithReference(client, {
  asset: "pathUSD",
  to: escrow,
  amount: 1_000_000_000n,          // 1,000 pathUSD (6 decimals)
  reference: ref,                  // 32-byte Corridor Reference
});
// → the Observation for the resulting TransferWithMemo log, ready to book
```

Legs call `tempoMoveOnce`: before sending, they search for an identical movement (same memo, parties and amount) since the saga's start block. A retry after a crash between send and bookkeeping finds the transfer instead of sending it twice.

## Observing

`TempoObserver` watches the vault addresses from a stored block cursor:

* `TransferWithMemo` logs **in and out** of each vault (two queries, because indexed-argument filters are ORed within an array).
* Optionally, **unreferenced** movements: plain inbound `Transfer`s (faucet mints, owner top-ups, deposits without a memo) and **fee transfers** to the Fee Manager.

## Gas accounting

Every Tempo transaction pays its fee as a TIP-20 `Transfer` from the fee payer to the Fee Manager at `0xfeec000000000000000000000000000000000000`, logged in the same receipt. On a real 2.000000 pathUSD transfer the vault's balance fell by 2.000098: 98 base units were the fee, equal to `gasUsed × effectiveGasPrice ÷ 10¹²`, rounded up. Corridor books each fee a vault pays to `expense:gas`, keyed by that log, so the treasury's on-chain balance equals the ledger to the last unit. See [Reconciliation](/architecture/reconciliation#vault-accounting-from-the-chain).

## Evidence

* Memo transfer found by indexed topic and booked once: `pnpm tempo:smoke`.
* Payout to a Shenzhen supplier with a decodable reference: [0x671161f6…](https://explore.testnet.tempo.xyz/tx/0x671161f61c70a0b5b33c6c8de4221c938d86c310958725146ea9f21517957b5e).
* Treasury on-chain = ledger: 1,000,051.994555 pathUSD, 10 fees booked from the chain.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.