I would like to build an online wallet service. I thinks it will be easy to implement all the functionalities if I go with Bitcoind. Here is a possible workflow:
New user with email
firstname.lastname@example.org obtain a new account (in Bitcoind) with new address by calling
We can then start polling
listsinceblock xxxto get all new transactions. If we receive a new incoming transaction, store
txidin database, then iteratively call
gettransaction txidon all unconfirmed transactions. When the number of confirmations are bigger than a certain threshold, credit the account in database, then call
move email@example.com safe, just to make the next step easier.
safeaccount exceeds say 50BTC, send them to offline wallet.
When user wants to withdraw, refill
safeif necessary, send the coins from
safe, and update user's balance in the database.
However, in all the related questions I've read, most people say Bitcoind won't scale. Even the Bitcoin wiki says so. Now, if we are only to use the JSONRPC to interface the network, I can imagine the following workflow:
We generate say 1M addresses in database. When user signs up or require new address, we assign one address to them.
blocknotifyto get new block hash
getblock blkhashto get all transaction hashes in the new block.
getrawtransaction txidto see whether we received an incoming transaction to our addresses. If so, keep the
txidand keep polling
gettransaction txidto update the confirmation number.
sendrawtransactionto move funds to offline wallet.
My questions are,
- Do you think my proposals are reasonable?
What are the nuances in the operations above? For example,
- by moving all funds to one account and then send money, does that count as one transaction or one transaction for each account? Are transaction fees the same?
- when doing
getrawtransaction, in the
voutarray, each object represents a destination, but each of them has an
addressesarray. There are cases where it contains multiple addresses. Does it mean it's a "multisig" transaction? Or is it related to
reqSigsfield? How do we handle such cases?
I've read following questions, but didn't find my answer:
Please help.. Thank you very much!