Mechanisms of Interaction Between Different Networks with Axelar

48 Views Asked by At

I'm trying to figure out how Axelar links different blockchain types (Cosmos-like and EVM)

Axelar currently allows the following types of cross-chain interactions:

1. EVM - Cosmos

2. EVM 1 - EVM 2

3. Cosmos 1 - Cosmos 2

Axelar itself is built on the Cosmos SDK and can communicate with some blockchains (zones) of the Cosmos ecosystem via the IBC protocol

Do I have the right understanding:

Axelar interacts with EVM networks by one mechanism (threshold signature mechanic) and with cosmos-like networks by another (light client mechanic).

Let's assume that Axelar supports a total of N networks. In this case, X is the number of supported networks in the Cosmos ecosystem, Y is the number of supported networks external to Cosmos (Ethereum, Fantom, Celo, etc.). It turns out that N= X + Y.

In the case of Y "external networks", Axelar has Y RPC connectivity to the nodes of those networks. Technically, this means that Axelar validator nodes are connected to N nodes of supported blockchains. The nodes scan the new blocks for the presence of the Gateway's contracted inevents, gather consensus on those inevents, and write them to the nodes' storage. Cross-chain calls are not delivered to the destination network by Axelar nodes, but by relayers. The delivery process is permisionless.

In the case of X "cosmos networks", Axelar doesn't need RPC.

In the case of X "cosmos-like networks", Axelar communicates according to the Light client model. This means that Axelar has a connection to each of the networks shown in the screenshot above. That is, there is at least 1 relayer between Axelar and each supported Cosmos blockchain, which handles: a) updating the state of the light client b) delivering messages between blockchains


Cosmos-chain A ---> Cosmos-chain B

In the case of interaction between cosmos-like networks, Axelar plays an intermediary role in case Cosmos-chain A and Cosmos-chain B have no IBC connection, but they do have a connection to Axelar. In this case it looks like this:

  1. Cosmos-chain A executes the logic that emits the event
  2. Relayer 1 picks up the event, performs the necessary update of the Axelar light client, and performs a cross-chain call to Axelar.
  3. The transaction with the cross-chain call is checked on the Axelar light client.
  4. Axelar executes logic, which results in the cross-chain call being written to the Axelar storage and the event being emitted.
  5. Relayer 2 listens to the event, performs the necessary update of the light client Cosmos-chain B, performs a cross-chain call to Cosmos-chain B.
  6. The light client Cosmos-chain B checks the transaction with the cross-chain call.
  7. The executed transaction is executed in Cosmos-chain B.

////////////////////////////////////////

Cosmos-chain A ---> EVM

In the case of interaction between Cosmos-chain A and EVM network. The actions are as follows:

  1. Cosmos-chain A executes logic, which IBC makes a call transfer to Axelar
  2. Relay 1 picks up the cross-chain call, updates the light client in Axelar, performs a cross-chain call transfer to Axelar.
  3. The transaction with the cross-chain call is checked on the Axelar light client.
  4. The call is written to the Axelar storage along with the event emit.
  5. A Batch with transaction metadata is formed in Axelar storage. Note: the Batch contains many different transaction metadata, including ours, with no calldata.
  6. The relayer transfers the Batch with transaction metadata to the EVM network.
  7. The smart contract Gateway verifies the threshold signature applied to the Batch.
  8. The relayer forms a transaction c calldata cross-chain call and calls the Gateway smart contract
  9. The smart contract checks if the transaction was in an already accepted Batches.
  10. The cross-chaincall is executed.

////////////////////////////////////////

EVM ---> Cosmos-chain A

In the case of interaction between EVM network and Cosmos-chain A. The actions are as follows:

  1. The EVM executes logic that emits the event through the Gateway.
  2. Axelar nodes connected to the EVM network hear the event and gather consensus for it.
  3. The cross-chain call is recorded from the Axelar repository along with the event emit.
  4. Relay 1 hears the event, updates the light client in Cosmos-chain A, performs a cross-chain transfer of the cross-chain call in Cosmos-chain A.
  5. The light client Cosmos-chain A checks the transaction with the cross-chain call.
  6. Cosmos-chain A executes logic from the transaction.

////////////////////////////////////////

EVM 1 ---> EVM 2

The actions are as follows:

  1. EVM 1 executes logic that emits the event via Gateway.
  2. Axelar nodes connected to EVM 1 network hear the event and collect consensus for it.
  3. The cross-chain call is written to the Axelar storage along with the event emit.
  4. A Batch with transaction metadata is generated in Axelar storage. Note: there are many different transaction metadata in Batch, including ours, with no calldata.
  5. The Relayer transfers the Batch with transaction metadata to the EVM 2 network.
  6. The Gateway 2 smart contract verifies the threshold signature on the Batch.
  7. The Relayer forms a transaction with cross-chain call and calls the Gateway 2 smart contract.
  8. The Gateway 2 smart contract checks if the transaction was in an already accepted Batches. 8 ) The call is executed on the target smart contract.

Is my understanding of this correct? Or is there something I am getting wrong?

1

There are 1 best solutions below

0
On BEST ANSWER

There are some minor inaccuracies or naming differences (for example, the cross-chain calls in EVM to EVM are detected by the relayers, not the validators. It's them submitted to the Axelar Network and voted on by validators running their own nodes) or that we call the "cross-chain call" in stage 6 is first an approval than execution of the endpoint contract.

But overall, upon a brief review, this looks right.