> For the complete documentation index, see [llms.txt](https://docs.escher.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.escher.finance/key-features/ica-controller.md).

# ICA Controller

The Contract Handler is a critical component in managing data transport between different blockchain types, such as from one Cosmos chain to another or from a Cosmos chain to an EVM chain. Nomos relies on IBC for this data transport, but because IBC is not natively supported by EVM and not all Cosmos chains support some required IBC modules like the ICA Host and ICQ Host modules, we have developed smart contracts for both Cosmos and EVM.

**Smart Contracts Developed by Nomos:**

**COSMOS**:

1. **ICA Controller Cosmos Contract**
2. **ICQ Controller Cosmos Contract**

**EVM**:

1. **ICA Controller EVM Contract**
2. **ICA Host EVM Contract**

**Functionality of Contract Handlers**

**Contract Handler Overview**: The contract handler is responsible for managing the transmission and reception of packets to and from target accounts on both EVM and Cosmos networks. It ensures seamless communication and data integrity between different blockchain ecosystems.

**Cosmos**:

* **Controller Chain**: On Cosmos, the contract handler operates mainly on the controller chain. It includes the ICA controller and the ICQ controller, along with middle contracts necessary for specific operations (e.g., a swapping contract for Osmosis). Typically, the host chain does not require these handlers.
* **Components**:
  * **ICA Controller**: Manages interchain accounts and facilitates cross-chain writes.
  * **ICQ Controller**: Handles interchain queries, enabling cross-chain reads.
  * **Middle Contracts**: Specific contracts required for certain operations, such as asset swaps.

**EVM**:

<figure><img src="https://nomos-ms.gitbook.io/~gitbook/image?url=https%3A%2F%2F3571369610-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1fHo5L80uITHHYzA4XbJ%252Fuploads%252FaHZjVYWAloJ6mxW4INFF%252Fimage%2520%2824%29.png%3Falt%3Dmedia%26token%3Dd017f7e1-be5e-41d6-a44a-139f39297145&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=b6654cac&#x26;sv=1" alt=""><figcaption></figcaption></figure>

* **Packet Management**: On EVM, the contract handler is responsible for receiving packets from other chains and managing their distribution within the EVM network. It determines how to send packets, including decoding and encoding messages.
* **Cross-Chain Operations**: The handler also facilitates communication from EVM to Cosmos, ensuring that all necessary contracts are in place to build the Nomos connections.
* **Components**:
  * **ICA Controller**: Manages cross-chain queries and ensures accurate data retrieval and verification when EVM is the "controller/main" chain
  * ICA Host: Manages cross-chain queries and ensures accurate data retrieval and verification when EVM is the "target/host" chain
  * **Message Handling**: Manages the encoding and decoding of messages to ensure compatibility and integrity across different blockchain platforms.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.escher.finance/key-features/ica-controller.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
