Implementation
dApp Implementation
Describes the protocol implementation for the User/dApp
1
2
Monitor the destination chain
- Watch for the
TokenLocked
event or use theId
on the destination chain by callinggetDetails()
. - Verify that the
hashlock
of theHTLC
on the destination chain provides sufficient time to act, ensuring it is at least . - Once detected, capture the
hashlock
value.
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.
3
3*
(signature flow) Sign a message instead of adding a lock
The user signs a message containing the Id
, hashlock
, and timelock
.
Edge Case: Party 2 fails to act on commitment
- Wait for the
timelock
to expire. - Call
refund()
on the source chain to reclaim your funds.
Edge Case: Party 2 fails to release at all
- Wait for the
timelock
to expire. - Call
refund()
on the source chain to reclaim your funds.
Edge Case: Party 2 fails to release Party 1’s funds
- If funds are not released on the destination chain, watch the source chain for the
TokenRedeemed
event (orgetDetails()
function). - Once detected, capture the
secret
and callredeem()
on the destination chain.
Was this page helpful?