<p>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.</p>

<p>Some of this is covered in my tutorial <a href="http://opensourcehacker.com/2013/10/16/accepting-and-spending-bitcoins-in-a-django-application/#Accepting_incoming_transaction" rel="nofollow">Accepting bitcoins in Django application</a>. </p>

CC BY-SA 3.0
2014-01-02T09:20:47.193Z
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
CC BY-SA 3.0
2014-01-02T10:03:28.653Z
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: https://github.com/richardkiss/pycoin
Mikko Ohtamaa
CC BY-SA 3.0
2014-01-02T09:08:16.930Z
2014-01-02T09:08:16.930Z
Mikko Ohtamaa
<p>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</p>

<pre><code>public function GetDepositAddress($account)
    {
            return $this-&gt;Client-&gt;getaccountaddress($account);
    }
</code></pre>

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

CC BY-SA 3.0
2014-03-03T13:43:58.590Z
2014-03-03T13:43:58.590Z
Khan Shahrukh
<p>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).</p>

<p>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.</p>

<p>My question is: how do I identify with which user this transaction is associated?</p>

<wallet>
Associating a bitcoin address with a user in a shared wallet
user11286
# Associating a bitcoin address with a user in a shared wallet

(Asked by: username_0 on 2014-01-02)

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?

**Tags:** wallet


---

## 2 answers

### Answer by username_1 on 2014-01-02. Score: 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](http://opensourcehacker.com/2013/10/16/accepting-and-spending-bitcoins-in-a-django-application/#Accepting_incoming_transaction).

> **Comments:**
> **username_0**: 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?  
> **username_1**: 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: https://github.com/richardkiss/pycoin  

---

### Answer by username_2 on 2014-03-03. Score: 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


---

