I have thought on similar lines,this just needs code implementation.
First posted at
https://bitcointalksearch.org/topic/rfc-p2p-trading-of-crypto-coins-112222Order opening,closing and modificationA block-chain is maintained which keeps all valid open orders.A node requesting to open an order sends order quote to the network.The network verifies the order by periodically querying the corresponding blockchain and check that order is sent by the node is less than its
balance or not.In this way fake orders could be weeded out.A node can modify or cancel the order by querying the network with message signed with its private keys.
Orders open could be accessed by all nodes.Any node interested could send request for accepting an order.After similar verification about buyer's balance the order status is changed to accepted.
Money Allocation to intermediate nodesOnce order is accepted,the network divides the money to the other nodes such that,the money send to any node is less than the trade amount,that node wants to execute.This trade assignment is sent to both trading parties.They are required to send money to assigned intermediate nodes.These transactions are verified by the network.
Intermediate transactionAfter all intermediate transactions are over,the network sends the address of buyer and seller to the nodes which received money from seller and buyer receptively. Until they successfully execute their routing assignment,their trade money is not released from their intermediates.
The intermediate node is the random third party node assigned by the network,which handles the trust problem.This assignment is random by the p2p network.There will be a very little chance that some one assigns his own trading router, if the number of nodes participating in it is sufficiently large.
Once the transaction from the buyer/sellers to intermediate nodes is verified,the network assigns the intermediate nodes, the address of the party (at opposite end of trade) to transfer the money to that end.
Until the intermediate nodes transfer the money,their own trade is locked.At all levels,all the transaction related to an order are securely stored in blockchain,using method similar to bitcoin (SHA-1 or other hash function),to avoid tampering to an open order.
Assumptions1. To start the trading, first two nodes should be assumed that they conducted their routing operation.
Advantages1.Buyer and seller don't know each other until trade is successfully conducted.
2.Using a block-chain,all trading activities can be recorded securely so that trade is not tampered until its over.
Possible Drawbacks1.Tackling of the closed loop deadlock problem.
2.Random trade route assignment function has to be thoroughly tested,before implementation.