Core Flow
Transactions flowing through the Connext network have the following lifecycle:Â
The end user initiates a transaction. To do so, an xcall function is called on the Connext contract where funds, gas details, target address object, chain info, as well as arbitrary data are specified. Â
xcall is designed to mimic solidity's lower-level call as much as possible.Â
The Connext contract will do the following:Â
- Swap passes token to the Nomad version of the same asset (if needed)Â
- Initiate the 30-60 minute message latency across blockchains by calling the Nomad contracts (included is a hash of the transaction details)Â
- Emit an event (that includes the transaction details)Â
Routers observe the origin chain and front the funds on the destination chain. Routers will then do the following:Â Â
- Simulate the transaction. If the tx fails, it must go through the Nomad process which is slower but can handle more âexpressiveâ crosschain messages requiring permissioningÂ
- Prepare the signed transaction object. Funds on the receving chain are used for this.Â
- Post object to the auctioneer (as a âbidâ)Â
If the router does not have enough funds, they can also provide part of the transferâs value. Â
- The auctioneer observes all underlying chainsÂ
- Bids for transactions are collected by the auctioneer every X blocksÂ
- Correct router is selected by the auctioneer for a given transaction. Tx can be randomÂ
- Auctioneer posts bids in batches to relayer network. This submits the badges to the blockchainÂ
An auctioneer submits a given bid to the chain. The contracts will then do the following:Â Â
- Verify that enough funds are available to execute the transactionÂ
- Swap the Nomad-flavored funds of the router for the chainâs canonical asset Â
- Send swapped funds to correct target addressÂ
- If target address is a contract, calldata will be executed against the targetÂ
- Hash router paramÂ
- Store mapping of hash on routerâs address in the contractÂ
At this stage of the swap process, the transaction has already been successfully completed.Â
Later in the process, the Nomad message will arrive. Â
At this point, it is possible to submit a heavily batched transaction with the purpose of taking all pending hashes that were received over Nomad to look up if there are corresponding router addresses in the hash or router address mapping. Â
If this is the case, the Nomad assets are minted and distributed to the router.Â
Connextâs core security mechanism ensures that routers behave correctly. If a router gives an incorrect amount of funds to a user or if the wrong calldata is executed, the router will not get reimbursed.Â
â ď¸ Note
There is a 30-60 minute lockup of a routerâs funds when a transaction is relayed. This removes the lack of having to rebalance funds which has the consequence that routers have more capital available. Â
ďťż