Cryptocurrency’s holders want to work with e-money and exchange it without intermediaries. Stakeholders have matter of trust in a third party and the security of the transaction, while collaborating with custodian exchanges.
Atomic swap – alternative technology of exchanging and your solution for solving above-described issues. Using of Atomic Swap does not depend on TEE (Trusted Execution Environment); however, it is invulnerable to exposure.
For different cryptocurrency idea of atomic swaps works another way. Exchange without intermediaries through unlimited blockchain networks that could implement these technologies, but for a particular network, it is unique.
According to the terms of the Free Ton competition, the exchange must be made for the Free Ton, Ethereum and Bitcoin networks.
If you are the initiator of the exchange, fill out the form: how much currency you are ready to give, how much you want to receive, enter the address from which you will come for your money.
Wait for someone to respond to your order, and when you have a partner, tell him the ID.
As soon as they answer it, produce a secret key, it is also a password, enter the timelock - the time allotted for the transaction, and send the transaction.
In the case of Free TON, the transaction is signed and sent directly from the browser. In Ethereum, MetaMask will do everything for you. In the case of Bitcoin, you will see a transaction that you need to send yourself using a convenient wallet.
Wait for your partner to respond to the order, respond and send their transaction with your details.
Withdraw funds from your partner's box, specifying the correct secret.
Once you have withdrawn the funds, the other party to the transaction will see this and, using your secret key, will receive the money you sent.
In general terms: the initiating user expands the box to which he sends:
Boxing transfers funds either to the specified recipient if he transfers the secret key, or to the user who created it, but only after the blocking time has expired.
The receiving user creates his box on another network with a similar data set. The recipient specifies the initiating user and, necessarily, a much shorter time interval.
It is important that the initiating user does not take funds from someone else's box and tokens from his own, thereby deceiving the second party to the transaction.
It sets the required number of tokens and expands the box with the same hash of the secret key. Then the receiving party transmits the address of its box to the initiating party.
The initiator takes tokens from the recipient's mailbox and writes down the secret key. It is important that the contracts of both networks can correctly figure out whether the secret key is correct or not.
The receiving party sees the secret key in his mailbox, transfers it to the initiating user, and receives tokens.
If one of the parties did not unfold its box, did not write down the secret key, did not come to pick up the funds, then after the blocking time expires, the creator of the box will return his money.
In the center of the system there is a register holding information about offers for exchange (boxes). The registry registers only those offers that are created through the system, thereby ensuring that the box code is correct, and it is not tampered with.
In addition, the register has other functions to ensure the system and check the correctness of transactions.
The box holds swap data (e. g. recipient, timelock, and so on), stores tokens and a secret after it is revealed.
Complete is a method that transfers funds to the recipient after specifying the correct secret.
Reclaim is a method that returns money to the creator if the deal fails and the timelock has expired.
As a shell for operations, a server part was created, the purpose of which is to track the status of the transaction and help users find partners. All she stores are orders and box address so that both parties can conveniently receive the information they need from each other.
Front-end solution is implemented to prove functionality and use ton-client-js and Metamask for sending transactions. For Bitcoin, transactions will be generated in the browser, but they will have to be sent from a tool that is convenient for you.
The interface part is based on ionic, therefore it is convenient for fast cross-platform functionality, so the delivery of mobile and desktop applications for popular platforms will not keep you waiting long.
Tender format gave us an added incentive and a powerful impetus in professional and research activities. Considerable work has been done because of which we became prize winners of the competition.
Rsquad company has showed competence in the FreeTON project, confirmed its position of strong developers in the community.
In addition to the system of secure atomic exchange, Rsquad has developed a software solution interface that is clear and intuitive for the user, it has a design, layouts, and identity.
The result is not just a bare technology, but a useful product that can be changed, assessed, and put into commercial operation, using not so much effort and time.