KEMBAR78
Decentralised Exchanges - An Introduction | PDF
Decentralised
Exchanges
An Introduction
by
Priya Satoshi
About Me
• Blockchain & Cryptocurrency Enthusiast
• Blogger
• Researcher
• Where to find:
• Twitter @twitmyreview
• Medium: https://medium.com/crypt-bytes-tech
• Slideshare: https://www.slideshare.net/PriyabrataDash2

Agenda
• What are Centralised Exchanges
• Issues with Centralised Exchanges
• What are Decentralised Exchanges
• Benefits & Issues of DEX
• Examples of DEX
• Q&A
• What are Centralised Exchanges
• Centralised cryptocurrency exchanges are online platforms
used to buy and sell cryptocurrencies. They are the most
common means that investors use to buy and sell
cryptocurrency holdings.
• This means that all orders are taking place in one specific
“location”, as they are all routed through the Cryptocurrency
Exchange.
• In the term "centralised cryptocurrency exchange," the idea of
centralisation refers to the use of a middle man or third party
to help conduct transactions. Buyers and sellers alike trust this
middle man to handle their assets.
• Transactors trust not only that the exchange will safely
complete their transactions for them, and they also make use
of the network of users in the exchange in order to find trading
partners.
• In the case of cryptocurrencies, which are often stored in
digital wallets, an individual can lose digital currency holdings
simply by forgetting the key to a wallet. An exchange is
entrusted to safeguard the holdings in place of the individual
investor.
Examples of Centralised
Exchanges
• Coinbase
• GDAX
• Kraken
• Poloniex
• Bittrex
• Bitfinex
• Bitstamp
• Gemini
• Zebpay
• Coinsecure
• Unocoin
Issues in Centralised
Exchange
• security
• outages
• Identity Breach Risks
• Laborious Verification Processes
• high fees
• Price Manipulation/Insider Trading
• front running
What is a Decentralised
Exchange
• A decentralised exchange is an exchange market that does not rely on a third party service to hold
the customer’s funds. Instead, trades occur directly between users (peer to peer) through an
automated process.
• Decentralised exchanges, do not store any coins or private keys on central servers
• This system can be achieved by creating proxy tokens, distributed anonymous order books, atomic
swaps or through a decentralised multi-signature escrow system.
• Key Features
• No centralised control over infrastructure
• Funds controlled by the user
• Compatibility with hardware wallets
• Anonymous Accounts
• Exchange In-A-Box
• Solving the Fiat problem
Centralised vs Decentralised
Exchange Comparison
Benefits & Issues of DEX
Benefits
• Faster and Cheaper
Transactions
• Potentially More Difficult to
Hack
• Seamless Integration with
Secure Hardware Wallets
• Funds Controlled by Users
Rather Than a Central
Corporation
Issues
• Difficult to Use
• Lack of Robust Features and Functionalities
• Low liquidity
• Order books on chain slows down trading when
the used blockchains themselves have scaling
problems
• Some decentralised exchanges like Bisq require
users to be online in order for an order to be
listed and for the trade to take place, requiring
users to perform certain actions like singling that
a payment was received.
• Trading features like margin trading, lending and
stop loss are currently not available in the
decentralised model as they only allow the basic
exchange of currency for a predetermined value.
DEX - Key Concepts
• Common base token: Ethereum and Nxt/Ardor allow new token creation on top of them using
the underlying ethereum and nxt blockchains. Nxt/Ardor has a built in exchange and creating
ethereum smart contracts for an exchange for ethereum based tokens is not that hard to do.
The major drawback is that only assets/currencies built using the base platform are supported.
• Escrow: Requires a mutually trusted party that holds all funds or some collateral. Multisig and
smart contracts can automate part of the escrow( in most cases releasing the cryptocurrency
funds in case there is no dispute).
• Cross chain transactions: Some algorithms have been developed to secure cross chain token
exchange withouth a central exchange holding all the funds. It achieves waterproof validation
without introducing the problems and complexities introduced by a escrow-based validation
system. While simple in concept,most of them have a pretty complex UX and require an off-
chain communication channel. One of the most known ones is decred atomic swaps or
variations on this. The Major drawback is that only cryptocurrencies are supported.
• For traditional money to and from cryptocurrency conversions Only solution so far is to use
escrow.
Decentralised Exchange -
Evolving Architecture
• Some take ideas from the structure of centralised exchanges and add decentralised
elements
• Others take a more radical peer-to-peer approach in the decentralisation of digital asset
trading.
• Most adopt the concept of an order book in their design decision while some embrace a
more peer-to-peer alternative of directly swapping assets with others.
• All of the DEXs follow a non-custodial nature in their architecture
• Options for DEX protocol design:
• on-chain order book: Etherdelta, Omisego
• on-chain peer-to-peer: KyberNetwork
• off-chain order book: 0x
• off-chain peer-to-peer: Airswap
DEX -Example Workflow
• Workflow for Kyber token exchange: 1. Makers post their exchange rates and size information to a smart
contract 2. Takers query this smart contract for instant exchange 3. Exchange update occurs notifying both
maker and taker
• Workflow for 0x token exchange: 1. Maker posts a signed order to Relayer, 2. Taker queries the Relayer 3.
Taker selects an order to match, 4. Taker submits order to exchange via smart contract
• Workflow for Kyber token exchange: 1. Makers post their exchange rates and size information to a smart
contract 2. Takers query this smart contract for instant exchange 3. Exchange update occurs notifying both
maker and taker
• Workflow for AirSwap token exchange: 1. Maker posts a token pair as “intent to trade” 2. Taker queries the
indexer for token pair 3. Taker fetches counterparty from Maker 4–5: Maker and Taker directly negotiate a
suitable trade 6. Taker submits order to smart contract for execution
• Workflow in EtherDelta: 1.Maker creates a new order: ERC20 token, the amount, the ETH amount in return
and whether it’s a buy or sell order. 2. Maker creates a cryptographic hash of that order (using SHA3) 3.
Maker then uses their Ethereum private key to sign the order hash (using ECDSA and in particular the
Secp256k1 implementation which is also used in Bitcoin) 4. Maker sends order off chain together with the
signature (In EtherDelta this is accomplished via a set of servers all communicating JSON messages via
WebSockets) 5. When Taker wants to trade against the order, the signature and order information is send to
the smart contract’s trade function. 6. The smart contract verifies that the signature originated from Maker 7.
The smart contract makes sure order is not expired or filled. 8. Funds are transferred and fees are taken.
Examples of Decentralised
Exchanges
• Waves
• 0x
• Kyber
• Omega One
• Airswap AST
• Legolas
• Bitshares
• Ether Delta
• Bisq
• Stellar
• NXT
• OpenLedger
• IDEX
• Airswap
Thank You & Q&A

