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

> ## Agent Instructions
> Tribridge is a crypto payment gateway for Solana and Sui (TON is coming soon). API base URL is https://tribridge.onrender.com. Server-side calls authenticate with the x-api-key header using a tri_test_... key (fully simulated test mode, no real funds) or tri_live_... key (real mainnet payments) — never expose keys client-side. Merchant test mode is simulated, not testnet. Refunds are automatic only (underpaid/overpaid), there is no manual refund endpoint. Always verify webhook HMAC-SHA256 signatures from the X-Tribridge-Signature header before trusting payloads.

# Architecture

> How Tribridge turns a customer wallet transfer into settled funds: address factory, detection, relayer forwarding.

Tribridge acts as a thin coordinator between your customer's wallet and your own payout wallet. Each payment is collected into a single-use deposit address, confirmed on-chain, then forwarded to settlement. Three pillars make this work.

## 1. Deterministic address factory

Every payment request mints a **unique, one-time deposit address** derived deterministically from a master HD seed (BIP-32/39 hardened paths, indexed per chain).

Because each payment gets its own address:

* No memo fields or destination tags needed.
* No address reuse — ever.
* Zero collision risk and maximum customer privacy.
* Effortless reconciliation: one address maps to exactly one payment.

## 2. Multi-chain detection

Our detection engine monitors each supported chain through its native provider:

| Chain | Detection method |
| - | - |
| Solana | Helius webhooks on registered deposit addresses |
| Sui | Always-on polling listener over watched addresses |

Incoming deposits are matched against the expected amount in near real-time. Once the transaction reaches **finality**, the payment is marked confirmed and your webhook fires. Addresses are registered for watching the moment a deposit address is created, and de-registered the moment it is emptied.

## 3. Relayer-funded forwarding

The moment a payment confirms, our relayer forwards the funds from the one-time deposit address to the settlement layer. Critically, **the relayer pays all network gas** — deposit addresses never need to hold a native token balance, so your customers never think about fees and Tribridge absorbs the (tiny, flat) cost.

Sweeps are **batched**: many deposit addresses are emptied in a single transaction, so one network fee covers them all.

* **Capped forwarding:** only the invoiced amount is forwarded — any surplus is never kept (see [Refunds](/refunds)).
* **Automatic refunds:** overpayments are returned and underpayments refunded, with the relayer covering gas.
* **Single-use addresses:** once emptied, each deposit address is retired and removed from the watch list.

## Settlement & gas

Collected funds are held by the platform's settlement vault, then paid out to the payout wallet you link to your account. Network gas is a flat, per-transaction cost that does not scale with payment size — Tribridge absorbs it entirely and it is **never** added to the payment or the 1% processing fee. The vault is funded and managed by Tribridge; your payout wallet remains a destination only you control.

<Note>
  Because funds are moved automatically, deposit addresses are controlled by the platform for a brief window (from detection to forwarding). Tribridge is therefore best described as a **relayer with automatic settlement** rather than fully non-custodial — funds are forwarded to your own payout wallet as soon as they clear.
</Note>


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