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.
Derive secret and hashlock
Using the recoverable secret generation mechanism, derive a secret from the user’s wallet signature, source chain, destination chain, and timelock parameters. Hash the secret to create the hashlock.
Monitor the destination chain
- Watch for the
TokenLockedevent or use theIdon the destination chain by callinggetDetails(). - Verify that the
hashlockof theHTLCon the destination chain matches your derived hashlock and provides sufficient time, ensuring it is at least .
The state of the destination chain should be read from a Light Client if one exists; if not, it should be read from multiple RPC providers.
Transmit signature with secret to Solver
Sign a message containing the derived secret and transmit this signed message to the Solver or any available actor. This allows them to use the secret to unlock funds on both chains without requiring further user interaction.
This signature transmission can happen via off-chain channels (WebSocket, API, etc.). The signature includes the actual secret, which the Solver can now use.