HomePhabricator

[electrum] freeze UTXOs that may contain ALP tokens

Description

[electrum] freeze UTXOs that may contain ALP tokens

Summary:
This makes ALP tokens unspendable.

We add a data structure to store outpoints that may be ALP tokens. For now, the detection logic is very basic: we freeze all outputs in any transaction whose first output is a valid EMPP output with at least one payload that starts with the ALP lokad ID.

A known drawback is that this method makes the change output also unspendable (for users who import a seed from a token wallet such as CashTab into Electrum ABC). Future improvements should be to:

  • make it possible for users to force-spend SLP, ALP and false positive ALP outputs if they insist
  • properly parse ALP tokens to eliminate these known false positives

Test Plan:
Open a wallet that already has an ALP token, make sure that now it is frozen and show as a potential token (green background) in the coins tab.

Send a new alp token to the wallet, make sure it gets frozen and green.

python test_runner.py

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
PiRKAuthored on Tue, Mar 11, 17:12
PiRKPushed on Thu, Mar 13, 10:00
Reviewer
Restricted Project
Differential Revision
D17777: [electrum] freeze UTXOs that may contain ALP tokens
Parents
rABCe5f570af9696: [electrum] build: use pyca/cryptography release version
Branches
Unknown
Tags
Unknown