> ## 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.

# Core Concepts

> The building blocks of KeyStone settlement infrastructure.

KeyStone coordinates bilateral atomic settlement between institutions on different platforms and chains using on-chain smart contracts.

## The settlement lifecycle

Every settlement follows this pattern:

1. **Instruct** - Both counterparties submit instructions via the API. KeyStone matches them and creates a settlement on-chain.
2. **Comply** - KeyStone screens parties off-chain (LSEG, CipherOwl) and attests results to the ComplianceRegistry on-chain.
3. **Deposit** - Parties deposit their assets directly to the escrow contract. KeyStone is not involved.
4. **Execute** - The last deposit executes the settlement inline once the compliance gate passes: the KeystoneSettlement contract pays every leg to its recipient bound at registration, all-or-nothing. Fully autonomous - KeyStone sends no transaction.
5. **Finalize** - Assets are delivered to counterparties. Both platforms receive confirmation via webhooks.

After compliance clears, the contracts are autonomous. KeyStone's only remaining role is monitoring events and dispatching webhooks - a convenience, not a requirement.

## Building blocks

<CardGroup cols={2}>
  <Card title="Settlements" icon="handshake" href="/concepts/settlements">
    The core transaction object, registered on-chain on the KeystoneSettlement contract.
  </Card>

  <Card title="Templates" icon="file-code" href="/concepts/templates">
    Reusable workflow definitions that control the state machine.
  </Card>

  <Card title="State Machine" icon="diagram-project" href="/concepts/state-machine">
    Contract-enforced transitions with compliance and deposit gates.
  </Card>

  <Card title="Parties and Legs" icon="users" href="/concepts/parties-and-legs">
    Who is involved and what obligations they have.
  </Card>

  <Card title="Compliance" icon="shield-check" href="/concepts/compliance">
    Off-chain screening, on-chain attestation, contract-enforced gate.
  </Card>

  <Card title="Cross-Platform" icon="arrows-left-right" href="/concepts/cross-platform">
    Bilateral instruction matching across platforms.
  </Card>

  <Card title="Tokenised Repo" icon="rotate" href="/concepts/tokenised-repo">
    Two linked DvP settlements for repurchase agreements.
  </Card>
</CardGroup>
