Decred DEX is a decentralized, non-custodial, trustless, and intermediary-free cryptocurrency exchange platform. Decred DEX aims to solve a number of issues with existing systems of exchange.
Currently, the majority of cryptocurrency trading is performed via centralized, custodial exchanges. These exchanges have filled an important role in the blockchain ecosystem, but are in many ways antithetical to the spirit of blockchain. Blockchain is decentralized, trustless, and enables self-custody, but when a user must send their coin to a third party in order to trade, all of those benefits are lost.
Several projects have attempted to address this misalignment by replacing the exchange with a blockchain or a token, and they have met with varying degrees of success. While they remove the trusted third party (TTP), they insert their own products as a means to capture trading fees, which replaces the TTP friction with a new platform friction.
A more robust solution is based on atomic swap technology [2], which enables trustless exchange directly between wallets. Until recently, few blockchains supported atomic swaps, but the past few years have seen widespread adoption, and such an exchange is now possible.
Decred DEX is the first exchange built on atomic swaps that doesn't collect trading fees. The primary service offered by DEX is to match traders through a familiar interface based on markets and orders. Decred DEX's novel matching algorithm disincintevizes manipulative, abusive trading practices commonly seen on centralized exchanges. The epoch-based match cycle is difficult to game by the client, while for the server, cryptographic order commitments make censorship and unfair matching difficult.
While trades are fully trustless, steps are taken to discourage malicious clients from hindering normal trade activity. All clients must lock coins in bonds to trade. Registered clients are then bound to the rules of community conduct, violation of which typically results in loss of trading privileges.
In the interest of maintaining active, open-source, community-driven development, this specification document describes the protocols necessary for implementation of both DEX clients and DEX servers.
The remaining content details the Decred DEX protocol. It is intended as a first resource when implementing servers and clients. Continuing client-server interoperability will likely depend on subtle aspects of the specification laid out in this document.
[1] Communication Protocols describes the messaging protocols and communication layer technologies that are to be used for the DEX API.
[2] Distributed Exchange Design Fundamentals describes the notable design aspects that facilitate an exchange service with the features described above.- Exchange Variables
- Fees
- Transaction Fees
- Epoch-based Order Matching
- Identification
- Blockchain Interaction
- Adding New Assets
- API Version
- Connection Persistence
- Order Book Subscriptions
- Order Preparation
- Order Types
- Preimage Handling
- Match Negotiation
- Match Revocation
- Trade Suspension
[7] Atomic Settlement walks through the settlement process with a couple of examples to provide a high-level overview.
[8] Community Conduct describes the system of rules to which clients interacting with the DEX must adhere. [9] References lists references used in the development of the specification.