Free TON

Contest: Atomic Swaps on Free TON [31 August 2020 - 20 September 2020]

Contest dates

  • Warm-up period: 28-30 August 2020
  • Submission period: 31 August 2020 - 20 September 2020

Short description

Develop a set of smart contracts and service tools, sufficient to perform cross-chain trades at least between the following blockchains (also known as “atomic swaps”):

  • Bitcoin <> FreeTON
  • Ethereum (native ETH and ERC20 tokens) <> FreeTON

Motivation

The goal is to develop an infrastructure that allows users to perform transactions between different blockchains without an escrow in an untrusted environment. This will make the exchange market around TON Crystal more secure for OTC transactions.

General requirements

  • The possibility of a safe return of funds to each of the parties if the other party does not comply with the terms of the trade
  • Open sources of smart contracts published at GitHub/GitLab or another open repository
  • Documentation
  • Name and contact information of the contestant for communication (Telegram username, e-mail)

Technical recommendations

  • Using state-of-the-art tools (Fift, Truffle, Solidity, TON Labs solidity compiler)
  • Automated tests

Evaluation criteria and winning conditions

Hard criteria

Functionality

  • Protection from the unauthorized withdrawal of funds from published contracts
  • The possibility of a safe return of funds to each of the parties if the other party does not comply with the terms of the trade
  • Possibility to set a fee and target wallet for the fee collection of the organizer of the trade (broker)

Artifacts

  • Link to a video demonstration (screencast) of the solution with a real exchange (TON↔BTC, TON↔ETH, TON↔ERC20 token [e.g., USDT/USDC]), links to transactions displayed in video in blockchain explorers (e.g., TON.live, Etherscan, Blockchair, etc.)
  • Link to smart contracts’ sources at Github/Gitlab or another open repository, with the obligatory backlink to your submission in the repository’s README

Soft criteria

  • Code quality
  • Detailed deployment and usage documentation
  • Detailed documentation for each part of the code
  • Documentation of the trade process for all parties of the trade

Rewards

1 place…………………………200,000 TONs
2 place…………………………100,000 TONs
3 place………….………………50,000 TONs
4-10 place………………………15,000 TONs

Voting

  • Jury members who vote in this contest must have a solid understanding of the technology. Those jurors who do not should not vote or “Abstain”.
  • Jurors whose team(s) intend to participate in this contest by providing submissions lose their right to vote in this contest.
  • Each juror will vote by rating each submission on a scale of 0 to 10 or can choose to reject it if it does not meet requirements, or they can choose to abstain from voting if they feel unqualified to judge.
  • Jurors will provide feedback on your submissions.
  • Duplicate, sub-par, incomplete or inappropriate submissions will be rejected.

The Jury

  • Jury members who vote in this contest must have a solid understanding of the technology. Those jurors who do not should not vote or “Abstain”.
  • Jurors whose team(s) intend to participate in this contest by providing submissions lose their right to vote in this contest.
  • Each juror will vote by rating each submission on a scale of 0 to 10 or can choose to reject it if it does not meet requirements, or they can choose to abstain from voting if they feel unqualified to judge.
  • Jurors will provide feedback on your submissions.
  • Duplicate, sub-par, incomplete, or inappropriate submissions will be rejected.

Jury rewards

An amount equal to 5% of the sum total of all total tokens actually awarded to winners of this contest will be divided equally between all jurors who vote and provide feedback. Both voting and feedback are mandatory in order to collect this reward.

Procedural reminders to all contestants

  • All submissions must be accessible for the jury to open and view, so please double-check your submission. If the submission is inaccessible or does not fit the criteria described, the submission may be rejected by jurors.
  • Contestants must submit their work before the closing of the filing of applications. If not submitted on time, the submission will not count.
  • All submissions must contain the contestant’s contact information, preferably a Telegram username by which jurors can verify that the submission belongs to the individual who submitted it. If not, your submission may be rejected.
  • The content published in the forum and in the provided PDF file should not differ, except for formatting, otherwise, the submission may be rejected by jurors.
  • If your submission has links to the work performed, the content of those links must have the contestant’s contact details, preferably a Telegram username so jurors can match it and verify who the work belongs to. If not, your submission may be rejected.

Disclaimer

Anyone can participate, but Free TON cannot distribute Tons to US citizens or US entities.

20 Likes

This one is fantastic Contest!!!

2 Likes

