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

# Introduction

> KeyStone OS - bilateral atomic settlement infrastructure for tokenized real-world assets.

## What KeyStone does

KeyStone coordinates bilateral atomic settlement between institutions on different platforms and chains. One integration, every counterparty, any chain.

Both counterparties submit settlement instructions independently via KeyStone's REST API. KeyStone matches the instructions, runs compliance, and creates a settlement on-chain. From there, smart contracts handle everything autonomously - deposits, atomic execution, and finalization.

* **Bilateral atomic DvP** - Delivery vs. Payment: both sides of a trade (the asset delivery and the payment) settle simultaneously, or neither does. No partial execution.
* **Cross-platform** - Platform A's seller and Platform B's buyer in a single atomic settlement.
* **Cross-chain** - Bond on Ethereum, USDC on Avalanche. Assets never bridge. LayerZero coordinates.
* **Autonomous post-compliance** - After compliance clears, contracts handle deposits, execution, and finalization.
* **No custody** - KeyStone never holds funds. Escrow contracts have no admin keys.

## Architecture overview

```mermaid theme={null}
%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#1a3a35', 'primaryTextColor': '#e0f2ef', 'primaryBorderColor': '#2DD4A8', 'lineColor': '#2DD4A8', 'secondaryColor': '#162e2a', 'tertiaryColor': '#0f2420', 'clusterBkg': '#0f2420', 'clusterBorder': '#1AAF8B', 'edgeLabelBackground': '#0c1c19', 'nodeTextColor': '#e0f2ef'}}}%%
flowchart TB
    subgraph "Client Layer"
        PA[RWA Platforms]
        Inst[Institutions]
    end

    subgraph "KeyStone"
        subgraph "On-Chain Protocol"
            SC[KeystoneSettlement<br/>Escrow + fixed lifecycle]
            CR[ComplianceRegistry<br/>Attestation gate]
        end
        subgraph "Off-Chain Services"
            API[REST API]
            Oracle[Compliance Oracle]
            Webhooks[Webhook Relay]
        end
    end

    subgraph "Per-Chain Escrow"
        EscA[Escrow - Chain A]
        EscB[Escrow - Chain B]
    end

    PA & Inst -->|"instructions"| API
    PA & Inst -->|"direct calls"| SC
    API --> SC
    Oracle -->|"attest()"| CR
    SC -->|"checks gate"| CR
    SC <-->|"LayerZero"| EscA & EscB
```

## Key concepts

| Concept         | Description                                                                                |
| --------------- | ------------------------------------------------------------------------------------------ |
| **Settlement**  | A coordinated bilateral transaction between parties, enforced by on-chain contracts.       |
| **Template**    | A reusable definition of a settlement workflow: states, transitions, gates, and roles.     |
| **Party**       | An entity in a settlement with a specific role (buyer, seller). Details provided inline.   |
| **Leg**         | A single obligation within a settlement (asset delivery, payment).                         |
| **Instruction** | One side of a trade, submitted via the API. Two matching instructions create a settlement. |

<Card title="Next: Quickstart" icon="arrow-right" href="/getting-started/quickstart">
  Get your first settlement running in minutes.
</Card>
