The more technical what, why, how and when of Destination Tags
TLDR: Those looking for a quick answer to a specific question should look for sections with blue stripes, like this.
There is a less technical version of this article called Destination Tags 101 (Introduction)
There appears to be a lot of confusion around the what, why, how and when of Destination Tags, called DT's from here on.
What are They? Why do they exist? How and when to use them? This article defines DT's, explains why they exist and how they are used.
There are "Source tags" as well but they affect individual users less so don't come up. This article will discuss DT's only. Source tags (ST's) are the same thing but are for going in the opposite direction. Almost everything said here about DT's applies equally to ST's but with the polarity reversed.
This article is informational (not technical) and based on the XRP protocol documentation at XRPL.org which is subject to change that might invalidate what is written here. Please check the reference in case of questions or issues.
Italic sections "surrounded by quotes" are taken from the documentation.
What is a DT?
A DT is an optional field that can be included after the
Destination Address "that can indicate specific purposes for payments from and to multi-purpose addresses.
"[DT's] do not have direct on-ledger functionality; [they] merely provide information about how off-ledger systems should process a payment."
Why do they exist?
"Destination tags indicate the beneficiary or destination for a payment."
"For example, a payment to an exchange or gateway address can use a destination tag to indicate which customer to credit for the amount of the payment in that business's own systems. A payment to a merchant could indicate what item or cart the payment is buying."
DT's are intended to reduce bloat in response to the XRP Reserve Requirement imposed by the XRP Ledger Protocol.
It is impractical to expect businesses transacting on the ledger (e.g. exchanges) to fund a 20 XRP reserve for each of their clients and, similarly, unfair to expect clients to maintain credentials and fund reserves for each business they with whom they transact.
DT's provide data that can be read by an external system and used to take action in the external system.
Exchanges, for example, may operate a single XRP account to receive all of their client's deposits allocating the deposit to the correct client by specifying a DT for the client to include when sending the transaction.
Unfortunately this manual process is error-prone in two ways: the client may neglect of forget to include the DT when sending and/or make a transcription error changing the value of the DT.
The result is the transaction is 'successful' as far as the ledger is concerned but the XRP is not credited to the correct client exchange account by the exchange's client management system external to the ledger.
How to use them?
In the case of XUMM, the how is very simple. When sending XRP the last SUMMARY screen defaults to an empty DT field. There is pencil icon to the right that triggers a dialogue to edit the DT. If sending funds to an exchange known to require DT's, XUMM may force you to enter a destination tag. Whether XUMM asks for a destination tag or not: ultimately you are responsible for checking if the destination you are sending to requires adding a DT, and, if so, entering the right one.
Usually, if a DT is required the destination account will specify this in advance.
There is no going backwards after sending the transaction. If no DT is specified the transaction will usually complete in seconds.
SOME exchanges have started to apply the
Require Destination Tag flag which means transactions with no DT will bounce. This helps if the DT is ommitted but not in the case of a transcription error where the sender includes an incorrect DT.
The only way to correct any mistakes is by contacting the recipient giving them the transaction ID.
They will then do what they are going to do. There is nothing XUMM (or any other wallet provider) can do.
When to use them?
DT's make automatic tracking of transactions coming from multiple sources possible. If the destination needs a DT, they will specify a DT.
Some organizations require clients to specify a DT when withdrawing XRP back to their own account address.
DT's may be specific to an account or they may be for one-time-use. That is a decision taken by each organization. Assuming the same DT can be re-used may not give the intended result.
Hopefully this article creates more clarification than confusion. Constructive criticism and comments are welcome.