webb-dapp icon indicating copy to clipboard operation
webb-dapp copied to clipboard

[BUG] Error message when attempting to claim airdrop at app.tangle.tools/claim

Open validorange opened this issue 1 year ago • 6 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

The claim airdrop dapp gives an error when I try to claim an airdrop from my Ledger device using Talisman wallet. image The airdrop remains unclaimed after the error.

Expected Behavior

I expected to receive the airdrop.

Steps To Reproduce

  1. I have attempted this in both Chrome and Opera with the same result
  2. Submit claim using Talisman extension connected to my Ledger wallet (Nano X). Ledger Polkadot address is 1D51dxpuGv1mWxstx7ERWyEWieLHSeQ8NBVX7VxkxT5PuKg.
  3. Specify a recipient address of 5HMnzhxodNNpAW9s2aa4js6ffgcJGBUJgxhKaS1V82CojdHA
  4. Click claim now and approve signing of the text on my Ledger wallet
  5. App immediately shows error message (which goes away almost immediately)

Screenshot

https://github.com/webb-tools/webb-dapp/assets/150610035/038f91a1-2a3f-40eb-b0c5-5d491c271d06

Anything else?

No response

validorange avatar Apr 26 '24 03:04 validorange

This error is due to Tangle network not being supported by Ledger app, we plan to release a ledger app soon.

1xstj avatar Apr 30 '24 12:04 1xstj

I'm not sure Tangle/Ledger support is needed here. I'm signing the text with the Polkadot app on Ledger. The Polkadot address is eligible for airdrop based on being a Polkadot validator. The recipient address is a Tangle wallet and is not a Ledger wallet. Indeed the reason I am requesting the payout to a different address is that I don't expect to be able to use the Ledger with Tangle.

Is there an alternate way to claim the airdrop if this method is not supported?

validorange avatar Apr 30 '24 12:04 validorange

We're investigating @validorange and will get back to you to re-test.

drewstone avatar May 06 '24 14:05 drewstone

After conducting some investigations, I have reached several conclusions:

  • By default, Ledger employs the ed25519 curve for signing messages. However, in the claim pallet, we use sr25519 to verify signatures from Substrate wallets here.
  • To verify an Ethereum signature from Ledger, we must modify the last bytes of the signature. For more information, please refer to https://mirror.xyz/coa.eth/mvPbLPXvy375CXi1_XwMTzG84lwlSKYUBHDx_R1TIgU.
  • In the case of Ledger signatures from Substrate wallets where their length exceeds 64 bytes (65 bytes and 66 bytes), the initial bytes are utilized to detect the cryptographic curve. The subsequent part constitutes the signature itself. You can refer to the signatureVerify function for further details.
    • For signatures of 65 bytes and 66 bytes, the getVerifyFn and verifyMultisig functions are employed. Initially, the first byte is used to determine the verification function, followed by the utilization of the remaining bytes (with the first byte truncated) as input for the verification function.

Regarding which signature scheme to use when users employ Ledger via Talisman, I'm uncertain. However, based on my research findings, I propose modifying the last byte if the signature is from EVM wallets and truncating the first byte if the signature is from Substrate wallets, whether both are via Ledger.

AtelyPham avatar May 08 '24 07:05 AtelyPham

Hello, @validorange! Could you please try signing and claiming with your Ledger wallet on this PR preview link?

AtelyPham avatar May 08 '24 10:05 AtelyPham

Hi @AtelyPham , I tried your link and received a different error, which I didn't catch before it went away, but I believe it was "Invalid Transaction". I tried a second time and got the attached screenshot ("temporarily banned"). image

validorange avatar May 08 '24 14:05 validorange

This issue is stale because it has been open for 60 days with no activity.

github-actions[bot] avatar Feb 14 '25 12:02 github-actions[bot]

Closed due to staleness; you may reopen or create a new issue if the error persists.

AtelyPham avatar Feb 14 '25 16:02 AtelyPham