1
Monitor the source chain
Subscribe to
TokenCommitted events to detect any commitments made to your address.2
3
Verify the commitment lock
- Monitor the source chain for the
TokenLockAddedevent (orgetDetails()function) on the existing commitment. - Once detected, verify that the
hashlockmatches the one you previously generated. - Verify that the
timelockprovides sufficient time to act, ensuring it is at least . - Verify that the
Idis equal to the original commitment Id in theTokenCommittedevent.
NaN
(signature flow) hashlock addition on behalf of the user
Call the
addLockSig() function, providing both the user’s signature and the message data (Id, hashlock, timelock).4
Complete the exchange
- Once verified, call
redeem()on both the source and destination chains. - Pass in the previously generated
Svalue.
Edge Case: User Fails to Act on the Solver’s Lock
- If the commitment is not locked, wait for the
timelockto expire. - Call
refund()on the destination chain to reclaim your funds.