paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.network/
1.63k stars 567 forks source link

Browser extensions can't sign extrinsics in v1.2.5 #4659

Open michalisFr opened 1 month ago

michalisFr commented 1 month ago

Doing some testing on Rococo I discovered that all browser extensions can't sign extrinsics, probably because they can't decode the SignedExtension with the merkleized metadata.

For example, here's the message from the Polkadot-JS browser extension: Screenshot 2024-05-31 at 1 25 44 PM and all other extensions (Talisman, Subwallet, Polkagate, Fearless) fail to sign in similar fashion.

A Polkadot Vault account imported in the Polkadot-JS extension fails to decode the QR code generated by the extension with this error: error

Just to note, both the extensions and Polkadot Vault have the latest Rococo metadata.

Similarly, the Rococo faucet has stopped working with error: Error: Unsupported signed-extension: CheckMetadataHash and Subwallet mobile and dashboard also can't sign transactions.

On the other hand, accounts created or imported directly on Polkadot-JS apps can sign extrinsics normally. The same goes for a Polkadot Vault imported directly on Polkadot-JS apps.

bkchr commented 1 month ago

@TarikGul shouldn't that have been fixed by PJS already? I mean I know that you fixed it, but maybe not yet released it to the UI?

michalisFr commented 1 month ago

@TarikGul shouldn't that have been fixed by PJS already? I mean I know that you fixed it, but maybe not yet released it to the UI?

@bkchr PJS-UI works, it's the extension (and all other extensions for that matter) that have this issue. But then again, the extension on Chrome web store hasn't been updated in 2 years.

In list form, the wallets and extensions we tested and I mention above:

  1. Accounts directly on PJS-UI: OK
  2. Accounts in Polkadot Vault imported directly in PJS-UI: OK
  3. Accounts in PJS extension: NOT OK
  4. Accounts in Polkadot Vault imported in PJS extension or Subwallet extension: NOT OK
  5. Accounts in Talisman, Subwallet, Fearless, Polkagate extensions: NOT OK
  6. Accounts in Subwallet mobile or managed through the Subwallet dashboard: NOT OK
  7. Rococo faucet: NOT OK

So, it seems PJS-UI is the only one working atm.

bkchr commented 1 month ago

Yeah the other teams are also informed. I again tried to reach out to Jaco so that we get access rights to the extension.

valentunn commented 1 month ago

Hey everyone, Valentin from Nova here. As for Nova Wallet & Polkadot Vault status:

  1. We have finished the work related to CheckMetadataHash - the development build is compatible with latest Rococo. Waiting for finalization of Ledger apps configuration before releasing to production
  2. Latest version of Polkadot Vault is able to decode & sign transactions on Rococo with CheckMetadataHash enabled. Tested in Nova<>Vault and PJS-UI<>Vault pairings
michalisFr commented 1 month ago
  1. Latest version of Polkadot Vault is able to decode & sign transactions on Rococo with CheckMetadataHash enabled. Tested in Nova<>Vault and PJS-UI<>Vault pairings

@valentunn The versions of Vault that we tested were v6.1.2 and v6.3.1. Both worked in conjunction with PJS-UI

S2kael commented 4 weeks ago

Hi everyone, I am Kael from SubWallet. We are working on resolving this issue.

mustermeiszer commented 4 weeks ago

Will all those fixes still allow for backward compatability - i.e. will chains without the CheckMetadataHash in their SignedExtension still work with the wallets?

valentunn commented 4 weeks ago

Will all those fixes still allow for backward compatability - i.e. will chains without the CheckMetadataHash in their SignedExtension still work with the wallets?

Yes, it's backwards compatible

bkchr commented 4 weeks ago

Will all those fixes still allow for backward compatability - i.e. will chains without the CheckMetadataHash in their SignedExtension still work with the wallets?

Yes. As all signed extensions, they are optional. Wallets can use the metadata to detect which signed extensions are enabled in the runtime to add the required data to the transactions.

mustermeiszer commented 3 weeks ago

Wallets can use the metadata to detect which signed extensions are enabled in the runtime to add the required data to the transactions.

In theory, yes. But this issue is probably the best proof for that to not always work. ^^

But if all wallets are backwards compatible we should be fine. Thanks!

bkchr commented 3 weeks ago

In theory, yes. But this issue is probably the best proof for that to not always work. ^^

