Trails end-to-end Flow
Trails enables seamless cross-chain transactions through a coordinated system of intent contracts, relayers, and solvers. Below is the complete flow from user initiation to transaction completion. (click here to view diagram in full screen)Under the Hood
Under the hood, Trails intents are counterfactual instantiations of Sequence v3 account abstraction contracts. The Sequence v3 account abstraction contracts introduce a very flexible and novel execution model powered by merkle trees. The contract execution configuration is represented as a merkle tree that includes signers, a digest, a module, or a combination of all. The execution of the intent is triggered by a single transaction to the intent address, where the Trails relayers observe intent address and post merkle proofs onchain of the encoded sub-transactions on origin and destination chains. Please review the “Protocol Flow Overview” section above for more details. TLDR: Trails successfully layers account abstraction transaction capabilities to primitive EOA wallets (even EOA wallets without ERC7702). This is the magic of the Trails design in how it can construct a single transaction with a single end-user confirmation that spans multiple chains and transactions. Trails also works with smart wallets directly, or ERC7702 wallets with some simplifications. The architectural goal of Trails is to always be able to construct a direct cross-chain/cross-token route for even the most common denominator of wallets, such as an EOA without ERC7702. Trails is architected as a trustless system that works on top of existing bridging / filler / solver infrastructure. For bridging / filling, Trails currently has integrated CCTPv2, Relay and Lifi.Key Components
🏗️ Architecture Layers
- User Interaction Layer: Handles user requests and wallet interactions
- SDK Layer: Manages balance queries, token selection, and orchestration
- Solver Layer: Provides optimal routing solutions for cross-chain transfers
- Chain Layer: Coordinates relayer operations across multiple blockchains
- Execution Layer: Executes intent contracts and completes transactions
🔄 Protocol Flow
The protocol follows a systematic approach:- Initiation: User initiates a cross-chain transaction through their app
- Discovery: SDK queries available token balances across all supported chains
- Selection: User selects preferred payment token from any available chain
- Solution: Sequence API provides optimal bridge/swapsolution
- Execution: Coordinated execution across origin and destination chains
- Completion: Intent contracts fulfill the transaction requirements
🎯 Intent-Based Architecture
The protocol leverages intent contracts that:- Define transaction requirements without specifying execution paths
- Enable flexible solver competition for optimal routes
- Provide atomicity guarantees across chain boundaries
- Support complex multi-hop operations seamlessly
🌉 Cross-Chain Coordination
Relayers on each chain work in concert to:- Monitor intent contract states
- Execute transactions with cryptographic proofs
- Ensure atomic completion or rollback
- Maintain consistency across chain boundaries
📨 Role of the Relayer (How is this trustless?)
- Relayers cannot alter the transaction calldata or intent contents in any way; they can only submit the pre-committed, verifiable calls that match the intent’s merkle commitments.
- Their responsibility is limited to subsidizing gas and successfully landing the transaction on the underlying chain on the user’s behalf.
- Any deviation from the committed parameters is rejected on-chain by the intent contracts, ensuring the relayer cannot manipulate execution.