catchain / tonscan

The Open Network explorer
https://tonscan.org
Other
194 stars 50 forks source link

Different fees shown for same transaction #80

Closed esigra closed 1 year ago

esigra commented 1 year ago

Bug Type

UX

Reproduction steps

  1. Look at this wallet: https://tonscan.org/address/EQBaIpArmpyjo2bXNcB_-DmKitP4KodxMK_NUcvbOTobjkyw
  2. Expand the transaction with timestamp "10/23/2023, 03:43:32 PM" and amount 171.5 TON.
  3. Note that the fee is 0.008012018 TON.
  4. Click on the sender name (death.ton).
  5. Expand the same transaction (with the same timestamp and amount).
  6. Note that the fee is 0.008352013 TON.

Actual result

Different fees are shown for the same transaction.

Expected result

It seems like tonscan shows two different fees for every transaction (even for the simplest form of transaction; from one wallet to another), as if one is what the sender pays and the other is what the recipient pays. But people say that only the sender pays transaction fee. Maybe they lie?

If only the sender pays for a transaction, show the same fee no matter where the transaction is shown.

If both sender and receiver pays for a transaction, make that clear in the user interface. Maybe a tooltip when the mouse cursor is over the word "Fee", showing the text "Paid by sender" or "Paid by recipient". (Just make sure that the tooltip does not get in the way if the user tries to select and copy the fee amount.)

Suggested Severity

Medium

Device

Browser in Microsoft Windows or Linux.

Additional Context

No response

ingria commented 1 year ago

Ton “transaction” is a much more complex concept that does not mean quite what we are used to in other blockchains.

In ton, “transaction” is an act of communication between multiple smart-contracts. Communication between contracts is done with in- and out- messages. Since each participating contract operates different set of messages (e.g. "out" message for sender is "in" message for receiver), every user “action” (e.g. money transfer) results in multiple transactions with different hashes.

In your example, the money transfer between death.ton and the other address involves two smart-contracts and produces two transactions:

https://tonscan.org/tx/GrSUpDpt2sM-rLpfo_eVW9qmgjLFUzUKm-XAETQr2hg= https://tonscan.org/tx/UMfdOk_HIxyzgqiPBv2I40Am60dSd9fnDpGg5xZWmXQ=

This also means that in ton everyone pays a fee, even the receiving party (wallet received message - had to process it - pays computation fee). Just the fee that is payed by the current address is displayed in transaction table.