Да я давно спрашивал про подобие dex , Митя говорил что рад был бы , если комьюнити сделало подобное. Как пример uniswap. Я конечно не разработчик и жаль что не смогу помочь кодом

2 Likes

Great proposal! This is what definitely Free TON ecosystem needs.

3 Likes

This is a step closer to the FreeTON adoption by crypto-communities widely(btc, eth, etc.)

3 Likes

Вы можете помочь использованием и популяризацией ))

2 Likes

Thank you, Michael :hugs:

1 Like

Yes, this is the aim

2 Likes

The contest was approved in a record 2 hours! :partying_face:
Thank you for your support!

As many of you have asked, I also added a couple of days to warm-up and better analyze the task.
As the platform doesn’t allow yet to split these two periods, formally the contest starts on Friday, informally on Monday.

Look forward to your submissions and good luck!

5 Likes

SUPER!!! :tada: :tada: :tada: :tada: :tada: :tada: :tada: :tada: :tada:

1 Like

Вопрос, кому будет принадлежать данная разработка пройдя конкурс? По сути это обменник с комиссией, но все исходники идут на гитхаб и будут принадлежать всем. Все желающие будут поднимать обменники, любой кто поднимет такой обменник, сможет обмануть пользователей. Какая защита должна быть от владельца обменника, учитывая, что он полностью контролирует перевод? По идее СК дол жен быть настроен так, чтобы владелец обменника не имел возможности повлиять на сделку.

4 Likes

unfortunately I had not seen this proposal before approval to show my disagreement.
some points:

  1. atomic swaps is an exchange business model like other centralized or decentralized exchanges, so if Free TON community invest in writing the code then the Free TON community should follow to implement and marketing it !!! (it is not the community job)
    if other third party company want to do marketing and implement the written code so that company also should pay the costs not the Free TON !!!
  2. Free TON Community just should create different SDKs and libraries as facilitators, so other exchanges (any type of exchange) can easily adapt their systems with the Free TON blockchain .
  3. atomic swap model is some how a failed model. so called successful atomic swaps(for example Changelly) never became a real atomic swap exchanges (the reason is low liquidity) and finally became just an intermediary between centralized exchanges and the trader.

so finally:
1. if the Free TON community don’t want to implement it why we should have this contest?
2. isn’t it better to have this approach in the Free TON community :arrow_right: facilitating for other devs to adapt TON in their systems instead of creating systems

1 Like

Здесь суть задания как раз создать такие контракты, которые бы не позволяли владельцу обменника влиять на процесс совершения сделки, чтобы не возникало кастоди и не нарушалась приватность участников сделки. Но, поскольку он обеспечивает фронт и поддержку, он должен иметь возможность задать комиссию от сделки, которая автоматически будет уходить на его адрес по её завершении.

Исходники должны быть выложены в Open Source с открытой лицензией, т.е. стать общественным достоянием - это позволит любому желающему провести аудит их безопасности и улучшать их.

Что касается второй части, то тут скорее вопрос - как убедиться, что владелец обменника использует именно те исходники, которые провалидированы сообществом. Этот вопрос выходит за рамки данного конкурса, но мы можем вынести его в отдельное обсуждение.

1 Like

Hello @nAMI, thanks for your opinion.
It is very good that you have addressed these points.

Let me try to oppose them.

On the goal of the contest

Ultimate goals of all FreeTON contests are decentralization, market penetration, and token distribution in the as short term as possible. However, we should not forget that FreeTON doesn’t exist in a vacuum and first needs to plug into the existing market architecture to succeed.

Creating technology that will help existing businesses (exchanges, wallets, OTC desks, and so on) to start accepting and exchanging crystals against popular coins and tokens will foster the liquidity flow and speed up FreeTON acceptance by people outside the FreeTON community.

On the reward

You stress that FreeTON pays contest winners for something, which is not true. The winners are rewarded for their impact on reaching FreeTON’s goals.

We are a decentralized organization that asks the community to help in the popularization of its values and benefits in exchange for some virtual assets, and not an institution running a tender and paying to the contractor.

On the tools created by the community

Free TON Community just should create different SDKs and libraries as facilitators

I disagree with such narrow positioning as it completely devalues the efforts of blockchain developers who invest their time in learning FreeTON smart contracts both in Fift and Solidity. Contests like this tease their professionalism and help them grow, at the same time creating a ground for discussion and rapid creation of industry standards.

