HomePhabricator

[Cashtab] Additional mitigation for legacy wallet addresses

Description

[Cashtab] Additional mitigation for legacy wallet addresses

Summary: As noted in D15079, every now and again during testing where, for an old wallet, the address is stored with bitcoincash: prefix. This diff checks for all three derivations upon wallet load on startup in useWallet and convert to eCash prefix if needed.

Test Plan:

  • npm test
  • npm start
  • Open a wallet and manually simulate this edge case where the wallet.Path1899.cashAddress value contains a bitcoincash: prefixed address. The easiest way to achieve this is to temporarily add:
const { type, hash } = cashaddr.decode(wallet.Path1899.cashAddress);
wallet.Path1899.cashAddress = cashaddr.encode('bitcoincash', type, hash);

near the top of isLegacyMigrationRequired along with debug logs right.

  • Re-load cashtab then ensure debug logs reflect the detection of a non-eCash prefixed address for Path1899 and subsequent conversion to eCash prefix.
  • Repeat for the Path245 and Path145 derivation path cash addresses.

Reviewers: bytesofman, #bitcoin_abc

Reviewed By: bytesofman, #bitcoin_abc

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

Details

Provenance
emackAuthored on Jan 5 2024, 06:36
emackPushed on Jan 11 2024, 23:45
Reviewer
Restricted Project
Differential Revision
D15084: [Cashtab] Additional mitigation for legacy wallet addresses
Parents
rABC4118b7d412f7: [Chronik] Add `TokenTxEntry::burn_summary` for a nice human-readable burn…
Branches
Unknown
Tags
Unknown