Hi
I'm creating an exchange website and the first step is to allow users to deposit and withdraw bitcoins from and to external wallets.
Right now i'm using the json rpc api from blockchain.info, since i don't have where to host my bitcoind client.
But since the json rpc api of blockchain.info implements the same methods that the bitcoind client supplies, i know that in the future i'll be able to move to my own bitcoind client easily so i'm not concerned about using third party api right now (referring to my previous post).
So in my website there will be 2 types of transactions:
External transactions - Transactions between the user's address in my website and an external wallet (Example: User A deposits bitcoins in his account in my website from his external wallet).
Internal transactions - Transactions between bitcoins and my local coin (The one that users will be able to exchange bitcoins with) inside the website itself (Example: User A buys 10 local coins for 0.003 bitcoins per coin from user B).
Now, before i had heard about the method move in the bitcoind client, i thought about adding a column in the users database of my website which would hold only the bitcoins that were earned/spent in internal transactions. The total amount of bitcoins that are in possession of a user would then be the amount that's written in that column + the amount that's returned from the method getBalance of the bitcoind client(the bitcoins that were earned/spent in external transactions).
But obviously, i ditched that idea after hearing about the move method in the bitcoind client(the method takes the address of user A and the address of user B and an amount and sends that amount from user A to user B).
So now my idea is, whenever some user puts a buying order (buying local coins for bitcoins), i will use the method move to move the requested amount from the user's address to another address that doesn't belong to any user.
Whenever some user puts a selling order and that order gets evaluated(someone sells to him), i will use the method move to move the requested amount from the address that doesn't belong to any user (the same address from case A) to the address of the user that sold the local coins.
The first question is: Is that the correct way of doing it? Am i over complicating things and there's a much easier way to implement this?
Second question: Does the move method moves the bitcoins from address A to address B instantly? or there's some delay?
Thank you