Atomic Swaps is a challenging task that may be used as a basis for future technologies and growing popularity of FreeTON.

On failed model

atomic swap model is some how a failed model

This is a very strong argument, please ground it with facts.
The world of DeFi and DeX is booming, and atomic swaps and uniswaps are one of the core technologies. FreeTON IMHO is an ideal blockchain for DeFi projects, and having the solutions that are elaborated and validated by the community will help FreeTON to become very competitive.

On a community will

the Free TON community don’t want to implement it

I have published the contest proposal more than week and a half ago and invited the community to object. Vice a versa, I see really strong support from other members and their readiness to even participate in this contest.

The only fair criticism I have seen so far is the one from @Mitja who accented that it was worth to first have a design contest for this task. However, there are so many good examples from Ethereum and Bitcoin that we agreed to provide them here as a benchmark.

2 Likes

Кстати, @Mitja можешь выложить сюда референсные ссылки на реализацию, про которые ты говорил на звонке?

1 Like
2 Likes

@cryonyx thanks a lot for your response (you easily could ignore my comment because any way the jurors have approved this contest and I am respectful also about their decision)

1.

about the failure of atomic swaps (because of liquidity problem):
1.1. I refer you to this article of Vitalik. he mentioned:

The main challenge that I see with the MKR market, etherdelta and other markets right now is the high spreads, often 10% or even higher.

he don’t use the word atomic swap but atomic swaps also include so later Vitalik wrote a new article to introduce what called x*y=k market makers that later inspired by Hayden Adams to create uniswap.org (we don’t have uniswaps it is just one exchange with x*y=k market maker idea)

1.2. this article explain that other alleged atomic swaps like Changelly and Shape Shift are not actually atomic swaps so the author called them instant exchanges. but the author don’t know that they wanted to be real atomic swaps and lack of liquidity forced them to became intermediaries between central exchanges and the customers. it is the reason that founders of Changelly had created a wallet an named it Atomic Wallet it wanted to be a real atomic exchange. I wish Konstantin Gladych again join to Free TON also as he was part of TON community in the past.

2.

no stress. i even think we should even reward to the proposal writers as well as contestants between 0-100k TON based on judge valuation their proposal (as I had explained in my proposal for idea management system contest at the end of page 5).

3.

you have answered @Aleksandr that have asked some how my first question

and you think that it is possible to fully implement an atomic swap on the blockchain as a smart contract with no dependancy to outer systems.
something by using a tool like SPV Verification that @Mitja mentioned. it is OK and so good so I think the contest should was a contest to create a tool like SPV Verification tool.
thanks @Mitja for sharing this link i really don’t know if their SPV tool work with no fault or not (even the possibility needs to be checked)

when I talk about different SDK and libraries the SPV Verification tool can be a good example it will facilitate any on chain exchange (atomic swap , uniswap or others) to work with the TON blockchain.

anyway thanks you and mitja for the contribution. I am learning also.

1 Like

Colleagues, what is the reason to combine all this into one competition? These are large tasks, and the implementation of each of them requires a lot of resources. At the same time, these tasks do not depend on each other, they can simply be divided into different contests.
I have been writing a smart contract for trustless exchanging TON Crystal for Bitcoin using SPV for some time (very short announce). I started in early August. The implementation is still not ready, but at this point in time it took more than a month.
And of course I want to take part in this contest. But the conditions are such that you simply cut off the participant, requiring 3 unrelated exchangers to be implemented in 3 weeks. This can only be done by a large team or if you prepare for the contest in advance.
I propose changing the terms of participation in the contest so that you can provide separate implementations of BTC and ETH and even separate native ETH and ERC20. Or even better, launch separate contests for different blockchains. Otherwise it’s just too hard.

What is the point of a contest that only the organizers take part in?

2 Likes

I agree with you. The task is big and you need more time or more experts. The competition is organized for its creators. In the next topic, I raised this issue. To which I was told that any member of the community can create contests according to their skills, in addition, it is difficult to find specialists for such a task. I would also take part, but physically I will not have time, as I am engaged in another contest.

1 Like

@creator, @Dekan I’m personally on your side and did what I could. However, the governance strongly objected to extend the deadline…

This is what the decentralization is :man_shrugging:t2:

But still, I invite you to participate in the discussion and development of other DeFi elements and also participate in the Jury contest. We need such passionate members as you.

2 Likes