从一个本地钱包到交换钱包的 Ripple 交易(示例:crex24)使用 java 给出错误代码 tecDST_TAG_NEEDED

Ripple Transaction from one local wallet to exchange wallet(example : crex24) gives error code tecDST_TAG_NEEDED using java

我在我的本地服务器上安装了 ripple 钱包。我创建了一个钱包并用 20 XRP 激活了它。

现在,当我将硬币从我的活动帐户发送到帐户(crex24.com)时,它会给出 tecDST_TAG_NEEDED 错误代码

波纹:http://127.0.0.1:5005

代码(使用提交方法):

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);

错误

{
  "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"
}

您在 crex24.com 上的帐户需要 destination tagXRPL 使用 account model 类似于 ETH。与使用 UTXO model.

BTC 不同

有些交易所需要 destination tag 的原因是您可能与交易所的其他人共享该地址。例如:

  • Person1的充币地址为:Addr1
  • Person2的充币地址也是Addr1
  • 有人将 100XRP 存款到 Addr1

在上述情况下,交易所将无法区分它是 Person1 还是 Person2
所以 XRPL 引入了 destination tag ,它看起来类似于:

  • 交易所使用 accountSet 事务
  • Addr1tfRequireDestTag 标志设置为 true
  • Person1的充值地址为:Addr1:1234
  • Person2的充币地址也是Addr1:1235
  • 有人将 100XRP 存入 Addr1XRPL 拒绝,因为 tfRequireDestTag 被设置为 true /这是你的情况/
  • 有人发送 50XRPAddr1:1234<-- this one succeeds!