To overcome challenges with the original HTLC, we introduce PreHTLC, an enhanced version of HTLC. 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 chain, addressing the issue of users lacking assets on a new network.

V8 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, allowing 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, allowing the transaction flow to be fully recoverable from on-chain data. However, ensuring the user is live to transmit the hashlock from the destination chain to the source chain remains crucial.

Was this page helpful?