# 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="https://2874846156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDl9PIQunhIbtX5NHobUr%2Fuploads%2FBXbUJsCZNjoHbZfPhGZq%2Fimage.png?alt=media&#x26;token=743b5955-6233-4090-bb53-5e94789514a9" 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.](https://docs.chainspot.io/architecture/transaction-flow)
  {% endhint %}
