Skip to content

Commit

Permalink
chore: add intent focused lense to express docs (#1112)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin852 authored Aug 20, 2024
1 parent e5d4202 commit 7ac8146
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
Binary file added public/images/intent-diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 20 additions & 17 deletions src/pages/dev/general-message-passing/express.mdx
Original file line number Diff line number Diff line change
@@ -1,53 +1,56 @@
# Introduction to the Axelar Express Service
# Axelar Intents (Express Service)

Axelar's Express Service allows interchain [GMP](/dev/general-message-passing/overview) transactions to execute significantly more quickly than regular GMP transactions.
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](/dev/general-message-passing/overview) 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](/learn/txduration), taking up to 80 minutes to achieve finality.

The Express Service skips this wait time by executing the transaction 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:
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:

* [Express transaction](https://axelarscan.io/gmp/0x4dbf091ebf31157bf73995c0fb473f115888bd1f11793359807d543ada03f021:11): **18 seconds** transaction time
* [Non-Express transaction](https://axelarscan.io/gmp/0xc3653cda8535c59e0418b57250c504528a493dd5556fc4cb71b80f8c0a867e62:2): **28 minutes** transaction time
- [Express transaction](https://axelarscan.io/gmp/0x4dbf091ebf31157bf73995c0fb473f115888bd1f11793359807d543ada03f021:11): **18 seconds** transaction time
- [Non-Express transaction](https://axelarscan.io/gmp/0xc3653cda8535c59e0418b57250c504528a493dd5556fc4cb71b80f8c0a867e62:2): **28 minutes** transaction time

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.

<img src="/images/intent-diagram.png" height="350" />

## Integrate your app with the Express Service

**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](#funding) as insurance for the Express transaction.
1. Provide [liquidity](#funding) as insurance, ensuring that the intent fulfillment by the executor can proceed smoothly.
2. Have your app contract [inherit](#axelar-executable-vs-axelar-valued-express-executable) from either the [`AxelarExpressExecutable`](https://github.com/axelarnetwork/axelar-gmp-sdk-solidity/blob/main/contracts/express/AxelarExpressExecutable.sol) or the [`AxelarValuedExpressExecutable`](https://github.com/axelarnetwork/axelar-gmp-sdk-solidity/blob/main/contracts/express/AxelarValuedExpressExecutable.sol) contracts.
3. Fill out and submit the [required onboarding information](#required-onboarding-information) through the [Axelar Express Integration Form](https://docs.google.com/forms/d/e/1FAIpQLSeIpbcdEzQQY0k00leK2jrOnR0KUUJlKc2SzeNzENyLWs80jA/viewform).

### Required onboarding information

The following information is required for an Express relayer to be configured for your app:
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
- 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](https://docs.google.com/forms/d/e/1FAIpQLSeIpbcdEzQQY0k00leK2jrOnR0KUUJlKc2SzeNzENyLWs80jA/viewform).

## Axelar Executable vs. Axelar Valued Express Executable

Regular Express Executables have tokens being sent with them. With the Valued Express Executable, the relayer is able to calculate the value of a GMP message in the event that the message itself has a value with no tokens being sent.
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 that the call is worth.
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 relayer dynamically queries the value of the payload from the contract itself, in terms of how much amount and in what token it will need to loan if allowlisted.
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 time the call is triggered 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](#fees) involved.

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](#fees) involved.

## Express ITS tokens

Expand Down Expand Up @@ -77,17 +80,17 @@ await api.estimateGasFee(
sourceContractAddress: sourceChainAddress,
destinationContractAddress: destinationChainAddress
tokenSymbol: "axlUSDC", //aUSDC for testnet
}
}
)
```

## Risks

Using the Axelar Express Service comes with risks. Please keep these in mind when integrating your contracts.
Using the Axelar Express Service comes with risks. These risks are primarily associated with intent-driven execution before finality.

### Funding

Since the Express service instantly executes the transaction 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](https://cointelegraph.com/explained/what-is-chain-reorganization-in-blockchain-technology)) could lead to funds being lost.
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](https://cointelegraph.com/explained/what-is-chain-reorganization-in-blockchain-technology)) 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.

Expand Down

0 comments on commit 7ac8146

Please sign in to comment.