V Atomic Swap Contract

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.

V Atomic Swap features

No-code deployment

Issuing tokens on the V Systems’ chain does not require any coding skills. Contracts are pre-built and audited by V Systems.

Binary Outcome Swap

V Atomic Swap allows you to exchange one asset for another atomically – the entire process either succeeds or fails. It is that simple.

ZERO Risk

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.

How does it work

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

Example

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.

V Atomic Swap Image
Developer Resources CTA Image

개발자 리소스

V 시스템 시작하기

이 웹사이트에 대한 쿠키 사용

V Systems 에 오신 것을 환영합니다. 웹사이트를 원활하게 표시하기 위해 쿠키를 사용합니다. V Systems를 계속 이용하려면 쿠키 사용에 동의해야 합니다. 더 보기

Footer VSYS Logo Colored
Privacy Policy | Terms of Use © 2024 V Systems All Rights Reserved.
Footer Artwork