Page MenuHomePhabricator

[Cashtab] Additional tests on OP_RETURN utxos to confirm they can be included in non-eToken utxo set
ClosedPublic

Authored by bytesofman on Nov 25 2021, 01:55.

Details

Summary

emack

This is a bug fix in response to https://www.reddit.com/r/ecash/comments/qy5835/50k_coins_disappeared_from_my_wallet_any_tips/

Some shorter OP_RETURN transactions create a conflict when the app attempts to parse whether or not they are eToken utxos. The backend behavior classifies them isValid: null, which is indeterminate. Previously the "safe" thing to do was ignore such utxos, as they were probably eToken utxos that would be validated soon. The risk of including these in the non-eToken utxo set was token burns.

Now though, OP_RETURN is a popular feature in Cashtab and these utxos are more common. Cashtab needs a way to confirm these utxos are not eTokens and are safe to spend.

This diff adds logic for this. Any utxos with isValid: null are run through additional screening. The app gets their specific OP_RETURN field and confirms it does not include the eToken prefix. If the eToken prefix is not present, the app treats the token as a safe-to-spend non-eToken utxo and adds it to user balance.

Test Plan

Running cashtab.com, send yourself a transaction duplicating the OP_RETURN msg seen in the above reddit thread.
Note it will not show in balance of receiving wallet.

npm start
Load the same wallet
utxo appears in balance

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emack added a subscriber: emack.

regression tested all ok.
send/receive XEC, send/receive eTokens, send/receive messages, signing messages, switching wallets all good.

This revision is now accepted and ready to land.Nov 25 2021, 03:14