1

How can I associate a transaction with a unique user in a shared online wallet? It makes no sense to have one wallet account per user in the shared wallet as it would degrade performance (say I have 1M users).

Thus, I need to have bitcoind running in parallel with a database that hosts all the users and when a transaction comes in update the balance of the particular user.

My question is: how do I identify with which user this transaction is associated?

2 Answers 2

1

You generate and store the receiving bitcoin addresses of each user in the database. Then you poll bitcoind for new transactions for the all the receiving address you have in your database. When the receiving bitcoin address has incoming transaction, then you follow the relation from the receiving bitcoin address to the user and then credit the transaction on the user's database balance.

Some of this is covered in my tutorial Accepting bitcoins in Django application.

2
  • Can each user have their own private key or can I only use the private key(s) on the bitcoind pool for creating receiving addresses for each user?
    – user11286
    Commented Jan 2, 2014 at 9:20
  • The simplest way is to let bitcoind to create the addresses. Alternatively there is something called "deterministic wallets" where private and public keys can be derived from (the user specific) seed: github.com/richardkiss/pycoin Commented Jan 2, 2014 at 10:03
0

create a table in the db named user_addresses if the user clicks on generate address first query the db if the user have any address stored with his ID if yes show that address to the user if not query the bitcoin daemon with RPC

public function GetDepositAddress($account)
    {
            return $this->Client->getaccountaddress($account);
    }

where $account has the username of the user generating this address this way you can use single daemon to host multiple addresses

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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