The Evolution of the Decentralized Exchange: A Brief History

The Blocknet Protocol
21 min readMay 13, 2019

--

A Vision

When Bitcoin first exploded into the world back in 2009, it was revolutionary. The first ever decentralized P2P currency with no single entity controlling it. The vision and ideals of Satoshi Nakamoto inspired millions of people across the globe and multiple cryptocurrencies were created. This quick evolution of the crypto-ecosystem dictated a desperate need for people to exchange their cryptocurrencies with one another and so, in 2010 the very first cryptocurrency exchange opened, Bitcoinmarket.com. It would be the first of many. While the growing list of new exchanges enabled massive growth for crypto markets, this growth came at a cost. These exchanges were all centralized and were operated and under the control of the people and entities that built them. Many saw this as a huge problem and some even viewed it as a betrayal of the original ideology of Satoshi Nakamoto and Bitcoin. However, the problem went beyond ideology and was actually far worse. First, users had to relinquish control of their crypto to a third party to actually use a centralized exchange (CEX), and second, hackers also found centralized exchanges an easy target. Many users lost their funds because they entrusted them to centralized exchanges and when those exchanges were hacked, it was already too late. It quickly became obvious to everyone that the ideology of Bitcoin and decentralized money needed to be applied to exchanges. How do you trade without giving up control of your funds to a third party? How do you remove the need for trust? The answer was decentralized exchange (DX). The race had begun!

The Beginning

On the 3rd January 2014 NXT announced their intention to create a decentralized exchange and the NXT Asset Exchange was eventually launched. This was one of the very first decentralized exchange systems. NXT asset exchange used the NXT digital currency as the fuel for the NXT ecosystem using it to create assets that represented for example, bonds or network storage. The term “colored coins” was later applied to this system of creating assets on pre-existing blockchains. However, in this early iteration of a DEX, the assets could only be traded for the NXT coin and direct asset to asset trading was not yet possible. In addition colored coins could only be sent to wallets that supported the Open Assets Protocol. But the decentralized crypto space was still young and 2014 proved to be a year of innovation and evolution with regards to DEX’s. Around the same time, Counterparty launched their DEX. Once again, trading was limited to Counterparty related assets because Counterparty was built as an asset layer inside the Bitcoin blockchain. This was an improvement on the colored coin approach as unlike colored coins, Counterparty tokens were not tied to the BTC balance of any given address. However, when trading these assets on the Counterparty exchange, all buy and sell orders were automatically escrowed into the Bitcoin blockchain via the Counterparty protocol. Because of this, confirmation of these transactions could take some time. But the DEX ecosystem continued to grow and change. One of the projects on the NXT ecosystem called multi-gateway evolved away from NXT and into Supernet who then created the Komodo platform in 2016. As 2014 drew to a close it became obvious a truly decentralized trading system had yet to be introduced as so far, all solutions relied upon either a time consuming and complicated escrow system or trading was limited to blockchain-specific assets. This first generation of decentralized exchanges brought the problems still to be solved into focus. As the end of 2014 approached, Blocknet announced their intention to create the first truly decentralized exchange, Block DX.

Blocknet understood that true trading decentralization could only be achieved if the four core components of trading were ALL decentralized: (For an in-depth review of why this matters, please read Understanding a Decentralized Exchange or read the details further down below.)

  1. Capital deposits
  2. Order broadcast
  3. Order matching
  4. The exchange of tokens

With this understanding, Blocknet then set out to build the Blocknet Protocol. A second layer blockchain interoperability protocol that would form the foundation of truly decentralized trading and reflect the original principles of Bitcoin: openness, transparency, inclusivity and a high level of decentralization. The Blocknet Protocol was designed to maximize inter-chain interoperability allowing for the decentralized exchange of assets, inter-blockchain communication, and monetization of services. This would enable dApps (decentralized applications) to be built on the Blocknet Protocol. (You can read more about how Blocknet is meeting the need for interoperability here.) The first dApp to be built on the protocol was Block DX. While the building of a protocol takes longer because features have to be built into the protocol itself, the advantages are numerous and the use cases vast.

DEX Generations

While the Blocknet Protocol and Block DX were in development, others began to build their own decentralized exchanges. Various methods of decentralized trading were explored by a number of developers, one of which was an escrow / Multisig trading method. This way of trading emphasized the honesty of both parties that were undertaking a trade: assets were held by an independent third party or system protocol on behalf of the two parties who were engaged in the exchange. Once both parties had completed their part of the exchange transaction, the asset was released from the escrow / multisig system. However, this was still not an ideal system because during this escrow process, you are no longer in control of your assets because someone / something must decide who those funds ultimately go to. As 2014 turned to 2015, other options continued to be explored, one of which was the Atomic Swap system of trading. Blocknet began testing some of the very first atomic swaps during this time. But more about that later. Slowly but surely, three main variants of decentralized exchange methods emerged, each falling into a rough lineage of DEX generations:

1st Generation DEX — Currency or Chain Dependent: Reliant or built on a specific chain.

2nd Generation DEX — Contract Dependent: Reliant on smart contracts and ethereum

3rd Generation DEX — Currency Agnostic / Protocol-based / Partially Decentralized Hybrid: Not limited to specific blockchains.

Let’s take a look at the first generation of the DEX:

1st Generation DEX — Currency or Chain Dependent: (Reliant or built on a specific chain)

In 2016 Waves announced their DEX. They used the “colored coins” approach but this was not a representation of true decentralization. Blocknet’s Arlyn Culwick on colored coins:

“As a trader, you’d have to deposit your coins for some underlying token in order to trade. This does not decentralise deposits, even if the underlying architecture is distributed. Additionally it requires you to trust some manner of intermediary to redeem your colored coins for a real coin when you want to withdraw. If you’re building a decentralised exchange, the main objective is to provide an alternative to having to trust some intermediary with your coin deposits. colored coins cannot achieve that, and so I cannot consider any exchange of this type a decentralised one in the true sense of the word.”

Others also recognised these limitations and the leading colored coin wallet, Coinprism, founded in 2014, recently closed its doors with its founder stating:

“While we have been one of the first in the area of blockchain tokens, long before ethereum was even released, the ecosystem has since shifted towards ERC-20, which is more flexible and more powerful than bitcoin-based systems,” he wrote, adding:

“The unpredictability of transactions fees and confirmation times in the past couple of years have also made it hard to argue bitcoin is a good platform for this.”

Another system of trading that is loosely connected to the chain dependent colored coin method (because it relies on a central entity issuing 1:1 tokens) and borrowed from the centralized exchange system of trading is the IOU / proxy token method. The partnership between Bitshares and OpenLedger used the IOU / Proxy token system. The proxy token on Openledger is called Open.BTC. A 1:1 representation of BTC. The problem with this is that you must first trust a third party and second, that a user does not have control of the assets they have exchanged before or after a trade has occurred — control is only regained once the assets have been processed and withdrawn from the exchange. You can read more about the IOU / proxy system of trading here.

2nd Generation DEX — Contract Dependent (Reliant on smart contracts and Ethereum)

The 2nd generation of DEXs relied on Smart contracts built on Ethereum. This means users must deposit their tokens into a smart contract to be able to execute a trade. While Ethereum is indeed more flexible, there are still specific limitations tied into decentralized exchanges built on Ethereum smart contracts such as IDEX who went live last year and Etherdelta who launched in 2017. Ethereum creator Vitalik Buterin, explains smart contracts:

“an asset or currency is transferred into a program “and the program runs this code and at some point it automatically validates a condition and it automatically determines whether the asset should go to one person or back to the other person, or whether it should be immediately refunded to the person who sent it or some combination thereof.”

This is great if you only want to trade Ethereum tokens but because Ethereum Smart contracts run on the ethereum blockchain, trading with non-ethereum tokens is not possible. Using smart contracts also means you are depositing your funds into a smart contract which holds your funds, only then allowing you to trade. The same is true if you decide you want to withdraw the funds. If you want to use those funds for something else, you may miss your opportunity as they are still tied up in the smart contract and it will take time to withdraw them. You must also trust that the smart contract has been correctly coded and written with zero bugs or exploits that may allow a bad actor to hack the contract and the exchange process itself. To complicate things further, on some Ethereum exchanges users must use the Metamask wallet to trade, which can be very confusing to a new trader, and is also a “hot wallet” where your funds are at risk from hackers because the wallet is online. While systems built on Ethereum were a vast improvement over earlier iterations, they were still not perfect. Smart contracts are still slow. To address these speed issues, exchanges such as EtherDelta have centralized their order books on a server. This is not an ideal solution as centralized order books could potentially be a single point of failure and could allow manipulation of the order books (front running) as well as censoring of the order books. An additional point of failure was the requirement to log into the etherdelta website. Unfortunately, this weak point was exploited by hackers and users funds were stolen. Any system that requires the creation of an account, holds your funds online or requires some form of deposit or withdrawal is not decentralized because you are required to relinquish control of your funds to a third party system. This is NOT a non-custodial trading system and thus is not truly decentralized. Because of this, Etherdelta, IDEX and similar exchanges can be better categorized as hybrid exchanges as some components such as orders books are centralized and account creation may be required. In the case of IDEX specifically, they are even able to halt trading altogether. This would not be possible on a truly decentralized exchange.

3rd Generation DEX — Currency Agnostic / Protocol-based / Partially Decentralized Hybrid. (Not limited to specific blockchains)

So how to get around these problems? How do you achieve safe and secure decentralized order books? How do you open up decentralized trading beyond Ethereum tokens? This brings us to the 3rd Generation of DEX’s: those that are built on or use a protocol. So what precisely is a “protocol”? In short, a protocol is an open standard on which developers can build and customize. It allows value to be assigned to whatever token they choose that utilizes that protocol. There are many protocols being worked on but one of the most widely used is the 0x protocol which was announced in 2017. The 0x protocol was primarily designed for the ethereum network to allow two or more parties to more easily communicate with one another. Many ethereum based exchanges use the 0x protocol as a way of decentralizing their order books. The 0x protocol acts as a “relayer” so that off-chain orders are relayed to the chain so they can be settled on-chain. Relayers act as a trading exchange, but they can’t execute trades, they just manage the off-chain orderbook. Because 0x is based on smart contracts (although still a protocol), an argument could be made as to whether a DEX built on top of it can really be classed as a 3rd generation DEX and perhaps a more accurate description for a 0x DEX would be somewhere between a 2nd and 3rd generation DEX. You can read more about 0x here.

In December 2017, Radar Relay recognised that building on a protocol is much more beneficial and announced they would be building a DEX on top of the 0x protocol. However, users still required a third party “hot” wallet such as Metamask which could be a security risk as highlighted previously. But 0x is just a single protocol. There are other decentralized, currency agnostic protocol systems but even these are not completely decentralized. For example the Kyber Network Protocol uses a 3rd party “Reserve Manager” system. Using this method, effectively you are trading with these reserve managers and not other traders directly. Additionally, cross-chain swaps cannot be achieved on Kyber. Another example is the Bancor Protocol that was used to build the Bancor network Exchange. However, the exchange was hacked and users funds were stolen resulting in its claims of being decentralized being strongly questioned.

By this point in the evolution of DEXs many avenues had sprouted and were being explored. Because building on a protocol was mostly limited to Ethereum tokens, other decentralized exchanges wanted to be able to offer trading of non-ethereum tokens and chose not to build on a protocol and instead build on pre-existing blockchains to save time. It is much quicker and easier to build on something that already exists rather than creating a new protocol from scratch. However, the major drawback on following the non-protocol route is that most pre-existing systems still require additional centralized components to be created and are tagged onto the system rather than being an inherent part of it. For example, the Ark Smart-Bridge system which was announced in 2016 requires individual Blockchains to directly implement the ARK SmartBridge product into their code. This means transactions would need to take a “pitstop” on the Ark Blockchain and any chain that wanted to use the smartbridge system would need to adjust their own code before doing so. This is a barrier to building a DEX if ARK follow this path. The aforementioned Komodo platform offered many great innovations such as private transactions, side chains and more, but was still a “middleman” solution and not built on a protocol. Billing themselves as the “platform of platforms”, developers were restricted to using the Komodo platform only. This could be very limiting as it is an enforcement of a “one size fits all” approach, which is a barrier to potential innovation. By this time, Komodo had also begun utilizing an (unrecognized) atomic swap process on its own DEX, Barterdex, but they use a partially centralized order matching system for buy and sell orders that is similar to Waves and also feature centralized Electrum servers in the trading process itself which ultimately increases risk and reduces decentralization. Since Bartedex was not built on a protocol geared specifically towards decentralized exchange and the Komodo system requires nodes to back up the Komodo Blockchain every 10 minutes into the KMD chain and then into the BTC chain, this “piggyback” system may cause scaling issues in the future as this process may cause blockchain bloat due to the limitations of the BTC block, which is also about 10 minutes or 1MB per block.

