-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(hd_wallet): utxo and evm hd wallet and trezor #1962
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! I have only a few minor comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
Just want to add some doc coms for main types and have question also about doc coms for now.
It expects |
I see - I was using an example that did not include this, though confirm docs have the While testing HD-withdraw.mp4Can you please confirm the following:
If so, I'll add some extra notes to docs to reduce the confusion. |
@@ -311,23 +358,22 @@ pub trait UtxoFieldsWithHardwareWalletBuilder: UtxoCoinBuilderCommonOps { | |||
let recently_spent_outpoints = AsyncMutex::new(RecentlySpentOutPoints::new(my_script_pubkey)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just have taken a look how RecentlySpentOutPoints works.
One of its tasks is that it allows to immediately spend an output sent to self ('my_address') from a just broadcasted transaction. This is needed because the electrum provider may not know immediately about just sent txns. Basically this was added for 'change' outputs. But I think the current RecentlySpentOutPoints implementation (when it is created only with the initially activated 'my_address') does not cover cases with HD accounts:
- when a user withdraws from some HD account the change is sent to this 'from' account (not to 'my_address').
- another case is when a user sends coins from one HD account to another his account.
(Not sure if we need this fixed though. Maybe it's okay for the user to just wait for a couple of min until the provider db is actualised)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be easier done in this PR #2053 or after it's merged where UnspentInfo
has the script_pubkey
. Add this to the checklist here #1838 (comment)
This commit implements all HD wallet and trezor methods for EVM coins/tokens. It also adds `init_platform_coin_with_tokens` and `init_token` methods for initializing EVM coins/tokens using task manager which is the prefered way for HD/Trezor.
@KomodoPlatform/qa latest commits allow EVM coins/tokens to work with HD wallet and trezor methods same as how utxo works, so this methods/requests/responses #1962 (comment), #1962 (comment), #1962 (comment), #1962 (comment), #1962 (comment) should work the same for EVM. Transaction history is still not implemented for EVM so these #1962 (comment) should not work. New methods for EVM coins/tokens activation were added similar to these #1962 (comment) but differ in requests and responses, so I will detail them below. Enable EVM coin with tokens in HD mode (or trezor):
|
* dev: docs(README): remove outdated information from the README (KomodoPlatform#2097) fix(sia): fix sia compilation after hd wallet PR merge (KomodoPlatform#2103) feat(hd_wallet): utxo and evm hd wallet and trezor (KomodoPlatform#1962) feat(sia): initial Sia integration (KomodoPlatform#2086) fix(BCH): deserialize BCH header that uses KAWPOW version correctly (KomodoPlatform#2099) fix(eth_tests): remove ETH_DEV_NODE from tests (KomodoPlatform#2101)
* dev: feat(app-dir): implement root application dir `.kdf` (KomodoPlatform#2102) fix tendermint fee calculation (KomodoPlatform#2106) update dockerfile (KomodoPlatform#2104) docs(README): remove outdated information from the README (KomodoPlatform#2097) fix(sia): fix sia compilation after hd wallet PR merge (KomodoPlatform#2103) feat(hd_wallet): utxo and evm hd wallet and trezor (KomodoPlatform#1962) feat(sia): initial Sia integration (KomodoPlatform#2086) fix(BCH): deserialize BCH header that uses KAWPOW version correctly (KomodoPlatform#2099) fix(eth_tests): remove ETH_DEV_NODE from tests (KomodoPlatform#2101) feat(coin): support nucleus as an alternative to iris HTLC (KomodoPlatform#2079)
Intermediate PR part of #1838
withdraw
is used for HD wallet andtask::withdraw
for Trezor. APIs used for HD wallet:task::enable_utxo
task::enable_qtum
task::create_new_account
account_balance
task::account_balance
get_new_address
task::scan_for_new_addresses
my_tx_history
v2withdraw
both v1 and v2path_to_address
in activation now usesHDAccountAddressId
struct,StandardHDCoinAddress
was removed to reduce redundancies.account_id'/chain/address_id
specified in activation bypath_to_address
is enabled/added during the activation.task::create_new_account
can now take an optional parameteraccount_id
to specify the new account index instead of just incrementing the account index. If not specified, incrementing will be used as before.WithdrawFrom
also usesHDAccountAddressId
instead ofStandardHDCoinAddress
, a full derivation path can be also used to specify the address to withdraw from, this makes specifying the address more easy since the full derivation path is what is returned in the response of activation/account_balance
/etc..