0

This question already has an answer here:

I want to build a rails application to create buy or sell offer for coins. If buy offer is accepted by seller, How the coins exchanged between the buyer and seller. How can it be implemented? What is the sequence of processes to be done in development level. Is there any opensource projects available in Github. I don't want to use other API's such as cryptsy. Can anybody guide me with proper steps as I am a beginner to cryptocoins.

marked as duplicate by Joe Pineda, dchapes, hafnero, Stéphane Gimenez, cdecker May 27 '14 at 21:40

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

This "rails application" you would like to create, could be called an "exchange platform". A challenge hereby is to create a secure platform, as you will be taking responsibility for and handling other people's money.

One main difference between exchange platforms is how services facilitate the trade: I am aware of three different modi operandi:

  1. Service only sells crypto. (e.g. Coinbase.com)

    1. The service offers crypto currency at a given price.
    2. The user accepts the current offer for a specific amount and provides an address where he wants to receive the crypto currency.
    3. The user sends a fiat deposit to the service.
    4. The service waits for the user's payment to clear, then sends the crypto to the user's address.
       
  2. Service holds crypto in escrow. (e.g. Bitcoin.de)

    1. User Alice sends a crypto currency deposit to the service.
    2. Alice creates an offer on the service's platform to sell a specific amount of crypto at a certain price.
    3. User Bob accepts Alice's offer.
    4. Bob sends a fiat payment to Alice.
    5. Once Alice receives the payment from Bob, she confirms the payment to the service.
    6. The service sends Alice's crypto currency deposit to Bob, after taking their fees from it.
    7. If something goes wrong, the service mediates the dispute.
       
  3. Service holds deposits of all currencies. (e.g. Bitstamp.net)

    1. User Alice sends a crypto currency deposit to the service.
    2. Alice can now create a
      • sell offer at a specific price (limit order) Which will remain in the order book until somebody is willing to pay the price she set.
      • sell immediately at the current price (market order)
        Which will match the best buy offers until her order is matched completely.
    3. Vice versa user Bob sends a fiat deposit to the service.
    4. User Bob can now create a
      • buy offer at a specific price (limit order) Which will remain in the order book until somebody is willing to sell for the price he set.
      • buy immediately at the current price (market order)
        Which will match the best sell offers until his order is matched completely.
    5. At any point, Alice and Bob can withdraw their deposits from the service.
      You can find a more detailed example at How do buy and sell orders work?

Any of the above should also work for exchanging crypto for crypto.


In order to make the complete platform work, you will need:

  • User interface, i.e. a website
  • User management including fulfillment of local KYC, AML laws
  • Orderbook
  • Matching engine
  • Wallets for any tradable crypto currencies
  • Cold storage for any tradable crypto currencies
  • Payment processing for fiat currencies, maybe a banking partner
  • Customer Service
  • Legal advice

You might also find What would it take to create my own Bitcoin exchange? helpful, which goes more in-depth on the same topic.


Concerning your question for open source Bitcoin exchange software, this question has been answered here: Is there an open source Bitcoin exchange?

Not the answer you're looking for? Browse other questions tagged or ask your own question.