Concurrently, Blocknet had continued to build the Blocknet Protocol with the aim of being an un-opinionated connector of blockchains without being a middleman to the data itself. A way for developers to contact and connect blockchains freely without having to do so via a single platform or unnecessary “platform on a platform”. This is why Block DX was built on top of the Blocknet Protocol. Blocknet understood that building on an interoperability protocol will help achieve liquidity across multiple decentralized exchanges.

While development of the Blocknet Protocol continued, so did the development of other exchanges. In May 2017 EOS announced the EOS protocol, a decentralized blockchain protocol that would be the foundation of the EOS decentralized exchange, DEXEOS which would run on decentralized nodes. However, the amount of nodes was very small at only 21, which was a concern for many with regards to true decentralization. Recently, EOS chose to freeze the accounts of users leading many to further question the claim of being decentralized.

Time moved on and in summer 2017 CryptoBridge announced they would build their DEX on the Graphene-Bitshares Blockchain. While this was a good choice for scalability, it still had drawbacks. Even a currency agnostic exchange such as CryptoBridge still required deposits, withdrawals, and account creation which relies upon trusting a group of multisignature federated gateways to confirm or deny your withdrawals. This means you must trust that gateway operators will not collude (a problem that any gateway system could suffer from). Additionally there is a risk of dependency and centralization as CryptoBridge relies on the Bitshares Blockchain, which also means it could be affected by decisions made by the BTS committee. In other words, still not 100% decentralized. It seemed that however the problems of decentralization were approached, a truly 100% decentralized exchange still did not exist and the list of problems still to be overcome was not getting any shorter. What was needed was a system of trading that was NOT restricted to Ethereum, was currency agnostic, that did not involve a third party, an escrow system, a colored coin, a single platform or the insertion of code into other blockchains….

Blocknet had been working on these very issues. The Blocknet Protocol had continued to be developed to a point where the protocol would now “just work” with the majority of other blockchains without any additional inserting of code into any other blockchain as a requirement. A dynamic “all in one” solution. This allowed Blocknet to utilize a different way of trading; the “Atomic Swap”.

So what is an atomic swap exactly? An atomic swap shrinks and speeds up the actual trade mechanism. Atomic swaps are much faster than having to deal with escrow-based or other centralized trust/audit-based solutions. An important distinction is to be made here: some exchanges such as Bitshares use atomic swaps, but these swaps are confined to the bitshares chain only. They are not Cross-chain swaps. With Cross-chain atomic swaps, trades are not limited to single chains and can take place across any blockchain between any token pairs. Briefly, trades use a single hash in a checklocktimeverify account which is shared between two parties. Two transactions on each chain take place using asynchronous timelocks. This allows both parties to trade securely and safely directly with each other (p2p) without funds ever being deposited anywhere else. This is much safer because your funds never leave your control and no third party is ever involved. Block DX and the Blocknet Protocol utilizes atomic swaps to ensure 100% decentralized, direct wallet-to-wallet trading. In early 2018, Blocknet launched the beta version of Block DX. Built on the Blocknet Protocol with no account creation, no third parties, no blockchain limitations, no trading pair limitations, no listing fees, a P2P orderbook and direct wallet to wallet trading via atomic swaps, Block DX represents the 4th generation of decentralized exchanges:

4th generation DEX — Currency Agnostic / Fully Decentralized — Protocol Based: Not limited to specific blockchains.

True Decentralization and the 4th Generation DEX

As you have read, many systems are referred to as decentralized exchange. They are all different and so cannot all correctly claim the term “decentralized”. Many would fall under the 3rd generation “hybrid exchange” category.

The landscape is confusing and it’s not easy to determine which systems are actually truly decentralized and which are closer to a hybrid decentralized exchange or in some cases not decentralized at all. So what does it mean to be a truly decentralized exchange? What are the criteria? When looking to identify if an exchange is truly decentralized, ask yourself these questions:

