Skip to content

Conversation

@onur-ozkan
Copy link
Collaborator

@onur-ozkan onur-ozkan commented Jun 25, 2024

Currently, pubkey-only mode fails with Ledger's Keplr extension. This is because Ledger doesn't support SIGN_MODE_DIRECT transaction signing (more context).

Ledger supports two signing modes at the moment:

  1. SIGN_MODE_LEGACY_AMINO_JSON
  2. SIGN_MODE_TEXTUAL

The first one is a legacy signing type and doesn't support HTLC transactions, meaning we can't support swaps with it.

Unlike the first one, the second one is actively maintained but Keplr doesn't support it yet.

So we end up with having one option only; use SIGN_MODE_LEGACY_AMINO_JSON and only support withdrawals for Ledger's Keplr extension.

@onur-ozkan onur-ozkan marked this pull request as draft June 27, 2024 09:47
@onur-ozkan onur-ozkan force-pushed the external-sign-keplr-ledger branch from 89ee914 to 4263525 Compare June 28, 2024 06:04
Signed-off-by: onur-ozkan <[email protected]>
@onur-ozkan onur-ozkan force-pushed the external-sign-keplr-ledger branch from 4263525 to 4af3927 Compare June 28, 2024 09:50
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
@onur-ozkan onur-ozkan marked this pull request as ready for review July 1, 2024 07:06
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
@shamardy shamardy self-requested a review July 1, 2024 16:19
Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work! Only one comment from my side.

mariocynicys
mariocynicys previously approved these changes Jul 1, 2024
Copy link
Collaborator

@mariocynicys mariocynicys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

protocol_conf: Self::PlatformProtocolInfo,
) -> Result<Self, MmError<Self::ActivationError>> {
let conf = TendermintConf::try_from_json(&ticker, coin_conf)?;
let is_keplr_from_ledger = activation_request.is_keplr_from_ledger && activation_request.with_pubkey.is_some();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: Can this be a keplr from ledger but not with pubkey?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it can't. If you are using hardware wallet, with-pubkey is the only way you can use your wallet with mm2.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, then does it make sense to && activation_request.with_pubkey.is_some(). If we suspect the activation request might be malformed, maybe we could error here instead.

@shamardy shamardy merged commit 9f241c0 into dev Jul 2, 2024
@shamardy shamardy deleted the external-sign-keplr-ledger branch July 2, 2024 06:28
dimxy pushed a commit that referenced this pull request Jul 3, 2024
* dev:
  fix(restrictions): remove wallet-only restriction from max_maker_vol (#2153)
  feat(tendermint): support unsigned txs for ledger's keplr extension (#2148)
  chore(toolchain): upgrade to 1.72 nightly (#2149)
  feat(solana-swap): solana swap protocol v1 POC (#2091)
  fix(docs): update cargo test command (#2144)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants