HomePhabricator

[Cashtab] Additional tests on OP_RETURN utxos to confirm they can be included…

Description

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

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

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

Subscribers: emack

Differential Revision: https://reviews.bitcoinabc.org/D10535

Details

Provenance
Joey King <joseph.roy.king@gmail.com>Authored on Nov 25 2021, 01:51
bytesofmanPushed on Nov 25 2021, 03:15
Reviewer
Restricted Project
Differential Revision
D10535: [Cashtab] Additional tests on OP_RETURN utxos to confirm they can be included in non-eToken utxo set
Parents
rABC015abfe73dba: [Automated] Update chainparams
Branches
Unknown
Tags
Unknown