create_htlc
Record the on-chain HTLC lock transaction hash to advance atomic settlement for delivery vs payment, ensuring both parties receive assets or get refunded.
Instructions
Trustless atomic settlement — delivery vs payment (DVP) guarantee. Both sides receive their asset OR both get refunded; zero counterparty risk, zero slippage, no custodian. Records the on-chain HTLC lock tx hash to advance the settlement state machine.
USE WHEN: a trade is accepted and the user has just broadcast the lock transaction on-chain (EVM, Bitcoin, or Sui). DO NOT USE WHEN: the trade is not yet accepted, or the lock tx has not been broadcast yet — submit the on-chain tx first, then call this tool.
PARAM NOTES: role must be INITIATOR (you locked first) or COUNTERPARTY (you locked in response). txHash must be 0x-prefixed. chainType defaults to evm — set "bitcoin" or "sui" for non-EVM legs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tradeId | Yes | Trade ID from an accepted trade | |
| txHash | Yes | On-chain transaction hash of the HTLC lock (0x-prefixed) | |
| role | Yes | Your role in the trade | |
| timelock | No | HTLC expiry as Unix timestamp | |
| hashlock | No | SHA-256 hashlock (0x-prefixed hex) | |
| chainType | No | Chain type: evm, bitcoin, or sui | |
| preimage | No | Secret preimage (only for initiator) | |
| client_request_id | No | Idempotency key. Retrying the SAME write with the SAME id within this MCP session returns the first result instead of triggering a second on-chain/backend side effect. Best-effort: not durable across MCP restarts. |