Decentralized exchange (“DEX”) is a concept that has received increasing attention in the cryptocurrency domain as a result of exchanges being hacked, used as exit scams or subjected to regulatory actions. Several cryptocurrency projects exist with the intention of replacing typical centralized virtual-only cryptocurrency exchanges with a token or a blockchain. We propose an alternative to existing decentralized exchanges with the following properties:
- It facilitates exchange between only cryptocurrencies, not fiat currencies.
- It is architected as a simple client and server, without a corresponding token or a blockchain.
- Server operators never take custody of client funds.
- It uses on-chain transactions for order fulfillment and rule enforcement.
- Server operators collect no fee for matching orders.
- Adding support for coins is a straightforward matter of adding the corresponding atomic swap support.
- Orders placed on the exchange can be internally regulated via rules enforced by the clients and the server.
- Malicious clients are managed using a reputation system based on Politeia.
- There is an upfront fee to create a client account on a server, to discourage malicious behavior.
- Order matching occurs pseudorandomly within epochs.
- Order sizes on both the buy and sell side of a trading pair have standardized lot sizes.
- Limit orders and cancels are broadcast by clients via the server, but market orders are routed from client-to-client.
- Near-instant exchange for smaller orders can be achieved through a related off-chain LN-based network which uses atomic swaps.
- Servers can connect via a mesh network to allow cross-server order matching.
- External services, e.g. wallets, can access a simple client API on the server that provides a data feed, ability to place orders, and other services.
I believe this infrastructure has the ability to substantially improve the resiliency of the cryptocurrency ecosystem as a whole, and Decred markets more specifically. In what follows, I will explain the various considerations that have led us to propose the architecture summarized above.