Sun. May 9th, 2021
DePool, Free TON,

The next step in the evolution of the Free TON ecosystem after the validator contest was DePools Contest — a little less large-scale, but no less significant.

DePool is an exclusive Free TON smart contract that allows any token holder to earn on investments in validator stakes.

DePools are a step forward not only for Free TON, but for the entire blockchain industry.

DePool: This is Only Possible in Free TON

The transition from Proof-of-Work to Proof-of-Stake received its logical continuation in cryptocurrency — the Delegated Proof-Of-Stake protocol. If PoS is like democracy, then DPoS is like representative democracy. In the first case, the holder of large assets is engaged in staking, in the second, each owner of a significant amount of cryptocurrency can vote for representatives of the community who will be given the right to generate a block.

DePool provides an opportunity for any TON Crystal holder to profit from validation.

DePool is a smart contract that combines the deposits of crystal holders. For validation and revenue generation, you need to have over one hundred thousand crystals. Thanks to the DePool, those who do not have such a large amount of currency do not stand aside and take part in the process along with large investors.

Cryptocurrency holders can attract funds from other depositors to their DePool, or deposit their own in a third-party validator’s DePool. The investment brings the depositor a reward after each validation cycle, proportional to the amount deposited.

You Should Have Seen Him in Action

DePool, Free TON

DePool work algorithm is simple: it receives stakes from the participants and transfers funds to the validator so that he can take part in the elections. Several Steps leading up to the validation process follow this. The first of them is the preliminary round: DePool certifies that a special smart contract Elector is ready to accept stakes from the participants.

The second round is the time the Elector waits for an election request from the validator’s wallet. After receiving the request, the DePool attaches the stake to the election request and passes it to the Elector.

If the stake is accepted, then the validator becomes a participant in the elections, and the Elector enters its address, stake, and other parameters into a special dictionary — members

Then the Elector selects a validator according to a certain algorithm. If the validator is selected, then the Elector saves the validator data to another dictionary — frozen. If the validator loses, the stake is returned to the election participant.

If the validator wins, the validation cycle starts. It may or may not be very successful. If the validator is wrong, its stake may be slashed.

At the end of the validation cycle, the Elector removes the validator’s data from the frozen dictionary and adds a stake with rewards to the validator’s address in the credits dictionary. After the validator’s request, the Elector checks the credits dictionary and, if there is something there, returns the stake with the rewards to the validator in transit through the proxy contract. The proxy contract takes a small amount from the stake to pay for its gas and sends the rest of the funds to the DePool. DePool’s contract also takes part of the amount to pay for gas.

In DePools Game, it took 5%, but in subsequent versions of DePool, it was decided to abandon this and now DePool takes the minimum that he needs to work.

Then the percentage of the validator is deducted from the amount and sent to the validator’s wallet. In DePool Game it was 25%, but now this parameter can be anything — from 1% to 99%. The most common is 5%.

The remaining amount is distributed among the depositors of this round in proportion to their deposits. If the amount exceeds the total contribution of the round, then each depositor receives a certain income.

“The Most Complex Smart Contract”

DePools game was announced in August 2020. The contest was aimed at testing the DePool contract and training validators to work with it.

Participants received from the organizers in their DePools 1,000,000 special game currency — rubies. The metrics for them were as follows:

  • the rewards earned by the validator were added to 1,000,000 rubies, which served as an incentive not to miss the validation; 
  • the slashing threshold was lowered from 0.66 to about 0.38 to differentiate the best participants from the simply good ones. Validators were given penalty points for their inactive participation in the blockchain consensus.

Penalty points were deducted from 1,000,000 rubies. For the remaining rubies by the end of the game, a rating of validators was compiled. The first 200 received prizes — direct payments to the wallet.

There was also a special prize pool for those players who were the first to find bugs (bug bounty) in DePool’s contract. During the game, slashing mechanisms were also tested, the implementation of which is provided in Rust Cup.

The prize money was, in descending order, from 111,000 to 78,000 crystals for the top ten, and from 34,000 to 4,100 for all the others. One participant noted that reward is not the most important component:

In fact, the current combat DePools, like the Rust Cup with penalties, are the legacy of that game. And all this tells us that the project is developing without throwing, the roadmap is clearly visible. Anatoly Ustinov

At the time of this writing, a total of 396 DePools were registered in the system. Now they are already functioning in the updated, third version of the smart contract, but this version may not be the last. According to Mitya Goroshevsky, this is one of the most complex smart contracts in the entire Free TON ecosystem, with over 20 unique contracts. DePool has been thoroughly tested for errors and continues to undergo formal verification.

Sergei Zaitseff, Senior Data Scientist and Product Owner of TON Live Blockchain explorer revealed the details of this process:

From October 2020 to February 2021, the DePool contract went through several stages of formal verification, and as new functionality was added, it was also checked by the Pruvendo formal verification team.

In an informal conversation, the Pruvendo team called DePool “the most complex contract they have encountered in the blockchain”.

As a result, the third version of the DePool contract, in which the Magister Ludi rewards were distributed, was released with approximately the following status:

The probability of critical bugs that can lead to the loss of the stake by the depositor is negligible.

Due to the complexity of the contract, formal verification is still ongoing.


Thanks to the DePool Game contest, Free TON has developed and tested a unique mechanism that allows you to control the emission of cryptocurrencies and involves any representative of the community in the activities of the platform.