DFS’s Road to Decentralization

6 min readSep 15, 2020

Decentralization of the DFS project is the ultimate goal we pursue.

As for how to achieve complete decentralization, it is a road that requires us to take the courage and determination to take the first step and keep going.

For a composite DeFi project, complete decentralization is unlikely to be achieved overnight, and progressive decentralization is the current compromise.
The first step in the decentralization of DFS is to start with the multi-signature of the Swap contract.

DFS Swap introduction

DFS Swap is a decentralized exchange based on a constant product market maker algorithm.

This kind of decentralized exchange model in which everyone can provide funds to jointly build transaction depth and share transaction fees was originally proposed by Ethereum V and implemented by the Uniswap project of the Ethereum community.

This algorithm human-machine exchange model based on a single mathematical formula ignited the spark of revolution in decentralized exchanges.

Uniswap has used its daily turnover of over 100 million to tell us what a real decentralized exchange is.

This year, there have been a series of countless xxSwap projects spurting out. It is hard to tell the true from the false. With the popularity of DeFi, they are cheating every day, and they have tried repeatedly.

And DFS Swap is just one of them. The difference is that we are really doing the project seriously.

DFS Swap adopts the same mathematical formula as Uniswap, with 317 lines of clean code, on the EOS public chain with better performance, it realizes a complete decentralization that integrates independent currency listing, everyone's market making, and token swap. Chemical exchange.

Then, on the basis of keeping the code extremely simple in DFS Swap core, through external logic contracts, without affecting the trading and market making functions of DFS Swap core at all, a series of subsequent business function expansions will be made.

Such as DFS Pool mining pool, DFS Link oracle machine and so on.

DFS Swap has won various best practices in DeFi development and design. After experiencing a daily flow of US$95 million in 33 hours after the launch, until now, there has been no abnormality.

In terms of security audits, SlowMist and Paidun have been audited.

This is a code that has been tested line by line and word by word punctuation.

The contract contains 3 tables for storing data, and 4 actions for calling the functions of the contract. There are no other functions.

Because I believe in mathematics and code, there is no suspension, no risk control, no backdoor, and no admin key in the contract.

Swap is created based on a minimalist mathematical model. Input x must output y. There is no case where x is input, y cannot be calculated or y is calculated incorrectly. In math we trust. For the DFS Swap project, after signing multiple permissions, you no longer need to trust me, just believe in mathematics. Its principle is as unpretentious and boring as 1+1=2.
View link on contract table data and action interface chain

An excerpt from the DeFi protocol design principles of the Ethereum DeFi upper-class society:

  1. The longer the code is written, the less chance it will become the underlying infrastructure of DeFi. Will increase the audit cost of third-party callers. If you calculate the bug rate of 0.01% per line of code, the probability of writing 100 lines of code is 1%, and the probability of writing 1000 lines of code is 9.5%. Safety audits are only on this basis to reduce the probability of safety accidents.
  2. The DeFi protocol layer should remain open. Treat all access parties equally. It does not distinguish between ordinary users, third-party smart contract contracts, or proxy accounts.
  3. The DeFi protocol maintains the software design principle of single responsibility. A smart contract only focuses on things within your own business.
  4. Permissionless: Free access, anyone can become a part of the system. Only need to have a blockchain account. This is the first condition for the DeFi agreement to become a global inclusive financial infrastructure.
  5. Trustless: Believe in code, believe in mathematics, believe in cryptography, and believe in blockchain. Verifiable trust. Better than any strong credit endorsement.
  6. Serverless: Weaken the importance of front-end and server-side. The front end can be decentralized. Anyone can develop their own front-end based on the protocol interface. Only the contract runs on the chain, and the chain on the project is there. In addition, there is no single point of failure. Such a DeFi agreement can theoretically provide endless financial services to the world throughout the year.
  7. Priceless: The transaction quotation system that comes with the chain. Do not rely on centralized quotations. Eliminate the risk of oracle attacks.

DFS Swap’s multi-signature scheme

Excuting an order:
cleos set account permission defisswapcnt owner '{"threshold": 5,"keys": [],"accounts":[
]}' -p defisswapcnt@owner
Multi-signature selection
msig.tp@active 1/5
eoscannonchn@active 1/5
whaleex.com@active 1/5
wangruixiwww@active 1/5
b1@active 1/5
dfsdeveloper@active 2/5
The purpose of multi-signature is to take a big step towards the ultimate goal of complete decentralization.

The purpose is to prevent internal risks. Therefore, the following different types of representatives were selected to participate in the multi-signature.

Community Representative: eoscannonchn EOS Group Canon Community Project Representative: msig.tp TP Wallet Project Party + Super Node Representative: whaleex.com Whale Exchange Representative: wangruixiwww Wang Shoufu DFS Project Party: dfsdeveloper Special attendance: b1 Just that

Permission multi-signature description:
The total threshold is 5, weight distribution, the other 5 multi-signature parties 1, and the project party is 2. Under this multi-signature permission assignment, when the contract account initiates any chain operation, if it is initiated by the project party, at least 3 multi-signature parties are required to cooperate. If it is initiated by another multi-signature party, if there is no cooperation from the project party, the four parties need to join together and then draw b1 together.

Multi-signature contract account authority is an excessive solution on the road to complete decentralization.

When DFS Swap, after the test of time and big money, in the next two to three years. Then choose the opportunity to initiate a true decentralized permission setting.

Regarding the issue that the EOS smart contract can be modified after deployment, so that it is despised and criticized, here is an old article in the community for popular science, and those who are interested can expand reading.

[In-depth understanding of EOS] Permission solutions for decentralized smart contracts

The timeline for the full open source of DFS code
As the saying goes without open source, not DeFi , we want to continue this lineage from Bitcoin followed to the Ethernet to Ethernet Square Square DeFi ecological tradition. Practice the blockchain spirit of Code is law and In math we trust that we pursue in our hearts.

At present, we insist that every line of code from non-core smart contracts to the front-end is open source.

The existing core smart contract code is expected to run smoothly for six months to more than one year. Open source completely. The main reason is that the security audit is a bit expensive, so let's give the code to everyone after I pay the bill.

Developers are responsible for writing secure code, and users choose to use secure code. The trust in the open financial network based on blockchain technology in the future must come from open source.

Please look forward to our comprehensive open source plan.

In summary

One more step for signing permissions is a big step for safety.

The code is non-toxic and safe to eat. No need to ask me if I will run away. The EOS public chain will not fail, and DFS Swap will last forever.




Welcome to Dfs-network official medium page Take a dive to our app https://apps.defis.network/