Skip to main content

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.

Overview

The TRAIN Bridge dApp serves as the central interface for seamless cross-chain transactions. It submits user intents for Solver matching, receives the selected Solver quote, and orchestrates the HTLC flow with recoverable secret generation. The dApp has four main responsibilities:
  1. Accept user swap intent and obtain a Solver quote
  2. Display the winning Solver quote and allow the user to initiate the swap (specifying the winning Solver)
  3. Execute the HTLC flow:
    • Derive a secret from the user’s wallet signature
    • Lock funds on the source chain with the derived hashlock
    • Observe the Solver’s lock on the destination chain
    • Sign and transmit the derived secret to the Solver so they can unlock funds on both chains
  4. Optionally monitor and verify that funds are unlocked on both chains. The Solver is economically incentivized to redeem on the destination chain quickly because a reward is reserved for whoever completes that transaction—if they delay, any other actor can step in and claim it.

Observing the Destination Network

The dApp must observe the destination lock created by the Solver to verify the swap is proceeding correctly. The dApp can observe this transaction through the following methods, listed in order of priority:
  1. Bootstrap a Light Client (e.g., Helios) for the destination chain and read the lock state from it
  2. If no Light Client is available, read and verify the lock state from multiple RPC providers