Decentralised Exchanges - An Introduction

  • 1.
  • 2.
    About Me • Blockchain& Cryptocurrency Enthusiast • Blogger • Researcher • Where to find: • Twitter @twitmyreview • Medium: https://medium.com/crypt-bytes-tech • Slideshare: https://www.slideshare.net/PriyabrataDash2

  • 3.
    Agenda • What areCentralised Exchanges • Issues with Centralised Exchanges • What are Decentralised Exchanges • Benefits & Issues of DEX • Examples of DEX • Q&A
  • 4.
    • What areCentralised Exchanges • Centralised cryptocurrency exchanges are online platforms used to buy and sell cryptocurrencies. They are the most common means that investors use to buy and sell cryptocurrency holdings. • This means that all orders are taking place in one specific “location”, as they are all routed through the Cryptocurrency Exchange. • In the term "centralised cryptocurrency exchange," the idea of centralisation refers to the use of a middle man or third party to help conduct transactions. Buyers and sellers alike trust this middle man to handle their assets. • Transactors trust not only that the exchange will safely complete their transactions for them, and they also make use of the network of users in the exchange in order to find trading partners. • In the case of cryptocurrencies, which are often stored in digital wallets, an individual can lose digital currency holdings simply by forgetting the key to a wallet. An exchange is entrusted to safeguard the holdings in place of the individual investor.
  • 5.
    Examples of Centralised Exchanges •Coinbase • GDAX • Kraken • Poloniex • Bittrex • Bitfinex • Bitstamp • Gemini • Zebpay • Coinsecure • Unocoin
  • 6.
    Issues in Centralised Exchange •security • outages • Identity Breach Risks • Laborious Verification Processes • high fees • Price Manipulation/Insider Trading • front running
  • 7.
    What is aDecentralised Exchange • A decentralised exchange is an exchange market that does not rely on a third party service to hold the customer’s funds. Instead, trades occur directly between users (peer to peer) through an automated process. • Decentralised exchanges, do not store any coins or private keys on central servers • This system can be achieved by creating proxy tokens, distributed anonymous order books, atomic swaps or through a decentralised multi-signature escrow system. • Key Features • No centralised control over infrastructure • Funds controlled by the user • Compatibility with hardware wallets • Anonymous Accounts • Exchange In-A-Box • Solving the Fiat problem
  • 8.
  • 9.
    Benefits & Issuesof DEX Benefits • Faster and Cheaper Transactions • Potentially More Difficult to Hack • Seamless Integration with Secure Hardware Wallets • Funds Controlled by Users Rather Than a Central Corporation Issues • Difficult to Use • Lack of Robust Features and Functionalities • Low liquidity • Order books on chain slows down trading when the used blockchains themselves have scaling problems • Some decentralised exchanges like Bisq require users to be online in order for an order to be listed and for the trade to take place, requiring users to perform certain actions like singling that a payment was received. • Trading features like margin trading, lending and stop loss are currently not available in the decentralised model as they only allow the basic exchange of currency for a predetermined value.
  • 10.
    DEX - KeyConcepts • Common base token: Ethereum and Nxt/Ardor allow new token creation on top of them using the underlying ethereum and nxt blockchains. Nxt/Ardor has a built in exchange and creating ethereum smart contracts for an exchange for ethereum based tokens is not that hard to do. The major drawback is that only assets/currencies built using the base platform are supported. • Escrow: Requires a mutually trusted party that holds all funds or some collateral. Multisig and smart contracts can automate part of the escrow( in most cases releasing the cryptocurrency funds in case there is no dispute). • Cross chain transactions: Some algorithms have been developed to secure cross chain token exchange withouth a central exchange holding all the funds. It achieves waterproof validation without introducing the problems and complexities introduced by a escrow-based validation system. While simple in concept,most of them have a pretty complex UX and require an off- chain communication channel. One of the most known ones is decred atomic swaps or variations on this. The Major drawback is that only cryptocurrencies are supported. • For traditional money to and from cryptocurrency conversions Only solution so far is to use escrow.
  • 11.
    Decentralised Exchange - EvolvingArchitecture • Some take ideas from the structure of centralised exchanges and add decentralised elements • Others take a more radical peer-to-peer approach in the decentralisation of digital asset trading. • Most adopt the concept of an order book in their design decision while some embrace a more peer-to-peer alternative of directly swapping assets with others. • All of the DEXs follow a non-custodial nature in their architecture • Options for DEX protocol design: • on-chain order book: Etherdelta, Omisego • on-chain peer-to-peer: KyberNetwork • off-chain order book: 0x • off-chain peer-to-peer: Airswap
  • 13.
    DEX -Example Workflow •Workflow for Kyber token exchange: 1. Makers post their exchange rates and size information to a smart contract 2. Takers query this smart contract for instant exchange 3. Exchange update occurs notifying both maker and taker • Workflow for 0x token exchange: 1. Maker posts a signed order to Relayer, 2. Taker queries the Relayer 3. Taker selects an order to match, 4. Taker submits order to exchange via smart contract • Workflow for Kyber token exchange: 1. Makers post their exchange rates and size information to a smart contract 2. Takers query this smart contract for instant exchange 3. Exchange update occurs notifying both maker and taker • Workflow for AirSwap token exchange: 1. Maker posts a token pair as “intent to trade” 2. Taker queries the indexer for token pair 3. Taker fetches counterparty from Maker 4–5: Maker and Taker directly negotiate a suitable trade 6. Taker submits order to smart contract for execution • Workflow in EtherDelta: 1.Maker creates a new order: ERC20 token, the amount, the ETH amount in return and whether it’s a buy or sell order. 2. Maker creates a cryptographic hash of that order (using SHA3) 3. Maker then uses their Ethereum private key to sign the order hash (using ECDSA and in particular the Secp256k1 implementation which is also used in Bitcoin) 4. Maker sends order off chain together with the signature (In EtherDelta this is accomplished via a set of servers all communicating JSON messages via WebSockets) 5. When Taker wants to trade against the order, the signature and order information is send to the smart contract’s trade function. 6. The smart contract verifies that the signature originated from Maker 7. The smart contract makes sure order is not expired or filled. 8. Funds are transferred and fees are taken.
  • 14.
    Examples of Decentralised Exchanges •Waves • 0x • Kyber • Omega One • Airswap AST • Legolas • Bitshares • Ether Delta • Bisq • Stellar • NXT • OpenLedger • IDEX • Airswap
  • 15.