t3rn Executors, Part 1: What are t3rn Executors?
This blog post will explain a crucial actor in the t3rn ecosystem, the Executor. Anybody can become an Executor, generating yield by executing multichain transactions. This document aims to explain Executors in detail, covering all relevant aspects of the t3rn ecosystem.
What are t3rn Executors?
At t3rn, we aim to abstract away the complexity of multichain executions. Upon becoming a Polkadot parachain, we will be able to utilize XCM to perform cross-chain transactions with other Polkadot parachains. To connect to blockchains outside the Polkadot ecosystem, we rely on network participants to facilitate these transactions. At t3rn, we call these participants 'Executors'.
In simple terms, Executors generate yield by executing transactions invoked by users on the t3rn blockchain. For example, a user submits a transaction requesting to send ETH to a specific address on the Ethereum blockchain. An Executor can now execute the transaction on the target chain (Ethereum) and submit an inclusion proof back to the t3rn Circuit (our blockchain), verifying the execution of the transaction. The SFX (side effects) reward is now unlocked, rewarding the executor for their service.
Besides finding efficient ways to source assets to send to users, Executors must also balance their funds internally. Since they operate on multiple chains, they periodically need to move funds across chains. When executing transactions, the Executor deposits funds on the target blockchain. Once an execution is confirmed, the Executor receives their payment on the t3rn blockchain (Circuit). After a while, the Executor needs to move their funds from the Circuit to the target chain it is operating on. Executors decide how they move their funds across chains, e.g., using their proprietary resources, CEXs, DEXs, Bridges, OTC deals, etc.
To incentivize efficient fees, which the user pays, Executors compete with each other. Users set a maximum reward that they are looking to pay for each transaction, which is then used as a starting value for a reverse auction. Executors looking to facilitate a transaction can bid on specific side effects, bringing the fees down to a value they are happy with. The main goal behind this mechanism is to have efficient Executors that can profit without charging excessive fees. Throughout this document, we will detail all aspects that are important to consider for Executors.
Transaction Types on t3rn
Before covering the different transaction types, we will look at transactions in general, covering what they fundamentally have in common. In general, t3rn enables users to invoke transactions on other chains. In t3rn, we call these transactions "side effects" (SFX). A side effect is a flexible way of generically describing various transaction outputs on blockchains. These outputs can result in transfers, swaps, storage reads, or other arbitrary calls.
To invoke cross-chain transactions, a user creates an XTX (cross-chain transaction) object, adding an arbitrary amount of SFXs. These can be across different chains, executing different functions. The SFX object describes the transaction details, the “insurance” and the “max_reward” that the user has set. These are important for the Executors as they decide how profitable each side effect could be if executed.
The user sets the reward for each SFX. When submitting the XTX to the t3rn blockchain, Executors can bid on the SFX by submitting a lower reward payout, competing with other Executors for the SFX. The reward is only collected by the Executor that won the bid.
When bidding on an SFX, the Executor also submits the insurance deposit, a refundable fee set by the user. This fee acts as an incentive for the Executor to execute the SFX that they won the bid on. The Executor can reclaim the deposit if they confirm the SFX execution before the timeout block.
We will now examine different transaction types, how they are different and what they are specifically used for.
Escrow transactions rely on an escrow contract deployed on the target blockchain. When an Executor executes a certain SFX, the resulting funds are not sent to the receiver directly but deposited into the escrow contract. The funds reside there until the t3rn blockchain either “commits” or “reverts” the execution. Depending on the outcome, the funds are either unlocked to the receiver or the Executor.
This transaction type is useful when dealing with multiple side effects in one execution. As the receiver is not in control of the funds, it is possible to fully reverse the transaction, refunding the Executor. The full reversibility enables multi-step XTXs to not require bonding on the Executor's side, outside of the insurance deposit, making escrow transactions very capital efficient.
As the escrow contract must explicitly support each SFX, the supported transactions are limited to the standard side effects. These include native transfers, token transfers, swaps, adding liquidity and removing liquidity.
Optimistic transactions are a lot simpler, and arguably easy to implement, as they do not require a smart contract to be available on the target chain. Instead of using the escrow contract to enable full reversibility, optimistic transactions are sent to the receiver immediately, relying on a bonding mechanism to ensure no honest/timely participant loses their assets.
The following rules determine the bonding requirements:
- Every optimistic side effect must bond the reward amount of all other optimistic side effects in the execution
- The reward payments of all optimistic side effects are in the same asset (TRN, DOT, USDT, etc.)
These bonding rules are required as an escrow contract is not used in this type of transaction. In an optimistic transfer, the funds are directly sent to the receiver by the Executor. This can become a problem when an execution contains multiple optimistic SFX.
What if Executor A sends the funds correctly, but Executor B does not confirm the SFX it won the bid for? Reimbursing Executor A is only possible if there is enough slashable bond available. For this reason, every Executor who is part of the execution must bond the reward amount of all other optimistic SFX of the XTX. We do not want to rely on oracles to determine the bonding value, so the reward is paid in the same asset.
As a result, single-step optimistic transactions do not require any bond (outside of the insurance deposit, which is always required); this enables capital efficient (for Executors) and cheap (for users) bridging transactions. On the target blockchain, the Executor pays only the native transaction fee, mirroring the price of a native transfer. For this reason, we expect cheap value transfers.
Optimistic transactions are also much more flexible compared to escrowed SFX. A new SFX interface can be added dynamically to the t3rn blockchain without changing the escrow contract on target blockchains. This flexibility enables a much greater array of use cases. For example, an optimistic SFX can query the state on another blockchain and then use that value in a smart contract hosted on t3rn.
Optimistic side effects are useful for single-step executions like bridging or multi-step executions for more generic operations, like state reads or simple calls. Creating high-value optimistic transactions is only recommended if they are single-step. Multi-step optimistic transactions can result in large bonding requirements for the Executors, making them unattractive to execute.
The future of Web3 is multichain. t3rn has been built to enable this new paradigm in multichain programming, which is trustless, fail-safe and interoperable. We believe in trust-free collaboration, therefore the network will offer open access for anyone to join and play a critical role as Collator, Executor, Attester or Contracts Registry Builder.
Team t3rn will take a phased approach to rolling out the protocol, gradually releasing different features, showcasing and battle testing the network within a Substrate-based environment first before integrating with some of the foremost ecosystems in the industry.
t3rn is a multichain protocol that brings fail-safe, interoperable execution and smart contract composability to the Polkadot ecosystem and beyond.
t3rn’s ultimate goal is to enable trust-free collaboration between blockchains and to create an ecosystem in which anyone can utilize and deploy an interoperable smart contract, in an ecosystem where developers are fairly rewarded for their contributions.
Welcome to the next generation of multichain composability.
t3rn Circuit - the name of the t3rn blockchain
XTX - a cross-chain execution containing N side effects on an arbitrary number of different target chains. Every side effect belongs to a specific execution
Execution Stage - Executions are grouped by their side effect transaction type, namely escrow and optimistic. These stages must be confirmed sequentially, with the order within a group not mattering
Side Effect (SFX) - a single transaction on a target blockchain.
Insurance Deposit - a small deposit paid by the Executor winning the side effect bidding. This deposit incentivizes Executors to execute the side effects they have won the bid for. Failing to submit the execution proof until the execution expiry will result in the deposit being slashed. The user sets the insurance amount on a per-side effect basis.
Side Effect Reward - The reward the user pays to execute a single side effect. This is the total amount paid to Executors. During the bidding stage, Executors can submit execution bids, lowering the reward amount paid out.
Attesters - Stakers on t3rn used to authorize unlock transactions in the target escrow contract. Users can nominate their TRN tokens to receive a proportional share of the inflation paid to them.
Escrow Contract - A smart contract deployed on the blockchains t3rn connects to. The outputs of escrow side effects are temporarily deposited there until the execution has finalized. An Attester majority is needed to unlock transactions from the contract
👉 Subscribe to our newsletter: Join 15,000 subscribers for exclusive monthly updates and insights, directly from Maciej Baj, founder & CTO of t3rn. - no spam, unsubscribe anytime.