How Atomic Swaps Work

Atomic swaps enable trustless exchange of cryptocurrencies between two parties without requiring a trusted third party or custody of participant keys.

Step 1: Create or Browse Offers

Sellers create offers specifying BTC amount and discount/premium. Buyers browse the marketplace for suitable offers.

Step 2: Accept & Sign Terms

When a buyer accepts an offer, both parties digitally sign the swap terms, creating a binding agreement.

Step 3: Seller Locks BTC

The seller signs a BTC HTLC lock transaction from their own wallet, committing the BTC to the shared secret hash and refund timelock.

Step 4: Buyer Locks USDT

After verifying the BTC lock, the buyer signs the TRON escrow funding transaction from their own wallet using the same secret hash.

Step 5: Buyer Redeems BTC

The buyer signs the BTC redeem transaction, which claims the locked BTC and reveals the secret on-chain.

Step 6: TRON Escrow Settles

Once BTC redeem reveals the secret, the TRON escrow can release funds to the seller and fee recipients. Refund paths remain available if the timelocks expire instead.

Key Concepts

Hash Time-Locked Contracts

The BTC side uses an HTLC script, and the TRON side uses an escrow contract keyed to the same secret hash and refund windows.

Timelocks

The BTC refund window is the short leg and the TRON refund window stays longer, so the secret reveal path completes before any buyer refund can open.

Atomicity

"Atomic" means the swap either completes fully for both parties, or refunds become available according to the on-chain rules. The app coordinates, but does not custody participant spend keys.

Refund Safety

If either party fails to complete their part, the timelocks ensure the seller can refund BTC first and the buyer can refund TRON later if settlement never completes.

← Back to Home