Open andrewkozlik opened 1 year ago
I like it too! However, I am not sure with some of the wording. Especially "payjoin". But I don't have any other proposal right now…
Alternative workaround, when non coinjoin account label all transactions as Joint transaction.
Updated description to go with 'Joint transaction'.
Update 3/5/23
'Joint transaction' to be used when not in CJ account https://github.com/trezor/trezor-suite/issues/7851#issuecomment-1476111263
Problem summary
When Trezor or the Trezor's seed is used in another application to conduct unusual transactions, Suite may display the account history somewhat inaccurately. For example some wallets might support spending from multiple accounts simultaneously in a single transaction. Recently we had a user who reported seeing a coinjoin transaction in their account history, but the transaction was quite obviously not a coinjoin, but some other sort of joint transaction, possibly a spend from multiple of the user's accounts. This issue proposes new logic for identifying transaction types as best we can.
Proposal
Terminology:
Assume that we have a transaction that appears in this account's transaction history, i.e. one of the inputs or outputs corresponds to an address derived from the account's XPUB. The transaction should be labeled as specified below. Sometimes I propose several different labels that are open for discussion and depending on what label we choose, the logic may simplify a little bit.
If all inputs are from this account, then:
If all inputs are from my accounts and at least one input is not from this account, then:
If at least one input is from my account and at least one input is not from my account, then:
If no inputs are from my accounts, then "Received {symbol}".
Coinjoin heuristic
I see several ways to identify that a joint transaction is a coinjoin.
I like the idea of identifying coinjoins by checking that conditions 3 and 4 are both satisfied. It's easy to implement. The condition should be satisfied by all coinjoins (WW, Samourai, Joinmarket) under normal conditions and even by small coinjoins on testnet. Even if the transaction has only 5 outputs, the condition requires at least 3 equal-valued outputs to be present or at least two pairs of equal-valued outputs to be present. A non-coinjoin transaction is unlikely to satisfy this. Of course, there can easily be a transaction where someone pays five people the same amount, e.g. prize money for a 5-member team, but let's not forget that there is also the condition "at least one input is not from my account" before the coinjoin heuristic is applied.
See also