Flow overview
Step 1: Platform A submits seller instruction
Platform A creates their side of the settlement:trade_reference:
Step 2: Share trade reference
Platform A shares the trade reference with Platform B through their own communication channels (API integration, OTC desk, email, etc.). The generated reference is unguessable and acts as the matching capability, so only a party it was shared with can submit the counterpart. A trade reference Platform A chose itself would not match here: caller-chosen references pair only within their own environment, so for cross-platform settlement the first instruction must be submitted withtrade_reference: null and the generated reference shared. Both environments must also be the same type - a development instruction never pairs with a production one, whatever reference it presents - see match scope.
Step 3: Platform B submits buyer instruction
Platform B submits the counterpart instruction with the same trade reference:status: "matched" and the new settlement_id.
Both platforms authenticate with their own M2M tokens. Each platform can only see and manage their own instructions.
Step 4: Compliance and autonomous execution
Once both instructions are confirmed, the settlement is created on-chain with both parties confirmed. KeyStone handles compliance screening and attestation. After compliance clears:- Both parties deposit to escrow contracts using their deposit secrets (via their own custody provider)
- The final deposit executes the settlement atomically - every leg pays the recipient bound at registration
- Settlement auto-finalizes
Monitoring
Both platforms can track the settlement:Cancelling before confirmation
If Platform A wants to cancel before Platform B submits:pending_match instructions can be cancelled. Once confirmed, the settlement follows its normal lifecycle.
Cross-chain variant
Legs may live on different chains. Each leg must name a chain the environment has an active settlement contract on, which you can read fromGET /v1/chains; a leg naming any other chain is rejected at registration. Where the leg set spans more than one chain, the KeystoneRouter coordinates release across them and the assets never bridge.