XRPLF / rippled

Decentralized cryptocurrency blockchain daemon implementing the XRP Ledger protocol in C++
https://xrpl.org
ISC License
4.51k stars 1.46k forks source link

About source tag and dest tag #2757

Closed qiluge closed 5 years ago

qiluge commented 5 years ago

If i have a ripple address and a tag 1234, when i send a tx to a rippled account that tag is 4321, should i use bitwise-or operator on 4321 and https://developers.ripple.com/transaction-common-fields.html#flags-field and set 1234 to SourceTag value or use bitwise-or operator on 1234 and SourceTag value?

MarkusTeufelberger commented 5 years ago

Tags are not flags, they are separate fields.

qiluge commented 5 years ago

So how can i set dest tag while call the RippleApi or send transaction?

nbougalis commented 5 years ago

This example Payment transaction (in json format) for 500 XRP shows how to set both the source and destination tags:

{
  "TransactionType" : "Payment",
  "Account" : "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
  "Destination" : "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
  "SourceTag": 1234,
  "DestinationTag": 5678,
  "Amount" : "500000000",
  "Fee": "12",
  "Flags": 2147483648,
  "Sequence": 1,
}
qiluge commented 5 years ago

thank you very much!