The core of the protocol relies on the PreHTLC contract. This contract is responsible for locking and unlocking funds based on specific conditions.

Core Functions

commit ()

Creates a PreHTLC on the source chain, representing the intent to exchange with a specific party without including a hashlock.

lock ()

Creates an HTLC on the destination chain, locking funds with a specified hashlock and timelock.

addlock () or addLockSig ()

Adds a hashlock to the HTLC on the chain, as well as updates the timelock, finalizing the commitment to the exchange. addLockSig signs a transaction allowing the other party to execute it on behalf of the initiator.

redeem ()

Reveals the secret to claim locked funds.

refund ()

Allows the original sender to reclaim their locked funds after the timelock expires if the exchange wasn’t completed.

Was this page helpful?