Skip to content
forked from jaybny/dexchain

dexchain: a bitcoin sidechain decentralized exchange

License

Notifications You must be signed in to change notification settings

sidepit/dexchain

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 

Repository files navigation

dexchain

dexchain: a bitcoin sidechain decentralized exchange

Purpose

  • dexchain is for traders to hedge bitcoin/usd by selling short futures contracts
  • dexchain is for speculator to leverage Bitcoin by going long futures contracts
  • dexchain is for market-making bots looking for alpha
  • dexchain is meant to generate Fair Price Discovery as a public good, to be used by p2p DEXs like Bisq, or otc desks

Why Dexchain

Since MtGox went down, almost 10 years ago, Bitcoiners have been dreaming of a Decentralized Exchange solution to enable censorship resistant buying and selling of bitcoin without a central authority.

What’s wrong with Bisq?

Nothing! In fact, we expect Bisq and other non-custodial or escrow services to be an integral part of the end-to-end solution. However, all these require a price to be agreed on. Today this price comes from looking at centralized exchanges such as Coinbase. Dexchain fixes this, by providing decentralized price discovery.

How is DexChain different

Previous attempts at Bitcoin DEXs concentrated solely on the non-custodial aspect of exchange. Atomic swaps for example, are perfect for this. However, in order to achieve a free market price in real time, limit order books and matching engines with finality are required.

  • Dexchain is different by focusing solely on the Price Discovery aspect of exchange. With focus on price discovery, everything else takes a back seat.
  • Dexchain is not focused on non-custodial p2p atomic swaps.
  • Dexchain is focused on the price for those non-custodial p2p atomic swaps.

Main hurdles

Components

  • Bitcoin Peg Trust Module
  • Distributed limit order book
  • Front-running resistance via Pay to Front-run
  • Peer to Peer Delivery via The Dex Experiment

The Dex Experiment

Testing the hypothesis that Dexchain can deliver true end-to-end price discovery on Bitcoin/USD trading pairs, without a price oracle.

What is it?

Experiment will be a controlled ~6 month first run of the Dexchain proof-of-concept.

  1. Dex-In - moving Bitcoin to Dex sidechain
  2. Trading DEX-Bitcoin/USD Futures contracts
  3. Clearing profits-and-losses into Dex-Accounts
  4. Settling PNL into Bitcoin
  5. Delivery of Bitcoin for USD

Purpose

Running it as an experiment, enables scientific gathering of data without the regulator hurdles of full blown public service. Just like controlled experiments on illegal drugs, to test the possible medical benefits, without the hurdles of the war on drugs, The Dex Experiment will test the public benefits of decentralized Exchange without the hurdles of Legal tender, KYC, AML, Securities laws.

Main purpose of The Dex Experiment is to enable and test the Probabilistic Altruistic Delivery hypothesis

Probabilistic Altruistic Delivery

A decentralized on-chain system cannot force actual USD to be delivered for Bitcoin and visa-versa. Other exchanges, such as the CME, use what is called Cash Delivery. Cash delivery requires an external price of Bitcoin/USD to peg the final settlement price of each futures contract.

The Delivery Problem

Dexchain cant claim to be generating price discovery, if it relies on external price with cash delivery. Dexchain cant claim to be a DEX if it requires a centralized custodian to force delivery.

What about atomic swaps?

Atomic swaps solve for non-custodial by not having a *forced" matching engine. One side, can always back out, even after a price is negotiated. Forced matching is a basic requirement of price discovery and on-chain limit order book matching engines.

Forced matching with price discovery vs non-custodial

Dexchain choses forced matching for price discovery, but is still able to achieve almost full non-custodial trading by staying on-chain.

The Final Mile Trust via Altruistic Delivery

  • Bitcoiners may choose to volunteer to deliver on their futures contract positions by either delivering USD for short positions or Bitcoin for long positions.
  • This requires longs and shorts to match and agree to deliver.
  • This now becomes the things we have been doing for years, a simple p2p swap of bitcoin for USD, like bitcoin-otc, or localbitcoin or bisq, etc..
  • However, on-chain attestation of such a delivery is not possible, and it requires the assumption of altruistic delivery

The probability that going long or short bitcoin/USD futures will enable you to ultimately deliver is what ultimately ensures a price-peg to the reality of the $BCTUSD price.

Bitcoin Notaries - delivery of last resort

  • Thousands of local non technical plebs, bitcoiners, and common people are eager to get educated on bitcoin, earn some Sats, and be part of this revolution
  • Ultimately swapping of Bitcoin for USD is an in-person face to face interaction, which requires longs and shorts seeking delivery to physically be in the same region

We propose a simple on-chain attestation of delivery process though social trust of so called Bitcoin Notaries

  1. Notaries will be a decentralized self governing group of regional individuals
  2. Altruistic Longs and Shorts may choose a Notary to facilitate low value ($100) final mile delivery

The barista comparative

When purchasing coffee with Lightning bitcoin at point-of-sale, one would pay with LN, and then trust that the barista will in-fact deliver on her promise of delivering the Coffee. So to with Notaries, you pay the notary USD and trust that she will deliver the bitcoin and visa-versa.

Atomic swap of Bitcoin to USD is just as impossible as an Atomic swap of Bitcoin for coffee. Final mile trust required.

When you hold your receipt for Coffee in your hand, that receipt is "good" for coffee. When you get a delivery receipt for USD after paying bitcoin, that receipt is "as-good" as USD. Making the receipt a possible Dexdollar stablecoin . In fact, the UTXO held by a Notary during delivery is explicity worth ($100) USD, idependant of current price. This is an avenue for further research into a possible bitcoin backed stablecoin!

Rational Design and Game Theory

A notary that goes through the self-identification process as Bitcoin Notary by going through special education programs with detailed techniques and specialized portable full-node hardware and software, is in it for the SATs as well as altruistic in completing the process to enable Fair Price Discovery as a public good, and joining the bitcoin revolution.

Given that the longs and shorts are also volunteering to take part in delivery for the same altruistic reasons, once you enter into the Notary delivery system it becomes a social interaction, just like with the barista.

By explicitly stating purpose and goals, and with the process taking time, energy and risk, the game theory equilibrium will hopefully prove to be in line with the intent of the model. This result will be analyzed from The Dex Experiment data.

Separation of Concerns

By separating main components of the Dexchain, we are able to keep our focus on the core distributed limit order book technology.

  1. Bitcoin to DEX peg-in and peg-out trust model is external to the core
  2. Voluntary delivery via voluntary independent external Notaries are external to the core

Core component assumes an on-chain token pegged to bitcoin, and an external probability of delivery. No company, non-profit, or coordination with the core Dexchain is needed nor desired. We expect these to evolve independently.

Milestones

  1. Sidepit paper (complete)
  2. Dex Chain sidechain POC ( wip )
  3. Dex Experiment
  4. Sidepit paper 2.0 with results from Experiment

Releases

No releases published

Packages

No packages published