chainapsis / keplr-wallet

The most powerful wallet for the Cosmos ecosystem and the Interchain
https://www.keplr.app
Other
764 stars 456 forks source link

Remove ethermint like chain id check in signEthereum #800

Open randy75828 opened 1 year ago

randy75828 commented 1 year ago

Currently there exists a ethermint like chain id check when signing ethereum tx. however for some chains, like the carbon chain, their cosmos chain id(carbon-1) is different from the evm chain id (carbon-9790_1). Therefore i will need to the cosmos chain id when signing the transaction, but it is throwing the not ethermint-like chain error. Inputting the evm chain id also doesnt work because that is not the chain which is registered on keplr, leading to a there is no chain info error. Previously it was working well for keplr 1.0

image

HeesungB commented 1 year ago

@randy75828 The chain ID of EVM chain is unknown. Can you explain more detail on what you are implementing?

randy75828 commented 1 year ago

Oh basically my chain id is not ethermint like, and the check is stopping it, is it okay to remove that check? @HeesungB

randy75828 commented 1 year ago

hi any updates on this

randy75828 commented 1 year ago

image can we remove this check for ethermint-like chain, because carbon chain id does not comply with it. was working okay with Keplr V1 as the check wasnt present

@HeesungB may i seek your assistance on this?

hitchhooker commented 12 months ago

Title:

Remove hardcoded cointype ID to support other networks and testnets

Body:

Problem Statement:

The hardcoded cointype ID of 60 in service.ts poses issues when using the Keplr Wallet with the Kava testnet and possibly other networks.

Relevant Code:

Here's the relevant code snippet from service.ts:

Background:

On February 17th this year, Kava Mainnet introduced a change in key generation and adopted a new cointype ID of 459. Initially, Kava used the same coin type as the Cosmos Network, but this led to issues with various wallet providers, necessitating the change.

Reference: Kava Labs Quick Guide Overview

Suggested Solution:

  1. Remove the hardcoded value of 60 for the default cointype.
  2. Enable a mechanism for specifying the cointype dynamically.
  3. Additionally, consider supporting testnets with a cointype ID of 1, as testnets are currently not allowed due to the hardcoded value.

Impact:

This change would make Keplr Wallet more flexible and compatible with other Cosmos networks and their testnets.

https://github.com/chainapsis/keplr-chain-registry/blob/main/cosmos/kava_2222.json kava bip id 459

hitchhooker commented 12 months ago

We were able to override Cointype for testnet to be 60 instead of 459, but that is not option for mainnet which would be nice to have working preferably without need to manipulate kava's cointype

stevenkhong commented 8 months ago

Hey @HeesungB, circling back to the original issue here, can we remove the validation in signEthereum so that chains with different chain IDs for cosmos and EVM environments can use Keplr's signEthereum function?

e.g. we cannot sign EVM messages using keplr now because Carbon chain has chain ID carbon-1 but the EVM module has chain ID carbon_9790-1.