1

i installed ripple wallet on my local server. i created one wallet and activate it with 20 XRP.

Now when i send coin from my active account to account(of crex24.com) then it gives tecDST_TAG_NEEDED error code

Ripple : http://127.0.0.1:5005

Code (using submit method):

RestTemplate template = new RestTemplate();
Map<String,Object> mainMap = new HashMap<>();
mainMap.put("secret", "sxxxxxxxxxxx");
mainMap.put("Fee", "1000"); // in drops

Map<String,String> subMap = new HashMap<>();
subMap.put("Account", "raxxxxxxxxx"); // amount will be deducted from this account
subMap.put("Amount", "1000000"); // in drops
subMap.put("Destination", "rdxxxxxxxxx"); // receiver address
subMap.put("TransactionType", "Payment"); // since we are making a  payment request

mainMap.put("tx_json", subMap);

JSONObject json = new JSONObject();
json.put("method", "submit");
json.put("params", new JSONArray(mainMap)); 
String requestData = json.toString();
System.out.println(requestData);
String response = template.postForObject("http://127.0.0.1:5005", requestData,String.class);
System.out.println(response);

Error

{
  "status": 200,
  "message": "Transaction achieved successfully.",
  "data": {
    "result": {
      "deprecated": "Signing support in the 'submit' command has been deprecated and will be removed in a future version of the server. Please migrate to a standalone signing tool.",
      "engine_result": "tecDST_TAG_NEEDED",
      "engine_result_code": 143,
      "engine_result_message": "A destination tag is required.",
      "status": "success",
      "tx_blob": "120000228000000024000000096140000000000F424068400000000000000A7321036CB83FF75DAxxxxxxxxxxxxxxxxxx",
      "tx_json": {
        "Account": "raxxxxxxxxx",
        "Amount": "1000000",
        "Destination": "rdxxxxxxxxx",
        "Fee": "10",
        "Flags": 214482148,
        "Sequence": 9,
        "SigningPubKey": "036Cxxxxxxxxxxxxxxx6",
        "TransactionType": "Payment",
        "TxnSignature": "txxxxxxxxx",
        "hash": "hxxxxxxxxxx"
      }
    }
  },
  "path": "/api/ripple_wallet/makeTransaction"
}
vishvas4u
  • 41
  • 9

1 Answers1

3

Your account on crex24.com requires a destination tag. XRPL uses account model similar to ETH. Unlike BTC which uses an UTXO model.

The reason some exchanges require destination tag is that you might be sharing that address with some other person on the exchange. e.g:

  • Person1's deposit address is: Addr1
  • Person2's deposit address is also Addr1
  • Somebody deposits 100XRP to Addr1.

In the case above the exchange wouldn't be able to differentiate if it was Person1's or Person2's.
So the XRPL introduced destination tag which would look something similar to this:

  • Exchange sets tfRequireDestTag flag of the Addr1 to true using accountSet transaction
  • Person1's deposit address is: Addr1:1234
  • Person2's deposit address is also Addr1:1235
  • Somebody deposits 100XRP to Addr1. XRPL refuses due to tfRequireDestTag being set to true /This is your case/
  • Someone sends 50XRP to Addr1:1234. <-- this one succeeds!
Atu
  • 917
  • 1
  • 11
  • 20
  • 1
    Thanks, got it and also implemented it. but i can get balance of my account using "account_info" method of ripple. "account_info" method returns total balance of whole account. but how can i get destination tag wise balances if my account has multiple destination tags? do you have any idea – vishvas4u Mar 19 '19 at 03:53
  • oh the balance is of the account itself. `destTag` really is just an optional data of the `tx`. You have to implement a mechanism to track each `destTag`'s balance on your end. How to track is completely up to you. The important thing to remember is that the sum of all `destTag`'s balances must equal to account's balance. – Atu Mar 19 '19 at 04:04