<p>You can assign destination tags to users however you wish. You can even do it randomly, which is the recommended method. Just keep track of which destination tags you've assigned to which users so you know who to credit when you receive a payment.</p>

<p>For UTXO-based systems, you give every user their own address and you credit the user whose address received a payment. For XRP, you give each user their own destination tag and you credit the destination tag that received the payment. This method is much simpler because you only have to watch one address on the network.</p>

<p>Note that you should set the "destination tag required" bit in your receiving address to ensure that you don't receive erroneous payments with no destination tag. If you need to send funds to your own account for some reason, just use any unassigned destination tag -- zero is commonly used for this purpose.</p>

CC BY-SA 3.0
2018-03-12T09:37:56.213Z
thanks for the answer. I thought of same as you said for assigning destination tag and giving the ripple to user according to received tag. But I'm stuck with the question that how can i know that the received payment is for the corresponding user. Do i receive a transaction hash whenever a user sends payment to my address?? so that i can fetch the destination tag from that hash.
veeresh kumbar
CC BY-SA 3.0
2018-03-12T09:41:01.767Z
How do i know that the received transaction is for the particular user and how can i credit them with the payment.
veeresh kumbar
CC BY-SA 3.0
2018-03-12T09:52:58.023Z
If i get the information whenever a receiving transaction is happened at that time how i can fetch the destination tag from that. Because the sender adds a destination tag but at the time of receiving that tag should be known to us, only in this condition i can credit the amount to particular user or else not.
veeresh kumbar
CC BY-SA 3.0
2018-03-12T16:28:24.260Z
@veereshkumbar There will be a "DestinationTag" field in the transaction. You can't credit someone for a transaction unless you see the transaction. You will have to follow all transactions to your account.
David Schwartz
CC BY-SA 3.0
2018-03-13T04:58:17.380Z
Do ripple-lib gives the info of Received transaction or the recently received transaction so that i can fetch the destination tag from it??? if yes please show the method to do it. Thanks
veeresh kumbar
CC BY-SA 3.0
2018-03-13T05:09:15.057Z
There are several ways to do it, but the simplest is probably to [subscribe to the account](https://ripple.com/build/rippled-apis/#transaction-streams). You should probably also keep track of the last ledger you checked so that you can resume where you left off in the event your monitoring of the network is disrupted.
David Schwartz
CC BY-SA 3.0
2018-03-13T05:33:31.753Z
Ok bro thanks for your time. I read that subscribing to transaction streams but i cannot find how to use it. do u have an example code ?
veeresh kumbar
CC BY-SA 3.0
2018-03-13T05:37:17.013Z
You can start [here](https://ripple.com/build/rippleapi-beginners-guide/).
David Schwartz
CC BY-SA 3.0
2018-03-13T05:38:25.867Z
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/74419/discussion-between-veeresh-kumbar-and-david-schwartz).
veeresh kumbar
CC BY-SA 3.0
2018-03-12T08:44:18.920Z
2018-03-12T08:44:18.920Z
David Schwartz
<p>I am integrating ripple for my trading website and what I know is that the ripple address is common to all the users but we need to provide destination tags to identify the user. So my question is how can I assign destination tags to the users and how can I know about the received transaction is of the corresponding user.Please Help.... :(</p>

<transactions><ripple>
How to assign destination tags to users for ripple address.
veeresh kumbar
# How to assign destination tags to users for ripple address.

(Asked by: username_0 on 2018-03-12)

I am integrating ripple for my trading website and what I know is that the ripple address is common to all the users but we need to provide destination tags to identify the user. So my question is how can I assign destination tags to the users and how can I know about the received transaction is of the corresponding user.Please Help.... :(

**Tags:** transactions, ripple


---

## 1 answers

### Answer by username_1 on 2018-03-12. Score: 1 | Accepted answer

You can assign destination tags to users however you wish. You can even do it randomly, which is the recommended method. Just keep track of which destination tags you've assigned to which users so you know who to credit when you receive a payment.

For UTXO-based systems, you give every user their own address and you credit the user whose address received a payment. For XRP, you give each user their own destination tag and you credit the destination tag that received the payment. This method is much simpler because you only have to watch one address on the network.

Note that you should set the "destination tag required" bit in your receiving address to ensure that you don't receive erroneous payments with no destination tag. If you need to send funds to your own account for some reason, just use any unassigned destination tag -- zero is commonly used for this purpose.

> **Comments:**
> **username_0**: thanks for the answer. I thought of same as you said for assigning destination tag and giving the ripple to user according to received tag. But I'm stuck with the question that how can i know that the received payment is for the corresponding user. Do i receive a transaction hash whenever a user sends payment to my address?? so that i can fetch the destination tag from that hash.  
> **username_0**: How do i know that the received transaction is for the particular user and how can i credit them with the payment.  
> **username_0**: If i get the information whenever a receiving transaction is happened at that time how i can fetch the destination tag from that. Because the sender adds a destination tag but at the time of receiving that tag should be known to us, only in this condition i can credit the amount to particular user or else not.  
> **username_1**: @username_0 There will be a "DestinationTag" field in the transaction. You can't credit someone for a transaction unless you see the transaction. You will have to follow all transactions to your account.  
> **username_0**: Do ripple-lib gives the info of Received transaction or the recently received transaction so that i can fetch the destination tag from it??? if yes please show the method to do it. Thanks  
> **username_1**: There are several ways to do it, but the simplest is probably to [subscribe to the account](https://ripple.com/build/rippled-apis/#transaction-streams). You should probably also keep track of the last ledger you checked so that you can resume where you left off in the event your monitoring of the network is disrupted.  
> **username_0**: Ok bro thanks for your time. I read that subscribing to transaction streams but i cannot find how to use it. do u have an example code ?  
> **username_1**: You can start [here](https://ripple.com/build/rippleapi-beginners-guide/).  
> **username_0**: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/74419/discussion-between-username_0-username_0-and-username_1-username_1).  

---