Block DX is a completely decentralized and trustless exchange dApp built on the Blocknet Protocol that mimics a centralized exchange experience and enables traders to conduct exchanges directly from the wallets of the coins being traded. Using atomic swaps via the Blocknet Protocol, a trustless, direct wallet-to-wallet exchange is achieved, thus eliminating the need for trust in a third party. Funds are in your possession at all times, and you trade directly from your own wallet. It has been created to further the original ideologies of cryptocurrencies — the decentralization of money. To that end, Block DX has endeavored to remove all the common barriers that still plague centralized and hybrid exchanges. Here are some benefits to using Block DX:

Design

Block DX is a dApp and is not website based for added security. It was built on the Blocknet Protocol because the protocol was designed to maximize inter-chain interoperability. This is made possible through the protocol’s two core components: a data transport system and decentralized asset exchange (XBridge) and a blockchain router (XRouter).

  1. XBridge

XBridge is a serverless DHT-based peer-to-peer network. On a given local machine, nodes on this network are integrated with nodes on other networks, making the network an inter-chain network overlay. This enables lookup, location, and broadcast between nodes on any blockchain network. The exchange component allows for trustless transactions between different blockchains. Cross-chain atomic swaps may be performed between any digital asset that is supported by the protocol.

2. Blockchain Router (XRouter)

The purpose of the router is to trustlessly direct service requests through the proper Service Nodes. For example, if creating a dApp on Ethereum, you may require storage functionality. Ethereum doesn’t intrinsically handle file storage very efficiently. In this scenario, XRouter can be used to interact with other blockchains such as Storj, Filecoin, Sia, or Swarm to utilize their storage services. Or let’s say that in a supply chain there will be multiple blockchains being used at various steps of the process much like there is today with traditional software stacks. The Blocknet Protocol and XRouter would allow information to be accessible between these different blockchains. For Example, pharmaceutical manufacturers have strict regulations to follow and need to provide certain information and assurances. Being able to access batch information from the raw materials being consumed, temperature and humidity information during transportation, and final destinations are all important. A smart contract could utilize XRouter to gather this information from each respective chain and write it to the pharmaceutical’s blockchain along with the batch code. XRouter would enable this communication to occur in a trustless way, which is important to ensure validity of the information. (This routing technology can be used for other services as well that you can read more about here and view the API’s here.)

Fees and Orderbook

There is no Maker fee and the Taker fee is currently 0.015 BLOCK. You can read more about the fees here. A Service Node can only earn fees from trades performed on coins that the node supports, which incentivizes nodes to run more full blockchains. Currently 100% of trading fees are paid to the Blocknet community which maintains the protocol. Read more about Service Nodes and stakers here. The orderbook is decentralized and off-chain, which enables matching to take place off-chain with the swap still taking place on-chain, preventing front running and market manipulation. However, trade time is independent of the block time of the asset being traded. There is no middleman on Block DX transactions. Trading is directly wallet-to-wallet. The exchange component is broken into the 4 core functions of an exchange: capital storage, order books, order matching, and asset exchange. These core functions are decentralized in the following ways:

  1. Capital Storage — Funds remain in each party’s wallets, and are not entrusted to a third party at any stage.
  2. Order Book — Orders are broadcasted directly from party to party over the 400+ Service Node network and are completely decentralized. Order broadcast is via a spam-resistant p2p interchain overlay network. A party’s app compiles the order book themselves instead of relying on a central order book service. All integrators and services on the protocol share the orderbook and liquidity. Blocknet Service Node host full nodes of the blockchains the protocol is compatible with, manage and cross-verify the orderbooks, verify interactions between peers and route communication between blockchains. This orderbook shares liquidity for any services that utilize the Blocknet Protocol. Currently there is just support for a public order book, but there are plans for a private orderbook and direct trading as well.
  3. Order Matching — Orders are matched directly between parties. The order matching is undertaken by the Order Maker in a direct p2p action with a Taker of their selection. When one accepts another’s order, their clients communicate to set up the exchange process, and this is broadcasted over the inter-chain network. The matched orders then proceed with the cross-chain atomic settlement between the counterparties.
  4. Asset Exchange — The exchange of tokens is achieved without the involvement of an intermediary, in a manner that does not require counterparties to trust one another beforehand. An atomic protocol is utilised (meaning that either the exchange of both currencies takes place, or nothing takes place), which employs OP_CHECKLOCKTIMEVERIFY to nullify transaction malleability-based attacks.

