delphi-labs / shuttle

Shuttle is an open-source npm package designed to turn wallet connections into a plug-and-play Lego brick for Cosmos dApps.
https://npmjs.com/package/@delphi-labs/shuttle
MIT License
21 stars 29 forks source link

signArbitrary() with Injective gives 'Error: Unsupported algorithm: ethsecp256k1' #162

Closed AKnownEntity closed 4 months ago

AKnownEntity commented 1 year ago

I'm trying to use Shuttle to sign an arbitrary message and prove ownership on the injective network.

I will skip most of the setup, but the code I am using for signing a network comes from the react example:

    const data = "123"
    const bytes = Buffer.from(data, "utf-8");

    signArbitrary({
      wallet,
      data: bytes,
    })
      .then(async (result) => {
        console.log("sign arbitrary result", result);

        console.group("###### verifying signature.... ########");
        const verification = await verifyArbitrary({
          wallet,
          data: bytes,
          signResult: result,
        });
        console.log("verification result:", verification);
        console.log("####################################");

        console.groupEnd();
      })
      .catch((error) => {
        console.error("sign arbitrary error", error);
      });

When I run this, I always get a console error after signing the tx: sign arbitrary error Error: Unsupported algorithm: ethsecp256k1 I am using a Keplr wallet for this test.

Any help with this issue? Am I missing something?

afsardo commented 1 year ago

Yeah unfortunately Keplr doesn't support injective for signArbitrary, will have to take a look and see if there is some workaround it.

thandaanda commented 1 year ago

@afsardo Does this solve the issue - https://github.com/chainapsis/keplr-wallet/pull/694

afsardo commented 1 year ago

That should be it! Will take a look by EOW, thanks for the link

afsardo commented 1 year ago

@thandaanda From what I understood, I don't think we need to do anything in Shuttle right? This should start working as soon as that fix is out with a new Keplr version?

thandaanda commented 11 months ago

@afsardo We were able to fix verifyArbitray using verifyADR36Amino from @keplr-wallet/cosmos for extensions. However, we have ran into issues for mobile providers. We tried with Leap, Keplr. Metamask works with provided values.

When we contacted Leap team, they said walletconnect is not supported so using Leap Browser is a way to go.

For Keplr, we changed the data to sign - https://github.com/thandaanda/nextjs-shuttle-demo/blob/main/src/components/ArbitrarySign.tsx#L77

Do you think there is a bug in the prepareSigningWithMemo code since it doesn't send any message.

Demo - https://shuttle.keyval.me/ Repo - https://github.com/thandaanda/nextjs-shuttle-demo

afsardo commented 11 months ago

@afsardo We were able to fix verifyArbitray using verifyADR36Amino from @keplr-wallet/cosmos for extensions. However, we have ran into issues for mobile providers. We tried with Leap, Keplr. Metamask works with provided values.

When we contacted Leap team, they said walletconnect is not supported so using Leap Browser is a way to go.

For Keplr, we changed the data to sign - https://github.com/thandaanda/nextjs-shuttle-demo/blob/main/src/components/ArbitrarySign.tsx#L77

Do you think there is a bug in the prepareSigningWithMemo code since it doesn't send any message.

Demo - https://shuttle.keyval.me/ Repo - https://github.com/thandaanda/nextjs-shuttle-demo

Will have to give it a run, and check out.

thandaanda commented 7 months ago

@afsardo We can close this ticket. We created custom signArbitry call for mobile providers.