BitShares Forum

Main => General Discussion => Topic started by: fluxer555 on February 15, 2015, 06:00:49 am

Title: Trust-minimized centralized exchange through multisig
Post by: fluxer555 on February 15, 2015, 06:00:49 am
This is how I'm thinking of it:

1. When depositing currency A to the exchange, you transfer to a 2-of-3 multisig address. You own two keys, and the exchange owns another key.

2. When placing a trade for currency B, the exchange initiates a transaction to transfer the trade amount of currency A to a 1-of-2 multisig 'personal hot wallet', which you have to sign with one of your keys. You and the exchange each have a key for this 1-of-2 'personal hot wallet'. The exchange can transfer funds to the current owner(s) of currency B, and you can transfer the funds back if you need to cancel the trade.

3. When the trade executes, the exchange sends your new currency B to another 2-of-3 multisig address of that currency, which is the same as currency A's (you own two keys, they own one key.)

4. Whenever you want to 'withdraw' any currency, you can transfer the funds to a different wallet using both your keys. (I put 'withdraw' in quotes, because the money is barely 'deposited'; you own the funds and the exchange cannot steal or transfer them without your consent.)

Advantages:
- Exchange only has control of funds in the order book; you don't have to trust them with 100% of the funds you want to trade with
- Damage done by exchange getting hacked would be minimal; hackers would seek other targets for bigger rewards.
- The centralized service just acts as an escrow facilitator of transactions, and all transactions are voluntarily signed

Disadvantages:
- Speed of trading is limited by the block-confirm times of the currency
- This cannot work with Fiat or any non-cryptocurrency
- Having to confirm and sign all trade transactions manually could be annoying/tedious.

Some ways to combat these disadvantages are to, of course, use bitshares or bitassets as at least one side of the currency, as we have 10 second block confirms. If there is a fiat on-ramp for their corresponding MPAs, users could use this instead of centralized IOU fiat. Finally, instead of signing/confirming every transaction manually, an opensource exchange client could be built that handles automatically verifying the transactions.

I realize this may have limited utility since we can do a lot of this kind of trading right inside the client we already have, but I'm thinking that cross-crypto trading without IOUs or MPAs of those cryptos would be killer.

Thoughts?
Title: Re: Trust-minimized centralized exchange through multisig
Post by: monsterer on February 15, 2015, 05:10:16 pm
This is exactly equivalent to this cycle:

balance X=0,Y=0
deposit X
trade X/Y
withdraw X,Y

Essentially the same sequenced used by bridges, such as shapeshift.io, or metaexchange.info. :)
Title: Re: Trust-minimized centralized exchange through multisig
Post by: fluxer555 on February 15, 2015, 05:21:19 pm
The difference is that the centralized entity here would facilitate an order book. So, it's sort of a bridge/exchange combination.

I thought of another disadvantage: traditional centralized exchanges don't contribute to blockchain bloat, unlike this method. Also, depending on the specifics, this could be cheaper or more expensive than centralized exchanges.
Title: Re: Trust-minimized centralized exchange through multisig
Post by: monsterer on February 15, 2015, 05:24:01 pm
The difference is that the centralized entity here would facilitate an order book. So, it's sort of a bridge/exchange combination.

Right. So, as well as market orders, you can place limit orders with this method and your theft exposure is then limited to open orders on the book.
Title: Re: Trust-minimized centralized exchange through multisig
Post by: fluxer555 on February 15, 2015, 05:28:25 pm
The difference is that the centralized entity here would facilitate an order book. So, it's sort of a bridge/exchange combination.

Right. So, as well as market orders, you can place limit orders with this method and your theft exposure is then limited to open orders on the book.

Exactly!

It looks like you're in a pretty good position to implement something like this... ;)
Title: Re: Trust-minimized centralized exchange through multisig
Post by: monsterer on February 15, 2015, 05:33:47 pm
Exactly!

It looks like you're in a pretty good position to implement something like this... ;)

Funnily enough, we do have this planned :)
Title: Re: Trust-minimized centralized exchange through multisig
Post by: fluxer555 on February 15, 2015, 06:08:20 pm
+5% +5% +5% +5% +5% +5% +5%
Title: Re: Trust-minimized centralized exchange through multisig
Post by: CLains on February 15, 2015, 10:03:11 pm
haha, best interaction.  +5%
Title: Re: Trust-minimized centralized exchange through multisig
Post by: starspirit on February 15, 2015, 11:25:03 pm
Not a technical expert, but is the following a possible?

Say we have a new block-chain established for trading derivatives of each asset, and in that way it avoids bloat on the asset block-chains, as well as  speeds up transaction times to a common fast level.

All trading between the derivatives could be decentralised on its this block-chain as it is with bitAssets on BitShares. The purpose of a centralised third-party ("exchange") would be to take deposits and withdrawals, and to create and destroy the derivatives on a 1:1 basis for those same users. Is there a way to do that securely so that only those owning the derivatives can withdraw the real asset, and force the destruction of the derivative?
Title: Re: Trust-minimized centralized exchange through multisig
Post by: alt on February 15, 2015, 11:57:17 pm
you should try this exchange, it's really more safety than other centralized exchange, because all trade data are inside blockchain
http://btsbots.com/auction
Title: Re: Trust-minimized centralized exchange through multisig
Post by: fluxer555 on February 16, 2015, 01:08:28 am
Alt, I have to admit that I don't really understand what's going on on your auction page, or what's happening behind the scenes.
Title: Re: Trust-minimized centralized exchange through multisig
Post by: alt on February 16, 2015, 01:19:11 am
Alt, I have to admit that I don't really understand what's going on on your auction page, or what's happening behind the scenes.
in fact, this type of trade engine is named "call auction" at stock market, it's very hardly to control price, and is used to decide the open price at stock market.
here is a introduce for call auction with google translate
https://translate.googleusercontent.com/translate_c?act=url&depth=1&hl=zh-CN&ie=UTF8&prev=_t&rurl=translate.google.co.jp&sl=zh-CN&tl=en&u=http://wiki.mbalib.com/wiki/%25E9%259B%2586%25E5%2590%2588%25E7%25AB%259E%25E4%25BB%25B7&usg=ALkJrhjmbTrf_2bDH0Pxc_cx-aLyVISSSA

