# XOD — exchange integration guide Short version: **credit only final blocks**, **verify instead of trusting**, **withdrawal keys stay with the exchange**. Source of truth: the rule book (XIP-8) and `node/src/api.rs`. Full path list: `/dev/api.html`, `/static/api/openapi.yaml`. ## 1. Asset facts | field | value | |---|---| | name / ticker | XOD / XOD | | type | native layer-1 coin of `xod-mainnet` | | decimals | 8 (amounts in the API are micro-XOD: 1 XOD = 100 000 000) | | max supply | 1 000 000 000 XOD; premine 100 000 000 XOD (10 %: sale 9 %, team 1 %); block reward 20 XOD (1 % to the team) | | consensus | RandomX proof of work (CPU) + AMV finality seal (⅔+1, BFT) | | signatures | every transfer and block: Ed25519 + ML-DSA-65 (FIPS 204), both halves required | | block time | ~15 s; transfers per block ≤ 8 192; transfer ≤ 64 KiB | | fee | ≥ 0.0001 XOD per transfer, burned (the receiver gets the full amount) | | networks | mainnet only — there is no public test network; integrate with small amounts on mainnet | | wXOD (bridge) | SPL token on Solana; XOD sent to the bridge is real. Whether the bridge is open on the current network and the only valid contract addresses — /dev/agents/bridge.md | | explorer | /explorer on any node | | whitepaper | /whitepaper/ on any node | | source code, audit | not public yet / no external audit yet — published by the team when ready | ## 2. Connecting - Site API (convenient): `https:///…` (any node; the list — `/entry`). - Nodes directly (recommended for exchanges): TLS 1.3 only, key exchange `X25519MLKEM768`, self-signed certificate with a **pinned SPKI** from the node list; a wrong pin — refuse. An exchange node package (signed 2 of 3 by the team keys) is provided on request. - Read from **at least two nodes** and compare the hash of the final block at the same height. A mismatch — stop deposits and withdrawals and contact the team. - Errors: HTTP 4xx/5xx with `{"error": "CODE", "detail": "…"}`; `503` — busy, retry. ## 3. When a transfer is final - A block is final when its height ≤ `finalized_height` (`GET /finality`): the AMV seal ⅔+1 twice in a row. Usually 2–3 blocks after inclusion (~30–60 s). With the open AMV (a later era) finality becomes checkpoint-based, ~16 min; `finalized_height` stays the one number to watch. - Finality is never rolled back: two final blocks on different branches stop the node itself (`FINALITY_CONFLICT`). - Stop signals: `update_required` not empty, `finality_lag` growing, different `finalized` on two nodes. ## 4. Deposits 1. Give every customer their own ordinary address `x01…` (62 characters, lowercase), created by the exchange wallet. 2. Scanner: for `h` from the last processed + 1 to `finalized_height`: `GET /block//txs`; credit `amount_micro` of every transfer whose `to` is yours. Key: the transfer `id` (never credit twice). Store "processed up to h" and the block hash. 3. Trust-minimised check: the block hash matches on two nodes; the summary matches the block bytes (`raw`); optionally the balance via `GET /account/
` with its SMT proof to the final `state_root`. 4. A new account is created only by an incoming transfer ≥ 1 XOD; tell customers "minimum first deposit 1 XOD". ## 5. Withdrawals 1. Withdrawal keys live on the exchange machine; the node gets only a signed transfer. 2. `nonce = account.nonce + mempool.pending + 1` (≤ 64 pending per account). 3. Transfer JSON: `wire_version 3`, `chain_id "xod-mainnet"`, `genesis_hash`, `fee_micro ≥ 10000`, `priority_fee_micro ≤ 50000`, `expiry_height ≤ height + 1440`, Ed25519 + ML-DSA-65 signature. The first transfer of an account carries the keys. 4. `POST /tx` → `id`; the same transfer again gives the same `id` (no double spend). 5. Wait for `GET /tx/` = **`final`**; `dropped` + `code` — not included; after `expiry_height` sign a new one. 6. Ready tool: the `xod` CLI (`xod wallet send`, `xod wallet tx `), signed 2 of 3, self-checking. ## 6. Address kinds | prefix | what | for exchanges | |---|---|---| | `x01` | ordinary account | deposit addresses — only these | | `x0t1` | one-time address (era 1) | never a deposit address (receives once); withdrawing to it is fine | | `x0c1` | Photon 0 channel account (era 1) | never a recipient | | `x0n1` | node id | not a money address | ## 7. Security contact Vulnerabilities: see `SECURITY.md` in the release (acknowledgement within 72 h). Do not send keys or passwords to anyone — the team never asks for them. ## 8. Your own node, turnkey The exchange runs its own node; the team never holds the exchange keys. One script — `xod-cage` (Ubuntu 22.04/24.04): 1. `xod-cage --apply` — the cage: user `xod`, systemd hardening, firewall only for the node ports, SSH untouched. 2. `xod-cage --keygen ` — node keys are created **on the server** (`/var/lib/xod/security`, 0700/0600); only the public part leaves (`host_public.json`). 3. `xod-cage --write-config` — `node.toml` (no reward address — mining off; the admin port stays on loopback). 4. `xod-cage --install ` — the node binary: installed only if the release is signed **2 of 3** by the team keys, not older than the installed one, and the node's own `--check-config` matches the pinned genesis and keys. 5. `xod-cage --network` — the node sees ≥ 2 peers, the pinned genesis and a growing finality. `xod-cage --check` — any time, changes nothing. Machine: 4 cores, 8 GB RAM, SSD, a public IP (P2P port open). Updates: the next signed release, same `--install`. ## 9. Verify, do not trust - Every answer of a node is a hint. The light client checks the header chain and the ⅔+1 AMV seal itself (`/headers`, `/finality`, `/epochs`) and an account by its SMT proof to the final `state_root` (`/account/
` → `proof`). - Release check by yourself: `xod_release_tool verify-published ` — the same 2-of-3 check the cage does. - Post-quantum channel to the same API: `wss:///wire` (XOD-WIRE-1, open package `xodwire`). ## 10. wXOD on Solana - **XOD** (this chain) and **wXOD** (an SPL token on Solana) are different assets: list the one you actually hold. wXOD is backed by XOD locked in the network and minted only against XOD locked in the bridge reserve (1 : 1). - Bridge status and the only valid addresses: /dev/agents/bridge.md. The Solana bridge opens after checks and an audit; the Ethereum bridge of the previous chain is closed. The way back wXOD → XOD (burn on the bridge) is on from block 1 (genesis rule 1). - The daily mint limit is shared by all networks; the bridge can be paused by the team multisig. ## 11. Network changes (eras) - Rules change only by an **era record** (team 2 of 3 + 90 % of miners) with a height `not_before`; nodes announce it in `/status` (`update_required`, era warnings) long before the height. Watch `/status` and the release list. - Coming eras: open AMV (miners join the finality council), subnets, hash-time locks (HTLC). None of them changes addresses, transfers or deposits; `finalized_height` stays the one number to watch. ## 12. Listing checklist 1. Own node (§8) + a second source for the final hash (§2). 2. Deposit scanner by `finalized_height`, key = transfer `id` (§4). 3. Minimum first deposit 1 XOD shown to customers (§4). 4. Withdrawals signed on the exchange machine, `nonce` rule, wait for `final` (§5). 5. Only `x01…` deposit addresses (§6); checksum checked on input. 6. Refusal codes handled (`/dev/api.html`); `503` — retry. 7. Stop signals wired: different `finalized` on two nodes, `finality_lag` growing, `update_required` (§3, §11). 8. Sandbox run with 2–10 XOD on mainnet (`/dev/sandbox.html`). 9. XOD vs wXOD decided (§10). 10. Security contact saved (§7).