The order system as described avoids both the performance limitations of on-chain order systems and the trust-laden nature of other off-chain order systems. No other DEX achieves a decentralized orderbook in this way. For further reading, see the white paper or check out the Blocknet API pages.

Ease

A vital component to the success of a decentralized exchanged is the user interface (UI). To that end, Blocknet partnered with VSA Partners, a design agency with over 30 years experience who have worked with clients including Google, Alibaba, IBM, CME Group, Northern Trust, Goldman Sachs and more. The Block DX UI has been designed to be inclusive, user friendly and to mimic a trading experience that reflects those of centralized exchanges. But what about ease of use for developers and communities of new coins and tokens? It will not cost anything to list an asset on the Blocknet Decentralized Exchange. This removes another barrier for traders and will help developers who want to get their new coin listed. It will help liquidity and encourage innovation in the cryptosphere. The Blocknet was designed to maximize interoperability and so most blockchain tokens may be integrated with no coding required. The current integration requirements are:

  1. Support for OP_CHECKLOCKTIMEVERIFY
  2. A stock JSON RPC interface from Bitcoin Core

As a result, Blocknet supports the majority of cryptocurrencies, and no permission from anyone is required for new assets to be listed or traded on the exchange and there are no limitations to trading pairs. In this way, the maximum amount of inclusion is achieved. For Ethereum based tokens, integration will be achieved via the 0X protocol or a Blocknet contract. Additionally, Block DX comes with an automated setup system so users can begin trading in just a few minutes. Check out a setup and trade video below.

Scaling

The Blocknet Protocol is fast and the capacity of the protocol increases with its user base. Since order broadcast and order matching are completely decentralized, there are no bottlenecks (such as chain bloat) other than the ones which lie with users, namely their local internet connections. You can read more here.

Speed

Trades on Block DX are fast, with most trades taking about 15 seconds to complete. (There is however, an inherent limitation in the blockchain a party chooses to use that affects the time between an input being exchanged and re-traded or spent, which is the blockchain’s confirmation time.) If a party wishes to exchange Bitcoin at a “trustless” level of security that is immune to mining issues, they should wait for their desired number of confirmations until re-trading funds. It should be noted, though, that the risk increases with less confirmations used when trading assets with high network congestion such as Bitcoin.

Security

Block DX is a dApp and not website-based for added security. Allowing users to trade wallet-to-wallet and utilizing atomic swaps ensures that they are in control of their funds at every step of the exchange process and able to stop the trade and redeem their funds at any point prior to the exchange.

Comparisons

To help clarify further, please take a look at this comparison chart to see how Block DX compares to other exchanges:

The Future

SPV integration is underway. CloudChains Inc. (a separate entity from Blocknet) has begun development of a lite multi-wallet dApp which uses XRouter’s multi-chain SPV. This allows for transactions to be verified through our Service Node network that are sent from a multi wallet or lite wallet and removes the requirement for a trader to have the synced blockchain of any assets being traded. The dApp will utilize a serverless architecture by hosting microservices on XRouter’s plugin system (XCloud) to provide functionality. On Block DX, a number of upgrades and improvements are coming including a confirmation slider to allow for easy selection of confirmation times, ETH compatibility for cross-chain swaps with ERC20 tokens, market and limit trading, and much more! You can check out the roadmap for Blocknet here and you can start trading with over 100 tokens (or over 5000 trading pair combinations) on Block DX right now by downloading it here and following the setup guide.

— — — — — — — — — — —

Website / API Docs / Documentation Portal / Discord / Twitter / Medium / Telegram / Reddit / Steemit / Newsletter / Facebook / YouTube / DTube / Instagram / Minds / BitcoinTalk / Proposal Forum / Arlyn’s Blog / Block Node Info / Blockdx.co

--

--

The Blocknet Protocol

Blocknet is a 2nd layer blockchain interoperability protocol that enables communication, interaction & exchange between different blockchains.