-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support signing raw "signer payload" bytes? #924
Comments
(I think the bug label was automatically added; apologies if not; this is not a bug but a feature request) |
Hey James, Thanks for bringing this up, we'll have a look ! |
Just to provide some more context for my request: Subxt can be used to construct, sign and submit transactions in Rust. It can also compile to WASM and be used to make Rust based browser apps. Subxt can produce "signer payloads" (ie the I had hoped that it'd also be possible to take this payload and have a wallet like Talisman sign it, too, but instead we've struggled to produce the format that Talisman requires (that I hope that helps, and thankyou for having a look! |
Hi @jsdw, thanks for the request |
I guess the original security concern existed because there was a lack of metadata that was able to decode the bytes given and show the user something more sensible about what they were signing. I suppose my hope is that when things like paritytech/polkadot-sdk#291 exist, it would be possible to pass a metadata "proof" + signer payload to some extension/signing device, and the extension/device would be able to use the metadata to decode and present full details of the thing to users, while ensuring that the node would not accept it if the metadata provided was actually a lie. A long term advantage of accepting bytes + metadata is that there would be much more flexibility in what can be signed; currently the But anyway, perhaps that'll happen down the road a bit; food for thought though maybe :)
Makes sense! I think a broader push to this new model will be needed once it's available! |
No there was metadata all along. The concern is that when you ask users to sign raw bytes, it's expected to be some ascii messages. The signing part won't decode it. Now the security concern that led to this is to prevent being able to ask for raw signing of actual extrinsics:
So the users would think that they're just signing some message, but they end up signing an extrinsic that didn't get decoded. The wrapping prevents the ability to actually craft a valid extrinsic. |
That makes sense; I guess the ideal API would differentiate from "sign raw bytes" (and display those as ASCII, wrapped in |
Closing as stale/low priority |
Talisman currently seems to support signing:
<bytes>...</bytes>
).Libraries like Subxt and CAPI are able to generate "signer payloads" (ie
call_data + extra_bytes + additional_bytes
, black2_256 hashed if longer than 256 bytes) that can be signed natively. It'd be super helpful if wallets like Talisman also supported being passed and signing these same bytes.I wonder whether this has been deliberately avoided though (hence wrapping arbitrary bytes in
<bytes>..
before signing them)? now that metadata exists to decode and display such bytes, I wonder whether there's any scope to support it again?The text was updated successfully, but these errors were encountered: