V Atomic Swap contracts enable cross-chain swaps on the V Systems’ network. With V Atomic Swap, you can build a cross-chain DEX to swap VSYS with other tokens, including ETH. It is a secure, 100% decentralized solution, requiring no trusted party to hold custody of the coins.
V Atomic Swap’s risk mitigation capability relies on a pre-commit framework which removes the importance of transaction ordering or time.
Issuing tokens on the V Systems’ chain does not require any coding skills. Contracts are pre-built and audited by V Systems.
V Atomic Swap allows you to exchange one asset for another atomically – the entire process either succeeds or fails. It is that simple.
The binary outcome of each swap maximizes security for both parties. It is either a win-win or a no-deal situation where either the transfer is fully completed or it fails.
Swap two different kinds of tokens by deploying two contracts as follows:
Deposit tokens into the contract before locking it
Call the lock function by inputting the hash of the secret, together with the determined recipient and an expiration timestamp
The recipient can unlock it by calling the SolvePuzzle function with the transaction ID of the lock together with the secret
The contract will check that the hash of the secret matches the puzzle in the lock. If it matches, the contract will transfer ownership of the locked coins or tokens to the recipient
The contract will check that the hash of the secret matches the puzzle in the lock. If it matches, the contract will transfer ownership of the locked coins or tokens to the recipient
If Alice wishes to swap 100 A-Tokens for 100 of Bob’s B-Tokens (1:1), Alice will need to create a secret and hash it to generate Hash(Secret A). Thanks to the asymmetric cryptography of hashes, no user can infer Alice’s secret from her hash. Alice then creates an Atomic Swap contract (Contract A) which releases 100 A-Tokens to Bob as long as Bob can broadcast Secret A before timestamp 1000. The contract also shows Hash(Secret A) publicly. Bob copies Hash(Secret A) into his own Atomic Swap contract (Contract B) to release 100 B-Tokens to Alice as long as she can broadcast Secret A before timestamp 500. Bob now knows Secret A and has at least 500 seconds to broadcast it to receive the 100 A-Tokens. Since the contract specifies Bob as the recipient, he is the only one who can receive the tokens.