Atomic Swap Process
September 09, 2019
A cross-chain swap is a traded between two users of different cryptocurrencies.
The first party sends coin (A) to a second party’s (A) address, while the second party would send (B) coin to the first party’s (B) address. There is a problem that occurs here. The issue is that there is no protection if one of the parties goes against the agreement. That was the past. Now, the future is a mutually-trusted third party for escrow is to solve the problem. An atomic cross-chain swap is the answer the community was waiting for.
Atomic swaps acts as a binding contract between both parties. Within the contracted transaction, there is one contract for each blockchain. A key element in this process is that the contracts contain an output that is spendable by either party, but the rules required for redemption are different for each party involved.
Party (A), will pay for the intended trade amount provided and will generate a secret. Keeping it a secret is a main component in this process. As long as the secret is known, the contract output can be redeemed by party (B). If the time period expires after the contract transaction has been mined, but one party has not redeemed, a refund can be placed back in the initiators wallet.
- Party A and B agree about terms of exchange
- Party A publish a contract in Blockchain A
- Party A send a Secret Hash and contract transaction to Part B
- Party B audit contract transaction
- Party B create a contract in Blockchain B with A secret hash
- Party B send the contract transaction to Party A
- Party A audit contract transaction from Party B
- Party A withdrawal from B contract with publishing secret
- B extract secret from withdrawal transaction
- B withdrawal from A contract
Decentralized order book (DOB)
Atomic swap is only a fraction of it’s exclusivity. Along with the swap function, it also connects two users together. The Atomic Wallet uses a decentralized orderbook based on the BitTorrent protocol. Atomic’s orders differ from the centralized exchange order:
- Don’t lock user fund.
- It is a proposal to a trade, not obligation.
- User can set a range available for swap (fox example from 10 to 100 BTC).
- Orders show in orderbook if user Atomic wallet online.
- Order transmit via p2p network between users.
- User creates an order for the trade and signs it with the private key.
- Order is being sent to all Atomic Wallet users as the update proposal to the file distributed and synced among all users.
- One of the verification nodes checks the order for legitimacy in terms of Atomic Wallet environment. Verification node creates an updated version of the DOB file wiping off the closed orders and adding new orders created.
- New version of the DOB file is synchronized along the network once in a minute.
If an user exits from the wallet or wallet loses connection, the user’s order will stay automatically unavailable. After the users connection is restored, their order will stay visible for other users.
Atomic wallet connects Order book and Atomic swap technologies in a friendly interface.
The Atomic Wallet Atomic Swap Exchange process:
- Create a wallet — registration is not required.
- Top up the wallet.
- Party A select an order from the BitTorrent order book.
- Party A enter an amount of coin to swap or coin to receive.
- Party A confirm the swap.
- Party B receives notification.
- Party B confirms the swap.
- First party and Second party’s Atomic Wallet checks the contracts.
- Both receive their coins.
- No registration, verification.
- Custody free solution.
- Unlimited amount of exchange.
- Fixed exchange rate.
- Guaranteed by blockchains exchange or refund time.
- Direct exchanges of one coin for another without intermediary pairs.
- User to user exchange.
- User friendly interface.
- Decentralized order book.
- Serverless solution.