No, you misunderstood the issue. We upgraded Rococo to test out ledger etc. However, not all wallets and especially the PJS extension where ready to detect this new extension. It needs to be said that the extension was ENABLED on Rococo, while if you don't do anything, the extension will not be enabled. As the wallets don't know the extension, they fail to sign the extrinsics.

You were asking about backwards compatibility, aka can the wallets detect that the extension is not there and still sign the extrinsics correctly. The answer to this is yes ;) I hope it is now more clear.

mustermeiszer commented 3 weeks ago

Yes, that is much clearer. So all wallets only sign what is there? I could remove one Extra and PJS would still be able to sign?

SBalaguer commented 3 weeks ago

@michalisFr, update on the list you provided before:

Interface Initial Status Current Status Publicly Deployed
Accounts directly on PJS-UI Ok Ok ✅ Yes
Accounts in Polkadot Vault imported directly in PJS-UI Ok Ok ✅ Yes
Accounts in PJS extension Not Ok Ok ✅ Partially (*)
Accounts in Polkadot Vault imported in PJS extension Not Ok Ok ✅ Partially (*)
Accounts in Polkadot Vault imported in Subwallet extension Not Ok Ok ✅ Yes
Accounts in Polkadot Vault imported in Talisman extension Not Ok Ok ✅ Yes
Accounts in Subwallet extension Not Ok Ok ✅ Yes
Accounts in Talisman extension Not Ok Ok ✅ Yes
Fearless, Polkagate extensions Not Ok Not Ok -
Accounts in Subwallet mobile or managed through the Subwallet dashboard Not Ok Checking...
Accounts in NovaWallet Not Ok Ok ✅ Yes
Rococo faucet Not Ok Ok ✅ Yes

Some comments:

EDITED 25/06. As for PJS Extension, the app has been released and updated for Chrome users. For Firefox, the Firefox team is currently reviewing it, but manual instructions have been added to the repo for installation if needed.

bkchr commented 3 weeks ago

Yes, that is much clearer. So all wallets only sign what is there? I could remove one Extra and PJS would still be able to sign?

Yes! For that we put the information about the used signed extensions into the metadata. This way, all wallets (not just PJS) can fetch this information and construct transactions correctly. This already works this way since some years.

wischli commented 1 week ago

@michalisFr, update on the list you provided before:

Interface Initial Status Current Status Publicly Deployed Accounts directly on PJS-UI Ok Ok ✅ Yes Accounts in Polkadot Vault imported directly in PJS-UI Ok Ok ✅ Yes Accounts in PJS extension Not Ok Not Ok - Accounts in Polkadot Vault imported in PJS extension Not Ok Not Ok - Accounts in Polkadot Vault imported in Subwallet extension Not Ok Ok ✅ No Accounts in Polkadot Vault imported in Talisman extension Not Ok Ok ✅ No Accounts in Subwallet extension Not Ok Ok ✅ No Accounts in Talisman extension Not Ok Ok ✅ No Fearless, Polkagate extensions Not Ok Not Ok - Accounts in Subwallet mobile or managed through the Subwallet dashboard Not Ok Checking... Accounts in NovaWallet Not Ok Ok ✅ No Rococo faucet Not Ok Ok ✅ Yes Some comments:

  • PJS Extension: we are currently working on a solution to it, but it will not be available in the very short term. Using Nova, Talisman and Subwallet is recommended.
  • Non-publicly deployed solutions (yet): Teams are working on these and will be releasing them together with the Kusama Runtime Upgrade: https://kusama.subsquare.io/referenda/406

AFAICT, this list is outdated at this point? If so, could you update it please @SBalaguer. I was able to sign with Talisman using a Chopsticks fork with WASM override.

SBalaguer commented 1 week ago

could you update it please @SBalaguer

Updated @wischli :)

wischli commented 1 week ago

could you update it please @SBalaguer

Updated @wischli :)

Thanks a lot! Could you elaborate on the two partially deployed interfaces? We would like to launch this feature ASAP, i.e. next week shortly after it is enabled on Polkadot.

SBalaguer commented 1 week ago

@wischli, PJS Extension is not yet released on Firefox, and it's being checked by the Mozilla team still. It might take a bit more time until we get there, as the extension has not been updated in over 2 years.

So what you can expect as full support right now on the new extrinsic format is the biggest wallets, plus PJS Extension on Chrome. As to supporting signing with the new Ledger App, what you can expect from day 0 (aka from July 1st) is full support on Talisman, Subwallet and Nova Wallet.