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

# Programs Overview

> Summary of all x0 on-chain programs, their purposes, and deployment addresses.

## Deployed Programs

All programs are built with **Anchor 0.30.1** on **Solana 1.18.22** and use the **Token-2022** token standard.

<Columns cols={2}>
  <Card title="x0-guard" icon="shield-halved" href="/protocol/guard">
    Policy enforcement via Token-2022 transfer hook. Rolling window spend limits, whitelist verification (Merkle, Bloom, Domain), and privacy levels.
  </Card>

  <Card title="x0-token" icon="coins" href="/protocol/token">
    Token-2022 mint with TransferFee (0.8%), TransferHook (x0-guard), and optional ConfidentialTransfer extensions.
  </Card>

  <Card title="x0-escrow" icon="handshake" href="/protocol/escrow">
    Conditional escrow with 7-state machine: create → fund → deliver → release. Supports dispute resolution with arbiter and auto-release timeout.
  </Card>

  <Card title="x0-registry" icon="magnifying-glass" href="/protocol/registry">
    Agent discovery service. Agents register with endpoint URLs and capability metadata. Supports activation/deactivation lifecycle.
  </Card>

  <Card title="x0-reputation" icon="star" href="/protocol/reputation">
    On-chain reputation oracle. Tracks success rate, dispute rate, failure rate, and response time. Weighted scoring with monthly decay.
  </Card>

  <Card title="x0-wrapper" icon="repeat" href="/protocol/wrapper">
    1:1 USDC-backed stablecoin wrapper. Deposit USDC → mint x0-USD, burn x0-USD → redeem USDC. Timelocked governance with emergency pause.
  </Card>

  <Card title="x0-zk-verifier" icon="lock" href="/protocol/zk-verifier">
    On-chain Groth16 zero-knowledge proof verification for confidential transfers. Validates PubkeyValidity, ZeroBalance, Withdraw, and Transfer proofs.
  </Card>

  <Card title="x0-zk-proofs" icon="wand-magic-sparkles" href="/protocol/zk-proofs">
    Off-chain WASM library for client-side proof generation. Compiled to WebAssembly for browser and Node.js environments.
  </Card>
</Columns>

## Shared Library: x0-common

The `x0-common` crate provides shared infrastructure used by all programs:

| Module         | Contents                                                                                     |
| -------------- | -------------------------------------------------------------------------------------------- |
| `constants.rs` | \~100 protocol constants: fees, time windows, limits, PDA seeds, account sizes, CU estimates |
| `error.rs`     | 7 error enums with \~122 structured error codes (0x1100–0x1721)                              |
| `events.rs`    | 27 event structs emitted by all programs                                                     |
| `state.rs`     | Shared types: `EscrowState`, `Capability`, `AdminActionType`                                 |
| `utils.rs`     | Fee calculation, hashing, timestamp validation                                               |
| `whitelist.rs` | `WhitelistMode` enum, Merkle/Bloom/Domain verification functions                             |

## Technology Stack

| Layer           | Technology                                      |
| --------------- | ----------------------------------------------- |
| Runtime         | Solana 1.18.22                                  |
| Framework       | Anchor 0.30.1                                   |
| Token Standard  | Token-2022 (SPL Token Extensions)               |
| Extensions Used | TransferHook, TransferFee, ConfidentialTransfer |
| Cryptography    | Twisted ElGamal, Groth16, Ristretto255          |
| ZK SDK          | `solana-zk-token-sdk`                           |
| Client SDK      | TypeScript (`@x0-protocol/sdk`)                 |
| WASM            | `wasm-bindgen` + `wasm-pack`                    |
