To overcome challenges with the original HTLC, we introduce PreHTLC, an enhanced version of HTLC. The PreHTLC represents the User’s intent and commitment to exchange with the Solver but without the initial requirement of a hashlock. In this model:

  • Secret Management Delegated: The Solver generates and manages the secret, relieving the User of this responsibility.
  • Claim Transactions Simplified: The Solver executes the claim transaction on the destination Network, addressing the issue of Users lacking assets on a new Network.

TRAIN PreHTLC Flow

1

User Commit

The user creates a PreHTLC, committing funds for the selected Solver - commit().

2

Solver Lock

The Solver detects this transaction, generates a random Secret S, and creates an HTLC, locking funds (minus the Solver Fee) for the user in the destination chain - lock().

3

User AddLock

The user observes the transaction on the destination chain, retrieves the Hashlock, and converts their PreHTLC to an HTLC on the source chain. The PreHTLC can only be converted once with a single Hashlock; no other information can be altered - addLock().

4

Unlocks

Upon seeing this conversion, the Solver reveals the Secret S on the destination chain to release the user’s funds and then reveals the Secret S on the source chain to claim their funds - redeem().

Delegating secret management to the Solver does not create trust assumptions. When the Solver reveals the secret to claim funds in the source Network, the secret becomes public. This allows anyone to use it to unlock the User’s funds in the destination Network. The protocol incentivizes the release of User funds by reserving a portion of the total bridging fee as a reward for this task.

The Liveness Issue

PreHTLCs improve upon HTLCs by delegating secret management and destination claim transactions to the Solver. This delegation reduces the liveness issue by making the transaction flow fully recoverable from on-chain data. However, it remains crucial for the User to be live to transmit the hashlock from the destination Network to the source Network.