[Cashtab] Implement ecash-lib for tx building
Summary:
T3582
Implement ecash-lib for building txs in Cashtab.
This diff uses ecash-lib instead of utxo-lib + ecash-coinselect to build raw txs with schnorr signatures (previously all Cashtab txs were ECDSA).
Because ecash-coinselect is calibrated for ECDSA, it does not provide accurate fee estimation for Schnorr txs (hence, it also does not provide accurate estimation of the maximum amount of satoshis a wallet can send, or a useful utxo selection algorithm).
The key feature of ecash-coinselect --- determining whether or not a tx needs a change output, and what the value of that output should be given the desired tx fee --- is handled by ecash-lib. Going forward, we may wish to add utxo selection algorithms to ecash-lib. For now, since Cashtab only uses a simple accumulative algorithm and this was all that ecash-coinselect provided -- simply deprecate ecash-coinselect.
Since ecash-lib already does most of what ecash-coinselect used to do (but better and for schnorr), ecash-coinselect should go through a deprecation cycle. No point in adding new features to the lib.
There is still more work to be done to fully implement ecash-lib in Cashtab. ecash-lib covers features where Cashtab is currently still using utxo-lib or slp-mdm. These will be deprecated in subseqent diffs (see T3582).
Test Plan:
npm test
Select 2 or 3 of the changed txs from the tests at random. Import the old tx into Electrum and compare to the new tx.
Confirm the inputs and outputs are the same. Differences should be
- txid is different
- size is different
- fee is lower in absolute terms
Reviewers: #bitcoin_abc, Fabien, tobias_ruck
Reviewed By: #bitcoin_abc, Fabien, tobias_ruck
Subscribers: tobias_ruck, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D16190