and here is howto use btsbots exchange
https://bitsharestalk.org/index.php?topic=14018.0;topicseen

I select call auction, because btsbots exchange based blockchain, it can't response very fast, and this type of trade engine don't need very fast response time.
now the trade engine excute every 4 hours, when there are more active order, we can change this to every 30 minutes.
Title: Re: Trust-minimized centralized exchange through multisig
Post by: alt on February 16, 2015, 01:32:09 am
I think you really should  try this exchange if you want to know how it work.
you can use a very small order, sell 1 BTS at price more than 0.051CNY/BTS
Code: [Select]
transfer 1 BTS youraccount auction.btsbots 0.051
buy with 0.1 USD at price less than 0.051 CNY/BTS
Code: [Select]
transfer 0.1 USD youraccount auction.btsbots 0.051
Title: Re: Trust-minimized centralized exchange through multisig
Post by: fluxer555 on February 16, 2015, 01:34:55 am
What advantage do I have using this exchange over the internal exchange?
Title: Re: Trust-minimized centralized exchange through multisig
Post by: alt on February 16, 2015, 01:56:23 am
What advantage do I have using this exchange over the internal exchange?
I think here is some advantage:
1. you can use light wallet/mobile wallet trade.
2. trade engine of call auction is good, you can make deal with a more better price if you don't care about wait some time.

for example, there is a bid order at price 0.051 now, but the price is down to 0.049 at btc38,
so someone should make an ask order at price 0.05 or 0.049, the final price will change to 0.049.
there are enough time to compete the price for ask order and bid order.
Title: Re: Trust-minimized centralized exchange through multisig
Post by: arhag on February 16, 2015, 03:25:54 am
Not a technical expert, but is the following a possible?

Say we have a new block-chain established for trading derivatives of each asset, and in that way it avoids bloat on the asset block-chains, as well as  speeds up transaction times to a common fast level.

All trading between the derivatives could be decentralised on its this block-chain as it is with bitAssets on BitShares. The purpose of a centralised third-party ("exchange") would be to take deposits and withdrawals, and to create and destroy the derivatives on a 1:1 basis for those same users. Is there a way to do that securely so that only those owning the derivatives can withdraw the real asset, and force the destruction of the derivative?

starspirit, have you seen my post (https://bitsharestalk.org/index.php?topic=13101.msg171855#msg171855) on the BitShares Standard Gateway?
Title: Re: Trust-minimized centralized exchange through multisig
Post by: starspirit on February 16, 2015, 07:44:20 am
Not a technical expert, but is the following a possible?

Say we have a new block-chain established for trading derivatives of each asset, and in that way it avoids bloat on the asset block-chains, as well as  speeds up transaction times to a common fast level.

All trading between the derivatives could be decentralised on its this block-chain as it is with bitAssets on BitShares. The purpose of a centralised third-party ("exchange") would be to take deposits and withdrawals, and to create and destroy the derivatives on a 1:1 basis for those same users. Is there a way to do that securely so that only those owning the derivatives can withdraw the real asset, and force the destruction of the derivative?

starspirit, have you seen my post (https://bitsharestalk.org/index.php?topic=13101.msg171855#msg171855) on the BitShares Standard Gateway?
No I hadn't seen it, but the BitShares Standard Gateway concept sounds consistent with what I was thinking, except probably better in that it would use the existing BitShares block-chain for the derivative trading. Although this can never be trust less, how did you feel in the end about the level of user protection that could be built around the Gateway? I think there will always be trust issues where parties need to deal with multiple chains, but workable solutions are required in this area.
Title: Re: Trust-minimized centralized exchange through multisig
Post by: monsterer on February 16, 2015, 10:32:43 am
Not a technical expert, but is the following a possible?

Say we have a new block-chain established for trading derivatives of each asset, and in that way it avoids bloat on the asset block-chains, as well as  speeds up transaction times to a common fast level.

I take the view (on bloat) that it is encouragement for the core devs to implement pruning - at some point it has to come into existance to avoid centralising the service.

Regarding speed - I'm not sure you can get much faster than bitshares already is if you're waiting for transactions to appear in a block before acting on them?
Title: Re: Trust-minimized centralized exchange through multisig
Post by: starspirit on February 16, 2015, 11:11:05 am
Not a technical expert, but is the following a possible?

Say we have a new block-chain established for trading derivatives of each asset, and in that way it avoids bloat on the asset block-chains, as well as  speeds up transaction times to a common fast level.

I take the view (on bloat) that it is encouragement for the core devs to implement pruning - at some point it has to come into existance to avoid centralising the service.

Regarding speed - I'm not sure you can get much faster than bitshares already is if you're waiting for transactions to appear in a block before acting on them?
Regarding speed - agreed. My comparison was against the waiting times one would experience if trying to trade cryptos in a decentralised manner as per the OP. Faster speed is attained by trading their derivatives on an a single fast chain, such as BitShares.