Axelar Intents (Express Service)

Intents allow for the execution of a user’s intention in a more flexible and efficient path. Users can simply let the network know of the end result that it wants to be achieved and off-chain solvers stand ready to determine how the intent can best be fulfilled.

Axelar makes use of intents in its Express Service. This service allows for interchain GMP transactions to execute significantly more quickly than regular GMP transactions.

Axelar requires a GMP transaction to be finalized on the source chain before it can be executed on the destination chain. Some source chains have a long transaction time, taking up to 80 minutes to achieve finality.

The Express Service bypasses this wait time by allowing for the execution of the intent of the sender on the destination chain before the source chain transaction is completely finalized. The following are two example transactions that took place between the Linea and Polygon chains:

Think of it as a loan: funds on the destination chain are “loaned out” to the app while the transaction is still being finalized on the source chain. Once the transaction is finalized on the source chain and goes through the Axelar network, the funds that are sent through the Axelar network are used to pay back the Express Relayer on the destination chain which loaned out the funds.

Your browser does not support SVG

Your application must be onboarded by the Interop Labs team to integrate with Express. Simply extending the AxelarExpressExecutable or AxelarValuedExpressExecutable contracts is not enough.

To onboard your app to the Express Service:

  1. Provide liquidity as insurance, ensuring that the intent fulfillment by the executor can proceed smoothly.
  2. Have your app contract inherit from either the AxelarExpressExecutable or the AxelarValuedExpressExecutable contracts.
  3. Fill out and submit the required onboarding information through the Axelar Express Integration Form.

The following information is required to configure an Express relayer to act as an executor for your app’s intents:

  1. The address of the contract integrating with Express
  2. The assets (tokens) to be sent in Express transactions from that contract
    • The maximum value to be Expressed in a single GMP call
    • The maximum value to be Expressed in a 30-minute window
  3. The EVM chains to be enabled for Express transactions

Please provide this information via the Axelar Express Integration Form.

Regular Express messages carry tokens with them, ensuring straightforward intent fulfillment. However, with the Valued Express Executable, the executor dynamically evaluates the value of a GMP message, even when the intent does not involve transferring tokens directly.

If your app requires Express support for arbitrary GMP messages, where the value of the payload can alter the state of the contract, you can use the Valued Express Executable. Call either the contractCallWithTokenValue() or callContractValue() function to trigger your interchain transaction. These functions will return the value of the intent.

If the tokenAddress is 0, then the value will be set in terms of the native token. Otherwise, it will be set in terms of the token address.

Under the hood, the executor dynamically queries the value of the intent from the contract itself, in terms of how much amount and in what token it will need to loan if allowlisted.

Protocols that integrate with the Valued Express Executable must keep the following in mind:

  1. They must be whitelisted, since the relayer cannot trust arbitrary contracts.
  2. The value of the payload in terms of a token is not state or time dependent, so the value cannot change between the intent’s origin on the source chain and when it is executed on the destination chain. This restriction can be removed, but since it will require the relayer to assume more risk, there will be an additional fee involved.

Interchain Tokens that were deployed via the Interchain Token Service can also be integrated with the Express Service. After integration, an ITS token will use AxelarValuedExpressExecutable instead of AxelarValuedExecutable, as the value in an ITS transaction is in the payload.

Express transactions require an additional fee of $1 USD per call alongside existing GMP fees. This extra fee acts as insurance for the Express relayer for assuming the risk of an Express transaction. If the fee is not paid, the transaction will revert to a regular non-Express GMP transaction.

The estimateGasFee() function provides the estimated cost when estimating gas for an interchain transaction. This same function can be used to estimate gas costs for an Express transaction. You’ll just need to provide some more information to help it specify an accurate gas estimation.

For example, in an Express transaction from Polygon to Avalanche:

await api.estimateGasFee(
"Polygon",
"Avalanche",
"MATIC",
500000,
1.1,
"0",
{
showDetailedFees: true,
transferAmount: inputTokenAmount, // In terms of symbol, not unit denom, e.g. use 1 for 1 axlUSDC, not 1000000
sourceContractAddress: sourceChainAddress,
destinationContractAddress: destinationChainAddress
tokenSymbol: "axlUSDC", //aUSDC for testnet
}
)

Using the Axelar Express Service comes with risks. These risks are primarily associated with intent-driven execution before finality.

Since the Express service instantly executes the intent on the destination chain, any changes on the source chain between the time the transaction is sent and the time it is finalized (for example, due to a block reorg) could lead to funds being lost.

These funds would be lost because the transaction will have been instantly executed on the destination chain on the assumption of logic that never took place on the source chain.

To mitigate this risk, liquidity must be provided to the Express relayers for all Express transactions. This liquidity will act as insurance against the risk the relayer takes when loaning out funds on the destination chain. The amount of funds should match the value of the transaction itself, and will be returned when the transaction has finalized on the source chain.

In a non-Express transaction, an Axelar relayer triggers a transaction with either the execute() or executeWithToken() function. The GMP payload can be assumed to be true as it passes through the validation process on the Axelar Gateway. However, in an Express call, the execution on the destination chain occurs before the source chain finalizes. Thus, you cannot rely on the validation process.

Instead, use the commandID, the transaction’s unique identifier on the destination chain, to reconstruct the message that was passed in.

The Call Contract with Token (Express) sample contract is an example of a contract that executes with the Express Service. The implementation is an Axelar GMP integration that inherits from AxelarExpressExecutable rather than AxelarExecutable.

Edit on GitHub