Any ideas what an exchange protocol might look like?

I was just thinking about how one would go about creating a sub-currency/smart property that could be exchanged via a decentralized exchange.

Since there will (hopefully) be many types of properties that people would like to exchange, no exchange application would want to implement a different system for each type. This leads me to believe that an exchange would develop a certain protocol by which the property contract would have to be developed in order to be traded on that exchange.

I'm not really sure if this would work though. I'm not sure how the exchange would be able to trust some random property contract. The exchange might still need human inspection of each contract in order to be added to an exchange. A possible solution, could be that a contract would have to register with an exchange with an initial tx in which the exchange contract would send a few transactions to make sure the property contract actually follows it's protocol. The problem here is that the contract can be coded to pass the test and then do other things later. Even changing the contract code is possible.

Any ideas? Perhaps the very fact that Ethereum gives the developer so much control means that it can't truly be a trustless (contracts not the Blcokchain) environment.

End rant.

Comments

  • JasperJasper Eindhoven, the NetherlandsMember Posts: 514 ✭✭✭
    edited March 2014
    I think you're way off the ball, to be honest. Here is a system to do arbitrary exchanges, that can be made to work across different cryptocurrencies. Well, some of them, at least, probably bitcoin aswel. (coinswap is 'sortah this', as i understand)

    Party A and B want to do an exchange involving A doing a transaction and B doing some transaction. A makes a transaction;

    if block.number > TOO_LATE
    { mktx(...returning..)
    stop
    }
    if sha3(tx.data[0]) == REVEAL_H:
    { mktx(...this is what B wanted..)
    stop
    }
    He knows that B cannot make it send that transaction, because he will only tell B what `tx.data[0]` should be if B makes the same contract, but with `mktx(..what A wanted...)` Once B has made that contract, A can simply trigger B's revealing what `tx.data[0]` is, allowing A to do the same.

    The timeout is there because they might have to do something on the side of the contract those transactions talk too. For instance if it is a subcurrency contract, after creating the contracts, both put coin on the contract addresses of the subcurrency. However, if the exchange then fails to come true, only the contracts for exchanging are able to get at those subcurrency coins!

    If there is anything that allows A to quickly make the transaction-for-B invalid, B shouldnt agree to play along. For instance a subcurrency might add a 'multiple addresses can access' feature. So then once B gives his contract, A could *both* use that contact to get what he wanted *and* in the same block drain the subcurrency address. Then B can still trigger his side, but in vain, as that balance in the subcurrency is empty.

    Edit: can you do stuff like insert code here..?..(would prefer markdown, but ah well..)
  • mids106mids106 Member Posts: 188 ✭✭✭
  • JasperJasper Eindhoven, the NetherlandsMember Posts: 514 ✭✭✭
    @mids106: Right, it is vanillaforums, d'oh seen that word before.. Hmm html, bbcode or markdown. Suppose defaultly it is just html with a little extra magic for paragraphs? (→that sounds fine to me)
  • StephanTualStephanTual London, EnglandMember, Moderator Posts: 1,282 mod
    edited March 2014
    <code> also works :)
Sign In or Register to comment.