# Asterizm Client Server Module

## Intro

This module is implemented based on the off-chain and on-chain infrastructure of the cross-chain messaging protocol Asterizm.

{% hint style="info" %}
**Asterizm was chosen as the first AMB provider for implementing the logic of omnichain DeFi positions, as it offers the most optimal speed and cost for cross-chain transactions as of Q4 2024.** The protocol provides transaction costs of around $0.10, coupled with the highest message delivery speed compared to other known protocols in the industry. This combination makes Asterizm a compelling choice for projects seeking efficient cross-chain communication.

For more detailed information about the Asterizm infrastructure, you can visit their documentation at [docs.asterizm.io](https://docs.asterizm.io/).
{% endhint %}

## Overview

The Chainspot Client Server module functions as an off-chain module within the Asterizm infrastructure, facilitating the transportation of payloads between blockchains. \
The most important role in processing and verifying cross-chain transactions plays an on-chain Asterizm client, that calculates and checks proofs from payload and hash this smart contract receives from Chainspot Client Server and Asteriz Relayers.&#x20;

This design enables efficient cross-chain communication, allowing for seamless transactions while ensuring the integrity and reliability of the data being transferred.

<figure><img src="/files/JU3lrSVugxzZp61XNXPj" alt=""><figcaption><p>Asterizm architecture</p></figcaption></figure>

The transaction flow within the Chainspot protocol, utilizing the Asterizm infrastructure, follows a secure and trustless model:

1. **Payload Submission**: The payload is sent to the immutable Chainspot smart contract, which inherits the abstract methods from Asterizm for sending and receiving data. The contract computes a hash of the payload directly.
2. **Client Server Retrieval**: The Chainspot client server retrieves the payload, while the hash is collected by the relayer servers of the Asterizm protocol.
3. **Payload Execution in Destination Network**: When the payload arrives at the destination network's immutable Chainspot smart contract, it undergoes a re-computation of the hash to ensure it matches the one received from the Asterizm relayer servers.
4. **Validation and Execution**: If the hashes match, the payload is executed, such as withdrawing funds from a DeFi position or claiming rewards. If they do not match, the transaction is deemed invalid.

This approach enhances security by leveraging a trustless infrastructure, ensuring the safety of user funds even if the off-chain module of Chainspot is compromised. This method emphasizes the reliability and integrity of transactions across different blockchain networks.

{% hint style="info" %}

* [Learn more about Asterizm cross-chain transaction flow and security mechanics.](https://docs.asterizm.io/guides/transaction-flow)
* [Learn more about transaction flow in Chainspot protocol.](/architecture/transaction-flow.md)
  {% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.chainspot.io/architecture/asterizm-client-server-module.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
