The protocol model relies on atomic swaps with recoverable secret generation for parties exchanging assets across different chains. The model outlines the core flow of assets and actions that should be taken by each party for a successful asset exchange. The protocol uses the Standard flow for asset exchange between parties.Documentation Index
Fetch the complete documentation index at: https://docs.train.tech/llms.txt
Use this file to discover all available pages before exploring further.
Standard flow
When a party (Solver) directly supports both the source and destination chains and is willing to perform the swap, the standard flow applies. The user derives a secret using the recoverable secret generation mechanism and locks funds on the source chain with the hashlock of that secret, setting the timelock to , where is the current timestamp and is a reasonable duration (e.g., 15 minutes). The Solver observes this lock and creates a matching lock on the destination chain with the same hashlock and timelock of . The user then signs and transmits the derived secret to the Solver. The Solver reveals the secret on both chains to complete the swap. Here are the steps:User Derives Secret and Locks
The user derives a secret using HKDF and creates a lock object on the source chain with the hashlock and a timelock of .
Solver Lock
The Solver observes the lock on the source chain and creates a matching lock object on the destination chain with the same hashlock and a timelock of .
User Transmits Signed Secret
The user signs and transmits the derived secret to the Solver via off-chain channels.
Solver Reveals and Redeems
The Solver reveals the secret on the destination chain to unlock the user’s funds (earning a reward for this action), then reveals it on the source chain to claim their primary fee. The Solver is economically incentivized to complete the destination redemption promptly—if they delay, any other actor can step in and claim the reward instead.
Standard transaction sequence diagram
Standard transaction sequence diagram