XChains
  • 💡Introduction
  • Understanding XChains
    • Getting Started
    • Actors
      • Liquidity Providers
      • Swappers
      • Bridgers
    • 9CP (IXCP)
  • How it works
    • Technology
    • Fees
    • Govenance
    • Tokenomics
  • Roadmaps
    • Product Roadmap
    • Business Roadmap
  • One-page Pitch Deck
  • 🏛️XChains Architecture
    • Design Strategy
    • Hashed Time-Locked Contracts (HTLCs)
    • Cross-chain Communication
      • Oracle
      • Relay Network
  • 🛠️XChains Implementation
    • Smart Contracts
      • Private Liquidity Pool Contracts
      • Bridge Contracts
    • Atomic Swap Protocol
    • Cross-Chain Transfer Flow
    • Security Considerations
    • Public Pool Integration
  • 🔐XChains Liquidity
    • Private Liquidity Pools
    • Shared Liquidity Pools
    • XChains Formula
  • 📬Contact Us
    • Email
    • Website
    • Telegram Channel
    • Telegram Chat
Powered by GitBook
On this page
  • Approach: Private Liquidity Providers with HTLCs
  • Steps for Cross-Chain Token Transfer Using HTLCs and Liquidity Providers
  1. XChains Implementation

Cross-Chain Transfer Flow

Using Private Liquidity Pools and HTLCs

Approach: Private Liquidity Providers with HTLCs

Instead of relying on a DEX or shared liquidity pool, use a decentralized network of liquidity providers. These liquidity providers lock their own funds in HTLCs and facilitate cross-chain transfers by providing the equivalent value on the destination chain.

Steps for Cross-Chain Token Transfer Using HTLCs and Liquidity Providers

  1. Locking Tokens on Chain A:

    • User A transfers 100 Token 1, and they are locked in an HTLC-based private pool contract on Chain A. This HTLC includes a hash lock and a time lock.

  2. Generating and Sharing the Hash Preimage:

    • User A's private pool contract generates a secret (preimage) and hashes it. The hash is included in the HTLC on Chain A.

    • User A's private pool contract shares the hash (but not the preimage) with User B's private pool contract on Chain B via the Bridge contract and a cross-chain communication mechanism such as a decentralized oracle or relay network.

  3. Private Liquidity Pool on Chain B:

    • A liquidity provider on Chain B has Token 2 and agrees to facilitate the transfer.

    • The liquidity provider locks the equivalent value of 100 Token 2 in an HTLC on Chain B using the same hash.

  4. Revealing the Preimage:

    • User A reveals the preimage to unlock the HTLC on Chain A, triggering the process.

    • The preimage is then used by User B and the liquidity provider on Chain B to unlock the HTLC for Token 2.

  5. Finalizing the Transfer:

    • User B uses the preimage to unlock and receive the 100 Token 2 from the HTLC on Chain B.

    • The liquidity provider can use the preimage to claim the 100 Token 1 from the HTLC on Chain A, thus completing the transaction.

PreviousAtomic Swap ProtocolNextSecurity Considerations

Last updated 11 months ago

🛠️