Skip to main content

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.

Cross-platform settlement is the core value proposition of KeyStone. Platform A’s seller and Platform B’s buyer can settle atomically, with contracts handling deposits, execution, and finalization autonomously.

How it works

Both platforms independently submit settlement instructions via POST /instructions. KeyStone matches them automatically when the second instruction arrives with the same trade reference.

1. First instruction

Platform A submits their side of the trade. KeyStone generates a trade reference:
{
  "template_slug": "dvp-standard",
  "role": "seller",
  "party": {
    "external_reference": "seller-001",
    "name": "Acme Securities",
    "wallet_address": "0xSellerWallet..."
  },
  "legs": [
    { "leg_type": "asset_delivery", "instrument_id": "0xTokenAddress", "quantity": "500", "direction": "deliver", "chain_id": 11155111 },
    { "leg_type": "payment", "instrument_id": "0xUSDCAddress", "quantity": "125000", "direction": "receive", "chain_id": 11155111 }
  ]
}

2. Trade reference exchange

Platform A shares the trade reference with Platform B through their own channels. KeyStone does not handle this exchange.

3. Matching instruction

Platform B submits their side with the same trade reference. KeyStone validates that the instructions are compatible (same template, different roles, same instruments, matching quantities, complementary directions) and creates a settlement with both parties confirmed.

4. Settlement proceeds autonomously

After matching, KeyStone handles compliance screening and attestation. From that point:
  1. Both parties deposit to escrow contracts directly (using their own custody provider)
  2. Contracts detect deposits complete and auto-execute the swap
  3. Settlement auto-finalizes
Both platforms receive webhooks at every state transition.

Identity model

KeyStone does not maintain a global identity registry. Each platform provides their own party details in their instruction:
  1. Platform A provides their party’s wallet address, name, and external reference
  2. Platform B provides their party’s wallet address, name, and external reference
  3. The trade reference links the two sides together
  4. KeyStone does not need to know who’s who across platforms
Platforms retain full control over their entity data.

Authorization boundary

Each platform authenticates with its own M2M token. Platforms can only see and manage their own instructions. When instructions match, the resulting settlement is visible to both platforms.

Webhook delivery

In cross-platform settlements, webhooks are delivered to ALL involved platforms, not just the first to submit. Every state change is pushed to every platform that has a party in the settlement.

Cross-chain support

Cross-platform settlements can also be cross-chain. The seller’s bond on Ethereum and the buyer’s USDC on Avalanche settle atomically through per-chain escrow contracts coordinated via LayerZero messaging. See Cross-Chain Settlement for the full guide.