atomicDEX-API icon indicating copy to clipboard operation
atomicDEX-API copied to clipboard

`get_private_keys` responds unexpectedly after Trezor/WC activation

Open smk762 opened this issue 5 months ago • 4 comments

Describe the bug

  • Launch KDF, and activate Trezor device.
  • Activate a coin using "priv_key_policy": {"type":"Trezor"}
  • Query get_private_keys for the Trezor activated coin
  • See address and keypairs not matching activation output for same derivation path indexes.

What would you expect? Two options:

  • If KDF session has an active trezor connection, disable all privkey export capability (global restriction)
  • If a coin activated with "priv_key_policy": {"type":"Trezor"} queries get_private_keys, return an error - but retain export capability for any other coin.

Additional info

When querying an activated coin via the legacy show_priv_key method, an error is returned (as expected)

{
    "error": "rpc:195] RPC call failed: lp_coins:5507] eth:2656] 'display_priv_key' is not supported for Hardware Wallets"
}

smk762 avatar Jul 29 '25 06:07 smk762

I've confirmed the above also applies to WalletConnect, which should apply similar limitations to priv key export..

{
    "error": "rpc:195] RPC call failed: lp_coins:5507] eth:2659] 'display_priv_key' is not supported for WalletConnect"
}

smk762 avatar Jul 29 '25 07:07 smk762

This is expected as trezor or walletconnect don't expose private keys, if we want pubkeys and address exports instead, then we should rename the method or create a new one.

shamardy avatar Jul 29 '25 14:07 shamardy

I see the problem, we want to bypass the coins that are using HW wallets or wallet connect instead of returning an error. I guess this is a bug.

shamardy avatar Jul 29 '25 14:07 shamardy

Put a medium priority to this as trezor is used in GUIs for all coins when logging in with it and wallet connect is not yet in GUIs.

shamardy avatar Jul 29 '25 14:07 shamardy