destination tagとは
振込人を特定するためのID
リップルはアドレスを無限に発行できない仕組みになっているのでビジネスアカウントの場合、一つだけアドレスを取得し、destination tagを利用してユーザーを識別する仕組みを推奨している
そうでない場合はユーザーごとに新規にアドレス発行し、20xrpをユーザーに負担させる必要がある。
タグつけ忘れ防止機能
リップルには入金トランザクションにdestination_tagがついていない場合に受け取りを拒否する機能がある
具体的にはaccount_setトランザクションでアカウントにlsfRequireDestTagフラグを付与すればよい
https://ripple.com/build/transactions/#accountset
https://ripple.com/build/transactions/#accountset-flags
https://ripple.com/build/ledger-format/#ledger-node-types
エラーとなったトランザクションのステータスに tecDST_TAG_NEEDED が入る。
その他参考資料
サンプルコード
const instructions = {
maxLedgerVersionOffset: 5,
fee: "0.1",
};
const settings = {
requireDestinationTag : true,
};
api.prepareSettings(wallet_address, settings, instructions)