district0x / district-proposals

Proposals for new districts to be built by the district0x Team.
https://vote.district0x.io/
214 stars 36 forks source link

DP #119: 0xchange – an anonymous, low-cost market for fiat-to-crypto exchange #119

Open CapnMB opened 6 years ago

CapnMB commented 6 years ago

Name

0xchange – an anonymous, low-cost, decentralized market for fiat-to-crypto exchange

Purpose

To create a decentralized fiat-to-crypto exchange that is secure, anonymous, and low-fee.

Description

How it works Crypto to Fiat exchanges are enabled via six main components:

Buyers are users looking to buy any cryptocurrency using fiat Sellers are users looking to sell their cryptocurrency for fiat Enforcers are human actors that enforce the contract (i.e. escrow holders) Buy/Sell Board is the listing of buy and sell orders Multi-Signature Transactions are blockchain transactions that require 2 out of 3 signatures to broadcast (see https://en.wikipedia.org/wiki/Multisignature) District0x Staked Tokens that users have staked in the 0xchange district comprise the Governance Committee.

Use Case

Alice is a Buyer who wants to buy 1 nextBigCoin at the market rate of $100 per coin. But Alice doesn’t want to go through Coinbase. She doesn’t like the complicated, fee-ridden flow of:

Even if Alice is a more experienced user and uses GDAX for free fiat transfers, she incurs fees when moving to the alt-coin.

Bob is a Seller who wants to sell his nextBigCoin for Fiat, but doesn’t want to go through the opposite flow of Alice. Bob doesn’t mind the fees – he’s cashing out from an ICO and is making 10x his money. But, Bob wants to move to fiat without associating the fiat to his driver’s license, etc., that exchanges require.

Bob connects to 0xchange and creates a sell order on the Buy/Sell Board. He starts by entering his crypto nextBigCoin, how many he wants to sell, his selling price (in this case he simply selects market rate), then he selects an Enforcer – a trusted human intermediary that will enforce the transaction. Bob reads through the listing of Enforcers, which are profiles that include user-rankings and fees, and selects one with a low fee of .05% (this fee is set by the Enforcer in his profile) and a high 5-star user-ranking. He clicks finish and creates the sell order. The sell order is listed on the exchange board. (note that the amount of the order can be limited by the user’s account age and ranking to lower risk in the system – for example if the user’s account is only 1 week old, the system could limit his purchase ability to $100).

Alice sees the order on the exchange, and accepts it. A Multi-Signature Transaction is created for this transaction.

Now that the order has been accepted, Bob sends 1 nextBigCoin into the wallet.

Once the nextBigCoin is sent, the order is marked “pay now” for Alice.

Alice now has x hours (x determined by stakers – see the Governance Committee in the District0x section below) to transfer the money to Bob – to his bank account, paypal, western union, mail a check – whatever form Bob has agreed to accept.

When Bob receives the payment and it clears, he signs the transaction as complete from his end, and the transaction is broadcast, transferring the nextBigCoin to Alice. The order closes. The Enforcer gets his fee for simply being available in case of problems. The system also takes a very small fee - .05% (fee determined by stakers – see the Governance Committee in the District0x section below) - for enabling the transaction. These fees are distributed to the District0x Staked Tokens in this district for their work in securing the system (see the Governance Committee in the District0x section below).

Alice, Bob, and the Enforcer all give each other positive rankings.

If there is any problem - Bob claims he never received the money, or Alice claims there was an issue with the nextBigCoin - the Enforcer must verify the facts and enforce as he sees appropriate. If he determines the money was never sent, he returns the nextBigCoin to Bob. If he determines the money was sent, he sends the nextBigCoin to Alice. Either way, the Enforcer signs the transaction with either Bob or Alice, as only 2 signatures are required.

The enforcer is the connection to the non-decentralized world. He is the trusted piece of the otherwise trustless transaction that allows fiat and traditional banks to play a part in this exchange.

District0x

District0x itself provides the entire backbone of this system –listings, rankings, messaging, multisig-wallets, and voting.

District0x staked coins, through voting, are the Governance Committee that provides stability and security to the system through setting the risk parameters of:

Staked coins earn a share of the district fees. The better the stability and security of the system, the more transactions will occur, the more each staked coin earns.

Risks

Risk – Alice goes dark and never sends payment even though the nextBigCoin has been deposited Mitigation – The Enforcer provides his key to Bob, so that Bob can unlock the wallet and retrieve his nextBigCoin. Alice receives a negative review.

Risk – Bob goes dark and never sends the nextBigCoin Mitigation – Nothing is lost, as Alice hasn’t yet sent the money. Bob receives a negative rating.

Risk – Enforcer goes dark mid-transaction Mitigation - Only 2 of the 3 signature are needed. If the transaction is completed, Bob and Alice can sign. Note that if there is a dispute and the Enforcer has gone dark, there is a risk of the crypto being lost. (We rely on the market to solve this issue – the best Enforcers could have back-up enforcers entrusted with keys, or have a form of staked bounty that is released if they go dark, or some other form of security against their going dark.)

Risk – Price of nextBigCoin crashes mid-transaction Mitigation – The contract has already been set. As soon as the nextBigCoin has been sent, there is no way for Bob to back out. If Alice does not send the fiat, the Enforcer returns the nextBigCoin to Bob, and Alice is given a negative review.

Risk – Alice tries to get her money back after transaction has closed (through a paypal claim, her bank, etc.) Mitigation – The time for funds to clear needs to be set to a high-enough value by the Governance Committee to guard against this.

Risk – Enforcer colludes with one party to cheat the other This is always a risk in escrow-type settings. Enforcers are the trusted part of this otherwise trustless exchange, and are necessary to bring in fiat. High ranked Enforcers will earn their reputation through successful transactions, as well as unique ways of ensuring fairness such as bounties, backup signatories, staking a large number of their own coins in the District, etc.

Sunflower42 commented 6 years ago

Sounds useful and interesting. Thanks for sharing!

juniemarie commented 6 years ago

Yes - tired of the fees

ghost commented 6 years ago

A District0x exchange would be pretty cool, but I am having a hard time deciphering how this separates itself from the Lightning and Plasma Network proposals. Outside of voting on the direction of where development should go I'm not sure this is something that should be solved this high up in the stack (3rd layers) if the ultimate plan for Ethereum is to include it in the base protocol.

Also, with the creation of 0x, low fee transfer/exchange sounds like its a thing of the past once it becomes widely adopted.

jamesray1 commented 6 years ago

While having decentralised exchanges that can do all kinds of currency exchanges (fiat to crypto, crypto to crypto and fiat to fiat) would be useful, I think this could also work better with uport style blockchain identities that are Zug-style government-approved identities. In fact that may be needed in order to comply with local KYC regulations.

shyblugs commented 6 years ago

This is a great idea. I've been working on something similar since January. If your interested in having a chat message me @shyBlugs on telegram