V8 PreHTLC
Introduction to PreHTLCs - improved version of HTLCs
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 LP but without the initial requirement of a hashlock. In this model:
- Secret Management Delegated: The LP generates and manages the secret, relieving the user of this responsibility.
- Claim Transactions Simplified: The LP executes the claim transaction on the destination chain, addressing the issue of users lacking assets on a new network.
V8 PreHTLC flow
User Commit
The user creates a PreHTLC, committing funds for the selected LP - commit()
.
LP Lock
The LP detects this transaction, generates a random Secret S, and creates an HTLC, locking funds (minus the LP Fee) for the user in the destination chain - lock()
.
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()
.
Unlocks
Upon seeing this conversion, the LP 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 LP does not create trust assumptions. When the LP 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 LP. 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.
The protocol demonstrates its full potential in scenarios where:
- The user is running a local (light) node: This setup allows the user to actively participate in the process, monitoring and managing transactions seamlessly.
- The process is managed by user-facing software: Custodian platforms or local wallets can automate the bridging process, ensuring a smooth and efficient user experience without requiring the user to actively manage the transaction.
Was this page helpful?