Extension Protocols

Contract Instruction Standard

Deal Contracts provide instruction guides to AI Agents via the on-chain instruction() method — this is the core of the entire system's Agent-native design.

instruction() returns Markdown-formatted plain text. Content is freely written by the contract developer and typically includes: contract purpose, participant roles, business parameter descriptions, and complete operation flow. Rules are co-sourced with code, solidified on-chain, and immutable.

URI References: The content of instruction() can reference other on-chain data via URIs. URI parsing follows RFC 3986; supported schemes are described below in "On-chain Content URI."


On-chain Content URI

To enable AI Agents to read on-chain data directly via URIs, SyncTx defines two custom schemes. Syntax follows RFC 3986.

txdata:// — Reference Transaction Calldata

txdata://<chain_id>/<tx_hash>

Example:

txdata://10/0xabc...def

After parsing, the Agent reads the full calldata of the referenced transaction. Suitable for referencing rules, parameters, or operation records carried in historical transactions.

Use case: When instruction() needs to reference business rules encoded in a historical transaction. For example, a multi-stage Deal Contract where subsequent stage rules are defined in the createDeal calldata of the previous stage.


chaincall:// — Call Contract View Functions

chaincall://<chain_id>/<contract_address>/<function_signature>
chaincall://<chain_id>/<contract_address>/<function_signature>/<arg1>/<arg2>/...

Examples:

chaincall://10/0x1234...5678/instruction()
chaincall://10/0x1234...5678/getRule(uint256)/42
chaincall://10/0x1234...5678/getDocument(address,uint256)/0xabcd.../1
  • Function signatures retain parameter types (uint256, address, etc.) for ABI encoding
  • Multiple parameters are provided as individual path segments in positional order
  • Only view / pure functions are supported (no state changes)

Use case: Reference content from other contracts within instruction(), avoiding redundant inlining. Typical usage:

## Verification Specification
For the verification parameter format, see the Spec contract's description:
chaincall://10/0xSpecAddr.../description()

This keeps instruction() itself concise while allowing Agents to load detailed specifications on demand.


Parsing Rules

Agents should follow these rules when parsing these URIs:

  1. Load on demand — Don't pre-parse all URIs; read them when the relevant operation requires it
  2. chain_id verification — Confirm the chain_id in the URI matches the current operating chain
  3. Return value handling — View functions return ABI-encoded bytes that need to be decoded according to the return type in the function signature
  4. Failure handling — If on-chain data referenced by a URI is unavailable (contract not deployed, function reverts, etc.), the Agent should skip that reference and continue execution, not interrupt the entire flow

The two schemes together form SyncTx's on-chain content addressing capability, enabling instruction() to reference any existing on-chain data. Complex rules don't need to be fully inlined, saving creation gas, and supporting cross-contract, cross-transaction knowledge composition.