Atomic Swap

Enabling peer-to-peer trading on Cardano. Trade multiple tokens and NFTs with another users for multiple tokens and NFTs without smart contracts or a 3rd party.

How it Works

Atomic Swap use a feature of the Cardano blockchain to conduct peer-to-peer, non-custodial token (FTs and NFTs) swaps between users. It doesn't use smart contracts. Atomic Swap work because anyone can include any UTxO, from any wallet, in a transaction. However, the transaction only executes if the wallet holding the included UTxO signs the transaction.

Atomic Swap builds a transaction using UTxOs from both the wallets involved. Signatures are then required from both wallets to lock and execute the transaction. If both signatures are not received then the transaction doesn’t happen.

"Freeze" Function for Security

Whilst building the transaction each user has the ability to “freeze” the transaction. This doesn’t freeze the transaction, as such, instead it sets the program to remember the inputs that were there at the time the freeze button was clicked. If the other user changes the value of these inputs, say reduces the amount from 10,000 tokens to 10 tokens, then the platform alerts the user that clicked freeze things are different from what they previously agreed to.

This makes it very difficult for one party to change the parameters of the transaction and dupe the other into committing to a swap they didn't intend to create.

Conditions and Features of Atomic Swap

  • Each user pays half of the blockchain fee (~0.1ADA each)

  • 2ADA commission is paid to the platform (1ADA per party)

  • Every swap has a maximum time to live, TTL, of 24 hours. If it isn’t registered on the blockchain in that time then it is canceled.

  • After setting up an Atomic Swap users should wait until it is completed before making any other transactions from their wallet. This is due to the fact that a UTxO can only be consumed once, and if the Atomic Swap is yet to be processed and another transaction uses the UTxO intended for the Atomic Swap then the swap will fail.

Currently Yoroi, Nami, ccVault, and Flint are the wallets that are integrated and can be used with the Atomic Swap platform.

Compare similar projects toAtomic Swap