Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "reorganization transactions" to Yoroi (UI) #64

Closed
SebastienGllmt opened this issue Oct 22, 2018 · 1 comment
Closed

Add "reorganization transactions" to Yoroi (UI) #64

SebastienGllmt opened this issue Oct 22, 2018 · 1 comment
Labels
bug (confirmed) Bug with repro steps or logs UI/UX Makes a visual change

Comments

@SebastienGllmt
Copy link
Contributor

Concept
Sometimes users make transactions to themselves. It's inappropriate to label this as outgoing or incoming so we need a new category. I suggest reorganization to match the terminology used in the Cardano Wallet Spec.

Motivation for such transactions

  1. Sometimes a wallet has a large UTXO that they would want to split into many small UTXO. Doing such makes your payment-to-change ration closer to 1.0 which helps improve privacy on transactions.
  2. Sometimes a wallet has a lot of dust they would like to group together
  3. Once we have smart contracts in the SL layer, some utxo may be associated with special meaning. You would need to reorganize your UTXO to give special meaning to a UTXO of the right amount.
  4. Using a chimeric ledge means you would have to do transactions with yourself to convert between transaction-based and utxo-based models.

This will require a UI change (new icon, new way to display the fees, etc)

The current UI for this is at best misleading and depending on your definition also a bug.

@SebastienGllmt SebastienGllmt added bug (confirmed) Bug with repro steps or logs spec-implementation Its has been approved by the triage process after a proposal was made UI/UX Makes a visual change and removed spec-implementation Its has been approved by the triage process after a proposal was made labels Oct 22, 2018
@vsubhuman
Copy link
Contributor

The bug is much more serious than just the UI labelling, unfortunately:

  1. In the case of a reorg tx - its value is calculated all wrong, just because code checks that there are our inputs, but does not check if there are our outputs too, and therefore transaction shows something like -100 even of we got -99 back to the same wallet.
  2. In the same case also wallet does not recognise ALL the outputs to the same wallet (my guess would be because it is hardcoded logic that there's expected to be only one [change] output to the same wallet, and so code stops after first found output like that). It means that if we have transaction from our address A to our addresses B and C - funds on either B or C might get locked out of wallet until next restoration, just because code does not checks if it's ours or not.

We gotta do something similar to how it's solved in our mobile apps with:

  1. Distinct tx types: https://github.com/Emurgo/yoroi-mobile/blob/a3d72218b1e63f6362152aae2f03c8763c168795/src/types/HistoryTransaction.js#L4-L9
  2. Distinct logic on value calculation: https://github.com/Emurgo/yoroi-mobile/blob/a3d72218b1e63f6362152aae2f03c8763c168795/src/crypto/transactionUtils.js#L73-L103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug (confirmed) Bug with repro steps or logs UI/UX Makes a visual change
Projects
None yet
Development

No branches or pull requests

2 participants