Guide to Axelar
September 23, 2022
Introduction to Axelar
While bridges all have a similar goal, Axelar is working toward a vision of web3 interoperability that goes beyond bridges. Axelar is a blockchain that connects blockchains — a PoS blockchain acting as an overlay network, delivering secure cross-chain communication. According to the protocol foundation, developers use Axelar to build dapps that let their users interact with any asset or application, on any chain, with one click.
Axelar provides APIs and a software development kit (SDK) sitting atop a dynamic validator set running permissionless protocols. As of September 2022, Axelar connects to 15 external chains on mainnet: Ethereum, the Cosmos Hub, Avalanche, Polygon, BNB Chain, Osmosis, Terra, Fantom, Moonbeam, Juno, Injective, Secret Network, Crescent Network, Kujira, and e-Money. Axelar is built using the Cosmos SDK. It connects the EVM and Cosmos ecosystems, and is well-positioned to expand into other ecosystems.
In their white paper published in January 2021, Axelar's co-founders were the first to describe a method for securely passing arbitrary messages between blockchains. Axelar calls this feature General Message Passing, and rolled it out in March of 2022. General Message Passing opens the door for a number of novel use cases including, cross-chain borrowing and lending, cross-chain liquidity aggregators, and cross-chain NFT exchange and borrow/lend.
Developers can build applications on a particular blockchain that best fits their use case, while allowing users from other blockchains to interact with applications, assets, and native users.
The AxelarJS SDK helps handle certain complexities of cross-chain transactions. For example, Axelar's gas and executor services provide logic that enables users to pay fees one-time, using the source-chain token. Users don't have to swap into the AXL token or the destination-chain token to execute logic cross-chain.
In summary, Axelar aims to let developers deliver secure cross-chain interactions via a smooth user experience, using simple APIs and a developer-friendly SDK.
Tech stack overview
Axelar’s technology stack consists of four main categories: APIs and an SDK, external ‘Gateways,’ two permissionless protocols, and a dynamic validator set that generates the Axelar blockchain itself. The Axelar blockchain routes messages between Gateways on external chains using two specialized protocols:
Cross-Chain Gateway Protocol (CGP): The CGP is responsible for routing messages from blockchain to blockchain. It enables Axelar validators to perform read and write operations via Gateways deployed on external chains based on transactions submitted to other Gateways. It is comparable to the internet Border Gateway Protocol.
Cross-Chain Transfer Protocol (CTP): The CTP is anapplication-level protocol that sits above the CGP.It’s responsible for transmitting messages from full nodes on connected external chains to Axelar validators. This means that developers canuse the CTP to interact with applications on Axelar-connected chains using simple API calls. CTP is comparable to the application-level protocols File Transfer and Hypertext Transfer Protocols on the internet.
Source: Axelar, March 2022
So, how does the flow of information work on Axelar? Let’s break this down with an example. Source chain initiates an action:
An Avalanche application/user wants to transfer a token to Ethereum.
The Avalanche application calls the Axelar API to transmit a message to the Avalanche blockchain’s Gateway.
Axelar validators have nodes on Avalanche, which read the message submitted to the Avalanche Gateway.
The message gets relayed to the Axelar blockchain:
Axelar validators vote to determine the validity of the message.
If a supermajority of the validators read and validate the message, it is considered valid and recorded on the Axelar blockchain
Once the message is recorded on the Axelar blockchain, the CGP is used to handle translation (if needed) and routing to Ethereum blockchain's Gateway.
The message gets relayed to the destination chain:
Relayers deliver the validated transaction to the Ethereum Gateway.
Once the Gateway Contracts receive the message, the Axelar SDK will handle the required gas payments and execute the logic it contains (i.e., completing a token transfer from Avalanche to Ethereum).
Source: Diagram provided to Coinbase Cloud by Axelar
Now that the transaction flow has been broken down, you may be wondering how Axelar validators submit transactions on external chains. This is where the exciting cryptography behind Axelar comes into play. On each external blockchain, Axelar validators collectively control the Gateways with read-write capability. Control of the Gateways is maintained using a threshold signature scheme and multiparty computation, which allows for validators to submit a piece of a signing key, or key share. If there is a threshold number of key share signatures, as required by the protocol, the message is signed and valid.
The Axelar blockchain uses Tendermint consensus — the standard consensus method within the Cosmos ecosystem.
As of September 2022, Axelar’s active set is limited to the top 50 validators ranked by stake. Validators on Axelar are responsible for:
Reading, writing, and achieving consensus about messages submitted to Axelar Gateway Contracts.
Recording messages on the Axelar blockchain (a supermajority of validators must come to consensus for a message to be recorded on the Axelar blockchain).
Maintaining nodes on connected chains.
While running external full nodes is not required for Axelar validators, network incentives favor those that do. By distributing an additional 1% of inflationary rewards for supporting each network, validators are incentivized to run full nodes for chains that have less support than others. This encourages full node availability for all supported networks on Axelar.
Quadratic voting, which assigns each validator voting power equivalent to the square root of the amount of stake it has delegated, prevents concentration of voting power, in the event that stake becomes concentrated among a small group of validators.
Validators are also expected to participate in governance to initiate protocol upgrades and give input on various parameter changes, protocol integrations, and more.
Rewards & tokenomics
Information provided below is determined by the protocol, and subject to change.
As mentioned before, active validators must participate in consensus of the Axelar blockchain. Validators are incentivized, but not required, to support communication across many connected chains. Axelar validator rewards differ from other validator rewards: those that have the ability to run nodes for more blockchains should expect to receive higher rewards. Coinbase Cloud plans to run a validator on Axelar, which provides this additional service on external chains – and positions the validator, and its delegates, to earn additional rewards.
Risks of validating and delegating in Axelar
As with most Cosmos SDK-based chains, validators are at risk of slashing for downtime and double-signing.
0.01% of stake is slashed per block of downtime.
Maximum slashing penalty is 1.75% of stake.
If a validator misses 50% of the past 35,000 blocks (~60.75 hrs), it is temporarily jailed and cannot produce blocks, until a unjail transaction is approved.
Double signing risks
Double signing occurs when a validator proposes more than one block at a specific block height. This usually results from a main node and backup node operating at the same time due to a communication issue.
2% of stake is slashed.
The validator is permanently removed from the active set and all stake must be redelegated or undelegated.